From: Meenakshi.R Date: Thu, 5 Apr 2012 06:45:37 +0000 (+0530) Subject: Bug 7704 -Fix bug that prevent items to be returned to home branch, when independentb... X-Git-Url: http://git.rot13.org/?p=koha.git;a=commitdiff_plain;h=804b073a8274d9f719ef746d74198ade735dc620 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 --- 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,