From e2d7630ed1d92aed19fe9e0c794e5e62b6950593 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= Date: Thu, 17 Feb 2011 13:22:07 +0100 Subject: [PATCH] [SIGNED-OFF] 3341: Fines calculation erroneous when a repeatable holiday is added Content-Type: text/plain; charset="utf-8" Signed-off-by: Marcel de Rooy --- C4/Overdues.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index adba979..b5e3cdf 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -488,12 +488,12 @@ sub UpdateFine { if ( my $data = $sth->fetchrow_hashref ) { - # we're updating an existing fine. Only modify if we're adding to the charge. + # we're updating an existing fine. Only modify if amount changed # Note that in the current implementation, you cannot pay against an accruing fine # (i.e. , of accounttype 'FU'). Doing so will break accrual. if ( $data->{'amount'} != $amount ) { my $diff = $amount - $data->{'amount'}; - $diff = 0 if ( $data->{amount} > $amount); + #3341: diff could be positive or negative! my $out = $data->{'amountoutstanding'} + $diff; my $query = " UPDATE accountlines -- 1.6.0.6