Implement custom trigger for recurring transactions

This commit is contained in:
James Cole
2022-12-29 15:42:02 +01:00
parent 85a2a87806
commit 8c320fd199
16 changed files with 604 additions and 234 deletions

View File

@@ -37,8 +37,10 @@
</div>
<div class="box-footer">
<div class="btn-group">
<a href="{{ route('recurring.edit', [array.id]) }}" class="btn btn-sm btn-default"><span class="fa fa-pencil"></span> {{ 'edit'|_ }}</a>
<a href="{{ route('recurring.delete', [array.id]) }}" class="btn btn-sm btn-danger">{{ 'delete'|_ }} <span class="fa fa-trash"></span></a>
<a href="{{ route('recurring.edit', [array.id]) }}" class="btn btn-sm btn-default"><span
class="fa fa-pencil"></span> {{ 'edit'|_ }}</a>
<a href="{{ route('recurring.delete', [array.id]) }}" class="btn btn-sm btn-danger">{{ 'delete'|_ }}
<span class="fa fa-trash"></span></a>
</div>
</div>
</div>
@@ -57,24 +59,37 @@
{{ trans('firefly.repeat_until_in_past', {date: array.repeat_until.isoFormat(monthAndDayFormat) }) }}
</span>
{% endif %}
<ul>
{% for rep in array.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 %}
<ul>
{% for occ in rep.occurrences %}
<li>{{ occ.isoFormat(trans('config.month_and_date_day_js')) }}</li>
{% endfor %}
</ul>
</li>
<p>
<strong>{{ 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 %}
</strong>
</p>
<table class="table">
<tbody>
{% for occ in rep.occurrences %}
<tr>
<td>{{ occ.date.isoFormat(trans('config.month_and_date_day_js')) }}</td>
<td>
{% if not occ.fired %}
<form action="{{ route('recurring.trigger', [recurrence.id]) }}" method="post" style="display: inline;">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" name="date" value="{{ occ.date.isoFormat('YYYY-MM-DD') }}">
<input type="submit" name="submit" value="{{ 'create_right_now'|_ }}"
class="btn btn-sm btn-default">
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
</ul>
</div>
<div class="box-footer">
<small>
@@ -175,11 +190,13 @@
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="v1/css/bootstrap-sortable.css?v={{ FF_VERSION }}" type="text/css" media="all" nonce="{{ JS_NONCE }}">
<link rel="stylesheet" href="v1/css/bootstrap-sortable.css?v={{ FF_VERSION }}" type="text/css" media="all"
nonce="{{ JS_NONCE }}">
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ FF_VERSION }}"
nonce="{{ JS_NONCE }}"></script>
{# required for groups.twig #}
<script type="text/javascript" src="v1/js/ff/list/groups.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}