firefly-iii/resources/twig/list/journals.twig

144 lines
6.2 KiB
Twig
Raw Normal View History

2015-05-02 02:06:07 -05:00
{{ journals.render|raw }}
2015-05-01 15:44:35 -05:00
<table class="table table-hover">
<thead>
2015-05-01 15:44:35 -05:00
<tr class="ignore">
2015-05-12 23:34:17 -05:00
<th class="hidden-xs" colspan="2">&nbsp;</th>
2015-05-14 06:00:43 -05:00
<th>{{ trans('list.description') }}</th>
<th>{{ trans('list.amount') }}</th>
2015-06-25 10:06:20 -05:00
<th class="hidden-sm hidden-xs">{{ trans('list.date') }}</th>
2015-05-14 06:00:43 -05:00
<th class="hidden-xs">{{ trans('list.from') }}</th>
<th class="hidden-xs">{{ trans('list.to') }}</th>
2015-05-01 15:44:35 -05:00
<!-- Hide budgets? -->
{% if not hideBudgets %}
2015-05-14 06:00:43 -05:00
<th class="hidden-xs"><i class="fa fa-tasks fa-fw" title="{{ trans('list.budget') }}"></i></th>
2015-05-01 15:44:35 -05:00
{% endif %}
<!-- Hide categories? -->
{% if not hideCategories %}
2015-05-14 06:00:43 -05:00
<th class="hidden-xs"><i class="fa fa-bar-chart fa-fw" title="{{ trans('list.category') }}"></i></th>
2015-05-01 15:44:35 -05:00
{% endif %}
<!-- Hide bills? -->
{% if not hideBills %}
2015-05-14 06:00:43 -05:00
<th class="hidden-xs"><i class="fa fa-fw fa-rotate-right" title="{{ trans('list.bill') }}"></i></th>
2015-05-01 15:44:35 -05:00
{% endif %}
</tr>
</thead>
<tbody>
{% set _sum = 0 %}
2015-05-01 15:44:35 -05:00
{% for journal in journals %}
{% if invalidJournal(journal) %}
<tr class="ignore">
<td>
<div class="btn-group btn-group-xs">
<a href="{{ route("transactions.delete",journal.id) }}" class="btn btn-xs btn-danger"><i class="fa fa-fw fa-trash-o"></i></a>
</div>
</td>
<td>&nbsp;</td>
<td>{{ journal.description }}</td>
2015-06-27 01:06:24 -05:00
<td colspan="7"><em>Invalid journal: Found {{ journal.transactions|length }} transaction(s)</em></td>
2015-05-01 15:44:35 -05:00
</tr>
{% else %}
{% set _sum = _sum + journal.correct_amount %}
2015-06-27 01:06:24 -05:00
<tr class="drag" data-date="{{ journal.date.format('Y-m-d') }}" data-id="{{ journal.id }}">
2015-05-12 23:34:17 -05:00
<td class="hidden-xs">
2015-05-01 15:44:35 -05:00
<div class="btn-group btn-group-xs">
{% if sorting %}
<a href="#" class="handle btn btn-default btn-xs"><i class="fa fa-fw fa-arrows-v"></i></a>
{% endif %}
2015-06-27 01:06:24 -05:00
<a href="{{ route('transactions.edit',journal.id) }}" class="btn btn-xs btn-default"><i class="fa fa-fw fa-pencil"></i></a>
<a href="{{ route('transactions.delete',journal.id) }}" class="btn btn-xs btn-danger"><i class="fa fa-fw fa-trash-o"></i></a>
2015-05-01 15:44:35 -05:00
</div>
</td>
2015-05-12 23:34:17 -05:00
<td class="hidden-xs">
2015-05-01 15:44:35 -05:00
{{ journal|typeIcon }}
</td>
<td>
2015-06-27 01:06:24 -05:00
<a href="{{ route('transactions.show',journal.id) }}" title="{{ journal.description }}">{{ journal.description }}</a>
{% if journal.attachments|length > 0 %}
2015-07-26 08:51:07 -05:00
<i class="fa fa-paperclip pull-right"
title="{{ Lang.choice('firefly.nr_of_attachments', journal.attachments|length, {count: journal.attachments|length}) }}"></i>
{% endif %}
2015-05-01 15:44:35 -05:00
</td>
<td>
{% if not hideTags %}
2015-05-02 15:05:57 -05:00
{{ relevantTags(journal)|raw }}
2015-05-01 15:44:35 -05:00
{% else %}
{{ journal.correct_amount|formatAmount }}
2015-05-01 15:44:35 -05:00
{% endif %}
</td>
2015-06-25 10:06:20 -05:00
<td class="hidden-sm hidden-xs">
2015-06-27 01:06:24 -05:00
{{ journal.date.formatLocalized(monthAndDayFormat) }}
2015-05-01 15:44:35 -05:00
</td>
2015-05-12 23:34:17 -05:00
<td class="hidden-xs">
2015-06-05 12:02:23 -05:00
{% if journal.source_account.accountType.type == 'Cash account' %}
2015-05-01 15:44:35 -05:00
<span class="text-success">(cash)</span>
{% else %}
2015-06-27 01:06:24 -05:00
<a href="{{ route('accounts.show',journal.source_account.id) }}">{{ journal.source_account.name }}</a>
2015-05-01 15:44:35 -05:00
{% endif %}
</td>
2015-05-12 23:34:17 -05:00
<td class="hidden-xs">
2015-06-05 12:02:23 -05:00
{% if journal.destination_account.accountType.type == 'Cash account' %}
2015-05-01 15:44:35 -05:00
<span class="text-success">(cash)</span>
{% else %}
2015-06-27 01:06:24 -05:00
<a href="{{ route('accounts.show',journal.destination_account.id) }}">{{ journal.destination_account.name }}</a>
2015-05-01 15:44:35 -05:00
{% endif %}
</td>
<!-- Do NOT hide the budget? -->
{% if not hideBudgets %}
2015-05-12 23:34:17 -05:00
<td class="hidden-xs">
2015-05-01 15:44:35 -05:00
{% if journal.budgets[0] %}
2015-06-27 01:06:24 -05:00
<a href="{{ route('budgets.show',journal.budgets[0].id) }}">{{ journal.budgets[0].name }}</a>
2015-05-01 15:44:35 -05:00
{% endif %}
</td>
{% endif %}
<!-- Do NOT hide the category? -->
{% if not hideCategories %}
2015-05-12 23:34:17 -05:00
<td class="hidden-xs">
2015-05-01 15:44:35 -05:00
{% if journal.categories[0] %}
2015-06-27 01:06:24 -05:00
<a href="{{ route('categories.show',journal.categories[0].id) }}">{{ journal.categories[0].name }}</a>
2015-05-01 15:44:35 -05:00
{% endif %}
</td>
{% endif %}
<!-- Do NOT hide the bill? -->
{% if not hideBills %}
2015-05-12 23:34:17 -05:00
<td class="hidden-xs">
2015-05-01 15:44:35 -05:00
{% if journal.bill %}
2015-06-27 01:06:24 -05:00
<a href="{{ route('bills.show',journal.bill_id) }}">{{ journal.bill.name }}</a>
2015-05-01 15:44:35 -05:00
{% endif %}
</td>
{% endif %}
</tr>
{% endif %}
{% endfor %}
</tbody>
<tfoot>
{% if showPageSum %}
<tr>
<td colspan="3" style="text-align: right;"><em>{{ 'sum'|_ }}</em></td>
<td colspan="2">{{ _sum|formatAmount }}</td>
</tr>
{% endif %}
{% if showPeriodSum %}
<tr>
<td colspan="3" style="text-align: right;"><em>{{ 'period_sum'|_ }}</em></td>
<td colspan="2">{{ periodSum|formatAmount }}</td>
</tr>
{% endif %}
{% if showTotalSum %}
<tr>
<td colspan="3" style="text-align: right;"><em>{{ 'total_sum'|_ }}</em></td>
<td colspan="2">{{ totalSum|formatAmount }}</td>
</tr>
{% endif %}
</tfoot>
2015-05-01 15:44:35 -05:00
</table>
{{ journals.render|raw }}