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>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2020-05-08 12:28:46 +02:00 committed by Joy Nelson
parent f0ecc011f0
commit 44f4267cfc
1 changed files with 2 additions and 0 deletions

View File

@ -2397,6 +2397,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(
{