From a80f02df557d55f455c32d1d614352aa1961bfff Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 29 Jun 2018 10:06:31 -0300 Subject: [PATCH] Bug 21020: Fix return branch on transfer - SIP Caused by commit 546379cc92b733cb29a0b70247a72c770afdad26 Bug 17680: C4::Circulation - Remove GetItemIssue, simple calls Since this commit AddReturn return a Koha::Issue object, not a hashref with item's info. Test plan: 1 - Enable SIP server on your test instance For kohadevbox: cp /etc/koha/SIPConfig.xml /etc/koha/sites/kohadev/ create patron with user/pass term1/term1 and grant circulation privileges 2 - enable AutomaticItemReturn 3 - Checkin an item which will generate a transfer via SIP2: perl /home/vagrant/kohaclone/misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l LPL --item {BARCODE} -m checkin -t CR 4 - Note no CT field 5 - Apply patch 6 - Repeate checkin via SIP2 7 - Transfer destination is correctly returned in CT Signed-off-by: Nick Clemens Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- C4/SIP/ILS/Transaction/Checkin.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm index 2ad3df5394..a35009f511 100644 --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ b/C4/SIP/ILS/Transaction/Checkin.pm @@ -65,7 +65,7 @@ sub do_checkin { . substr( $return_date, 16, 2 ); $debug and warn "do_checkin() calling AddReturn($barcode, $branch)"; - my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date); + my ($return, $messages, $issue, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date); $self->alert(!$return); # ignoring messages: NotIssued, WasLost, WasTransfered @@ -94,7 +94,7 @@ sub do_checkin { $self->alert_type('04'); # send to other branch } if ($messages->{WasTransfered}) { # set into transit so tell unit - $self->{item}->destination_loc($iteminformation->{homebranch}); + $self->{item}->destination_loc($issue->item->homebranch); $self->alert_type('04'); # send to other branch } if ($messages->{ResFound}) { -- 2.39.5