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

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

Return to bug 23293