Lines 417-423
sub TooMany {
Link Here
|
417 |
AND (categorycode = ? OR categorycode = ?) |
417 |
AND (categorycode = ? OR categorycode = ?) |
418 |
AND itemtype <> '*' |
418 |
AND itemtype <> '*' |
419 |
) "; |
419 |
) "; |
420 |
} else { |
420 |
} else { |
421 |
$count_query .= " JOIN biblioitems USING (biblionumber) |
421 |
$count_query .= " JOIN biblioitems USING (biblionumber) |
422 |
WHERE biblioitems.itemtype NOT IN ( |
422 |
WHERE biblioitems.itemtype NOT IN ( |
423 |
SELECT itemtype FROM issuingrules |
423 |
SELECT itemtype FROM issuingrules |
Lines 502-515
sub TooMany {
Link Here
|
502 |
|; |
502 |
|; |
503 |
push @bind_params, $borrower->{borrowernumber}; |
503 |
push @bind_params, $borrower->{borrowernumber}; |
504 |
|
504 |
|
505 |
if (C4::Context->preference('CircControl') eq 'PickupLibrary') { |
505 |
# Only for specific or default branches. |
506 |
$branch_count_query .= " AND issues.branchcode = ? "; |
506 |
unless ($branch_borrower_circ_rule->{has_priority}) { |
507 |
push @bind_params, $branch; |
507 |
if (C4::Context->preference('CircControl') eq 'PickupLibrary') { |
508 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
508 |
$branch_count_query .= " AND issues.branchcode = ? "; |
509 |
; # if branch is the patron's home branch, then count all loans by patron |
509 |
push @bind_params, $branch; |
510 |
} else { |
510 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
511 |
$branch_count_query .= " AND items.homebranch = ? "; |
511 |
; # if branch is the patron's home branch, then count all loans by patron |
512 |
push @bind_params, $branch; |
512 |
} else { |
|
|
513 |
$branch_count_query .= " AND items.homebranch = ? "; |
514 |
push @bind_params, $branch; |
515 |
} |
513 |
} |
516 |
} |
514 |
my ( $checkout_count, $onsite_checkout_count ) = $dbh->selectrow_array( $branch_count_query, {}, @bind_params ); |
517 |
my ( $checkout_count, $onsite_checkout_count ) = $dbh->selectrow_array( $branch_count_query, {}, @bind_params ); |
515 |
my $max_checkouts_allowed = $branch_borrower_circ_rule->{maxissueqty}; |
518 |
my $max_checkouts_allowed = $branch_borrower_circ_rule->{maxissueqty}; |
Lines 1597-1602
sub GetBranchBorrowerCircRule {
Link Here
|
1597 |
my $rules; |
1600 |
my $rules; |
1598 |
my $dbh = C4::Context->dbh(); |
1601 |
my $dbh = C4::Context->dbh(); |
1599 |
$rules = $dbh->selectrow_hashref( q| |
1602 |
$rules = $dbh->selectrow_hashref( q| |
|
|
1603 |
SELECT maxissueqty, maxonsiteissueqty, has_priority |
1604 |
FROM default_borrower_circ_rules |
1605 |
WHERE categorycode = ? AND has_priority = 1 |
1606 |
|, {}, $categorycode ) ; |
1607 |
return $rules if $rules; |
1608 |
|
1609 |
$rules = $dbh->selectrow_hashref( q| |
1600 |
SELECT maxissueqty, maxonsiteissueqty |
1610 |
SELECT maxissueqty, maxonsiteissueqty |
1601 |
FROM branch_borrower_circ_rules |
1611 |
FROM branch_borrower_circ_rules |
1602 |
WHERE branchcode = ? |
1612 |
WHERE branchcode = ? |