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

(-)a/C4/Circulation.pm (-1 / +34 lines)
Lines 65-71 use Koha::Exceptions::Checkout; Link Here
65
use Koha::Plugins;
65
use Koha::Plugins;
66
use Koha::Recalls;
66
use Koha::Recalls;
67
use Koha::Library::Hours;
67
use Koha::Library::Hours;
68
use Carp            qw( carp );
68
use Koha::Patron::Quotas;
69
use Koha::Patron::Quota;
70
use Koha::Patron::Quota::Usage;
71
72
use Carp qw( carp );
69
use List::MoreUtils qw( any );
73
use List::MoreUtils qw( any );
70
use Scalar::Util    qw( looks_like_number blessed );
74
use Scalar::Util    qw( looks_like_number blessed );
71
use Date::Calc      qw( Date_to_Days );
75
use Date::Calc      qw( Date_to_Days );
Lines 1365-1370 sub CanBookBeIssued { Link Here
1365
        }
1369
        }
1366
    }
1370
    }
1367
1371
1372
    # CHECK FOR QUOTAS
1373
    if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) {
1374
        unless ( $quota->has_available_quota ) {
1375
            if ( C4::Context->preference("AllowQuotaOverride") ) {
1376
                $needsconfirmation{QUOTA_EXCEEDED} = {
1377
                    available => $quota->available_quota,
1378
                    total => $quota->allocation,
1379
                    used => $quota->used,
1380
                };
1381
            }
1382
            else {
1383
                $issuingimpossible{QUOTA_EXCEEDED} = {
1384
                    available => $quota->available_quota,
1385
                    total => $quota->allocation,
1386
                    used => $quota->used,
1387
                };
1388
            }
1389
        }
1390
    }
1391
1368
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, );
1392
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, );
1369
}
1393
}
1370
1394
Lines 1953-1958 sub AddIssue { Link Here
1953
            Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue(
1977
            Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue(
1954
                { biblio_ids => [ $item_object->biblionumber ] } )
1978
                { biblio_ids => [ $item_object->biblionumber ] } )
1955
                if C4::Context->preference('RealTimeHoldsQueue');
1979
                if C4::Context->preference('RealTimeHoldsQueue');
1980
1981
            # Check quotas and record usage if needed
1982
            if ( my $quota = Koha::Patron::Quotas->get_patron_quota($patron->borrowernumber) ) {
1983
                # Update patron's used quota value
1984
                $quota->add_usage({
1985
                    patron_id => $patron->patron_id,
1986
                    issue_id => $issue->issue_id,
1987
                });
1988
            }
1956
        }
1989
        }
1957
    }
1990
    }
1958
    return $issue;
1991
    return $issue;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +13 lines)
Lines 156-161 Link Here
156
                    </li>
156
                    </li>
157
                [% END %]
157
                [% END %]
158
158
159
                [%IF ( QUOTA_EXCEEDED ) %]
160
                    <li class="needsconfirm age_restriction">
161
                        Quota Exceeded [% QUOTA_EXCEEDED | html %].
162
                        [% IF CAN_user_circulate_force_checkout %]
163
                            Check out anyway?
164
                        [% END %]
165
                    </li>
166
                [% END %]
167
159
                [% IF ( DEBT ) %]
168
                [% IF ( DEBT ) %]
160
                    <li class="needsconfirm debt">The patron has a debt of [% DEBT | $Price %].</li>
169
                    <li class="needsconfirm debt">The patron has a debt of [% DEBT | $Price %].</li>
161
                [% END %]
170
                [% END %]
Lines 653-658 Link Here
653
                    <li>Age restriction [% AGE_RESTRICTION | html %].</li>
662
                    <li>Age restriction [% AGE_RESTRICTION | html %].</li>
654
                [% END %]
663
                [% END %]
655
664
665
                [%IF ( QUOTA_EXCEEDED ) %]
666
                    <li>Quota Exceeded [% QUOTA_EXCEEDED | html %].</li>
667
                [% END %]
668
656
                [% IF ( EXPIRED ) %]
669
                [% IF ( EXPIRED ) %]
657
                    <li>Patron's card is expired</li>
670
                    <li>Patron's card is expired</li>
658
                [% END %]
671
                [% END %]
659
- 

Return to bug 38924