Files
firefly-iii/resources/views/list/bills.twig

129 lines
6.0 KiB
Twig
Raw Normal View History

2015-06-21 11:59:35 +02:00
<table class="table table-hover sortable">
2015-05-08 17:04:24 +02:00
<thead>
2015-05-02 12:51:02 +02:00
<tr>
2016-03-14 17:18:28 +01:00
<th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
2015-05-14 13:00:43 +02:00
<th>{{ trans('list.name') }}</th>
2017-06-30 07:17:25 +02:00
<th data-defaultsign="az" class="hidden-sm hidden-md hidden-xs">{{ trans('list.matchesOn') }}</th>
2016-11-20 15:30:16 +01:00
<th data-defaultsign="_19" colspan="2">{{ trans('list.matchingAmount') }}</th>
<th data-defaultsign="month" class="hidden-sm hidden-xs">{{ trans('list.paid_current_period') }}</th>
<th data-defaultsign="month" class="hidden-sm hidden-xs">{{ trans('list.next_expected_match') }}</th>
2017-06-30 07:17:25 +02:00
<th class="hidden-sm hidden-xs hidden-md">{{ trans('list.active') }}</th>
<th class="hidden-sm hidden-xs hidden-md">{{ trans('list.automatch') }}</th>
2016-11-20 15:30:16 +01:00
<th data-defaultsign="az" class="hidden-sm hidden-xs">{{ trans('list.repeat_freq') }}</th>
2015-06-27 08:06:24 +02:00
</tr>
</thead>
2015-05-08 17:04:24 +02:00
<tbody>
2015-05-02 12:51:02 +02:00
{% for entry in bills %}
2015-06-27 08:06:24 +02:00
<tr>
2016-03-14 17:18:28 +01:00
<td class="hidden-sm hidden-xs">
2017-09-28 08:59:59 +02:00
<div class="btn-group btn-group-xs edit_tr_buttons"><a href="{{ route('bills.edit',entry.id) }}" class="btn btn-default btn-xs"><i class="fa fa-fw fa-pencil"></i></a><a href="{{ route('bills.delete',entry.id) }}" class="btn btn-danger btn-xs"><i class="fa fa-fw fa-trash-o"></i></a></div>
2015-05-08 17:00:39 +02:00
</td>
2016-11-20 17:36:11 +01:00
<td data-value="{{ entry.name }}">
2015-06-27 08:06:24 +02:00
<a href="{{ route('bills.show',entry.id) }}" title="{{ entry.name }}">{{ entry.name }}</a>
2017-11-25 20:54:42 +01:00
{# count attachments #}
{% if entry.attachments.count > 0 %}
<i class="fa fa-paperclip"></i>
{% endif %}
2015-05-08 17:00:39 +02:00
</td>
2017-06-30 07:17:25 +02:00
<td class="hidden-sm hidden-md hidden-xs" data-value="{{ entry.match }}">
2015-06-27 08:06:24 +02:00
{% for match in entry.match|split(',') %}
<span class="label label-info">{{ match }}</span>
{% endfor %}
2015-05-08 17:00:39 +02:00
</td>
2017-01-02 19:27:27 +01:00
<td data-value="{{ entry.amount_min }}" style="text-align: right;">
<span style="margin-right:5px;">
2015-06-27 08:06:24 +02:00
{{ entry.amount_min|formatAmount }}
2017-01-02 19:27:27 +01:00
</span>
2015-06-27 08:06:24 +02:00
</td>
2017-01-02 19:27:27 +01:00
<td data-value="{{ entry.amount_max }}" style="text-align: right;">
<span style="margin-right:5px;">
2015-06-27 08:06:24 +02:00
{{ entry.amount_max|formatAmount }}
2017-01-02 19:27:27 +01:00
</span>
2015-05-08 17:00:39 +02:00
</td>
2016-10-23 14:56:05 +02:00
2017-06-30 07:17:25 +02:00
<!--
Some debug data:
entry.paidDates.count(): {{ entry.paidDates.count() }}
entry.paidDates set:
entry.payDates.count(): {{ entry.payDates.count() }}
active: {% if entry.active %}true{% else %}false{% endif %}
-->
2017-06-28 15:45:28 +02:00
2017-07-01 10:39:59 +02:00
{#
paidDates = 0 (bill not paid in period)
payDates = 0 (bill not expected to be paid in this period)
bill is active.
#}
2016-10-23 14:56:05 +02:00
{% if entry.paidDates.count() == 0 and entry.payDates.count() == 0 and entry.active %}
2017-07-22 22:56:21 +02:00
<td class="paid_in_period text-muted" data-value="0001-00-00 00-00-00">
2016-10-23 14:56:05 +02:00
{{ 'not_expected_period'|_ }}
2015-06-27 08:06:24 +02:00
</td>
2017-07-22 22:56:21 +02:00
<td class="expected_in_period hidden-sm hidden-xs" data-value="{{ entry.nextExpectedMatch.format('Y-m-d H-i-s') }}">
2016-10-23 14:56:05 +02:00
{{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }}
2015-06-27 08:06:24 +02:00
</td>
2015-05-02 12:51:02 +02:00
{% endif %}
2017-07-01 10:39:59 +02:00
{#
paidDates = 0 (bill not paid in period)
payDates > 0 (bill IS expected to be paid in this period)
bill is active
#}
2016-10-23 14:56:05 +02:00
{% if entry.paidDates.count() == 0 and entry.payDates.count() > 0 and entry.active %}
2017-07-22 22:56:21 +02:00
<td class="paid_in_period text-danger" data-value="0002-00-00 00-00-00">
2016-10-23 14:56:05 +02:00
{{ 'not_or_not_yet'|_ }}
2015-06-27 08:06:24 +02:00
</td>
2017-07-22 22:56:21 +02:00
<td class="expected_in_period hidden-sm hidden-xs" data-value="{{ entry.nextExpectedMatch.format('Y-m-d H-i-s') }}">
2016-10-23 14:56:05 +02:00
{{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }}
</td>
{% endif %}
2017-07-01 10:39:59 +02:00
{#
paidDates >= 0 (bill is paid X times).
Don't care about payDates.
#}
{% if entry.paidDates.count() > 0 and entry.active %}
2017-07-22 22:56:21 +02:00
<td class="paid_in_period text-success" data-value="{{ entry.paidDates.first.format('Y-m-d H-i-s') }}">
2016-10-23 14:56:05 +02:00
{% for date in entry.paidDates %}
{{ date.formatLocalized(monthAndDayFormat) }}<br/>
{% endfor %}
</td>
2017-07-22 22:56:21 +02:00
<td class="expected_in_period hidden-sm hidden-xs" data-value="{{ entry.nextExpectedMatch.format('Y-m-d H-i-s') }}">
2016-10-23 14:56:05 +02:00
{{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }}
</td>
{% endif %}
2017-07-01 10:39:59 +02:00
{# bill is not active #}
2016-10-23 14:56:05 +02:00
{% if not entry.active %}
2017-07-22 22:56:21 +02:00
<td class="paid_in_period text-muted" data-value="0000-00-00 00-00-00">
2016-10-23 14:56:05 +02:00
~
</td>
2017-07-22 22:56:21 +02:00
<td class="expected_in_period text-muted hidden-sm hidden-xs" data-value="0">
2016-10-23 14:56:05 +02:00
~
</td>
2015-05-02 12:51:02 +02:00
{% endif %}
2017-06-30 07:17:25 +02:00
<td class="hidden-sm hidden-xs hidden-md" data-value="{{ entry.active }}">
2015-06-27 08:06:24 +02:00
{% if entry.active %}
<i class="fa fa-fw fa-check"></i>
{% else %}
<i class="fa fa-fw fa-ban"></i>
{% endif %}
</td>
2017-06-30 07:17:25 +02:00
<td class="hidden-sm hidden-xs hidden-md" data-value="{{ entry.automatch }}">
2015-06-27 08:06:24 +02:00
{% if entry.automatch %}
<i class="fa fa-fw fa-check"></i>
{% else %}
<i class="fa fa-fw fa-ban"></i>
{% endif %}
</td>
<td class="hidden-sm hidden-xs" data-value="{{ entry.repeat_freq }}{{ entry.skip }}">
{{ entry.repeat_freq|_ }}
{% if entry.skip > 0 %}
2017-11-03 14:53:00 +01:00
{{ 'skips_over'|_ }} {{ entry.skip }}
2015-06-27 08:06:24 +02:00
{% endif %}
</td>
</tr>
2015-05-02 12:51:02 +02:00
{% endfor %}
2015-05-08 17:04:24 +02:00
</tbody>
2015-05-02 12:51:02 +02:00
</table>