Bug 3341: Fines calculation erroneous when a repeatable holiday is added

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Frédérick Capovilla 2011-03-06 08:15:04 +13:00 committed by Chris Cormack
parent 7c97e0bfe7
commit dbe3780fc0
1 changed files with 2 additions and 2 deletions

View File

@ -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