[Koha-patches] [PATCH 4/6] AddReturn now always updates holdingbranch

Galen Charlton gmcharlt at gmail.com
Sun Aug 23 16:04:22 CEST 2009


Prior to this patch, this was done only when returning
an item after it had been out on loan.  Even if the
item had not been on loan, the fact that it was checked
in means that it is now in fact at the new holding library.

Signed-off-by: Galen Charlton <gmcharlt at gmail.com>
---
 C4/Circulation.pm |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index 5930bed..5edc736 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -1469,15 +1469,17 @@ sub AddReturn {
             $messages->{'WasReturned'} = 1;    # FIXME is the "= 1" right?  This could be the borrower hash.
         }
 
-        # the holdingbranch is updated if the document is returned to another location.
-        if ($item->{'holdingbranch'} ne $branch) {
-            UpdateHoldingbranch($branch, $item->{'itemnumber'});
-            $item->{'holdingbranch'} = $branch; # update item data holdingbranch too
-        }
-        ModDateLastSeen( $item->{'itemnumber'} );
         ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'});
     }
 
+    # the holdingbranch is updated if the document is returned to another location.
+    # this is always done regardless of whether the item was on loan or not
+    if ($item->{'holdingbranch'} ne $branch) {
+        UpdateHoldingbranch($branch, $item->{'itemnumber'});
+        $item->{'holdingbranch'} = $branch; # update item data holdingbranch too
+    }
+    ModDateLastSeen( $item->{'itemnumber'} );
+
     # check if we have a transfer for this document
     my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->{'itemnumber'} );
 
-- 
1.6.3.3




More information about the Koha-patches mailing list