From 05987eb8a6111b40c2c29962f4220d4adab8c51a Mon Sep 17 00:00:00 2001
From: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Date: Wed, 1 Mar 2023 15:29:04 +0000
Subject: [PATCH] Bug 21043: (follow-up) Return Koha::Account::Debit

This patch updates Koha::Account->add_debit from returning a
Koha::Account::Line object to returning a Koha::Account::Debit object.

This shouldn't make any difference for internal code at the moment, as
we're using Koha::Account::Line as the base class for ::Credit and
::Debit classes.. but we do overload the to_api_mapping and this is
causing some tests to fail.

We still need a little work here.
---
 Koha/Account.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Koha/Account.pm b/Koha/Account.pm
index c1ee298426..3333088e84 100644
--- a/Koha/Account.pm
+++ b/Koha/Account.pm
@@ -479,7 +479,7 @@ sub add_debit {
             sub {
 
                 # Insert the account line
-                $line = Koha::Account::Line->new(
+                $line = Koha::Account::Debit->new(
                     {
                         borrowernumber    => $self->{patron_id},
                         date              => \'NOW()',
-- 
2.39.2