Can now handle withdrawals in foreign currency.

This commit is contained in:
James Cole
2017-04-14 14:37:04 +02:00
parent 7e31a29b12
commit c33dd1ecee
9 changed files with 171 additions and 27 deletions

View File

@@ -36,7 +36,15 @@
<!-- total amount -->
<tr>
<td>{{ 'total_amount'|_ }}</td>
<td>{{ journal|formatJournal }}</td>
<td>{{ journal|formatJournal }}
{% if journal.hasMeta('original_amount') %}
{% if journal.transactiontype.type == 'Withdrawal' %}
({{ formatAnything(originalCurrency, journal.getMeta('original_amount')*-1) }})
{% else %}
({{ formatAnything(originalCurrency, journal.getMeta('original_amount')) }})
{% endif %}
{% endif %}
</td>
</tr>
<tr>
<td style="width:30%;">{{ trans('list.date') }}</td>

View File

@@ -46,24 +46,28 @@
{{ ExpandedForm.text('source_account_name',data.source_account_name, {label: trans('form.revenue_account')}) }}
{% endif %}
<!-- FREE FORMAT DESTINATION ACCOUNT ONLY FOR EXPENSES -->
{# 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 AND DEPOSITS -->
{# SELECTABLE DESTINATION ACCOUNT ONLY FOR TRANSFERS AND DEPOSITS #}
{% if what == 'transfer' or what == 'deposit' %}
{{ 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 AMOUNT #}
{{ ExpandedForm.amount('amount',data.amount,{'currency' : data.currency}) }}
<!-- ALWAYS SHOW DATE -->
{# INSTRUCTIONS FOR EXCHANGE RATES #}
{{ ExpandedForm.staticText('exchange_rate_instruction','(here be text)') }}
{{ ExpandedForm.nonSelectableAmount('exchanged_amount') }}
{# ALWAYS SHOW DATE #}
{{ ExpandedForm.date('date',data['date']) }}
</div>
</div>
<!-- close panel -->
</div>
<div class="col-lg-6 col-md-12 col-sm-12">
@@ -235,6 +239,13 @@
<script type="text/javascript" src="js/lib/bootstrap-tagsinput.min.js"></script>
<script type="text/javascript" src="js/lib/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/lib/modernizr-custom.js"></script>
<script type="text/javascript" src="javascript/accounts?ext=.js"></script>
<script type="text/javascript" src="javascript/currencies?ext=.js"></script>
<script type="text/javascript">
var journal = {{ journal.toArray()|json_encode|raw }};
var journalData = {{ data|json_encode|raw }};
var exchangeRateInstructions = "{{ 'exchange_rate_instructions'|_|escape('js') }}";
</script>
<script type="text/javascript" src="js/ff/transactions/single/edit.js"></script>
{% endblock %}