From ed11e836f7b858339850de8398f5b62175767a68 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Mon, 26 Nov 2012 10:42:09 +1300 Subject: [PATCH] Bug 9138 : SIP2 passing incorrect itemnumber to ModReserveAffect --- C4/SIP/ILS/Transaction/Checkin.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm index 47bd85d..a9c5d37 100644 --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ b/C4/SIP/ILS/Transaction/Checkin.pm @@ -14,7 +14,7 @@ use ILS::Transaction; use C4::Circulation; use C4::Reserves qw( ModReserveAffect ); -use C4::Items qw( ModItemTransfer ); +use C4::Items qw( ModItemTransfer GetItemnumberFromBarcode); use C4::Debug; our @ISA = qw(ILS::Transaction); @@ -54,6 +54,7 @@ sub do_checkin { $debug and warn "do_checkin() calling AddReturn($barcode, $branch)"; my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch); $self->alert(!$return); + my $itemnumber = GetItemnumberFromBarcode( $barcode ); # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered # biblionumber, biblioitemnumber, itemnumber @@ -81,15 +82,15 @@ sub do_checkin { if ($messages->{ResFound}) { $self->hold($messages->{ResFound}); if ($branch eq $messages->{ResFound}->{branchcode}) { - $self->alert_type('01'); - ModReserveAffect( $messages->{ResFound}->{itemnumber}, + $self->alert_type('01'); + ModReserveAffect( $itemnumber, $messages->{ResFound}->{borrowernumber}, 0); } else { $self->alert_type('02'); - ModReserveAffect( $messages->{ResFound}->{itemnumber}, + ModReserveAffect( $itemnumber, $messages->{ResFound}->{borrowernumber}, 1); - ModItemTransfer( $messages->{ResFound}->{itemnumber}, + ModItemTransfer( $itemnumber, $branch, $messages->{ResFound}->{branchcode} ); -- 1.7.10.4