Signed-off-by: Galen Charlton <[email protected]>
---
 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

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to