Files
firefly-iii/resources/views/transactions/edit.twig

138 lines
6.0 KiB
Twig
Raw Normal View History

{% extends "./layout/default.twig" %}
2015-06-19 20:59:14 +02:00
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, journal) }}
2015-06-19 20:59:14 +02:00
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('transactions.update',journal.id) }}" accept-charset="UTF-8" class="form-horizontal" id="update"
enctype="multipart/form-data">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<input type="hidden" name="id" value="{{ journal.id }}"/>
<input type="hidden" name="what" value="{{ what }}"/>
2016-04-30 12:46:21 +02:00
{% if errors.all|length > 0 %}
<div class="row">
<div class="col-lg-12">
<h4>Errors</h4>
<ul>
{% for err in errors.all %}
<li>{{ err }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
<!-- ALWAYS AVAILABLE -->
{{ ExpandedForm.text('description',journal.description) }}
2016-04-30 12:46:21 +02:00
<!-- SELECTABLE SOURCE ACCOUNT ONLY FOR WITHDRAWALS AND TRANSFERS -->
{% if what == 'transfer' or what == 'withdrawal' %}
{{ ExpandedForm.select('source_account_id',assetAccounts, data.source_account_id, {label: trans('form.asset_source_account')}) }}
{% endif %}
2016-04-30 12:46:21 +02:00
<!-- FREE FORMAT SOURCE ACCOUNT ONLY FOR DEPOSITS -->
{% if what == 'deposit' %}
{{ ExpandedForm.text('source_account_name',data.source_account_name, {label: trans('form.revenue_account')}) }}
{% endif %}
2016-04-30 12:46:21 +02:00
<!-- FREE FORMAT DESTINATION ACCOUNT ONLY FOR EXPENSES -->
{% if what == 'withdrawal' %}
{{ ExpandedForm.text('destination_account_name',data.destination_account_name, {label: trans('form.expense_account')}) }}
{% endif %}
2016-04-30 12:46:21 +02:00
<!-- SELECTABLE DESTINATION ACCOUNT ONLY FOR TRANSFERS -->
{% if what == 'transfer' %}
2016-04-30 12:46:21 +02:00
{{ ExpandedForm.select('destination_account_id',assetAccounts, data.destination_account_id, {label: trans('form.asset_destination_account')} ) }}
{% endif %}
<!-- ALWAYS SHOW AMOUNT -->
{{ ExpandedForm.amount('amount',data.amount,{'currency' : journal.transactionCurrency}) }}
<!-- ALWAYS SHOW DATE -->
{{ ExpandedForm.date('date',data['date']) }}
</div>
2015-06-22 17:55:37 +02:00
</div>
<!-- close panel -->
2015-06-22 17:55:37 +02:00
</div>
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
<!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
{% if what == 'withdrawal' %}
2016-03-20 17:12:34 +01:00
{{ ExpandedForm.select('budget_id',budgetList,data['budget_id']) }}
{% endif %}
<!-- CATEGORY ALWAYS -->
{{ ExpandedForm.text('category',data['category']) }}
2016-03-12 07:37:36 +01:00
<!-- INTEREST DATE -->
{{ ExpandedForm.date('interest_date',data['interest_date']) }}
<!-- BOOK DATE -->
{{ ExpandedForm.date('book_date',data['book_date']) }}
<!-- PROCESSING DATE -->
{{ ExpandedForm.date('process_date',data['process_date']) }}
<!-- TAGS -->
{{ ExpandedForm.text('tags') }}
<!-- RELATE THIS TRANSFER TO A PIGGY BANK -->
2016-03-20 17:12:34 +01:00
{% if what == 'transfer' and piggyBankList|length > 0 %}
{{ ExpandedForm.select('piggy_bank_id',piggyBankList,data['piggy_bank_id']) }}
{% endif %}
<!-- ATTACHMENTS -->
2015-07-19 14:30:20 +02:00
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
</div>
</div>
<!-- end of panel for options-->
<!-- panel for options -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('update','transaction') }}
</div>
<div class="box-footer">
<button type="submit" class="pull-right btn btn-success">{{ ('update_' ~ what)|_ }}</button>
</div>
2015-06-20 21:55:55 +02:00
</div>
</div>
</div>
2015-06-22 17:55:37 +02:00
</form>
{% endblock %}
{% block scripts %}
2015-06-22 17:55:37 +02:00
<script type="text/javascript">
2015-12-18 16:37:45 +01:00
var what = "{{ what }}";
2015-06-22 17:55:37 +02:00
</script>
2016-04-10 17:51:51 +02:00
<script type="text/javascript" src="js/lib/bootstrap3-typeahead.min.js"></script>
<script type="text/javascript" src="js/lib/bootstrap-tagsinput.min.js"></script>
<script type="text/javascript" src="js/ff/transactions/create-edit.js"></script>
<script type="text/javascript" src="js/ff/transactions/edit.js"></script>
{% endblock %}
{% block styles %}
<link href="css/bootstrap-tagsinput.css" type="text/css" rel="stylesheet" media="all">
{% endblock %}