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

(-)a/C4/Circulation.pm (-13 / +25 lines)
Lines 448-465 sub TooMany { Link Here
448
    # given branch, patron category, and item type, determine
448
    # given branch, patron category, and item type, determine
449
    # applicable issuing rule
449
    # applicable issuing rule
450
450
451
    $parent_maxissueqty_rule = Koha::CirculationRules->get_effective_rule(
452
        {
453
            categorycode => $cat_borrower,
454
            itemtype     => $parent_type,
455
            branchcode   => $branch,
456
            rule_name    => 'maxissueqty',
457
        }
458
    ) if $parent_type;
459
460
    # If the parent rule is for default type we discount it
461
    $parent_maxissueqty_rule = undef if $parent_maxissueqty_rule && !defined $parent_maxissueqty_rule->itemtype;
462
463
    my $maxissueqty_rule = Koha::CirculationRules->get_effective_rule(
451
    my $maxissueqty_rule = Koha::CirculationRules->get_effective_rule(
464
        {
452
        {
465
            categorycode => $cat_borrower,
453
            categorycode => $cat_borrower,
Lines 469-474 sub TooMany { Link Here
469
        }
457
        }
470
    );
458
    );
471
459
460
    if ($parent_type) {
461
        if (   $maxissueqty_rule
462
            && defined $maxissueqty_rule->itemtype
463
            && $maxissueqty_rule->itemtype eq $parent_type )
464
        {
465
            # get_effective_rule already fell back to the parent itemtype rule
466
            $parent_maxissueqty_rule = $maxissueqty_rule;
467
        } else {
468
469
            # Child has its own specific rule; look up parent pool limit separately
470
            $parent_maxissueqty_rule = Koha::CirculationRules->get_effective_rule(
471
                {
472
                    categorycode => $cat_borrower,
473
                    itemtype     => $parent_type,
474
                    branchcode   => $branch,
475
                    rule_name    => 'maxissueqty',
476
                }
477
            );
478
479
            # Discard if only a global (non-itemtype-specific) rule was found
480
            $parent_maxissueqty_rule = undef
481
                if $parent_maxissueqty_rule && !defined $parent_maxissueqty_rule->itemtype;
482
        }
483
    }
484
472
    my $maxonsiteissueqty_rule = Koha::CirculationRules->get_effective_rule(
485
    my $maxonsiteissueqty_rule = Koha::CirculationRules->get_effective_rule(
473
        {
486
        {
474
            categorycode => $cat_borrower,
487
            categorycode => $cat_borrower,
475
- 

Return to bug 41917