Files
firefly-iii/resources/views/reports/partials/exp-grouped.twig
2017-12-10 20:03:10 +01:00

38 lines
1.5 KiB
Twig

<table class="table table-hover sortable">
<thead>
<tr>
<th style="width:40%;" data-defaultsign="az">{{ 'name'|_ }}</th>
<th style="width:20%;" data-defaultsign="az">{{ 'period'|_ }}</th>
<th class="hidden-xs" style="width:20%;text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
<th class="hidden-xs" style="width:20%;text-align: right;" data-defaultsort="disabled">{{ 'earned'|_ }}</th>
</tr>
</thead>
<tbody>
{% for name, periods in result %}
{% for periodIndex, period in periods %}
<tr>
<td>{{ name }}</td>
<td data-value="{{ periodIndex }}">{{ period.period }}</td>
<td style="text-align: right;" >
{% if period.spent|length == 0%}
{{ '0'|formatAmount }}
{% endif %}
{% for expense in period.spent %}
{{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br />
{% endfor %}
</td>
<td style="text-align: right;" >
{% if period.earned|length == 0 %}
{{ '0'|formatAmount }}
{% endif %}
{% for income in period.earned %}
{{ formatAmountBySymbol(income.sum, income.currency.symbol, income.currency.dp) }}<br />
{% endfor %}
</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>