diff --git a/Koha/Library/FloatLimits.pm b/Koha/Library/FloatLimits.pm index d22892fc51..840c8e8cd3 100644 --- a/Koha/Library/FloatLimits.pm +++ b/Koha/Library/FloatLimits.pm @@ -234,8 +234,12 @@ sub lowest_ratio_library { $item->$BranchTransferLimitsType ); - $transfer_branch = Koha::Libraries->find( $candidate->{branchcode} ) if $allowed; - last; + if ($allowed) { + $transfer_branch = Koha::Libraries->find( $candidate->{branchcode} ); + last; # Found an allowed transfer, exit loop + } + + # If not allowed, continue to next candidate } else { $transfer_branch = Koha::Libraries->find( $candidate->{branchcode} ); last;