View | Details | Raw Unified | Return to bug 38924
Collapse All | Expand All

(-)a/C4/Circulation.pm (-1 / +15 lines)
Lines 3401-3407 sub CanBookBeRenewed { Link Here
3401
        {
3401
        {
3402
            return ( 0, 'booked' ) unless ( $booking->patron_id == $patron->borrowernumber );
3402
            return ( 0, 'booked' ) unless ( $booking->patron_id == $patron->borrowernumber );
3403
        }
3403
        }
3404
    }
3404
3405
3406
    # CHECK FOR QUOTAS  
3407
    if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) {
3408
        unless ( $quota->has_available_quota ) {
3409
            return ( 0, "QUOTA_EXCEEDED" );
3410
        }
3405
    }
3411
    }
3406
3412
3407
    if ( $auto_renew eq 'auto_too_soon' ) {
3413
    if ( $auto_renew eq 'auto_too_soon' ) {
Lines 3518-3523 sub AddRenewal { Link Here
3518
3524
3519
    my $circ_library = Koha::Libraries->find( _GetCircControlBranch( $item_object, $patron ) );
3525
    my $circ_library = Koha::Libraries->find( _GetCircControlBranch( $item_object, $patron ) );
3520
3526
3527
    # Check quotas and record usage if needed
3528
    if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) {
3529
        # Update patron's used quota value
3530
        $quota->add_usage({
3531
            patron_id => $patron->patron_id, 
3532
            issue_id => $issue->issue_id,
3533
        });
3534
    }
3535
3521
    my $schema = Koha::Database->schema;
3536
    my $schema = Koha::Database->schema;
3522
    $schema->txn_do(
3537
    $schema->txn_do(
3523
        sub {
3538
        sub {
3524
- 

Return to bug 38924