@@ -, +, @@ --- C4/Circulation.pm | 9 ++++++--- C4/SIP/ILS.pm | 2 +- C4/SIP/ILS/Transaction/Checkin.pm | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1615,7 +1615,7 @@ sub GetBranchItemRule { =head2 AddReturn ($doreturn, $messages, $iteminformation, $borrower) = - &AddReturn($barcode, $branch, $exemptfine, $dropbox); + &AddReturn($barcode, $branch, $exemptfine, $dropbox, $returndate); Returns a book. @@ -1634,6 +1634,9 @@ overdue charges are applied and C<$dropbox> is true, the last charge will be removed. This assumes that the fines accrual script has run for _today_. +=item C<$return_date> allows the default return date to be overridden +by the given return date. + =back C<&AddReturn> returns a list of four items: @@ -1687,7 +1690,7 @@ patron who last borrowed the book. =cut sub AddReturn { - my ( $barcode, $branch, $exemptfine, $dropbox ) = @_; + my ( $barcode, $branch, $exemptfine, $dropbox, $return_date ) = @_; if ($branch and not GetBranchDetail($branch)) { warn "AddReturn error: branch '$branch' not found. Reverting to " . C4::Context->userenv->{'branch'}; @@ -1798,7 +1801,7 @@ sub AddReturn { } MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, - $circControlBranch, '', $borrower->{'privacy'} ); + $circControlBranch, $return_date, $borrower->{'privacy'} ); # FIXME is the "= 1" right? This could be the borrower hash. $messages->{'WasReturned'} = 1; --- a/C4/SIP/ILS.pm +++ a/C4/SIP/ILS.pm @@ -181,7 +181,7 @@ sub checkin { $circ->item($item = new ILS::Item $item_id); if ($item) { - $circ->do_checkin($current_loc); + $circ->do_checkin($current_loc, $return_date); } else { $circ->alert(1); $circ->alert_type(99); --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ a/C4/SIP/ILS/Transaction/Checkin.pm @@ -47,12 +47,13 @@ sub new { sub do_checkin { my $self = shift; my $branch = shift; + my $return_date = shift; if (!$branch) { $branch = 'SIP2'; } my $barcode = $self->{item}->id; $debug and warn "do_checkin() calling AddReturn($barcode, $branch)"; - my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch); + my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, $return_date); $self->alert(!$return); # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered --