Lots of new code for recurring transactions. #1469

This commit is contained in:
James Cole
2018-06-16 21:47:51 +02:00
parent 968abd26e8
commit 1cf91c78f8
19 changed files with 769 additions and 79 deletions

View File

@@ -1239,6 +1239,7 @@ return [
'repeat_forever' => 'Repeat forever',
'repeat_until_date' => 'Repeat until date',
'repeat_times' => 'Repeat a number of times',
'recurring_skips_one' => 'Every other',
'recurring_skips_more' => 'Skips :count occurrences',
'store_new_recurrence' => 'Store recurring transaction',
];

View File

@@ -112,6 +112,7 @@ return [
'amount_zero' => 'The total amount cannot be zero',
'unique_piggy_bank_for_user' => 'The name of the piggy bank must be unique.',
'secure_password' => 'This is not a secure password. Please try again. For more information, visit http://bit.ly/FF3-password-security',
'valid_recurrence_rep_type' => 'Invalid repetition type for recurring transactions',
'attributes' => [
'email' => 'email address',
'description' => 'description',

View File

@@ -16,7 +16,7 @@
<h3 class="box-title">{{ 'mandatory_for_recurring'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{{ ExpandedForm.text('title') }}
{{ ExpandedForm.date('first_date',null, {helpText: trans('firefly.help_first_date')}) }}
{{ ExpandedForm.select('repetition_type', [], null, {helpText: trans('firefly.change_date_other_options')}) }}
{{ ExpandedForm.number('skip', 0) }}
@@ -78,6 +78,7 @@
</div>
</div>
</div>
<input type="hidden" name="transaction_type" value="">
{# end of three buttons#}
{{ ExpandedForm.text('transaction_description') }}
@@ -125,7 +126,7 @@
{{ ExpandedForm.text('tags') }}
{# RELATE THIS TRANSFER TO A PIGGY BANK #}
{{ ExpandedForm.select('piggy_bank_id', [], '0') }}
{{ ExpandedForm.select('piggy_bank_id', piggies, 0) }}
</div>
</div>
</div>

View File

@@ -83,7 +83,16 @@
<td>
<ul>
{% for rep in rt.repetitions %}
<li>{{ rep.description }}</li>
<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 %}
</li>
{% endfor %}
</ul>
</td>

View File

@@ -42,7 +42,14 @@
<ul>
{% for rep in array.repetitions %}
<li>{{ rep.description }}
<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.formatLocalized(trans('config.month_and_date_day')) }}</li>