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

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

Return to bug 23293