From 3175067e2343b282b7df29b0e7b2fdd20c8fd806 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Apr 2020 12:44:47 +0200 Subject: [PATCH] Bug 24380: (QA follow-up) Simplify condition Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- C4/Circulation.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 527b878858..faaa2692e8 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1973,11 +1973,14 @@ sub AddReturn { MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy ); }; unless ( $@ ) { - my $calc_fine = C4::Context->preference('CalculateFinesOnReturn'); - $calc_fine ||= $return_date_specified && C4::Context->preference('CalculateFinesOnBackdate'); - $calc_fine &&= !$item->itemlost; - - if ( $calc_fine ) { + if ( + ( + C4::Context->preference('CalculateFinesOnReturn') + || ( $return_date_specified && C4::Context->preference('CalculateFinesOnBackdate') ) + ) + && !$item->itemlost + ) + { _CalculateAndUpdateFine( { issue => $issue, item => $item->unblessed, borrower => $patron_unblessed, return_date => $return_date } ); } } else { -- 2.39.5