From 39bb183f5387fedc01428e08d8633bf6bf666c81 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 9 May 2019 15:53:56 +0100 Subject: [PATCH] Bug 22877: Prevent double overdue processing for lost and returned Test plan: 1 - Issue an item to a patron with a backdated due date 2 - Run fines.pl - note you generate a fine for the patron 3 - Run longoverdue.pl - make sure MarkLostItemsAsReturned is turned off and to charge 4 - Confirm the patron has a lost fee and an overdue 5 - Return the item 6 - With patch applied, patron should now have 1 overdue fine and 1 lost fine Signed-off-by: Martin Renvoize Signed-off-by: Liz Rea Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize (cherry picked from commit d1b6e320860060ffe35e7df7f3df1b8c10517a73) Signed-off-by: Fridolin Somers --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index e1b0ed6348..9dd1a23774 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1960,7 +1960,7 @@ sub AddReturn { MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy ); }; unless ( $@ ) { - if ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue ) { + if ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue && !$item->itemlost ) { _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed, return_date => $return_date } ); } } else { -- 2.39.5