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