bug 3409 followup: always set holdinglibrary to library last seen at
authorGalen Charlton <gmcharlt@gmail.com>
Sun, 23 Aug 2009 12:53:39 +0000 (08:53 -0400)
committerGalen Charlton <gmcharlt@gmail.com>
Sun, 23 Aug 2009 14:05:09 +0000 (10:05 -0400)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
C4/Circulation.pm

index ab4f7a5..117ef83 100644 (file)
@@ -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'});
     }