Lines 113-122
if ( $userdebarred || $borr->{'gonenoaddress'} || $borr->{'lost'} ) {
Link Here
|
113 |
$canrenew = 0; |
113 |
$canrenew = 0; |
114 |
} |
114 |
} |
115 |
|
115 |
|
116 |
if ( $borr->{'amountoutstanding'} > 5 ) { |
116 |
my ( $amountoutstanding ) = GetMemberAccountRecords($borrowernumber); |
|
|
117 |
if ( $amountoutstanding > 5 ) { |
117 |
$borr->{'amountoverfive'} = 1; |
118 |
$borr->{'amountoverfive'} = 1; |
118 |
} |
119 |
} |
119 |
if ( 5 >= $borr->{'amountoutstanding'} && $borr->{'amountoutstanding'} > 0 ) { |
120 |
if ( 5 >= $amountoutstanding && $amountoutstanding > 0 ) { |
120 |
$borr->{'amountoverzero'} = 1; |
121 |
$borr->{'amountoverzero'} = 1; |
121 |
} |
122 |
} |
122 |
my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' ); |
123 |
my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' ); |
Lines 124-142
$no_renewal_amt = undef unless looks_like_number( $no_renewal_amt );
Link Here
|
124 |
|
125 |
|
125 |
if ( C4::Context->preference('OpacRenewalAllowed') |
126 |
if ( C4::Context->preference('OpacRenewalAllowed') |
126 |
&& defined($no_renewal_amt) |
127 |
&& defined($no_renewal_amt) |
127 |
&& $borr->{amountoutstanding} > $no_renewal_amt ) |
128 |
&& $amountoutstanding > $no_renewal_amt ) |
128 |
{ |
129 |
{ |
129 |
$borr->{'flagged'} = 1; |
130 |
$borr->{'flagged'} = 1; |
130 |
$canrenew = 0; |
131 |
$canrenew = 0; |
131 |
$template->param( |
132 |
$template->param( |
132 |
renewal_blocked_fines => $no_renewal_amt, |
133 |
renewal_blocked_fines => $no_renewal_amt, |
133 |
renewal_blocked_fines_amountoutstanding => $borr->{amountoutstanding}, |
134 |
renewal_blocked_fines_amountoutstanding => $amountoutstanding, |
134 |
); |
135 |
); |
135 |
} |
136 |
} |
136 |
|
137 |
|
137 |
if ( $borr->{'amountoutstanding'} < 0 ) { |
138 |
if ( $amountoutstanding < 0 ) { |
138 |
$borr->{'amountlessthanzero'} = 1; |
139 |
$borr->{'amountlessthanzero'} = 1; |
139 |
$borr->{'amountoutstanding'} = -1 * ( $borr->{'amountoutstanding'} ); |
140 |
$amountoutstanding = -1 * ( $amountoutstanding ); |
140 |
} |
141 |
} |
141 |
|
142 |
|
142 |
# Warningdate is the date that the warning starts appearing |
143 |
# Warningdate is the date that the warning starts appearing |
Lines 158-163
if ( $borr->{'dateexpiry'} && C4::Context->preference('NotifyBorrowerDeparture')
Link Here
|
158 |
my $renew_error = $query->param('renew_error'); |
159 |
my $renew_error = $query->param('renew_error'); |
159 |
|
160 |
|
160 |
$template->param( BORROWER_INFO => $borr, |
161 |
$template->param( BORROWER_INFO => $borr, |
|
|
162 |
amountoutstanding => $amountoutstanding, |
161 |
borrowernumber => $borrowernumber, |
163 |
borrowernumber => $borrowernumber, |
162 |
patron_flagged => $borr->{flagged}, |
164 |
patron_flagged => $borr->{flagged}, |
163 |
OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0, |
165 |
OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0, |