Lines 478-485
sub TooMany {
Link Here
|
478 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
478 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
479 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
479 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
480 |
} else { |
480 |
} else { |
|
|
481 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
481 |
$checkouts = $patron->checkouts->search( |
482 |
$checkouts = $patron->checkouts->search( |
482 |
{ 'item.homebranch' => $maxissueqty_rule->branchcode } ); |
483 |
{ "item.$branch_type" => $maxissueqty_rule->branchcode } ); |
483 |
} |
484 |
} |
484 |
} else { |
485 |
} else { |
485 |
$checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron |
486 |
$checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron |
Lines 574-582
sub TooMany {
Link Here
|
574 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
575 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
575 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
576 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
576 |
} else { |
577 |
} else { |
|
|
578 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
577 |
$checkouts = $patron->checkouts->search( |
579 |
$checkouts = $patron->checkouts->search( |
578 |
{ 'item.homebranch' => $branch}, |
580 |
{ "item.$branch_type" => $branch}, |
579 |
{ prefetch => 'item' } ); |
581 |
{ prefetch => 'item' } ); |
580 |
} |
582 |
} |
581 |
|
583 |
|
582 |
my $checkout_count = $checkouts->count; |
584 |
my $checkout_count = $checkouts->count; |
Lines 4315-4322
sub _CalculateAndUpdateFine {
Link Here
|
4315 |
# we only need to calculate and change the fines if we want to do that on return |
4317 |
# we only need to calculate and change the fines if we want to do that on return |
4316 |
# Should be on for hourly loans |
4318 |
# Should be on for hourly loans |
4317 |
my $control = C4::Context->preference('CircControl'); |
4319 |
my $control = C4::Context->preference('CircControl'); |
|
|
4320 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
4318 |
my $control_branchcode = |
4321 |
my $control_branchcode = |
4319 |
( $control eq 'ItemHomeLibrary' ) ? $item->{homebranch} |
4322 |
( $control eq 'ItemHomeLibrary' ) ? $item->{$branch_type} |
4320 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
4323 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
4321 |
: $issue->branchcode; |
4324 |
: $issue->branchcode; |
4322 |
|
4325 |
|