|
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 |
- |
|
|