[Koha-patches] [PATCH 1/6] bug 3409 followup: always set holdinglibrary to library last seen at

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


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

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index ab4f7a5..117ef83 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -1469,13 +1469,11 @@ sub AddReturn {
             $messages->{'WasReturned'} = 1;    # FIXME is the "= 1" right?  This could be the borrower hash.
         }
 
-            
-            
-        # We update the holdingbranch from circControlBranch variable
-        UpdateHoldingbranch($circControlBranch,$item->{'itemnumber'});
-        $item->{'holdingbranch'} = $circControlBranch;
-        
-		
+        # 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'});
     }
-- 
1.6.3.3



More information about the Koha-patches mailing list