From dbe3780fc0e54e637fcbac96bb758781f722ddc4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= Date: Sun, 6 Mar 2011 08:15:04 +1300 Subject: [PATCH] Bug 3341: Fines calculation erroneous when a repeatable holiday is added Signed-off-by: Marcel de Rooy Signed-off-by: Chris Cormack --- C4/Overdues.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index adba9793b7..b5e3cdf4dd 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 -- 2.39.2