Lines 479-486
sub TooMany {
Link Here
|
479 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
479 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
480 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
480 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
481 |
} else { |
481 |
} else { |
|
|
482 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
482 |
$checkouts = $patron->checkouts->search( |
483 |
$checkouts = $patron->checkouts->search( |
483 |
{ 'item.homebranch' => $maxissueqty_rule->branchcode } ); |
484 |
{ "item.$branch_type" => $maxissueqty_rule->branchcode } ); |
484 |
} |
485 |
} |
485 |
} else { |
486 |
} else { |
486 |
$checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron |
487 |
$checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron |
Lines 575-583
sub TooMany {
Link Here
|
575 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
576 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
576 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
577 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
577 |
} else { |
578 |
} else { |
|
|
579 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
578 |
$checkouts = $patron->checkouts->search( |
580 |
$checkouts = $patron->checkouts->search( |
579 |
{ 'item.homebranch' => $branch}, |
581 |
{ "item.$branch_type" => $branch}, |
580 |
{ prefetch => 'item' } ); |
582 |
{ prefetch => 'item' } ); |
581 |
} |
583 |
} |
582 |
|
584 |
|
583 |
my $checkout_count = $checkouts->count; |
585 |
my $checkout_count = $checkouts->count; |
Lines 4344-4351
sub _CalculateAndUpdateFine {
Link Here
|
4344 |
# we only need to calculate and change the fines if we want to do that on return |
4346 |
# we only need to calculate and change the fines if we want to do that on return |
4345 |
# Should be on for hourly loans |
4347 |
# Should be on for hourly loans |
4346 |
my $control = C4::Context->preference('CircControl'); |
4348 |
my $control = C4::Context->preference('CircControl'); |
|
|
4349 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
4347 |
my $control_branchcode = |
4350 |
my $control_branchcode = |
4348 |
( $control eq 'ItemHomeLibrary' ) ? $item->{homebranch} |
4351 |
( $control eq 'ItemHomeLibrary' ) ? $item->{$branch_type} |
4349 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
4352 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
4350 |
: $issue->branchcode; |
4353 |
: $issue->branchcode; |
4351 |
|
4354 |
|