James Cole 2024-09-28 17:43:18 +02:00
parent b45aa85853
commit cc7c6e02c5
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -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);