From 804b073a8274d9f719ef746d74198ade735dc620 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. Signed-off-by: Kyle M Hall Signed-off-by: Paul Poulain --- C4/Circulation.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 4902c133b5..c26de760c0 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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, -- 2.39.5