2016-04-29 10:29:13 -05:00
|
|
|
{% extends "./layout/default.twig" %}
|
|
|
|
|
|
|
|
{% block breadcrumbs %}
|
|
|
|
{{ Breadcrumbs.renderIfExists }}
|
|
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
2016-04-29 13:59:28 -05:00
|
|
|
{{ Form.open({'class' : 'form-horizontal','id' : 'store','url' : route('split.journal.from-store.post')}) }}
|
2016-05-12 15:44:31 -05:00
|
|
|
<input type="hidden" name="what" value="{{ preFilled.what }}"/>
|
2016-04-29 13:59:28 -05:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
2016-05-12 15:44:31 -05:00
|
|
|
<h3 class="box-title">{{ ('split_title_'~preFilled.what)|_ }}</h3>
|
2016-04-29 10:29:13 -05:00
|
|
|
|
2016-04-29 13:59:28 -05:00
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
2016-04-29 10:29:13 -05:00
|
|
|
</div>
|
2016-04-29 13:59:28 -05:00
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<p>
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ ('split_intro_one_'~preFilled.what)|_ }}
|
2016-04-29 13:59:28 -05:00
|
|
|
</p>
|
|
|
|
<p>
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ ('split_intro_two_'~preFilled.what)|_ }}
|
2016-04-29 13:59:28 -05:00
|
|
|
</p>
|
|
|
|
<p>
|
2016-05-12 15:44:31 -05:00
|
|
|
{% if preFilled.what =='deposit' %}
|
|
|
|
{{ trans(('firefly.split_intro_three_'~preFilled.what), {total: 500|formatAmount, split_one: 425|formatAmount, split_two: 75|formatAmount})|raw }}
|
2016-04-30 02:48:39 -05:00
|
|
|
{% else %}
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ trans(('firefly.split_intro_three_'~preFilled.what), {total: 20|formatAmount, split_one: 15|formatAmount, split_two: 5|formatAmount})|raw }}
|
2016-04-30 02:48:39 -05:00
|
|
|
{% endif %}
|
2016-04-29 13:59:28 -05:00
|
|
|
</p>
|
2016-05-05 00:46:11 -05:00
|
|
|
<p class="text-danger">This feature is experimental.</p>
|
2016-04-29 10:29:13 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-04-29 13:59:28 -05:00
|
|
|
</div>
|
2016-05-05 00:46:11 -05:00
|
|
|
{% if errors.all()|length > 0 %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
|
|
|
<div class="box box-danger">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">{{ 'errors'|_ }}</h3>
|
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<ul>
|
|
|
|
{% for key, err in errors.all() %}
|
|
|
|
<li class="text-danger">{{ err }}</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2016-04-29 13:59:28 -05:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">{{ 'transaction_meta_data'|_ }}</h3>
|
2016-04-29 10:29:13 -05:00
|
|
|
|
2016-04-29 13:59:28 -05:00
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
2016-04-29 10:29:13 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-04-29 13:59:28 -05:00
|
|
|
<div class="box-body">
|
2016-05-05 00:46:11 -05:00
|
|
|
{{ ExpandedForm.text('journal_description') }}
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ ExpandedForm.select('journal_currency_id', currencies, preFilled.journal_currency_id) }}
|
|
|
|
{{ ExpandedForm.staticText('journal_amount', preFilled.journal_amount|formatAmount) }}
|
|
|
|
<input type="hidden" name="journal_amount" value="{{ preFilled.journal_amount }}"/>
|
|
|
|
|
|
|
|
<!-- show source drop down box if withdrawal or transfer -->
|
|
|
|
{% if preFilled.what == 'withdrawal' or preFilled.what == 'transfer' %}
|
2016-05-13 00:33:04 -05:00
|
|
|
{{ ExpandedForm.select('journal_source_account_id', assetAccounts, preFilled.journal_source_account_id) }}
|
2016-04-29 13:59:28 -05:00
|
|
|
{% endif %}
|
2016-05-12 15:44:31 -05:00
|
|
|
<!-- show source text input if deposit: -->
|
|
|
|
{% if preFilled.what == 'deposit' %}
|
|
|
|
{{ ExpandedForm.text('journal_source_account_name', preFilled.journal_source_account_name) }}
|
2016-04-30 02:48:39 -05:00
|
|
|
{% endif %}
|
2016-05-12 15:44:31 -05:00
|
|
|
<!-- show destination drop down if transfer -->
|
|
|
|
{% if preFilled.what == 'transfer' %}
|
|
|
|
{{ ExpandedForm.select('journal_destination_account_id', assetAccounts, preFilled.journal_destination_account_id) }}
|
2016-04-29 13:59:28 -05:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2016-04-29 10:29:13 -05:00
|
|
|
</div>
|
2016-04-29 13:59:28 -05:00
|
|
|
</div>
|
|
|
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">{{ 'transaction_dates'|_ }}</h3>
|
2016-04-29 10:29:13 -05:00
|
|
|
|
2016-04-29 13:59:28 -05:00
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
2016-04-29 10:29:13 -05:00
|
|
|
</div>
|
2016-04-29 13:59:28 -05:00
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ ExpandedForm.date('date', preFilled.date) }}
|
2016-04-29 10:29:13 -05:00
|
|
|
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ ExpandedForm.date('interest_date', preFilled.interest_date) }}
|
2016-04-29 10:29:13 -05:00
|
|
|
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ ExpandedForm.date('book_date', preFilled.book_date) }}
|
2016-04-29 10:29:13 -05:00
|
|
|
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ ExpandedForm.date('process_date', preFilled.process_date) }}
|
2016-04-29 10:29:13 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-04-29 13:59:28 -05:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">{{ 'splits'|_ }}</h3>
|
2016-04-29 10:29:13 -05:00
|
|
|
|
2016-04-29 13:59:28 -05:00
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
2016-04-29 10:29:13 -05:00
|
|
|
</div>
|
2016-04-29 13:59:28 -05:00
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<p>
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ ('split_table_intro_'~preFilled.what)|_ }}
|
2016-04-29 13:59:28 -05:00
|
|
|
</p>
|
|
|
|
<table class="table table-bordered table-condensed table-striped split-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans('list.split_number') }}</th>
|
|
|
|
<th>{{ trans('list.description') }}</th>
|
|
|
|
<!-- split the source of a deposit -->
|
2016-04-30 02:48:39 -05:00
|
|
|
<!--
|
2016-05-12 15:44:31 -05:00
|
|
|
{% if preFilled.what == 'deposit' %}
|
2016-04-29 13:59:28 -05:00
|
|
|
<th>{{ trans('list.source') }}</th>
|
|
|
|
{% endif %}
|
2016-04-30 02:48:39 -05:00
|
|
|
-->
|
2016-04-29 13:59:28 -05:00
|
|
|
<!-- split where a withdrawal is going -->
|
2016-04-30 02:48:39 -05:00
|
|
|
<!-- split where a deposit is going -->
|
2016-05-12 15:44:31 -05:00
|
|
|
{% if preFilled.what == 'withdrawal' or preFilled.what == 'deposit' %}
|
2016-04-29 13:59:28 -05:00
|
|
|
<th>{{ trans('list.destination') }}</th>
|
|
|
|
{% endif %}
|
|
|
|
<th>{{ trans('list.amount') }}</th>
|
2016-05-12 15:44:31 -05:00
|
|
|
{% if preFilled.what == 'withdrawal' %}
|
2016-04-29 13:59:28 -05:00
|
|
|
<th>{{ trans('list.budget') }}</th>
|
|
|
|
{% endif %}
|
|
|
|
<th>{{ trans('list.category') }}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2016-05-12 15:44:31 -05:00
|
|
|
{% for index, descr in preFilled.description %}
|
2016-05-05 00:46:11 -05:00
|
|
|
<tr class="{% if loop.index == 1 %}initial-row{% else %}not-initial-row{% endif %}">
|
|
|
|
<td class="count">#{{ loop.index }}</td>
|
2016-04-29 13:59:28 -05:00
|
|
|
<td>
|
2016-05-05 00:46:11 -05:00
|
|
|
<input type="text" name="description[]" value="{{ descr }}" class="form-control"/>
|
2016-04-29 10:29:13 -05:00
|
|
|
</td>
|
2016-04-30 02:48:39 -05:00
|
|
|
|
2016-05-05 00:46:11 -05:00
|
|
|
<!-- withdrawal has several destination names. -->
|
2016-05-12 15:44:31 -05:00
|
|
|
{% if preFilled.what == 'withdrawal' %}
|
2016-05-05 00:46:11 -05:00
|
|
|
<td>
|
2016-05-12 15:44:31 -05:00
|
|
|
<input type="text" name="destination_account_name[]" value="{{ preFilled.destination_account_name[index] }}"
|
2016-05-05 00:46:11 -05:00
|
|
|
class="form-control"/>
|
|
|
|
</td>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<!-- deposit has several destination id's -->
|
2016-05-12 15:44:31 -05:00
|
|
|
{% if preFilled.what == 'deposit' %}
|
2016-05-05 00:46:11 -05:00
|
|
|
<td>
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ Form.select('destination_account_id[]', assetAccounts, preFilled.destination_account_id[index], {class: 'form-control'}) }}
|
2016-05-05 00:46:11 -05:00
|
|
|
</td>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
<td style="width:10%;">
|
2016-05-12 15:44:31 -05:00
|
|
|
<input type="number" name="amount[]" value="{{ preFilled.amount[index] }}"
|
2016-05-05 00:46:11 -05:00
|
|
|
class="form-control" autocomplete="off" step="any" min="0.01">
|
2016-04-29 10:29:13 -05:00
|
|
|
</td>
|
2016-05-12 15:44:31 -05:00
|
|
|
{% if preFilled.what == 'withdrawal' %}
|
2016-05-05 00:46:11 -05:00
|
|
|
<td>
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ Form.select('budget_id[]', budgets, preFilled.budget_id[index], {class: 'form-control'}) }}
|
2016-05-05 00:46:11 -05:00
|
|
|
</td>
|
|
|
|
{% endif %}
|
2016-04-29 13:59:28 -05:00
|
|
|
<td>
|
2016-05-12 15:44:31 -05:00
|
|
|
<input type="text" name="category[]" value="{{ preFilled.category[index] }}" class="form-control"/>
|
2016-04-29 13:59:28 -05:00
|
|
|
</td>
|
2016-05-05 00:46:11 -05:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2016-04-29 13:59:28 -05:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<p>
|
|
|
|
<br/>
|
|
|
|
<a href="#" class="btn btn-default btn-do-split"><i class="fa fa-plus-circle"></i> {{ 'add_another_split'|_ }}</a>
|
|
|
|
</p>
|
|
|
|
<p class="pull-right">
|
|
|
|
<button type="submit" id="transaction-btn" class="btn btn-success pull-right">
|
2016-05-12 15:44:31 -05:00
|
|
|
{{ ('store_splitted_'~preFilled.what)|_ }}
|
2016-04-29 13:59:28 -05:00
|
|
|
</button>
|
|
|
|
</p>
|
2016-04-29 10:29:13 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-04-29 13:59:28 -05:00
|
|
|
</div>
|
2016-04-29 10:29:13 -05:00
|
|
|
</form>
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
|
|
<script type="text/javascript">
|
2016-05-12 15:44:31 -05:00
|
|
|
var originalSum = {{ preFilled.journal_amount }};
|
|
|
|
var what = "{{ preFilled.what }}";
|
2016-04-29 10:29:13 -05:00
|
|
|
</script>
|
|
|
|
<script type="text/javascript" src="js/lib/bootstrap3-typeahead.min.js"></script>
|
|
|
|
<script type="text/javascript" src="js/ff/transactions/create-edit.js"></script>
|
2016-04-29 13:59:28 -05:00
|
|
|
<script type="text/javascript" src="js/ff/split/journal/from-store.js"></script>
|
2016-04-29 10:29:13 -05:00
|
|
|
{% endblock %}
|
|
|
|
{% block styles %}
|
|
|
|
{% endblock %}
|