From 0d6f42ba5f101c67ecc0c998743766da84826ec4 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 28 Feb 2025 20:38:29 +0000 Subject: [PATCH] Bug 39219: Do not apply amountoutstanding when credit type is REFUND --- Koha/Account/Line.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index 851ebec7551..9f4b503d276 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -638,9 +638,10 @@ sub apply { )->store(); $available_credit -= $amount_to_cancel; - - $self->amountoutstanding( $available_credit * -1 )->store; - $debit->amountoutstanding( $owed - $amount_to_cancel )->store; + if ( $self->credit_type_code ne 'REFUND' ) { + $self->amountoutstanding( $available_credit * -1 )->store; + $debit->amountoutstanding( $owed - $amount_to_cancel )->store; + } # Attempt to renew the item associated with this debit if # appropriate -- 2.39.5