if ( $borr->{'debarred'} || $borr->{'gonenoaddress'} || $borr->{'lost'} ) {
$borr->{'flagged'} = 1;
}
-# $make flagged available everywhere in the template
-my $patron_flagged = $borr->{'flagged'};
+
if ( $borr->{'amountoutstanding'} > 5 ) {
$borr->{'amountoverfive'} = 1;
}
if ( 5 >= $borr->{'amountoutstanding'} && $borr->{'amountoutstanding'} > 0 ) {
$borr->{'amountoverzero'} = 1;
}
+
+if ( $borr->{'amountoutstanding'} > C4::Context->preference( 'OPACFineNoRenewals' ) ) {
+ $borr->{'flagged'} = 1;
+ $template->param(
+ renewal_blocked_fines => sprintf( "%.02f", C4::Context->preference( 'OPACFineNoRenewals' ) ),
+ );
+}
+
if ( $borr->{'amountoutstanding'} < 0 ) {
$borr->{'amountlessthanzero'} = 1;
$borr->{'amountoutstanding'} = -1 * ( $borr->{'amountoutstanding'} );
$template->param( BORROWER_INFO => \@bordat,
borrowernumber => $borrowernumber,
- patron_flagged => $patron_flagged,
+ patron_flagged => $borr->{flagged},
);
#get issued items ....
# check if item is renewable
my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
-
- $issue->{'status'} = $status || C4::Context->preference("OpacRenewalAllowed");
+ $issue->{'status'} = $status && C4::Context->preference("OpacRenewalAllowed");
+ $issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many';
+ $issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve';
if ( $issue->{'overdue'} ) {
push @overdues, $issue;
selected => $selected
};
}
-$template->param( branchloop => \@branch_loop, "mylibraryfirst"=>C4::Context->preference("SearchMyLibraryFirst"));
+$template->param( branchloop => \@branch_loop );
# now the reserved items....
my @reserves = GetReservesFromBorrowernumber( $borrowernumber );