View | Details | Raw Unified | Return to bug 26132
Collapse All | Expand All

(-)a/C4/Circulation.pm (-8 / +7 lines)
Lines 450-469 sub TooMany { Link Here
450
    if (defined($maxissueqty_rule) and $maxissueqty_rule->rule_value ne "") {
450
    if (defined($maxissueqty_rule) and $maxissueqty_rule->rule_value ne "") {
451
451
452
        my $checkouts;
452
        my $checkouts;
453
        my $where = {};
454
        my $attr = { prefetch => 'item' };
453
        if ( $maxissueqty_rule->branchcode ) {
455
        if ( $maxissueqty_rule->branchcode ) {
454
            if ( C4::Context->preference('CircControl') eq 'PickupLibrary' ) {
456
            if ( C4::Context->preference('CircControl') eq 'PickupLibrary' ) {
455
                $checkouts = $patron->checkouts->search(
457
                $where = { 'me.branchcode' => $maxissueqty_rule->branchcode };
456
                    { 'me.branchcode' => $maxissueqty_rule->branchcode } );
457
            } elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') {
458
            } elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') {
458
                $checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron
459
                # if branch is the patron's home branch, then count all loans by patron
459
            } else {
460
            } else {
460
                $checkouts = $patron->checkouts->search(
461
                $where = { 'item.homebranch' => $maxissueqty_rule->branchcode };
461
                    { 'item.homebranch' => $maxissueqty_rule->branchcode },
462
                    { prefetch          => 'item' } );
463
            }
462
            }
464
        } else {
463
        } else {
465
            $checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron
464
            # if rule is not branch specific then count all loans by patron
466
        }
465
        }
466
        $checkouts = $patron->checkouts->search( $where, $attr );
467
        my $sum_checkouts;
467
        my $sum_checkouts;
468
        my $rule_itemtype = $maxissueqty_rule->itemtype;
468
        my $rule_itemtype = $maxissueqty_rule->itemtype;
469
        while ( my $c = $checkouts->next ) {
469
        while ( my $c = $checkouts->next ) {
470
- 

Return to bug 26132