|
Lines 419-425
sub TooMany {
Link Here
|
| 419 |
|; |
419 |
|; |
| 420 |
|
420 |
|
| 421 |
my $rule_itemtype = $maxissueqty_rule->itemtype; |
421 |
my $rule_itemtype = $maxissueqty_rule->itemtype; |
| 422 |
if ($rule_itemtype eq "*") { |
422 |
unless ($rule_itemtype) { |
| 423 |
# matching rule has the default item type, so count only |
423 |
# matching rule has the default item type, so count only |
| 424 |
# those existing loans that don't fall under a more |
424 |
# those existing loans that don't fall under a more |
| 425 |
# specific rule |
425 |
# specific rule |
|
Lines 457-463
sub TooMany {
Link Here
|
| 457 |
$count_query .= " AND borrowernumber = ? "; |
457 |
$count_query .= " AND borrowernumber = ? "; |
| 458 |
push @bind_params, $borrower->{'borrowernumber'}; |
458 |
push @bind_params, $borrower->{'borrowernumber'}; |
| 459 |
my $rule_branch = $maxissueqty_rule->branchcode; |
459 |
my $rule_branch = $maxissueqty_rule->branchcode; |
| 460 |
if ($rule_branch ne "*") { |
460 |
unless ($rule_branch) { |
| 461 |
if (C4::Context->preference('CircControl') eq 'PickupLibrary') { |
461 |
if (C4::Context->preference('CircControl') eq 'PickupLibrary') { |
| 462 |
$count_query .= " AND issues.branchcode = ? "; |
462 |
$count_query .= " AND issues.branchcode = ? "; |
| 463 |
push @bind_params, $branch; |
463 |
push @bind_params, $branch; |
|
Lines 471-478
sub TooMany {
Link Here
|
| 471 |
|
471 |
|
| 472 |
my ( $checkout_count, $onsite_checkout_count ) = $dbh->selectrow_array( $count_query, {}, @bind_params ); |
472 |
my ( $checkout_count, $onsite_checkout_count ) = $dbh->selectrow_array( $count_query, {}, @bind_params ); |
| 473 |
|
473 |
|
| 474 |
my $max_checkouts_allowed = $maxissueqty_rule ? $maxissueqty_rule->rule_value : 0; |
474 |
my $max_checkouts_allowed = $maxissueqty_rule ? $maxissueqty_rule->rule_value : undef; |
| 475 |
my $max_onsite_checkouts_allowed = $maxonsiteissueqty_rule ? $maxonsiteissueqty_rule->rule_value : 0; |
475 |
my $max_onsite_checkouts_allowed = $maxonsiteissueqty_rule ? $maxonsiteissueqty_rule->rule_value : undef; |
| 476 |
|
476 |
|
| 477 |
if ( $onsite_checkout and defined $max_onsite_checkouts_allowed ) { |
477 |
if ( $onsite_checkout and defined $max_onsite_checkouts_allowed ) { |
| 478 |
if ( $onsite_checkout_count >= $max_onsite_checkouts_allowed ) { |
478 |
if ( $onsite_checkout_count >= $max_onsite_checkouts_allowed ) { |
| 479 |
- |
|
|