From 5fbc4c394d5ee57a72c84c1072184a7014a4aacc Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 10 Oct 2019 17:12:52 +0100 Subject: [PATCH] Bug 23049: (follow-up) Fix manual debits via add_debit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Séverine QUEUNE --- Koha/Account.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/Account.pm b/Koha/Account.pm index 794d684787..b9ec68a40c 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -488,6 +488,8 @@ sub add_debit { my $schema = Koha::Database->new->schema; + my $offset_type = $Koha::Account::offset_type->{$debit_type} // 'Manual Debit'; + my $line; $schema->txn_do( sub { @@ -516,7 +518,7 @@ sub add_debit { my $account_offset = Koha::Account::Offset->new( { debit_id => $line->id, - type => $Koha::Account::offset_type->{$debit_type}, + type => $offset_type, amount => $amount } )->store(); -- 2.20.1