Skip to content

Firefly III: a personal finances manager

Fix https://github.com/firefly-iii/firefly-iii/issues/9275

James Colecc7c6e02c5e4
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);