From 44f4267cfc1097b5048cd2e49da73d4cbe7c69ed Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 8 May 2020 12:28:46 +0200 Subject: [PATCH] Bug 25417: Prevent negative debit amount on backdating returns Koha::Account->add_credit is expecting a positive amount. Signed-off-by: Kyle M Hall Signed-off-by: Didier Gautheron Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson --- C4/Circulation.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 099c92a9e6..cbb2b11e80 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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( { -- 2.39.5