From 4f881ba4846d29816cf7b5380a1ab3c0d27ca25d Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 15 May 2013 16:06:49 +0200 Subject: [PATCH] Bug 10030: QA Followup for trivial false warning detected while testing Moving the warn line below the line that returns if amount<=0. If amount<=0, a false warn is now raised because of the return after it. We should only warn here if we do not return. Signed-off-by: Marcel de Rooy Tested with fines.pl on overdue. Before this patch: Reducing fine for item 199709 borrower 23 from 44 to -1 - MaxFine reached. This did not happen however because of the return. After this change: no false warning. Signed-off-by: Jared Camins-Esakov (cherry picked from commit 656aba3e1ff1a2eb69baf9bbab38cf4b37b38afe) Signed-off-by: Jared Camins-Esakov --- C4/Overdues.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index c99a669c4f..9c056684f9 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -546,9 +546,8 @@ sub UpdateFine { if (my $maxfine = C4::Context->preference('MaxFine')) { if ($total_amount_other + $amount > $maxfine) { my $new_amount = $maxfine - $total_amount_other; - warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached"; return if $new_amount <= 0.00; - + warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached"; $amount = $new_amount; } } -- 2.39.5