From 042e6110b4f8ee1a7d9b2a83c12ffad9495b6e58 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 8 Oct 2009 12:13:13 +0000 Subject: [PATCH] BugFix - ReturnToShelvingCart If the ReturnToShelvingCart syspref is on, and something needs to go in transit, the shelving cart setting is overriding the transit. What seems to be happening is this: * Item is checked in, and flagged as needing to go in transit from A to B. * Item is immediately flagged as shelving cart, though. Current display says both shelving cart and in transit. * After the cart-to-shelf script runs, item comes out of transit and shows as being available at the destination library, although it hasn't arrived yet and no one has manually checked it in. It looks like the "checkin" from the script is telling Koha that the in-transit has been received. http://bugs.koha-community.org/show_bug.cgi?id=3701 --- C4/Items.pm | 2 +- circ/returns.pl | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 9f4b9b3..3b0e6f7 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -188,7 +188,7 @@ sub CartToShelf { unless ( $itemnumber ) { croak "FAILED CartToShelf() - no itemnumber supplied"; } - + my $item = GetItem($itemnumber); $item->{location} = $item->{permanent_location}; ModItem($item, undef, $itemnumber); diff --git a/circ/returns.pl b/circ/returns.pl index bd60d42..d78c356 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -212,12 +212,6 @@ if ($barcode) { } } - if ( C4::Context->preference("ReturnToShelvingCart") ) { - my $item = GetItem( $itemnumber ); - $item->{'location'} = 'CART'; - ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} ); - } - # # save the return # @@ -226,6 +220,12 @@ if ($barcode) { my $homeorholdingbranchreturn = C4::Context->preference('HomeOrHoldingBranchReturn'); $homeorholdingbranchreturn ||= 'homebranch'; + if ( C4::Context->preference("ReturnToShelvingCart") && !$messages->{'WasTransfered'} ) { + my $item = GetItem( $itemnumber ); + $item->{'location'} = 'CART'; + ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} ); + } + # get biblio description my $biblio = GetBiblioFromItemNumber($itemnumber); # fix up item type for display -- 1.7.2.5