mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 01:42:19 +00:00
Fix bug that occurs when the transaction journal does not have the field "transaction_currency_code"
This commit is contained in:
@@ -75,8 +75,9 @@ class Amount
|
||||
if ($journal->isWithdrawal()) {
|
||||
$float = floatval($journal->source_amount);
|
||||
}
|
||||
$formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);
|
||||
$result = $formatter->formatCurrency($float, $journal->transaction_currency_code);
|
||||
$formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);
|
||||
$currencyCode = $journal->transaction_currency_code ?? $journal->transactionCurrency->code;
|
||||
$result = $formatter->formatCurrency($float, $currencyCode);
|
||||
|
||||
if ($coloured === true && $float == 0) {
|
||||
return '<span style="color:#999">' . $result . '</span>'; // always grey.
|
||||
|
Reference in New Issue
Block a user