@@ -, +, @@ --- C4/Circulation.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -451,18 +451,16 @@ sub TooMany { my $checkouts; my $where = {}; - my $attr = { prefetch => 'item' }; + my $attr = { join => 'item' }; if ( $maxissueqty_rule->branchcode ) { if ( C4::Context->preference('CircControl') eq 'PickupLibrary' ) { $where = { '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 - } else { + } elsif (C4::Context->preference('CircControl') ne 'PatronLibrary') { $where = { 'item.homebranch' => $maxissueqty_rule->branchcode }; } - } else { - # if rule is not branch specific then count all loans by patron - } + # elsif branch is the patron's home branch, then count all loans by patron + } # elsif rule is not branch specific then count all loans by patron + $checkouts = $patron->checkouts->search( $where, $attr ); my $sum_checkouts; my $rule_itemtype = $maxissueqty_rule->itemtype; --