Bug 25123: Count the current fine when reducing for maxFine

If maxFine is set, we total the patrons outstanding fines when making an adjustment, however, we neglect to count the amount of a currently updating fine when doing so.

To test:
1 - Set maxFine to 5
2 - Create an overdue amount of 4.99 for a patron
3 - Set an itemtype to have a fine of $.10 per day
4 - Checkout an item of that type to a patron and backdate the due date so it is overdue
5 - Run fines.pl with -v
6 - Note the fine is reduced from $.10 (or a multiple) to .01
7 - Run it again, a second cent is added
8 - Repeat and note it keeps happening until the amount of the fine is reached, exceeding the maxFine setting
9 - Apply patch
10 - Note the fine is now reduced to 0 and nothing is added to account

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2020-04-13 11:38:28 +00:00 committed by Martin Renvoize
parent 49c15f06ac
commit 8d306ff2ff
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 0 additions and 1 deletions

View File

@ -552,7 +552,6 @@ sub UpdateFine {
}
else {
$accountline = $overdue;
next;
}
}
$total_amount_other += $overdue->amountoutstanding;