firefly-iii/resources/views/reports/partials/category-period.twig
2016-12-04 18:02:19 +01:00

44 lines
1.4 KiB
Twig

<table class="table table-hover sortable table-condensed">
<thead>
<tr>
<th data-defaultsort="disabled">{{ 'category'|_ }}</th>
{% for period in periods %}
<th data-defaultsort="disabled">{{ period }}</th>
{% endfor %}
<th data-defaultsort="disabled">{{ 'sum'|_ }}</th>
</tr>
</thead>
<tbody>
{% for id, info in report %}
<tr>
<td data-value="{{ info.name }}">
<a title="{{ info.name }}" href="#" data-category="{{ id }}" class="category-chart-activate">{{ info.name }}</a>
</td>
{% for key, period in periods %}
{# income first #}
{% if(info.entries[key]) %}
<td data-value="{{ info.entries[key] }}">
{{ info.entries[key]|formatAmount }}
</td>
{% else %}
<td data-value="0">
{{ 0|formatAmount }}
</td>
{% endif %}
{% endfor %}
{# if sum of income, display: #}
{% if info.sum %}
<td data-value="{{ info.sum }}">
{{ info.sum|formatAmount }}
</td>
{% else %}
<td data-value="0">
{{ 0|formatAmount }}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>