Lines 427-433
sub TooMany {
Link Here
|
427 |
AND (categorycode = ? OR categorycode = ?) |
427 |
AND (categorycode = ? OR categorycode = ?) |
428 |
AND itemtype <> '*' |
428 |
AND itemtype <> '*' |
429 |
) "; |
429 |
) "; |
430 |
} else { |
430 |
} else { |
431 |
$count_query .= " JOIN biblioitems USING (biblionumber) |
431 |
$count_query .= " JOIN biblioitems USING (biblionumber) |
432 |
WHERE biblioitems.itemtype NOT IN ( |
432 |
WHERE biblioitems.itemtype NOT IN ( |
433 |
SELECT itemtype FROM issuingrules |
433 |
SELECT itemtype FROM issuingrules |
Lines 512-525
sub TooMany {
Link Here
|
512 |
|; |
512 |
|; |
513 |
push @bind_params, $borrower->{borrowernumber}; |
513 |
push @bind_params, $borrower->{borrowernumber}; |
514 |
|
514 |
|
515 |
if (C4::Context->preference('CircControl') eq 'PickupLibrary') { |
515 |
# Only for specific or default branches. |
516 |
$branch_count_query .= " AND issues.branchcode = ? "; |
516 |
unless ($branch_borrower_circ_rule->{has_priority}) { |
517 |
push @bind_params, $branch; |
517 |
if (C4::Context->preference('CircControl') eq 'PickupLibrary') { |
518 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
518 |
$branch_count_query .= " AND issues.branchcode = ? "; |
519 |
; # if branch is the patron's home branch, then count all loans by patron |
519 |
push @bind_params, $branch; |
520 |
} else { |
520 |
} elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { |
521 |
$branch_count_query .= " AND items.homebranch = ? "; |
521 |
; # if branch is the patron's home branch, then count all loans by patron |
522 |
push @bind_params, $branch; |
522 |
} else { |
|
|
523 |
$branch_count_query .= " AND items.homebranch = ? "; |
524 |
push @bind_params, $branch; |
525 |
} |
523 |
} |
526 |
} |
524 |
my ( $checkout_count, $onsite_checkout_count ) = $dbh->selectrow_array( $branch_count_query, {}, @bind_params ); |
527 |
my ( $checkout_count, $onsite_checkout_count ) = $dbh->selectrow_array( $branch_count_query, {}, @bind_params ); |
525 |
my $max_checkouts_allowed = $branch_borrower_circ_rule->{maxissueqty}; |
528 |
my $max_checkouts_allowed = $branch_borrower_circ_rule->{maxissueqty}; |
Lines 1616-1621
sub GetBranchBorrowerCircRule {
Link Here
|
1616 |
my $rules; |
1619 |
my $rules; |
1617 |
my $dbh = C4::Context->dbh(); |
1620 |
my $dbh = C4::Context->dbh(); |
1618 |
$rules = $dbh->selectrow_hashref( q| |
1621 |
$rules = $dbh->selectrow_hashref( q| |
|
|
1622 |
SELECT maxissueqty, maxonsiteissueqty, has_priority |
1623 |
FROM default_borrower_circ_rules |
1624 |
WHERE categorycode = ? AND has_priority = 1 |
1625 |
|, {}, $categorycode ) ; |
1626 |
return $rules if $rules; |
1627 |
|
1628 |
$rules = $dbh->selectrow_hashref( q| |
1619 |
SELECT maxissueqty, maxonsiteissueqty |
1629 |
SELECT maxissueqty, maxonsiteissueqty |
1620 |
FROM branch_borrower_circ_rules |
1630 |
FROM branch_borrower_circ_rules |
1621 |
WHERE branchcode = ? |
1631 |
WHERE branchcode = ? |