From: djfiander Date: Fri, 19 May 2006 02:30:21 +0000 (+0000) Subject: Fix handling of the "renewal ok" status field in the ILS X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0ebc6b7e707eb199b56266fdeb7de92b3fe64381;p=working%2FSIPServer.git Fix handling of the "renewal ok" status field in the ILS --- diff --git a/ILS.pm b/ILS.pm index 8138b89..2ee1ded 100644 --- a/ILS.pm +++ b/ILS.pm @@ -93,6 +93,9 @@ sub checkout { $circ->ok($circ->patron && $circ->item); if ($circ->ok) { + # If the item is already associated with this patron, then + # we're renewing it. + $circ->renew_ok($item->{patron} eq $patron_id); $item->{patron} = $patron_id; $item->{due_date} = time + (14*24*60*60); # two weeks push(@{$patron->{items}}, $item_id); diff --git a/ILS/Transaction/Checkout.pm b/ILS/Transaction/Checkout.pm index d46aa30..d445df7 100644 --- a/ILS/Transaction/Checkout.pm +++ b/ILS/Transaction/Checkout.pm @@ -18,6 +18,7 @@ our @ISA = qw(ILS::Transaction); my %fields = ( security_inhibit => 0, due => undef, + renew_ok => 0, ); sub new { @@ -35,12 +36,4 @@ sub new { return bless $self, $class; } -sub renew_ok { - my $self = shift; - my $patron = $self->{patron}; - my $item = $self->{item}; - - return ($item->{patron} eq $patron->{id}); -} - 1;