From 5925635049390c5b86c22353a66e3f735d56a79c Mon Sep 17 00:00:00 2001 From: Meenakshi.R Date: Thu, 5 Apr 2012 12:15:37 +0530 Subject: [PATCH] Bug 7704 -Fix bug that prevent items to be returned to home branch, when independentbranches and canreservefromotherbranch sysprefs are both turned on. 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. --- C4/Circulation.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 999f617..b1811b4 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1545,8 +1545,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, -- 1.7.1