Lines 3267-3273
sub CanBookBeRenewed {
Link Here
|
3267 |
{ |
3267 |
{ |
3268 |
return ( 0, 'booked' ) unless ( $booking->patron_id == $patron->borrowernumber ); |
3268 |
return ( 0, 'booked' ) unless ( $booking->patron_id == $patron->borrowernumber ); |
3269 |
} |
3269 |
} |
|
|
3270 |
} |
3270 |
|
3271 |
|
|
|
3272 |
# CHECK FOR QUOTAS |
3273 |
if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) { |
3274 |
unless ( $quota->has_available_quota ) { |
3275 |
return ( 0, "QUOTA_EXCEEDED" ); |
3276 |
} |
3271 |
} |
3277 |
} |
3272 |
|
3278 |
|
3273 |
if ( $auto_renew eq 'auto_too_soon' ) { |
3279 |
if ( $auto_renew eq 'auto_too_soon' ) { |
Lines 3382-3387
sub AddRenewal {
Link Here
|
3382 |
|
3388 |
|
3383 |
my $circ_library = Koha::Libraries->find( _GetCircControlBranch( $item_object, $patron ) ); |
3389 |
my $circ_library = Koha::Libraries->find( _GetCircControlBranch( $item_object, $patron ) ); |
3384 |
|
3390 |
|
|
|
3391 |
# Check quotas and record usage if needed |
3392 |
if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) { |
3393 |
# Update patron's used quota value |
3394 |
$quota->add_usage({ |
3395 |
patron_id => $patron->patron_id, |
3396 |
issue_id => $issue->issue_id, |
3397 |
}); |
3398 |
} |
3399 |
|
3385 |
my $schema = Koha::Database->schema; |
3400 |
my $schema = Koha::Database->schema; |
3386 |
$schema->txn_do( |
3401 |
$schema->txn_do( |
3387 |
sub { |
3402 |
sub { |
3388 |
- |
|
|