From 5e00c3990fd50c3d99878ce4461dbdd099c9b9b8 Mon Sep 17 00:00:00 2001 From: genevieve Date: Thu, 3 Sep 2015 16:40:00 -0400 Subject: [PATCH] CAM 2267 - Bug 14784 : Fix checkin message for debarred patrons If there is an overdue but finedays equals 0, then we have to see if the patron is debarred and if he was forever debarred. So we have to go through the same code a if it was a debarred patron with no overdue. --- C4/Circulation.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 9fc2987..6f095ef 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1950,6 +1950,7 @@ sub AddReturn { } } + my $show_checkin_message = 0; # fix up the overdues in accounts... if ($borrowernumber) { my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox); @@ -1964,8 +1965,15 @@ sub AddReturn { } else { $messages->{'Debarred'} = $debardate if $debardate; } + if (!$debardate && $borrower->{debarred}) { + $show_checkin_message = 1; + } # there's no overdue on the item but borrower had been previously debarred } elsif ( $issue->{date_due} and $borrower->{'debarred'} ) { + $show_checkin_message = 1; + } + + if ($show_checkin_message) { if ( $borrower->{debarred} eq "9999-12-31") { $messages->{'ForeverDebarred'} = $borrower->{'debarred'}; } else { @@ -1975,7 +1983,7 @@ sub AddReturn { if ( DateTime->compare( $borrower_debar_dt, $today_dt ) != -1 ) { $messages->{'PrevDebarred'} = $borrower->{'debarred'}; } - } + } } } -- 1.7.9.5