|
Lines 3372-3378
sub CanBookBeRenewed {
Link Here
|
| 3372 |
{ |
3372 |
{ |
| 3373 |
return ( 0, 'booked' ) unless ( $booking->patron_id == $patron->borrowernumber ); |
3373 |
return ( 0, 'booked' ) unless ( $booking->patron_id == $patron->borrowernumber ); |
| 3374 |
} |
3374 |
} |
|
|
3375 |
} |
| 3375 |
|
3376 |
|
|
|
3377 |
# CHECK FOR QUOTAS |
| 3378 |
if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) { |
| 3379 |
unless ( $quota->has_available_quota ) { |
| 3380 |
return ( 0, "QUOTA_EXCEEDED" ); |
| 3381 |
} |
| 3376 |
} |
3382 |
} |
| 3377 |
|
3383 |
|
| 3378 |
if ( $auto_renew eq 'auto_too_soon' ) { |
3384 |
if ( $auto_renew eq 'auto_too_soon' ) { |
|
Lines 3489-3494
sub AddRenewal {
Link Here
|
| 3489 |
|
3495 |
|
| 3490 |
my $circ_library = Koha::Libraries->find( _GetCircControlBranch( $item_object, $patron ) ); |
3496 |
my $circ_library = Koha::Libraries->find( _GetCircControlBranch( $item_object, $patron ) ); |
| 3491 |
|
3497 |
|
|
|
3498 |
# Check quotas and record usage if needed |
| 3499 |
if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) { |
| 3500 |
# Update patron's used quota value |
| 3501 |
$quota->add_usage({ |
| 3502 |
patron_id => $patron->patron_id, |
| 3503 |
issue_id => $issue->issue_id, |
| 3504 |
}); |
| 3505 |
} |
| 3506 |
|
| 3492 |
my $schema = Koha::Database->schema; |
3507 |
my $schema = Koha::Database->schema; |
| 3493 |
$schema->txn_do( |
3508 |
$schema->txn_do( |
| 3494 |
sub { |
3509 |
sub { |
| 3495 |
- |
|
|