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

(-)a/C4/Circulation.pm (+32 lines)
Lines 124-129 use Koha::Plugins; Link Here
124
use Koha::Recalls;
124
use Koha::Recalls;
125
use Koha::Library::Hours;
125
use Koha::Library::Hours;
126
use Koha::Library::FloatLimits;
126
use Koha::Library::FloatLimits;
127
use Koha::Patron::Quotas;
128
use Koha::Patron::Quota;
129
use Koha::Patron::Quota::Usage;
127
use Carp            qw( carp );
130
use Carp            qw( carp );
128
use List::MoreUtils qw( any );
131
use List::MoreUtils qw( any );
129
use Scalar::Util    qw( looks_like_number blessed );
132
use Scalar::Util    qw( looks_like_number blessed );
Lines 1371-1376 sub CanBookBeIssued { Link Here
1371
        }
1374
        }
1372
    }
1375
    }
1373
1376
1377
    # CHECK FOR QUOTAS
1378
    if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) {
1379
        unless ( $quota->has_available_quota ) {
1380
            if ( C4::Context->preference("AllowQuotaOverride") ) {
1381
                $needsconfirmation{QUOTA_EXCEEDED} = {
1382
                    available => $quota->available_quota,
1383
                    total => $quota->allocation,
1384
                    used => $quota->used,
1385
                };
1386
            }
1387
            else {
1388
                $issuingimpossible{QUOTA_EXCEEDED} = {
1389
                    available => $quota->available_quota,
1390
                    total => $quota->allocation, 
1391
                    used => $quota->used,
1392
                };
1393
            }
1394
        }
1395
    }
1396
1374
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages );
1397
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages );
1375
}
1398
}
1376
1399
Lines 1998-2003 sub AddIssue { Link Here
1998
            Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue(
2021
            Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue(
1999
                { biblio_ids => [ $item_object->biblionumber ] } )
2022
                { biblio_ids => [ $item_object->biblionumber ] } )
2000
                if C4::Context->preference('RealTimeHoldsQueue');
2023
                if C4::Context->preference('RealTimeHoldsQueue');
2024
2025
            # Check quotas and record usage if needed
2026
            if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) {
2027
                # Update patron's used quota value
2028
                $quota->add_usage({
2029
                    patron_id => $patron->patron_id, 
2030
                    issue_id => $issue->issue_id,
2031
                });
2032
            }
2001
        }
2033
        }
2002
    }
2034
    }
2003
    return $issue;
2035
    return $issue;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +13 lines)
Lines 155-160 Link Here
155
                    </li>
155
                    </li>
156
                [% END %]
156
                [% END %]
157
157
158
                [%IF ( QUOTA_EXCEEDED ) %]
159
                    <li class="needsconfirm age_restriction">
160
                        Quota Exceeded [% QUOTA_EXCEEDED | html %].
161
                        [% IF CAN_user_circulate_force_checkout %]
162
                            Check out anyway?
163
                        [% END %]
164
                    </li>
165
                [% END %]
166
158
                [% IF ( DEBT ) %]
167
                [% IF ( DEBT ) %]
159
                    <li class="needsconfirm debt">The patron has a debt of [% DEBT | $Price %].</li>
168
                    <li class="needsconfirm debt">The patron has a debt of [% DEBT | $Price %].</li>
160
                [% END %]
169
                [% END %]
Lines 652-657 Link Here
652
                    <li>Age restriction [% AGE_RESTRICTION | html %].</li>
661
                    <li>Age restriction [% AGE_RESTRICTION | html %].</li>
653
                [% END %]
662
                [% END %]
654
663
664
                [%IF ( QUOTA_EXCEEDED ) %]
665
                    <li>Quota Exceeded [% QUOTA_EXCEEDED | html %].</li>
666
                [% END %]
667
655
                [% IF ( EXPIRED ) %]
668
                [% IF ( EXPIRED ) %]
656
                    <li>Patron's card is expired</li>
669
                    <li>Patron's card is expired</li>
657
                [% END %]
670
                [% END %]
658
- 

Return to bug 38924