mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 20:38:57 +00:00
Some code to get #384 working.
This commit is contained in:
36
resources/views/reports/partials/exp-categories.twig
Normal file
36
resources/views/reports/partials/exp-categories.twig
Normal file
@@ -0,0 +1,36 @@
|
||||
<table class="table table-hover sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-defaultsign="az">{{ 'category'|_ }}</th>
|
||||
<th style="text-align: right;">{{ 'spent'|_ }}</th>
|
||||
<th style="text-align: right;">{{ 'earned'|_ }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for categoryId, entry in together %}
|
||||
<tr>
|
||||
<td data-value="{% if entry.category.name|length ==0 %}{{ 'noCategory'|_ }}{% else %}{{ entry.category.name }}{% endif %}">
|
||||
<a href="{{ route('categories.show', categoryId) }}">{% if entry.category.name|length ==0 %}{{ 'noCategory'|_ }}{% else %}{{ entry.category.name }}{% endif %}</a>
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
{% if entry.spent|length ==0 %}
|
||||
{{ '0'|formatAmount }}
|
||||
{% else %}
|
||||
{% for expense in entry.spent %}
|
||||
{{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br />
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="width:20px;">
|
||||
{% if entry.earned|length ==0 %}
|
||||
{{ '0'|formatAmount }}
|
||||
{% else %}
|
||||
{% for income in entry.earned %}
|
||||
{{ formatAmountBySymbol(income.sum, income.currency.symbol, income.currency.dp) }}<br />
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
37
resources/views/reports/partials/exp-grouped.twig
Normal file
37
resources/views/reports/partials/exp-grouped.twig
Normal file
@@ -0,0 +1,37 @@
|
||||
<table class="table table-hover sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-defaultsign="az">{{ 'name'|_ }}</th>
|
||||
<th data-defaultsign="az">{{ 'period'|_ }}</th>
|
||||
<th class="hidden-xs" style="text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
|
||||
<th class="hidden-xs" style="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>
|
||||
33
resources/views/reports/partials/exp-not-grouped.twig
Normal file
33
resources/views/reports/partials/exp-not-grouped.twig
Normal file
@@ -0,0 +1,33 @@
|
||||
<table class="table table-hover sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-defaultsign="az">{{ 'name'|_ }}</th>
|
||||
<th class="hidden-xs" style="text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
|
||||
<th class="hidden-xs" style="text-align: right;" data-defaultsort="disabled">{{ 'earned'|_ }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for name, amounts in result %}
|
||||
<tr>
|
||||
<td>{{ name }}</td>
|
||||
<td style="text-align: right;" >
|
||||
{% if amounts.spent|length == 0%}
|
||||
{{ '0'|formatAmount }}
|
||||
{% endif %}
|
||||
{% for expense in amounts.spent %}
|
||||
{{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br />
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td style="text-align: right;" >
|
||||
{% if amounts.earned|length == 0 %}
|
||||
{{ '0'|formatAmount }}
|
||||
{% endif %}
|
||||
{% for income in amounts.earned %}
|
||||
{{ formatAmountBySymbol(income.sum, income.currency.symbol, income.currency.dp) }}<br />
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user