From: Tomas Cohen Arazi Date: Tue, 21 Jun 2016 18:18:51 +0000 (-0300) Subject: Bug 14048: (followup) Use the original holding branch X-Git-Tag: v16.11.00~1225 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=e657345fd7493816f1713fd825fac1e1f2f757a7;p=koha_ffzg Bug 14048: (followup) Use the original holding branch This patch picks the item's holding branch *before* it gets fixed by using the checkin library instead. This way the RefundLostOnReturnControl syspref set to ItemHoldingBranch is respected (otherwise, as Nick explained this behaves just like if CheckinLibrary was set) Signed-off-by: Tomas Cohen Arazi Signed-off-by: Nick Clemens Signed-off-by: Jason Robb Signed-off-by: Jennifer Schmidt Signed-off-by: Margaret Thrasher Signed-off-by: Jonathan Druart Signed-off-by: Jesse Weaver --- diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 1e8985ebd1..0b1ae468fc 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2110,6 +2110,7 @@ sub AddReturn { # the holdingbranch is updated if the document is returned to another location. # this is always done regardless of whether the item was on loan or not + my $item_holding_branch = $item->{ holdingbranch }; if ($item->{'holdingbranch'} ne $branch) { UpdateHoldingbranch($branch, $item->{'itemnumber'}); $item->{'holdingbranch'} = $branch; # update item data holdingbranch too @@ -2149,7 +2150,7 @@ sub AddReturn { { current_branch => C4::Context->userenv->{branch}, item_home_branch => $item->{homebranch}, - item_holding_branch => $item->{holdingbranch} + item_holding_branch => $item_holding_branch } ) )