| 
									
										
										
										
											2016-11-06 08:11:43 +01:00
										 |  |  | {% extends "./layout/default" %}
 | 
					
						
							| 
									
										
										
										
											2015-06-19 20:59:14 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | {% block breadcrumbs %}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  |     {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, what) }}
 | 
					
						
							| 
									
										
										
										
											2015-06-19 20:59:14 +02:00
										 |  |  | {% endblock %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% block content %}
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |     <form method="POST" action="{{ route('transactions.store',what) }}" accept-charset="UTF-8" class="form-horizontal" id="store" enctype="multipart/form-data">
 | 
					
						
							|  |  |  |         <input name="_token" type="hidden" value="{{ csrf_token() }}">
 | 
					
						
							|  |  |  |         <input type="hidden" name="what" value="{{ what }}"/>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         <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">
 | 
					
						
							|  |  |  |                         <div class="form-group">
 | 
					
						
							|  |  |  |                             <label class="col-sm-4 control-label">Quickswitch</label>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                             <div class="col-sm-8">
 | 
					
						
							|  |  |  |                                 <div class="btn-group btn-group-justified">
 | 
					
						
							|  |  |  |                                     <a href="#" data-what="withdrawal" class="switch btn btn-default"> {{ 'withdrawal'|_ }}</a>
 | 
					
						
							|  |  |  |                                     <a href="#" data-what="deposit" class="switch btn btn-default"> {{ 'deposit'|_ }}</a>
 | 
					
						
							|  |  |  |                                     <a href="#" data-what="transfer" class="switch btn btn-default">{{ 'transfer'|_ }}</a>
 | 
					
						
							|  |  |  |                                 </div>
 | 
					
						
							| 
									
										
										
										
											2015-06-03 17:32:50 +02:00
										 |  |  |                             </div>
 | 
					
						
							| 
									
										
										
										
											2015-06-27 08:06:24 +02:00
										 |  |  |                         </div>
 | 
					
						
							| 
									
										
										
										
											2015-06-03 17:32:50 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                         {# DESCRIPTION IS ALWAYS AVAILABLE #}
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |                         {{ ExpandedForm.text('description') }}
 | 
					
						
							| 
									
										
										
										
											2015-06-03 17:32:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                         {# SELECTABLE SOURCE ACCOUNT ONLY FOR WITHDRAWALS AND TRANSFERS #}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.select('source_account_id', assetAccounts, null, {label: trans('form.asset_source_account')}) }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                         {# FREE FORMAT SOURCE ACCOUNT ONLY FOR DEPOSITS #}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.text('source_account_name', null, {label: trans('form.revenue_account')}) }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                         {# FREE FORMAT DESTINATION ACCOUNT ONLY FOR EXPENSES #}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.text('destination_account_name', null, {label: trans('form.expense_account')}) }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                         {# SELECTABLE DESTINATION ACCOUNT ONLY FOR TRANSFERS AND DEPOSITS #}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.select('destination_account_id', assetAccounts, null, {label: trans('form.asset_destination_account')} ) }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                         {# ALWAYS SHOW AMOUNT #}
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |                         {{ ExpandedForm.amount('amount') }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |                         <!-- ALWAYS SHOW DATE -->
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.date('date', phpdate('Y-m-d')) }}
 | 
					
						
							|  |  |  |                     </div>
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                     <div class="box-footer">
 | 
					
						
							|  |  |  |                         <button type="submit" id="transaction-btn" class="btn btn-success pull-right">
 | 
					
						
							|  |  |  |                             {{ trans('form.store_new_'~what) }}
 | 
					
						
							|  |  |  |                         </button>
 | 
					
						
							|  |  |  |                     </div>
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  |                 </div>
 | 
					
						
							|  |  |  |             </div>
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |             <div class="col-lg-6 col-md-12 col-sm-12">
 | 
					
						
							|  |  |  |                 <div class="box">
 | 
					
						
							|  |  |  |                     <div class="box-header with-border">
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                         <h3 class="box-title">{{ 'optional_field_meta_data'|_ }}</h3>
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |                     </div>
 | 
					
						
							|  |  |  |                     <div class="box-body">
 | 
					
						
							|  |  |  |                         <!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
 | 
					
						
							| 
									
										
										
										
											2016-04-29 11:34:48 +02:00
										 |  |  |                         {% if budgets|length > 1 %}
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {{ ExpandedForm.select('budget_id', budgets, 0) }}
 | 
					
						
							| 
									
										
										
										
											2016-04-18 19:55:48 +02:00
										 |  |  |                         {% else %}
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {{ ExpandedForm.select('budget_id', budgets, 0, {helpText: trans('firefly.no_budget_pointer')}) }}
 | 
					
						
							| 
									
										
										
										
											2016-04-18 19:55:48 +02:00
										 |  |  |                         {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |                         <!-- CATEGORY ALWAYS -->
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.text('category') }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |                         <!-- TAGS -->
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.text('tags') }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |                         <!-- RELATE THIS TRANSFER TO A PIGGY BANK -->
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                         {{ ExpandedForm.select('piggy_bank_id', piggies) }}
 | 
					
						
							| 
									
										
										
										
											2015-07-17 21:45:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                     </div>
 | 
					
						
							|  |  |  |                 </div>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 <!-- explain if necessary -->
 | 
					
						
							|  |  |  |                 {% if | 
					
						
							|  |  |  |                 not optionalFields.interest_date or
 | 
					
						
							|  |  |  |                 not optionalFields.book_date or
 | 
					
						
							|  |  |  |                 not optionalFields.process_date or
 | 
					
						
							|  |  |  |                 not optionalFields.due_date or
 | 
					
						
							|  |  |  |                 not optionalFields.payment_date or
 | 
					
						
							| 
									
										
										
										
											2016-09-10 18:36:52 +02:00
										 |  |  |                 not optionalFields.invoice_date or
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                 not optionalFields.internal_reference or
 | 
					
						
							|  |  |  |                 not optionalFields.notes or
 | 
					
						
							| 
									
										
										
										
											2016-10-14 17:14:54 +02:00
										 |  |  |                 not optionalFields.attachments %}
 | 
					
						
							|  |  |  |                     <p class="text-center text-success"><i class="fa fa-info-circle" aria-hidden="true"></i>
 | 
					
						
							| 
									
										
										
										
											2016-12-05 21:58:23 +01:00
										 |  |  |                         <em>{{ trans('firefly.hidden_fields_preferences', {link: route('preferences.index')})|raw }}</em></p>
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                 {% endif %}
 | 
					
						
							| 
									
										
										
										
											2016-10-21 21:41:31 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                 <!-- box for dates -->
 | 
					
						
							| 
									
										
										
										
											2016-09-10 18:36:52 +02:00
										 |  |  |                 {% if | 
					
						
							| 
									
										
										
										
											2016-10-14 17:14:54 +02:00
										 |  |  |                 optionalFields.interest_date or optionalFields.book_date or optionalFields.process_date
 | 
					
						
							|  |  |  |                 or optionalFields.due_date or optionalFields.payment_date
 | 
					
						
							|  |  |  |                 or optionalFields.invoice_date %}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                     <div class="box">
 | 
					
						
							|  |  |  |                         <div class="box-header with-border">
 | 
					
						
							|  |  |  |                             <h3 class="box-title">{{ 'optional_field_meta_dates'|_ }}</h3>
 | 
					
						
							|  |  |  |                         </div>
 | 
					
						
							|  |  |  |                         <div class="box-body">
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {# INTEREST DATE #}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                             {% if optionalFields.interest_date %}
 | 
					
						
							|  |  |  |                                 {{ ExpandedForm.date('interest_date') }}
 | 
					
						
							|  |  |  |                             {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {# BOOK DATE #}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                             {% if optionalFields.book_date %}
 | 
					
						
							|  |  |  |                                 {{ ExpandedForm.date('book_date') }}
 | 
					
						
							|  |  |  |                             {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {# PROCESSING DATE #}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                             {% if optionalFields.process_date %}
 | 
					
						
							|  |  |  |                                 {{ ExpandedForm.date('process_date') }}
 | 
					
						
							|  |  |  |                             {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {# DUE DATE #}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                             {% if optionalFields.due_date %}
 | 
					
						
							|  |  |  |                                 {{ ExpandedForm.date('due_date') }}
 | 
					
						
							|  |  |  |                             {% endif %}
 | 
					
						
							| 
									
										
										
										
											2015-06-20 21:55:55 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {# PAYMENT DATE #}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                             {% if optionalFields.payment_date %}
 | 
					
						
							|  |  |  |                                 {{ ExpandedForm.date('payment_date') }}
 | 
					
						
							|  |  |  |                             {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {# INVOICE DATE #}
 | 
					
						
							| 
									
										
										
										
											2016-09-10 18:36:52 +02:00
										 |  |  |                             {% if optionalFields.invoice_date %}
 | 
					
						
							|  |  |  |                                 {{ ExpandedForm.date('invoice_date') }}
 | 
					
						
							|  |  |  |                             {% endif %}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                         </div>
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |                     </div>
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                 {% endif %}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                 <!-- box for business fields -->
 | 
					
						
							|  |  |  |                 {% if optionalFields.internal_reference or optionalFields.notes %}
 | 
					
						
							|  |  |  |                     <div class="box">
 | 
					
						
							|  |  |  |                         <div class="box-header with-border">
 | 
					
						
							|  |  |  |                             <h3 class="box-title">{{ 'optional_field_meta_business'|_ }}</h3>
 | 
					
						
							|  |  |  |                         </div>
 | 
					
						
							|  |  |  |                         <div class="box-body">
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |                             {# REFERENCE #}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                             {% if optionalFields.internal_reference %}
 | 
					
						
							|  |  |  |                                 {{ ExpandedForm.text('internal_reference') }}
 | 
					
						
							|  |  |  |                             {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {# NOTES #}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                             {% if optionalFields.notes %}
 | 
					
						
							|  |  |  |                                 {{ ExpandedForm.textarea('notes') }}
 | 
					
						
							|  |  |  |                             {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                         </div>
 | 
					
						
							|  |  |  |                     </div>
 | 
					
						
							|  |  |  |                 {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 <!-- box for attachments -->
 | 
					
						
							|  |  |  |                 {% if optionalFields.attachments %}
 | 
					
						
							|  |  |  |                     <div class="box">
 | 
					
						
							|  |  |  |                         <div class="box-header with-border">
 | 
					
						
							|  |  |  |                             <h3 class="box-title">{{ 'optional_field_attachments'|_ }}</h3>
 | 
					
						
							|  |  |  |                         </div>
 | 
					
						
							|  |  |  |                         <div class="box-body">
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |                             {# ATTACHMENTS #}
 | 
					
						
							| 
									
										
										
										
											2016-09-04 16:21:51 +02:00
										 |  |  |                             {% if optionalFields.attachments %}
 | 
					
						
							|  |  |  |                                 {{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
 | 
					
						
							|  |  |  |                             {% endif %}
 | 
					
						
							|  |  |  |                         </div>
 | 
					
						
							|  |  |  |                     </div>
 | 
					
						
							|  |  |  |                 {% endif %}
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 <!-- 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('create','transaction') }}
 | 
					
						
							|  |  |  |                     </div>
 | 
					
						
							|  |  |  |                     <div class="box-footer">
 | 
					
						
							|  |  |  |                         <button type="submit" id="transaction-btn" class="btn btn-success pull-right">
 | 
					
						
							|  |  |  |                             {{ trans('form.store_new_'~what) }}
 | 
					
						
							|  |  |  |                         </button>
 | 
					
						
							|  |  |  |                     </div>
 | 
					
						
							| 
									
										
										
										
											2015-06-20 21:55:55 +02:00
										 |  |  |                 </div>
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  |             </div>
 | 
					
						
							| 
									
										
										
										
											2016-10-21 19:06:22 +02:00
										 |  |  |             #}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  |         </div>
 | 
					
						
							| 
									
										
										
										
											2015-07-18 08:59:33 +02:00
										 |  |  |     </form>
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | {% endblock %}
 | 
					
						
							|  |  |  | {% block scripts %}
 | 
					
						
							|  |  |  |     <script type="text/javascript">
 | 
					
						
							|  |  |  |         var what = "{{ what }}";
 | 
					
						
							| 
									
										
										
										
											2015-06-03 17:32:50 +02:00
										 |  |  |         var piggiesLength = {{ piggies|length }};
 | 
					
						
							|  |  |  |         var doSwitch = true;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // some titles and names:
 | 
					
						
							|  |  |  |         var txt = [];
 | 
					
						
							|  |  |  |         var title = [];
 | 
					
						
							|  |  |  |         var breadcrumbs = [];
 | 
					
						
							|  |  |  |         var middleCrumbName = [];
 | 
					
						
							|  |  |  |         var middleCrumbUrl = [];
 | 
					
						
							|  |  |  |         var button = [];
 | 
					
						
							|  |  |  |         {% for type in {0:'withdrawal',1:'deposit',2:'transfer'} %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         txt['{{ type }}'] = '{{ type|_ }}';
 | 
					
						
							|  |  |  |         title['{{ type }}'] = '{{ trans('form.add_new_' ~ type) }}';
 | 
					
						
							|  |  |  |         breadcrumbs['{{ type }}'] = '{{ trans('breadcrumbs.create_' ~ type) }}';
 | 
					
						
							|  |  |  |         middleCrumbName['{{ type }}'] = '{{ trans('breadcrumbs.' ~ type ~ '_list') }}';
 | 
					
						
							|  |  |  |         middleCrumbUrl['{{ type }}'] = '{{ route('transactions.index', type) }}';
 | 
					
						
							|  |  |  |         button['{{ type }}'] = '{{ trans('form.store_new_' ~ type) }}';
 | 
					
						
							|  |  |  |         {% endfor %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +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/create.js"></script>
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | {% endblock %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% block styles %}
 | 
					
						
							|  |  |  |     <link href="css/bootstrap-tagsinput.css" type="text/css" rel="stylesheet" media="all">
 | 
					
						
							|  |  |  | {% endblock %}
 |