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

(-)a/C4/Circulation.pm (-1 / +4 lines)
Lines 2788-2794 sub CanBookBeRenewed { Link Here
2788
2788
2789
        if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
2789
        if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
2790
            my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals");
2790
            my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals");
2791
            my $amountoutstanding = $patron->account->balance;
2791
            my $amountoutstanding =
2792
              C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
2793
              ? $patron->account->balance
2794
              : $patron->account->outstanding_debits->total_outstanding;
2792
            if ( $amountoutstanding and $amountoutstanding > $fine_no_renewals ) {
2795
            if ( $amountoutstanding and $amountoutstanding > $fine_no_renewals ) {
2793
                return ( 0, "auto_too_much_oweing" );
2796
                return ( 0, "auto_too_much_oweing" );
2794
            }
2797
            }
(-)a/opac/opac-user.pl (-3 / +6 lines)
Lines 124-139 if ( $userdebarred || $borr->{'gonenoaddress'} || $borr->{'lost'} ) { Link Here
124
my $amountoutstanding = $patron->account->balance;
124
my $amountoutstanding = $patron->account->balance;
125
my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' );
125
my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' );
126
$no_renewal_amt = undef unless looks_like_number( $no_renewal_amt );
126
$no_renewal_amt = undef unless looks_like_number( $no_renewal_amt );
127
my $amountoutstandingfornewal =
128
  C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
129
  ? $amountoutstanding
130
  : $patron->account->outstanding_debits->total_outstanding;
127
131
128
if (   C4::Context->preference('OpacRenewalAllowed')
132
if (   C4::Context->preference('OpacRenewalAllowed')
129
    && defined($no_renewal_amt)
133
    && defined($no_renewal_amt)
130
    && $amountoutstanding > $no_renewal_amt )
134
    && $amountoutstandingfornewal > $no_renewal_amt )
131
{
135
{
132
    $borr->{'flagged'} = 1;
136
    $borr->{'flagged'} = 1;
133
    $canrenew = 0;
137
    $canrenew = 0;
134
    $template->param(
138
    $template->param(
135
        renewal_blocked_fines => $no_renewal_amt,
139
        renewal_blocked_fines => $no_renewal_amt,
136
        renewal_blocked_fines_amountoutstanding => $amountoutstanding,
140
        renewal_blocked_fines_amountoutstanding => $amountoutstandingfornewal,
137
    );
141
    );
138
}
142
}
139
143
140
- 

Return to bug 23293