firefly-iii/resources/views/reports/partials/category-period.twig

47 lines
1.6 KiB
Twig
Raw Normal View History

2016-12-03 14:12:02 -06:00
<table class="table table-hover sortable table-condensed">
2016-12-03 13:38:13 -06:00
<thead>
<tr>
2016-12-12 01:14:38 -06:00
<th data-defaultsign="az" colspan="2">{{ 'category'|_ }}</th>
2016-12-03 13:38:13 -06:00
{% for period in periods %}
2016-12-12 01:14:38 -06:00
<th data-defaultsign="_19">{{ period }}</th>
2016-12-03 13:38:13 -06:00
{% endfor %}
2016-12-12 01:14:38 -06:00
<th data-defaultsign="_19">{{ 'sum'|_ }}</th>
2016-12-03 13:38:13 -06:00
</tr>
</thead>
<tbody>
{% for id, info in report %}
<tr>
2016-12-07 14:38:35 -06:00
<td>
<a class="btn btn-default btn-xs" href="{{ route('categories.show', [id]) }}"><i class="fa fa-external-link" aria-hidden="true"></i></a>
</td>
<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 }}
2016-12-03 14:03:20 -06:00
</td>
{% else %}
<td data-value="0">
2016-12-03 14:12:02 -06:00
{{ 0|formatAmount }}
2016-12-03 14:03:20 -06:00
</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>
2016-12-03 13:38:13 -06:00
{% endfor %}
</tbody>
2016-12-12 01:14:38 -06:00
</table>