Lines 374-381
sub transferbook {
Link Here
|
374 |
|
374 |
|
375 |
sub TooMany { |
375 |
sub TooMany { |
376 |
my $borrower = shift; |
376 |
my $borrower = shift; |
377 |
my $biblionumber = shift; |
377 |
my $item_object = shift; |
378 |
my $item = shift; |
|
|
379 |
my $params = shift; |
378 |
my $params = shift; |
380 |
my $onsite_checkout = $params->{onsite_checkout} || 0; |
379 |
my $onsite_checkout = $params->{onsite_checkout} || 0; |
381 |
my $switch_onsite_checkout = $params->{switch_onsite_checkout} || 0; |
380 |
my $switch_onsite_checkout = $params->{switch_onsite_checkout} || 0; |
Lines 383-393
sub TooMany {
Link Here
|
383 |
my $dbh = C4::Context->dbh; |
382 |
my $dbh = C4::Context->dbh; |
384 |
my $branch; |
383 |
my $branch; |
385 |
# Get which branchcode we need |
384 |
# Get which branchcode we need |
386 |
$branch = _GetCircControlBranch($item,$borrower); |
385 |
$branch = _GetCircControlBranch($item_object->unblessed,$borrower); |
387 |
my $type = (C4::Context->preference('item-level_itypes')) |
386 |
my $type = $item_object->effective_itemtype; |
388 |
? $item->{'itype'} # item-level |
387 |
|
389 |
: $item->{'itemtype'}; # biblio-level |
|
|
390 |
|
391 |
# given branch, patron category, and item type, determine |
388 |
# given branch, patron category, and item type, determine |
392 |
# applicable issuing rule |
389 |
# applicable issuing rule |
393 |
my $maxissueqty_rule = Koha::CirculationRules->get_effective_rule( |
390 |
my $maxissueqty_rule = Koha::CirculationRules->get_effective_rule( |
Lines 905-911
sub CanBookBeIssued {
Link Here
|
905 |
and $issue |
902 |
and $issue |
906 |
and $issue->onsite_checkout |
903 |
and $issue->onsite_checkout |
907 |
and $issue->borrowernumber == $patron->borrowernumber ? 1 : 0 ); |
904 |
and $issue->borrowernumber == $patron->borrowernumber ? 1 : 0 ); |
908 |
my $toomany = TooMany( $patron_unblessed, $item_object->biblionumber, $item_unblessed, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); |
905 |
my $toomany = TooMany( $patron_unblessed, $item_object, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); |
909 |
# if TooMany max_allowed returns 0 the user doesn't have permission to check out this book |
906 |
# if TooMany max_allowed returns 0 the user doesn't have permission to check out this book |
910 |
if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) { |
907 |
if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) { |
911 |
if ( $toomany->{max_allowed} == 0 ) { |
908 |
if ( $toomany->{max_allowed} == 0 ) { |
912 |
- |
|
|