From 4891a05e7fa8ce673f231d224e380cd876ac8bf8 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 4 Aug 2020 19:01:30 +0000 Subject: [PATCH] Bug 26132: (follow-up) Count all checkouts if no limits needed Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index c7245b815f..523dd7f603 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -437,12 +437,14 @@ sub TooMany { $checkouts = $patron->checkouts->search( { 'me.branchcode' => $maxissueqty_rule->branchcode } ); } elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { - ; # if branch is the patron's home branch, then count all loans by patron + $checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron } else { $checkouts = $patron->checkouts->search( { 'item.homebranch' => $maxissueqty_rule->branchcode }, { prefetch => 'item' } ); } + } else { + $checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron } my $sum_checkouts; my $rule_itemtype = $maxissueqty_rule->itemtype; -- 2.28.0