mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 05:26:17 +00:00
Clean up report code.
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
<table class="table table-hover">
|
||||
<tbody>
|
||||
{% set sum = 0 %}
|
||||
{% for expense in expenses %}
|
||||
{% set sum = sum + expense.sum %}
|
||||
{% if loop.index > listLength %}
|
||||
<tr class="overListLength">
|
||||
{% else %}
|
||||
<tr>
|
||||
{% endif %}
|
||||
<td>
|
||||
<a href="{{ route('accounts.show',expense.id) }}">{{ expense.name }}</a>
|
||||
{% if expense.count > 1 %}
|
||||
<br/>
|
||||
<small>
|
||||
{{ expense.count }} {{ 'transactions'|_|lower }}
|
||||
<i class="fa fa-fw text-muted fa-info-circle firefly-info-button" data-location="expense-entry"
|
||||
data-account-id="{{ expense.id }}"></i>
|
||||
</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ (expense.sum)|formatAmount }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
{% if expenses|length > listLength %}
|
||||
<tr>
|
||||
<td colspan="2" class="active">
|
||||
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><em>{{ 'sum'|_ }}</em></td>
|
||||
<td>{{ (sum)|formatAmount }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
55
resources/views/reports/partials/income-expenses.twig
Normal file
55
resources/views/reports/partials/income-expenses.twig
Normal file
@@ -0,0 +1,55 @@
|
||||
<table class="table table-hover sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-defaultsign="az">{{ 'name'|_ }}</th>
|
||||
<th data-defaultsign="_19">{{ 'total'|_ }}</th>
|
||||
<th data-defaultsign="_19" class="hidden-xs">{{ 'average'|_ }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set sum = 0 %}
|
||||
{% for entry in entries %}
|
||||
{% set sum = sum + entry.sum %}
|
||||
{% if loop.index > listLength %}
|
||||
<tr class="overListLength">
|
||||
{% else %}
|
||||
<tr>
|
||||
{% endif %}
|
||||
<td data-value="{{ entry.name }}">
|
||||
<a href="{{ route('accounts.show',entry.id) }}">{{ entry.name }}</a>
|
||||
{% if entry.count > 1 %}
|
||||
<br/>
|
||||
<small>
|
||||
{{ entry.count }} {{ 'transactions'|_|lower }}
|
||||
<i class="fa fa-fw text-muted fa-info-circle firefly-info-button" data-location="{{ type }}"
|
||||
data-account-id="{{ entry.id }}"></i>
|
||||
</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td data-value="{{ entry.sum }}">
|
||||
{{ (entry.sum)|formatAmount }}
|
||||
</td>
|
||||
<td class="hidden-xs" data-value="{{ entry.average }}">
|
||||
{% if entry.count > 1 %}
|
||||
{{ entry.average|formatAmount }}
|
||||
{% else %}
|
||||
—
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
{% if entries|length > listLength %}
|
||||
<tr>
|
||||
<td colspan="3" class="active">
|
||||
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><em>{{ 'sum'|_ }}</em></td>
|
||||
<td>{{ (sum)|formatAmount }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -1,41 +0,0 @@
|
||||
<table class="table table-hover">
|
||||
<tbody>
|
||||
{% set sum = 0 %}
|
||||
{% for row in income %}
|
||||
{% set sum = sum + row.sum %}
|
||||
{% if loop.index > listLength %}
|
||||
<tr class="overListLength">
|
||||
{% else %}
|
||||
<tr>
|
||||
{% endif %}
|
||||
<td>
|
||||
<a href="{{ route('accounts.show',row.id) }}" title="{{ row.name }}">{{ row.name }}</a>
|
||||
{% if row.count > 1 %}
|
||||
<br/>
|
||||
<small>
|
||||
{{ row.count }} {{ 'transactions'|_|lower }}
|
||||
<i class="fa fa-fw text-muted fa-info-circle firefly-info-button" data-location="income-entry"
|
||||
data-account-id="{{ row.id }}"></i>
|
||||
</small>
|
||||
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
<td>{{ row.sum|formatAmount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
{% if income|length > listLength %}
|
||||
<tr>
|
||||
<td colspan="2" class="active">
|
||||
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{ number:listLength } ) }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><em>{{ 'sum'|_ }}</em></td>
|
||||
<td>{{ sum|formatAmount }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
Reference in New Issue
Block a user