Improve tests, models and views.

This commit is contained in:
James Cole
2019-04-16 16:20:46 +02:00
parent 5ac39dbdef
commit 66c55b7bbe
44 changed files with 13710 additions and 5067 deletions

View File

@@ -1,87 +1,4 @@
<table class="table table-hover table-condensed">
<thead>
<tr>
<th>&nbsp;</th>
<th>{{ trans('list.description') }}</th>
<th>{{ trans('list.amount') }}</th>
<th class="hidden-sm hidden-xs">{{ trans('list.date') }}</th>
{% if not hideSource %}
<th class="hidden-xs">{{ trans('list.from') }}</th>
{% endif %}
{% if not hideDestination %}
<th class="hidden-xs">{{ trans('list.to') }}</th>
{% endif %}
{# Hide budgets? #}
{% if not hideBudget %}
<th class="hidden-xs"><i class="fa fa-tasks fa-fw" title="{{ trans('list.budget') }}"></i></th>
{% endif %}
{# Hide categories? #}
{% if not hideCategory %}
<th class="hidden-xs"><i class="fa fa-bar-chart fa-fw" title="{{ trans('list.category') }}"></i></th>
{% endif %}
</tr>
</thead>
<tbody>
{# Make sum: #}
{% set sum = 0 %}
{% for transaction in journals %}
{# add to sum #}
{% set sum = (sum + transaction.transaction_amount) %}
<tr class="drag" data-date="{{ transaction.date.format('Y-m-d') }}" data-id="{{ transaction.journal_id }}">
<td class="hidden-xs">
{{ transaction|transactionIcon }}
</td>
<td>
<a href="{{ route('transactions.show',transaction.journal_id) }}">
{{ transaction|transactionDescription }}
</a>
</td>
<td>
{{ transaction|transactionAmount }}
</td>
<td class="hidden-sm hidden-xs">
{{ transaction.date.formatLocalized(monthAndDayFormat) }}
</td>
{% if not hideSource %}
<td class="hidden-xs">
{{ transaction|transactionSourceAccount }}
</td>
{% endif %}
{% if not hideDestination %}
<td class="hidden-xs">
{{ transaction|transactionDestinationAccount }}
</td>
{% endif %}
{# Do NOT hide the budget? #}
{% if not hideBudget %}
<td class="hidden-xs">
{{ transaction|transactionBudgets }}
</td>
{% endif %}
{# Do NOT hide the category? #}
{% if not hideCategory %}
<td class="hidden-xs">
{{ transaction|transactionCategories }}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="2" style="text-align: right;"><em>{{ 'sum'|_ }}:</em></td>
<td>
{% if inverseAmount %}
{{ (sum*-1)|formatAmount }}
{% else %}
{{ sum|formatAmount }}
{% endif %}
</td>
</tr>
</tfoot>
</table>
{{ journals.render|raw }}
{#
TODO REPLACE ME
#}
<h1 style="color:red;">REPLACE ME</h1>