From cc7c6e02c5e4159f944ce4a88226c23bed973b42 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 28 Sep 2024 17:43:18 +0200 Subject: [PATCH] Fix https://github.com/firefly-iii/firefly-iii/issues/9275 --- app/Support/Twig/General.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index e7bebdcd19..df88291480 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -74,7 +74,16 @@ class General extends AbstractExtension $strings = []; foreach ($info as $currencyId => $balance) { - $strings[] = app('amount')->formatByCurrencyId($currencyId, $balance, false); + if(0 === $currencyId) { + // not good code but OK + /** @var AccountRepositoryInterface $accountRepos */ + $accountRepos = app(AccountRepositoryInterface::class); + $currency = $accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency(); + $strings[] = app('amount')->formatAnything($currency, $balance, false); + } + if(0 !== $currencyId) { + $strings[] = app('amount')->formatByCurrencyId($currencyId, $balance, false); + } } return implode(', ', $strings);