Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fixed a bug that would leave all amounts at zero. #224
James Cole6698b57f5209
diff --git a/app/Support/Amount.php b/app/Support/Amount.phpindex c5ac2b7f28..2b2807f8d6 100644--- a/app/Support/Amount.php+++ b/app/Support/Amount.php@@ -70,11 +70,8 @@ class Amount*/public function formatJournal(TransactionJournal $journal, bool $coloured = true): string{- $locale = setlocale(LC_MONETARY, 0);- $float = round($journal->destination_amount, 2);- if ($journal->isWithdrawal()) {- $float = round($journal->source_amount, 2);- }+ $locale = setlocale(LC_MONETARY, 0);+ $float = round(TransactionJournal::amount($journal), 2);$formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);$currencyCode = $journal->transaction_currency_code ?? $journal->transactionCurrency->code;$result = $formatter->formatCurrency($float, $currencyCode);diff --git a/resources/views/list/journals-tiny.twig b/resources/views/list/journals-tiny.twigindex 5dd61db3e8..b788fac644 100644--- a/resources/views/list/journals-tiny.twig+++ b/resources/views/list/journals-tiny.twig@@ -1,24 +1,17 @@<div class="list-group">{% for journal in transactions %}-<a class="list-group-item" title="{{ journal.date.formatLocalized(trans('config.month_and_day')) }}"-{% if journal.isOpeningBalance() %}href="#"{% else %}href="{{ route('transactions.show',journal.id) }}"{% endif %}>-- {{ journal|typeIcon }}-- {{ journal.description }}-- <span class="pull-right small">- {{ journal|formatJournal }}-- </span>-+ {{ journal|typeIcon }}+ {{ journal.description }}+ <span class="pull-right small">+ {{ journal|formatJournal }}+ </span></a>{% endfor %}</div>