mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 10:53:37 +00:00
Fixed a bug that would leave all amounts at zero. #224
This commit is contained in:
@@ -70,11 +70,8 @@ class Amount
|
|||||||
*/
|
*/
|
||||||
public function formatJournal(TransactionJournal $journal, bool $coloured = true): string
|
public function formatJournal(TransactionJournal $journal, bool $coloured = true): string
|
||||||
{
|
{
|
||||||
$locale = setlocale(LC_MONETARY, 0);
|
$locale = setlocale(LC_MONETARY, 0);
|
||||||
$float = round($journal->destination_amount, 2);
|
$float = round(TransactionJournal::amount($journal), 2);
|
||||||
if ($journal->isWithdrawal()) {
|
|
||||||
$float = round($journal->source_amount, 2);
|
|
||||||
}
|
|
||||||
$formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);
|
$formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);
|
||||||
$currencyCode = $journal->transaction_currency_code ?? $journal->transactionCurrency->code;
|
$currencyCode = $journal->transaction_currency_code ?? $journal->transactionCurrency->code;
|
||||||
$result = $formatter->formatCurrency($float, $currencyCode);
|
$result = $formatter->formatCurrency($float, $currencyCode);
|
||||||
|
@@ -1,24 +1,17 @@
|
|||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
{% for journal in transactions %}
|
{% for journal in transactions %}
|
||||||
|
|
||||||
<a class="list-group-item" title="{{ journal.date.formatLocalized(trans('config.month_and_day')) }}"
|
<a class="list-group-item" title="{{ journal.date.formatLocalized(trans('config.month_and_day')) }}"
|
||||||
|
|
||||||
{% if journal.isOpeningBalance() %}
|
{% if journal.isOpeningBalance() %}
|
||||||
href="#"
|
href="#"
|
||||||
{% else %}
|
{% else %}
|
||||||
href="{{ route('transactions.show',journal.id) }}"
|
href="{{ route('transactions.show',journal.id) }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
>
|
>
|
||||||
|
{{ journal|typeIcon }}
|
||||||
{{ journal|typeIcon }}
|
{{ journal.description }}
|
||||||
|
<span class="pull-right small">
|
||||||
{{ journal.description }}
|
{{ journal|formatJournal }}
|
||||||
|
</span>
|
||||||
<span class="pull-right small">
|
|
||||||
{{ journal|formatJournal }}
|
|
||||||
|
|
||||||
</span>
|
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user