First attempt at job to create transactions for recurring transactions.

This commit is contained in:
James Cole
2018-06-22 18:42:23 +02:00
parent 636cd84f4f
commit db1c27d833
16 changed files with 646 additions and 133 deletions

View File

@@ -1223,33 +1223,41 @@ return [
'overview_for_recurrence' => 'Overview for recurring transaction ":title"',
'warning_duplicates_repetitions' => 'In rare instances, dates appear twice in this list. This can happen when multiple repetitions collide. Firefly III will always generate one transaction per day.',
'created_transactions' => 'Related transactions',
'expected_transactions' => 'Expected transactions',
'recurring_meta_field_tags' => 'Tags',
'recurring_meta_field_notes' => 'Notes',
'recurring_meta_field_bill_id' => 'Bill',
'recurring_meta_field_piggy_bank_id' => 'Piggy bank',
'create_new_recurrence' => 'Create new recurring transaction',
'help_first_date' => 'Indicate the first expected recurrence. This must be in the future.',
'help_first_date_no_past' => 'Indicate the first expected recurrence. Firefly III will not create transactions in the past.',
'no_currency' => '(no currency)',
'mandatory_for_recurring' => 'Mandatory recurrence information',
'mandatory_for_transaction' => 'Mandatory transaction information',
'optional_for_recurring' => 'Optional recurrence information',
'optional_for_transaction' => 'Optional transaction information',
'change_date_other_options' => 'Change the "first date" to see more options.',
'mandatory_fields_for_tranaction' => 'The values here will end up in the transaction(s) being created',
'click_for_calendar' => 'Click here for a calendar that shows you when the transaction would repeat.',
'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',
'stored_new_recurrence' => 'Recurring transaction ":title" stored successfully.',
'edit_recurrence' => 'Edit recurring transaction ":title"',
'recurring_repeats_until' => 'Repeats until :date',
'recurring_repeats_forever' => 'Repeats forever',
'recurring_repeats_x_times' => 'Repeats :count time(s)',
'update_recurrence' => 'Update recurring transaction',
'updated_recurrence' => 'Updated recurring transaction ":title"',
'expected_Withdrawals' => 'Expected withdrawals',
'expected_Deposits' => 'Expected deposits',
'expected_Transfers' => 'Expected transfers',
'created_Withdrawals' => 'Created withdrawals',
'created_Deposits' => 'Created deposits',
'created_Transfers' => 'Created transfers',
'created_from_recurrence' => 'Created from recurring transaction ":title" (#:id)',
'recurring_meta_field_tags' => 'Tags',
'recurring_meta_field_notes' => 'Notes',
'recurring_meta_field_bill_id' => 'Bill',
'recurring_meta_field_piggy_bank_id' => 'Piggy bank',
'create_new_recurrence' => 'Create new recurring transaction',
'help_first_date' => 'Indicate the first expected recurrence. This must be in the future.',
'help_first_date_no_past' => 'Indicate the first expected recurrence. Firefly III will not create transactions in the past.',
'no_currency' => '(no currency)',
'mandatory_for_recurring' => 'Mandatory recurrence information',
'mandatory_for_transaction' => 'Mandatory transaction information',
'optional_for_recurring' => 'Optional recurrence information',
'optional_for_transaction' => 'Optional transaction information',
'change_date_other_options' => 'Change the "first date" to see more options.',
'mandatory_fields_for_tranaction' => 'The values here will end up in the transaction(s) being created',
'click_for_calendar' => 'Click here for a calendar that shows you when the transaction would repeat.',
'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',
'stored_new_recurrence' => 'Recurring transaction ":title" stored successfully.',
'edit_recurrence' => 'Edit recurring transaction ":title"',
'recurring_repeats_until' => 'Repeats until :date',
'recurring_repeats_forever' => 'Repeats forever',
'recurring_repeats_x_times' => 'Repeats :count time(s)',
'update_recurrence' => 'Update recurring transaction',
'updated_recurrence' => 'Updated recurring transaction ":title"',
'recurrence_is_inactive' => 'This recurring transaction is not active and will not generate new transactions.',
];

View File

@@ -24,7 +24,7 @@
<div class="col-sm-8">
<div class="checkbox"><label>
{{ Form.checkbox('return_to_edit', '1', old('return_to_edit') == '1', {'id': name ~ '_return_to_edit'}) }}
{{ Form.checkbox('return_to_edit', '1', null, {'id': name ~ '_return_to_edit'}) }}
{{ trans('form.returnHereUpdateExplanation') }}
</label>
</div>

