firefly-iii/resources/views/v1/recurring/index.twig
2019-09-04 09:45:02 +02:00

157 lines
9.3 KiB
Twig

{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<!-- block with list of recurring transaction -->
{% if total > 0 %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ 'recurrences'|_ }}
</h3>
<div class="box-tools pull-right">
<div class="btn-group">
<button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ route('recurring.create') }}"><i class="fa fa-plus fa-fw"></i> {{ ('make_new_recurring')|_ }}</a></li>
</ul>
</div>
</div>
</div>
<div class="box-body table-responsive no-padding">
<div style="padding:8px;">
<a href="{{ route('recurring.create') }}" class="btn btn-success"><i class="fa fa-plus fa-fw"></i> {{ ('make_new_recurring')|_ }}
</a>
</div>
<!-- list of recurring here -->
<div style="padding-left:8px;">
{{ paginator.render|raw }}
</div>
<table class="table table-hover sortable">
<thead>
<tr>
<th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
<th data-defaultsign="az">{{ trans('list.title') }}</th>
<th data-defaultsort="disabled">{{ trans('list.transaction_s') }}</th>
<th data-defaultsort="disabled">{{ trans('list.repetitions') }}</th>
<th data-defaultsign="month" data-dateformat="{{ madMomentJS }}">{{ trans('list.next_due') }}</th>
</tr>
</thead>
<tbody>
{% for rt in paginator %}
<tr>
<td class="hidden-sm hidden-xs">
<div class="btn-group btn-group-xs edit_tr_buttons">
<a class="btn btn-default btn-xs" title="{{ 'edit'|_ }}" href="{{ route('recurring.edit',rt.id) }}"><i
class="fa fa-fw fa-pencil"></i></a><a class="btn btn-danger btn-xs" title="{{ 'delete'|_ }}"
href="{{ route('recurring.delete',rt.id) }}"><i
class="fa fa-fw fa-trash-o"></i></a>
</div>
</td>
<td data-value="{{ rt.title }}">
{% if rt.active == false %}<s>{% endif %}
{{ rt.type|_ }}:
<a href="{{ route('recurring.show',rt.id) }}">{{ rt.title }}</a>
{% if rt.active == false %}</s> ({{ 'inactive'|_|lower }}){% endif %}
{% if rt.description|length > 0 %}
<small><br>{{ rt.description }}</small>
{% endif %}
</td>
<td data-value="0">
<ol>
{% for rtt in rt.transactions %}
<li>
{# normal amount + comma#}
{{ formatAmountBySymbol(rtt['amount'],rtt['currency_symbol'],rtt['currency_decimal_places']) }}{% if rtt['foreign_amount'] == null %},{% endif %}
{# foreign amount + comma #}
{% if null != rtt['foreign_amount'] %}
({{ formatAmountBySymbol(rtt['foreign_amount'],rtt['foreign_currency_symbol'],rtt['foreign_currency_decimal_places']) }}),
{% endif %}
<a href="{{ route('accounts.show', rtt['source_id']) }}">{{ rtt['source_name'] }}</a>
&rarr;
<a href="{{ route('accounts.show', rtt['destination_id']) }}">{{ rtt['destination_name'] }}</a>
</li>
{% endfor %}
</ol>
</td>
<td>
<ul>
{% for rep in rt.repetitions %}
<li>{{ rep.description }}
{% if rep.repetition_skip == 1 %}
({{ trans('firefly.recurring_skips_one')|lower }}).
{% endif %}
{% if rep.repetition_skip > 1 %}
({{ trans('firefly.recurring_skips_more', {count: rep.repetition_skip})|lower }}).
{% endif %}
{% if rep.weekend == 3 %}
{{ 'will_jump_friday'|_ }}
{% endif %}
{% if rep.weekend == 4 %}
{{ 'will_jump_monday'|_ }}
{% endif %}
{% if rep.weekend == 2 %}
{{ 'except_weekends'|_ }}
{% endif %}
</li>
{% endfor %}
</ul>
<p>
{% if null == rt.repeat_until and rt.repetitions == 0 %}
{{ 'recurring_repeats_forever'|_ }}.
{% endif %}
{% if null != rt.repeat_until and rt.repetitions == 0 %}
{{ trans('firefly.recurring_repeats_until', {date: rt.repeat_until.formatLocalized(monthAndDayFormat)}) }}.
{% endif %}
{% if null == rt.repeat_until and rt.nr_of_repetitions != 0 %}
{{ trans('firefly.recurring_repeats_x_times', {count: rt.nr_of_repetitions}) }}.
{% endif %}
</p>
</td>
{% if rt.occurrences|length == 0 %}
<td>&nbsp;</td>
{% else %}
<td>{{ rt.occurrences[0].formatLocalized(monthAndDayFormat) }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
<div style="padding-left:8px;">
{{ paginator.render|raw }}
</div>
</div>
<div class="box-footer">
<a href="{{ route('recurring.create') }}" class="btn btn-success"><i class="fa fa-plus fa-fw"></i> {{ ('make_new_recurring')|_ }}</a>
</div>
</div>
</div>
</div>
{% endif %}
{% if total == 0 and page == 1 %}
{% include 'partials.empty' with {objectType: 'default', type: 'recurring',route: route('recurring.create')} %}
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="v1/css/bootstrap-sortable.css?v={{ FF_VERSION }}" type="text/css" media="all"/>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ FF_VERSION }}"></script>
{% endblock %}