From 0dd05fc90a735b9e22359fcb461bdc9291e7a85f 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 Signed-off-by: Jonathan Druart --- C4/Circulation.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index a379742706..629728666f 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -436,12 +436,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.39.2