[Koha-patches] [PATCH] BugFix 3701 - ReturnToShelvingCart

Kyle M Hall kyle.m.hall at gmail.com
Fri Oct 9 14:41:20 CEST 2009


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.
---
 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 3f550ef..b91137e 100644
--- a/C4/Items.pm
+++ b/C4/Items.pm
@@ -178,7 +178,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 40eeed1..df2b937 100755
--- a/circ/returns.pl
+++ b/circ/returns.pl
@@ -187,18 +187,18 @@ if ($barcode) {
         }
     }
 
-    if ( C4::Context->preference("ReturnToShelvingCart") ) {
-        my $item = GetItem( $itemnumber );
-        $item->{'location'} = 'CART';
-        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
-    }
-
 #
 # save the return
 #
     ( $returned, $messages, $issueinformation, $borrower ) =
       AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode);     # do the return
 
+    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.5.6.5




More information about the Koha-patches mailing list