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