diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 8de911f5f1..2a4b16e1d3 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -52,7 +52,7 @@ class General extends Twig_Extension $this->getCurrencySymbol(), $this->phpdate(), $this->env(), - + $this->getAmountFromJournal(), $this->activeRouteStrict(), $this->activeRoutePartial(), $this->activeRoutePartialWhat(), @@ -306,4 +306,16 @@ class General extends Twig_Extension ); } + /** + * @return Twig_SimpleFunction + */ + private function getAmountFromJournal() + { + return new Twig_SimpleFunction( + 'getAmount', function (TransactionJournal $journal) : string { + return TransactionJournal::amount($journal); + } + ); + } + } diff --git a/resources/views/popup/list/journals.twig b/resources/views/popup/list/journals.twig index 64d425c32a..f4bf459842 100644 --- a/resources/views/popup/list/journals.twig +++ b/resources/views/popup/list/journals.twig @@ -9,7 +9,7 @@ {{ trans('list.from') }} {% endif %} {% if not hideDestination %} - {{ trans('list.to') }} + {{ trans('list.to') }} {% endif %} {% if not hideBudget %} @@ -23,7 +23,14 @@ + {% for journal in journals %} + {{ journal|typeIcon }} @@ -38,22 +45,22 @@ {{ journal.date.formatLocalized(monthAndDayFormat) }} {% if not hideSource %} - - {% if journal.source_account_type == 'Cash account' %} - (cash) - {% else %} - {{ journal.source_account_name }} - {% endif %} - + + {% if journal.source_account_type == 'Cash account' %} + (cash) + {% else %} + {{ journal.source_account_name }} + {% endif %} + {% endif %} {% if not hideDestination %} - - {% if journal.destination_account_type == 'Cash account' %} - (cash) - {% else %} - {{ journal.destination_account_name }} - {% endif %} - + + {% if journal.destination_account_type == 'Cash account' %} + (cash) + {% else %} + {{ journal.destination_account_name }} + {% endif %} + {% endif %} @@ -76,6 +83,12 @@ {% endfor %} + + + {{ 'sum'|_ }}: + {{ sum|formatAmount }} + + {{ journals.render|raw }}