View File

@@ -222,7 +222,7 @@
var transactionType = "{{ preFilled.transaction_type }}";
var suggestUri = "{{ route('recurring.suggest') }}";
var eventsUri = "{{ route('recurring.events') }}";
var currentRepetitionType= "{{ currentRepetitionType }}";
var currentRepetitionType = "{{ currentRepetitionType }}";
</script>
<script type="text/javascript" src="js/ff/recurring/edit.js?v={{ FF_VERSION }}"></script>
{% endblock %}

View File

@@ -54,12 +54,15 @@
</div>
</td>
<td data-value="{{ rt.title }}">
{% if rt.active == false %}<s>{% endif %}
{{ rt.transaction_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>

View File

@@ -12,10 +12,23 @@
<div class="box-header with-border">
<h3 class="box-title">
{{ array.title }}
({{ array.transaction_type }})
{% if array.active == false %}
({{ 'inactive'|_|lower }})
{% endif %}
</h3>
</div>
<div class="box-body">
<p><em>{{ array.description }}</em></p>
{% if array.active == false %}
<p>
{{ 'recurrence_is_inactive'|_ }}
</p>
{% endif %}
<ul>
{% for rep in array.repetitions %}
<li>{{ rep.description }}</li>
@@ -35,13 +48,13 @@
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ 'expected_transactions'|_ }}
{{ ('expected_'~array.transaction_type~'s')|_ }}
</h3>
</div>
<div class="box-body">
<ul>
{% for rep in array.repetitions %}
{% for rep in array.recurrence_repetitions %}
<li>
{{ rep.description }}
{% if rep.repetition_skip == 1 %}
@@ -128,47 +141,47 @@
<!-- meta data -->
{% if array.meta|length > 0 %}
<div class="col-lg-4 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ 'meta_data'|_ }}
</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover sortable">
<thead>
<th style="width:30%;" data-defaultsign="az">{{ trans('list.field') }}</th>
<th data-defaultsign="az">{{ trans('list.value') }}</th>
</thead>
<tbody>
{% for meta in array.meta %}
<tr>
<td>{{ trans('firefly.recurring_meta_field_'~meta.name) }}</td>
<td>
{% if meta.name == 'tags' %}
{% for tag in meta.tags %}
<span class="label label-info">{{ tag }}</span>
{% endfor %}
{% endif %}
{% if meta.name == 'notes' %}
{{ meta.value|markdown }}
{% endif %}
{% if meta.name == 'bill_id' %}
<a href="{{ route('bills.show', [meta.bill_id]) }}">{{ meta.bill_name }}</a>
{% endif %}
{% if meta.name == 'piggy_bank_id' %}
<a href="{{ route('piggy-banks.show', [meta.piggy_bank_id]) }}">{{ meta.piggy_bank_name }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
<div class="col-lg-4 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ 'meta_data'|_ }}
</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover sortable">
<thead>
<th style="width:30%;" data-defaultsign="az">{{ trans('list.field') }}</th>
<th data-defaultsign="az">{{ trans('list.value') }}</th>
</thead>
<tbody>
{% for meta in array.meta %}
<tr>
<td>{{ trans('firefly.recurring_meta_field_'~meta.name) }}</td>
<td>
{% if meta.name == 'tags' %}
{% for tag in meta.tags %}
<span class="label label-info">{{ tag }}</span>
{% endfor %}
{% endif %}
{% if meta.name == 'notes' %}
{{ meta.value|markdown }}
{% endif %}
{% if meta.name == 'bill_id' %}
<a href="{{ route('bills.show', [meta.bill_id]) }}">{{ meta.bill_name }}</a>
{% endif %}
{% if meta.name == 'piggy_bank_id' %}
<a href="{{ route('piggy-banks.show', [meta.piggy_bank_id]) }}">{{ meta.piggy_bank_name }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</table>
</div>
</div>
</div>
</div>
{% endif %}
</div>
<div class="row">
@@ -177,11 +190,11 @@
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ 'transactions'|_ }}
{{ ('created_'~array.transaction_type~'s')|_ }}
</h3>
</div>
<div class="box-body">
Bla bla
List be here.
</div>
</div>
</div>