Bug 25417: Prevent negative debit amount on backdating returns

Koha::Account->add_credit is expecting a positive amount.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-05-08 12:28:46 +02:00 committed by Martin Renvoize
parent 2c9a322486
commit 53349e8000
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 0 deletions

View File

@ -2433,6 +2433,8 @@ sub _FixOverduesOnReturn {
if ($exemptfine) {
my $amountoutstanding = $accountline->amountoutstanding;
return if $amountoutstanding <= 0;
my $account = Koha::Account->new({patron_id => $borrowernumber});
my $credit = $account->add_credit(
{