Lines 457-465
sub TooMany {
Link Here
|
457 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
457 |
} 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 |
458 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
459 |
} else { |
459 |
} else { |
|
|
460 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
460 |
$checkouts = $patron->checkouts->search( |
461 |
$checkouts = $patron->checkouts->search( |
461 |
{ 'item.homebranch' => $maxissueqty_rule->branchcode }, |
462 |
{ "item.$branch_type" => $maxissueqty_rule->branchcode }, |
462 |
{ prefetch => 'item' } ); |
463 |
{ prefetch => 'item' } ); |
463 |
} |
464 |
} |
464 |
} else { |
465 |
} else { |
465 |
$checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron |
466 |
$checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron |
Lines 545-553
sub TooMany {
Link Here
|
545 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
546 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
546 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
547 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
547 |
} else { |
548 |
} else { |
|
|
549 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
548 |
$checkouts = $patron->checkouts->search( |
550 |
$checkouts = $patron->checkouts->search( |
549 |
{ 'item.homebranch' => $branch}, |
551 |
{ "item.$branch_type" => $branch}, |
550 |
{ prefetch => 'item' } ); |
552 |
{ prefetch => 'item' } ); |
551 |
} |
553 |
} |
552 |
|
554 |
|
553 |
my $checkout_count = $checkouts->count; |
555 |
my $checkout_count = $checkouts->count; |
Lines 4341-4348
sub _CalculateAndUpdateFine {
Link Here
|
4341 |
# we only need to calculate and change the fines if we want to do that on return |
4343 |
# we only need to calculate and change the fines if we want to do that on return |
4342 |
# Should be on for hourly loans |
4344 |
# Should be on for hourly loans |
4343 |
my $control = C4::Context->preference('CircControl'); |
4345 |
my $control = C4::Context->preference('CircControl'); |
|
|
4346 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
4344 |
my $control_branchcode = |
4347 |
my $control_branchcode = |
4345 |
( $control eq 'ItemHomeLibrary' ) ? $item->{homebranch} |
4348 |
( $control eq 'ItemHomeLibrary' ) ? $item->{$branch_type} |
4346 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
4349 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
4347 |
: $issue->branchcode; |
4350 |
: $issue->branchcode; |
4348 |
|
4351 |
|