From cb759e5c21118cf18b29cb4619d7a2a540a9c76f Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 21 Jul 2021 06:23:42 +0200 Subject: [PATCH] Fix issue in liability credits. --- app/Services/Internal/Support/JournalServiceTrait.php | 2 +- config/firefly.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index 9af842ec1c..ce621bc415 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -74,7 +74,7 @@ trait JournalServiceTrait // and now try to find it, based on the type of transaction. $message = 'Based on the fact that the transaction is a %s, the %s account should be in: %s. Direction is %s.'; - Log::debug(sprintf($message, $transactionType, $direction, implode(', ', $expectedTypes[$transactionType]), $direction)); + Log::debug(sprintf($message, $transactionType, $direction, implode(', ', $expectedTypes[$transactionType] ?? ['UNKNOWN']), $direction)); $result = $this->findAccountById($data, $expectedTypes[$transactionType]); $result = $this->findAccountByName($result, $data, $expectedTypes[$transactionType]); diff --git a/config/firefly.php b/config/firefly.php index 62ff1611fa..1d9494be0b 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -658,6 +658,7 @@ return [ TransactionTypeModel::OPENING_BALANCE => [AccountType::INITIAL_BALANCE, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE,], TransactionTypeModel::RECONCILIATION => [AccountType::RECONCILIATION, AccountType::ASSET], + TransactionTypeModel::LIABILITY_CREDIT => [AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE], // in case no transaction type is known yet, it could be anything. 'none' => [ AccountType::ASSET,