Fix edit routine

This commit is contained in:
James Cole
2016-04-30 12:46:21 +02:00
parent 4ec6bcc8c7
commit bdcd033952
3 changed files with 56 additions and 49 deletions

View File

@@ -12,6 +12,20 @@
<input type="hidden" name="id" value="{{ journal.id }}"/>
<input type="hidden" name="what" value="{{ what }}"/>
{% 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">
@@ -22,25 +36,24 @@
<!-- ALWAYS AVAILABLE -->
{{ ExpandedForm.text('description',journal.description) }}
<!-- SHOW ACCOUNT (FROM) ONLY FOR WITHDRAWALS AND DEPOSITS -->
{% if what == 'deposit' or what == 'withdrawal' %}
{{ ExpandedForm.select('account_id',accountList,data['account_id']) }}
<!-- 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 %}
<!-- SHOW EXPENSE ACCOUNT ONLY FOR WITHDRAWALS -->
{% if what == 'withdrawal' %}
{{ ExpandedForm.text('expense_account',data['expense_account']) }}
{% endif %}
<!-- SHOW REVENUE ACCOUNT ONLY FOR DEPOSITS -->
<!-- FREE FORMAT SOURCE ACCOUNT ONLY FOR DEPOSITS -->
{% if what == 'deposit' %}
{{ ExpandedForm.text('revenue_account',data['revenue_account']) }}
{{ ExpandedForm.text('source_account_name',data.source_account_name, {label: trans('form.revenue_account')}) }}
{% endif %}
<!-- ONLY SHOW FROM/TO ACCOUNT WHEN CREATING TRANSFER -->
<!-- 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 %}
<!-- SELECTABLE DESTINATION ACCOUNT ONLY FOR TRANSFERS -->
{% if what == 'transfer' %}
{{ ExpandedForm.select('account_from_id',accountList,data['account_from_id']) }}
{{ ExpandedForm.select('account_to_id',accountList,data['account_to_id']) }}
{{ ExpandedForm.select('destination_account_id',assetAccounts, data.destination_account_id, {label: trans('form.asset_destination_account')} ) }}
{% endif %}
<!-- ALWAYS SHOW AMOUNT -->