From 36e35d14b3f58f7b5f3186d6a0d0e83f5cda68da Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 13 Sep 2012 11:04:55 -0400 Subject: [PATCH] Bug 8769 - WIP - Allow SIP2 return backdating Content-Type: text/plain; charset="utf-8" --- C4/Circulation.pm | 4 ++-- C4/SIP/ILS.pm | 2 +- C4/SIP/ILS/Transaction/Checkin.pm | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 48b7b4a..71eaae7 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1569,7 +1569,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'}; @@ -1670,7 +1670,7 @@ sub AddReturn { ); } } - MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'}); + MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, $return_date, $borrower->{'privacy'}); $messages->{'WasReturned'} = 1; # FIXME is the "= 1" right? This could be the borrower hash. } diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm index f046568..4e335aa 100644 --- a/C4/SIP/ILS.pm +++ b/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); diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm index 47bd85d..5c8bcaa 100644 --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ b/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, undef, undef, $return_date); $self->alert(!$return); # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered -- 1.7.2.5