From 60196383885a311a62409b6a7ac9e664f3e5d696 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 7 Jan 2020 17:18:56 +0100 Subject: [PATCH] Fix old todo item --- .../Commands/Upgrade/OtherCurrenciesCorrections.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php index c16c3e85d0..8c4fa54d40 100644 --- a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php +++ b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php @@ -125,19 +125,17 @@ class OtherCurrenciesCorrections extends Command if (isset($this->accountCurrencies[$accountId]) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) { return $this->accountCurrencies[$accountId]; // @codeCoverageIgnore } - // TODO we can use getAccountCurrency() instead - $currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id'); - $result = $this->currencyRepos->findNull($currencyId); - if (null === $result) { + $currency = $this->accountRepos->getAccountCurrency($account); + if (null === $currency) { // @codeCoverageIgnoreStart $this->accountCurrencies[$accountId] = 0; return null; // @codeCoverageIgnoreEnd } - $this->accountCurrencies[$accountId] = $result; + $this->accountCurrencies[$accountId] = $currency; - return $result; + return $currency; }