Clean up report code.

This commit is contained in:
James Cole
2016-12-27 15:31:17 +01:00
parent d520849ce1
commit be201e811d
4 changed files with 72 additions and 90 deletions

View File

@@ -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>

View 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 %}
&mdash;
{% 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>

View File

@@ -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>