Lines 474-481
sub TooMany {
Link Here
|
474 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
474 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
475 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
475 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
476 |
} else { |
476 |
} else { |
|
|
477 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
477 |
$checkouts = $patron->checkouts->search( |
478 |
$checkouts = $patron->checkouts->search( |
478 |
{ 'item.homebranch' => $maxissueqty_rule->branchcode } ); |
479 |
{ "item.$branch_type" => $maxissueqty_rule->branchcode } ); |
479 |
} |
480 |
} |
480 |
} else { |
481 |
} else { |
481 |
$checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron |
482 |
$checkouts = $patron->checkouts; # if rule is not branch specific then count all loans by patron |
Lines 570-578
sub TooMany {
Link Here
|
570 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
571 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
571 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
572 |
$checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron |
572 |
} else { |
573 |
} else { |
|
|
574 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
573 |
$checkouts = $patron->checkouts->search( |
575 |
$checkouts = $patron->checkouts->search( |
574 |
{ 'item.homebranch' => $branch}, |
576 |
{ "item.$branch_type" => $branch}, |
575 |
{ prefetch => 'item' } ); |
577 |
{ prefetch => 'item' } ); |
576 |
} |
578 |
} |
577 |
|
579 |
|
578 |
my $checkout_count = $checkouts->count; |
580 |
my $checkout_count = $checkouts->count; |
Lines 4362-4369
sub _CalculateAndUpdateFine {
Link Here
|
4362 |
# we only need to calculate and change the fines if we want to do that on return |
4364 |
# we only need to calculate and change the fines if we want to do that on return |
4363 |
# Should be on for hourly loans |
4365 |
# Should be on for hourly loans |
4364 |
my $control = C4::Context->preference('CircControl'); |
4366 |
my $control = C4::Context->preference('CircControl'); |
|
|
4367 |
my $branch_type = C4::Context->preference('HomeOrHoldingBranch') || 'homebranch'; |
4365 |
my $control_branchcode = |
4368 |
my $control_branchcode = |
4366 |
( $control eq 'ItemHomeLibrary' ) ? $item->{homebranch} |
4369 |
( $control eq 'ItemHomeLibrary' ) ? $item->{$branch_type} |
4367 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
4370 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
4368 |
: $issue->branchcode; |
4371 |
: $issue->branchcode; |
4369 |
|
4372 |
|