From 1180b1b8e05f0d9f95ad1e522afaa9acde4deff2 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 14 Aug 2020 11:30:12 +0000 Subject: [PATCH] Bug 26078: (follow-up) Use a boolean rather than changing returnbranch --- C4/Circulation.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 7283ba4644..c7e9b9e37e 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1923,7 +1923,7 @@ sub AddReturn { my $messages; my $patron; my $doreturn = 1; - my $validTransfert = 0; + my $validTransfer = 1; my $stat_type = 'return'; # get information on item @@ -2084,12 +2084,11 @@ sub AddReturn { $sth->execute( $item->itemnumber ); # If we are completing a transfer we should not generate a new transfer from return policy - $returnbranch = $branch; + $validTransfer = 0; } else { $messages->{'WrongTransfer'} = $tobranch; $messages->{'WrongTransferItem'} = $item->itemnumber; } - $validTransfert = 1; } # fix up the accounts..... @@ -2212,7 +2211,7 @@ sub AddReturn { } # Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer - if (!$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'}){ + if ($validTransfer && !$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'}){ my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType") eq 'itemtype' ? 'effective_itemtype' : 'ccode'; if (C4::Context->preference("AutomaticItemReturn" ) or (C4::Context->preference("UseBranchTransferLimits") and -- 2.11.0