diff --git a/C4/Circulation.pm b/C4/Circulation.pm index f0879242f3..062b165691 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1946,11 +1946,15 @@ sub AddReturn { } # there's no overdue on the item but borrower had been previously debarred } elsif ( $issue->{date_due} and $borrower->{'debarred'} ) { - my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); - $borrower_debar_dt->truncate(to => 'day'); - my $today_dt = $today->clone()->truncate(to => 'day'); - if ( DateTime->compare( $borrower_debar_dt, $today_dt ) != -1 ) { - $messages->{'PrevDebarred'} = $borrower->{'debarred'}; + if ( $borrower->{debarred} eq "9999-12-31") { + $messages->{'ForeverDebarred'} = $borrower->{'debarred'}; + } else { + my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); + $borrower_debar_dt->truncate(to => 'day'); + my $today_dt = $today->clone()->truncate(to => 'day'); + if ( DateTime->compare( $borrower_debar_dt, $today_dt ) != -1 ) { + $messages->{'PrevDebarred'} = $borrower->{'debarred'}; + } } } } diff --git a/circ/returns.pl b/circ/returns.pl index eeb0fe34a2..14997a13eb 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -506,6 +506,9 @@ foreach my $code ( keys %$messages ) { elsif ( $code eq 'PrevDebarred' ) { $err{prevdebarred} = $messages->{'PrevDebarred'}; } + elsif ( $code eq 'ForeverDebarred' ) { + $err{foreverdebarred} = $messages->{'ForeverDebarred'}; + } elsif ( $code eq 'NotForLoanStatusUpdated' ) { $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated}; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 0872043844..b938724bcd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -440,7 +440,7 @@ $(document).ready(function() { [% END %] [% IF ( USERBLOCKEDNOENDDATE ) %] -
Reminder: Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %]
[% END %] + [% IF ( errmsgloo.foreverdebarred ) %] +Reminder: Patron has an indefinite restriction
+ [% END %] + [% END %] [% IF ( soundon ) %]