From 9003db6eba7483575be97e53d1d8441b72e1618e Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 23 Mar 2021 18:38:24 +0100 Subject: [PATCH] Fix #4529 --- .../Upgrade/TransferCurrenciesCorrections.php | 2 ++ .../Internal/Update/JournalUpdateService.php | 29 ++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php b/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php index b23de4ae19..7cc9cf287b 100644 --- a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php +++ b/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php @@ -70,6 +70,8 @@ class TransferCurrenciesCorrections extends Command */ public function handle(): int { + + $this->stupidLaravel(); $start = microtime(true); // @codeCoverageIgnoreStart diff --git a/app/Services/Internal/Update/JournalUpdateService.php b/app/Services/Internal/Update/JournalUpdateService.php index 5394209ba8..7184b7622d 100644 --- a/app/Services/Internal/Update/JournalUpdateService.php +++ b/app/Services/Internal/Update/JournalUpdateService.php @@ -63,23 +63,30 @@ class JournalUpdateService private array $metaString; private ?Account $sourceAccount; private ?Transaction $sourceTransaction; - private TransactionGroup $transactionGroup; - private TransactionJournal $transactionJournal; + private ?TransactionGroup $transactionGroup; + private ?TransactionJournal $transactionJournal; /** * JournalUpdateService constructor. */ public function __construct() { - $this->billRepository = app(BillRepositoryInterface::class); - $this->categoryRepository = app(CategoryRepositoryInterface::class); - $this->budgetRepository = app(BudgetRepositoryInterface::class); - $this->tagFactory = app(TagFactory::class); - $this->accountRepository = app(AccountRepositoryInterface::class); - $this->currencyRepository = app(CurrencyRepositoryInterface::class); - $this->metaString = ['sepa_cc', 'sepa_ct_op', 'sepa_ct_id', 'sepa_db', 'sepa_country', 'sepa_ep', 'sepa_ci', 'sepa_batch_id', 'recurrence_id', - 'internal_reference', 'bunq_payment_id', 'external_id', 'external_uri']; - $this->metaDate = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date',]; + $this->destinationAccount = null; + $this->destinationTransaction = null; + $this->sourceAccount = null; + $this->sourceTransaction = null; + $this->transactionGroup = null; + $this->transactionJournal = null; + $this->billRepository = app(BillRepositoryInterface::class); + $this->categoryRepository = app(CategoryRepositoryInterface::class); + $this->budgetRepository = app(BudgetRepositoryInterface::class); + $this->tagFactory = app(TagFactory::class); + $this->accountRepository = app(AccountRepositoryInterface::class); + $this->currencyRepository = app(CurrencyRepositoryInterface::class); + $this->metaString = ['sepa_cc', 'sepa_ct_op', 'sepa_ct_id', 'sepa_db', 'sepa_country', 'sepa_ep', 'sepa_ci', 'sepa_batch_id', + 'recurrence_id', + 'internal_reference', 'bunq_payment_id', 'external_id', 'external_uri']; + $this->metaDate = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date',]; } /**