Bug 7704 -Fix bug that prevent items to be returned to home branch, when independentb...
authorMeenakshi.R <meenakshi.r@osslabs.biz>
Thu, 5 Apr 2012 06:45:37 +0000 (12:15 +0530)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 21 May 2012 16:43:13 +0000 (18:43 +0200)
Before this fix, when attempt to checkin the item at the other branch is made, system disallows checkin. Now (with this fix) the item is checked in and an automatic transfer to the home branch is setup.

How to test:
Case 1
Set independentbranches to "Prevent" and canreservefromotherbranch to "allow". Set up an item in branch A and a member in branch A and another member in branch B.

Checkout the item to member in branch A.
Place a reserve on the item on behalf of member in branch B.
Return the item in branch A. Check if a transfer is setup to branch B.
Checkout the item to the member in branch B and check it back in. Checkin should be allowed and at this point an automatic return to branch A (the home library) should be setup.

Case 2
Set independentbranches to "Prevent" and canreservefromotherbranch to "not allow". In this case item checkin should not be allowed in branch B.

Other cases
Set independentbranches to "Not Prevent". Here items should be returned automatically to home branch, the value in canreservefromotherbranch has no impact.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Circulation.pm

index 4902c13..c26de76 100644 (file)
@@ -1577,8 +1577,8 @@ sub AddReturn {
         $branches->{$hbr}->{PE} and $messages->{'IsPermanent'} = $hbr;
     }
 
-    # if indy branches and returning to different branch, refuse the return
-    if ($hbr ne $branch && C4::Context->preference("IndependantBranches")){
+    # if indy branches and returning to different branch, refuse the return unless canreservefromotherbranches is turned on
+    if ($hbr ne $branch && C4::Context->preference("IndependantBranches") && !(C4::Context->preference("canreservefromotherbranches"))){
         $messages->{'Wrongbranch'} = {
             Wrongbranch => $branch,
             Rightbranch => $hbr,