From 8617fbda62e9ad81f4662f8513210949602eacef Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 21 Nov 2025 11:05:31 +0100 Subject: [PATCH] Bug 41280: Add check on branchcode of patron_maxissueqty rule Content-Type: text/plain; charset=utf-8 Test plan: Still coming --- C4/Circulation.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 0a8df34263..c0ff2a6726 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -591,11 +591,11 @@ sub TooMany { if ( defined( $branch_borrower_circ_rule->{patron_maxissueqty} ) and $branch_borrower_circ_rule->{patron_maxissueqty} ne '' ) { - my $checkouts; - if ( C4::Context->preference('CircControl') eq 'PickupLibrary' ) { + my $checkouts = $patron->checkouts; + if ( !$branch_borrower_circ_rule->branchcode ) { # global level: look at all checkouts + } elsif ( C4::Context->preference('CircControl') eq 'PatronLibrary' ) { # do the same + } elsif ( C4::Context->preference('CircControl') eq 'PickupLibrary' ) { $checkouts = $patron->checkouts->search( { 'me.branchcode' => $branch } ); - } elsif ( C4::Context->preference('CircControl') eq 'PatronLibrary' ) { - $checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron } else { my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; $checkouts = $patron->checkouts->search( -- 2.39.5