mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
Can now create recurring transactions. #1469
This commit is contained in:
@@ -1229,6 +1229,7 @@ return [
|
||||
'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.',
|
||||
'mandatory_for_recurring' => 'Mandatory recurrence information',
|
||||
'mandatory_for_transaction' => 'Mandatory transaction information',
|
||||
'optional_for_recurring' => 'Optional recurrence information',
|
||||
@@ -1242,4 +1243,6 @@ return [
|
||||
'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"',
|
||||
];
|
||||
|
@@ -77,7 +77,7 @@
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
<li class="{{ activeRoutePartial('bills') }} {{ activeRoutePartial('piggy-banks') }} {{ activeRoutePartial('rules') }} treeview">
|
||||
<li class="{{ activeRoutePartial('bills') }} {{ activeRoutePartial('recurring') }} {{ activeRoutePartial('piggy-banks') }} {{ activeRoutePartial('rules') }} treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-euro fa-fw"></i>
|
||||
<span>{{ 'moneyManagement'|_ }}</span>
|
||||
|
@@ -126,7 +126,7 @@
|
||||
{{ ExpandedForm.text('tags') }}
|
||||
|
||||
{# RELATE THIS TRANSFER TO A PIGGY BANK #}
|
||||
{{ ExpandedForm.select('piggy_bank_id', piggies, 0) }}
|
||||
{{ ExpandedForm.piggyBankList('piggy_bank_id',0) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -200,6 +200,7 @@
|
||||
var transactionType = "{{ preFilled.transaction_type }}";
|
||||
var suggestUri = "{{ route('recurring.suggest') }}";
|
||||
var eventsUri = "{{ route('recurring.events') }}";
|
||||
var oldRepetitionType= "{{ oldRepetitionType }}";
|
||||
</script>
|
||||
<script type="text/javascript" src="js/ff/recurring/create.js?v={{ FF_VERSION }}"></script>
|
||||
{% endblock %}
|
||||
|
214
resources/views/recurring/edit.twig
Normal file
214
resources/views/recurring/edit.twig
Normal file
@@ -0,0 +1,214 @@
|
||||
{% extends "./layout/default" %}
|
||||
{% block breadcrumbs %}
|
||||
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, recurrence) }}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<form action="{{ route('recurring.update') }}" method="post" id="store" class="form-horizontal">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
|
||||
{# row with recurrence information #}
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
{# mandatory recurrence stuff #}
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'mandatory_for_recurring'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ ExpandedForm.text('title',recurrence.title) }}
|
||||
{{ ExpandedForm.date('first_date',recurrence.first_date.format('Y-m-d'), {helpText: trans('firefly.help_first_date_no_past')}) }}
|
||||
{{ ExpandedForm.select('repetition_type', [], null, {helpText: trans('firefly.change_date_other_options')}) }}
|
||||
{{ ExpandedForm.number('skip', 0) }}
|
||||
{{ ExpandedForm.select('repetition_end', []) }} {#typesOfRepetitions#}
|
||||
{{ ExpandedForm.date('repeat_until',null) }}
|
||||
{{ ExpandedForm.number('repetitions',null) }}
|
||||
|
||||
{# calendar in popup #}
|
||||
<div class="form-group" id="calendar_holder">
|
||||
<label for="ffInput_calendar" class="col-sm-4 control-label">{{ trans('form.calendar') }}</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<p class="form-control-static" id="ffInput_calendar">
|
||||
<a href="#" id="calendar-link">{{ 'click_for_calendar'|_ }}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
{# optional recurrence stuff #}
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'optional_for_recurring'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ ExpandedForm.textarea('recurring_description') }}
|
||||
|
||||
{{ ExpandedForm.checkbox('active',1) }}
|
||||
|
||||
{{ ExpandedForm.checkbox('apply_rules',1) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
{# mandatory transaction information #}
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'mandatory_for_transaction'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p><em>{{ 'mandatory_fields_for_tranaction'|_ }}</em></p>
|
||||
{# three buttons to distinguish type of transaction#}
|
||||
<div class="form-group" id="name_holder">
|
||||
<label for="ffInput_type" class="col-sm-4 control-label">
|
||||
{{ trans('form.transaction_type') }}
|
||||
</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="#" class="btn btn-default switch-button" data-value="withdrawal">{{ 'withdrawal'|_ }}</a>
|
||||
<a href="#" class="btn btn-default switch-button" data-value="deposit">{{ 'deposit'|_ }}</a>
|
||||
<a href="#" class="btn btn-default switch-button" data-value="transfer">{{ 'transfer'|_ }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="transaction_type" value="">
|
||||
{# end of three buttons#}
|
||||
|
||||
{{ ExpandedForm.text('transaction_description') }}
|
||||
{# transaction information (mandatory) #}
|
||||
{{ ExpandedForm.currencyList('transaction_currency_id', defaultCurrency.id) }}
|
||||
{{ ExpandedForm.amountNoCurrency('amount', []) }}
|
||||
|
||||
{# source account if withdrawal, or if transfer: #}
|
||||
{{ ExpandedForm.assetAccountList('source_account_id', null, {label: trans('form.asset_source_account')}) }}
|
||||
|
||||
{# source account name for deposits: #}
|
||||
{{ ExpandedForm.text('source_account_name', null, {label: trans('form.revenue_account')}) }}
|
||||
|
||||
{# destination if deposit or transfer: #}
|
||||
{{ ExpandedForm.assetAccountList('destination_account_id', null, {label: trans('form.asset_destination_account')} ) }}
|
||||
|
||||
{# destination account name for withdrawals #}
|
||||
{{ ExpandedForm.text('destination_account_name', null, {label: trans('form.expense_account')}) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
{# optional transaction information #}
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'optional_for_transaction'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{# transaction information (optional) #}
|
||||
{{ ExpandedForm.currencyList('foreign_currency_id', defaultCurrency.id) }}
|
||||
{{ ExpandedForm.amountNoCurrency('foreign_amount', []) }}
|
||||
|
||||
{# BUDGET ONLY WHEN CREATING A WITHDRAWAL #}
|
||||
{% if budgets|length > 1 %}
|
||||
{{ ExpandedForm.select('budget_id', [], null) }} {#budgets#}
|
||||
{% else %}
|
||||
{{ ExpandedForm.select('budget_id', [], null, {helpText: trans('firefly.no_budget_pointer')}) }}
|
||||
{#budgets#}
|
||||
{% endif %}
|
||||
|
||||
{# CATEGORY ALWAYS #}
|
||||
{{ ExpandedForm.text('category') }}
|
||||
|
||||
{# TAGS #}
|
||||
{{ ExpandedForm.text('tags') }}
|
||||
|
||||
{# RELATE THIS TRANSFER TO A PIGGY BANK #}
|
||||
{{ ExpandedForm.select('piggy_bank_id', [], 0) }} {#piggies#}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# row with submit stuff. #}
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-lg-offset-6 lg-md-offset-6">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'options'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ ExpandedForm.optionsList('create','recurrence') }}
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn pull-right btn-success">
|
||||
{{ ('store_new_recurrence')|_ }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{#
|
||||
<div class="row">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'expected_repetitions'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
Here.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#}
|
||||
</form>
|
||||
|
||||
{# calendar modal #}
|
||||
<div class="modal fade" id="calendarModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Calendar view yay</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="recurring_calendar" style="max-width: 400px;margin: 0 auto;">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script type="text/javascript" src="js/lib/modernizr-custom.js?v={{ FF_VERSION }}"></script>
|
||||
<script type="text/javascript" src="js/lib/bootstrap3-typeahead.min.js?v={{ FF_VERSION }}"></script>
|
||||
<script type="text/javascript" src="js/lib/bootstrap-tagsinput.min.js?v={{ FF_VERSION }}"></script>
|
||||
<script type="text/javascript" src="js/lib/jquery-ui.min.js?v={{ FF_VERSION }}"></script>
|
||||
<script type="text/javascript" src="lib/fc/fullcalendar.min.js?v={{ FF_VERSION }}"></script>
|
||||
<script type="text/javascript">
|
||||
var transactionType = "{{ preFilled.transaction_type }}";
|
||||
var suggestUri = "{{ route('recurring.suggest') }}";
|
||||
var eventsUri = "{{ route('recurring.events') }}";
|
||||
var currentRepetitionType= "{{ currentRepetitionType }}";
|
||||
</script>
|
||||
<script type="text/javascript" src="js/ff/recurring/edit.js?v={{ FF_VERSION }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block styles %}
|
||||
<link href="css/bootstrap-tagsinput.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all">
|
||||
<link href="css/jquery-ui/jquery-ui.structure.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all">
|
||||
<link href="css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all">
|
||||
<link href="lib/fc/fullcalendar.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all">
|
||||
{% endblock %}
|
@@ -49,8 +49,7 @@
|
||||
<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-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>
|
||||
|
@@ -86,8 +86,7 @@
|
||||
{{ ExpandedForm.text('tags') }}
|
||||
|
||||
{# RELATE THIS TRANSFER TO A PIGGY BANK #}
|
||||
{{ ExpandedForm.select('piggy_bank_id', piggies, '0') }}
|
||||
|
||||
{{ ExpandedForm.piggyBankList('piggy_bank_id',0) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -211,7 +210,6 @@
|
||||
{% block scripts %}
|
||||
<script type="text/javascript">
|
||||
var what = "{{ what }}";
|
||||
var piggiesLength = {{ piggies|length }};
|
||||
|
||||
// some titles and names:
|
||||
var txt = [];
|
||||
|
Reference in New Issue
Block a user