| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  | {% extends "./layout/default.twig" %}
 | 
					
						
							|  |  |  | {% block content %}
 | 
					
						
							|  |  |  |     {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, what) }}
 | 
					
						
							|  |  |  |     {{ Form.open({'class' : 'form-horizontal','id' : 'store','url' : route('transactions.store',what)}) }}
 | 
					
						
							|  |  |  |     <input type="hidden" name="reminder_id" value="{{ Input.get('reminder_id') }}" />
 | 
					
						
							|  |  |  |     <input type="hidden" name="what" value="{{ what }}" />
 | 
					
						
							|  |  |  |     <div class="row">
 | 
					
						
							|  |  |  |         <div class="col-lg-6 col-md-12 col-sm-12">
 | 
					
						
							|  |  |  |             <div class="panel panel-primary">
 | 
					
						
							|  |  |  |                 <div class="panel-heading">
 | 
					
						
							| 
									
										
										
										
											2015-05-09 22:42:45 +02:00
										 |  |  |                     <i class="fa fa-exclamation-circle"></i> {{ 'mandatoryFields'|_ }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  |                 </div>
 | 
					
						
							|  |  |  |                 <div class="panel-body">
 | 
					
						
							|  |  |  |                     <!-- DESCRIPTION ALWAYS AVAILABLE -->
 | 
					
						
							|  |  |  |                     {{ ExpandedForm.text('description') }}
 | 
					
						
							|  |  |  |                     {% if what == 'deposit' or what == 'withdrawal' %}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.select('account_id',accounts) }}
 | 
					
						
							|  |  |  |                     {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- SHOW EXPENSE ACCOUNT ONLY FOR WITHDRAWALS -->
 | 
					
						
							|  |  |  |                     {% if what == 'withdrawal' %}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.text('expense_account') }}
 | 
					
						
							|  |  |  |                     {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- SHOW REVENUE ACCOUNT ONLY FOR DEPOSITS -->
 | 
					
						
							|  |  |  |                     {% if what == 'deposit' %}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.text('revenue_account') }}
 | 
					
						
							|  |  |  |                     {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- ONLY SHOW FROM/TO ACCOUNT WHEN CREATING TRANSFER -->
 | 
					
						
							|  |  |  |                     {% if what == 'transfer' %}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.select('account_from_id',accounts) }}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.select('account_to_id',accounts) }}
 | 
					
						
							|  |  |  |                     {% endif %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- ALWAYS SHOW AMOUNT -->
 | 
					
						
							|  |  |  |                     {{ ExpandedForm.amount('amount') }}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- ALWAYS SHOW DATE -->
 | 
					
						
							|  |  |  |                     {{ ExpandedForm.date('date', phpdate('Y-m-d')) }}
 | 
					
						
							|  |  |  |                 </div>
 | 
					
						
							|  |  |  |             </div>
 | 
					
						
							|  |  |  |         </div>
 | 
					
						
							|  |  |  |         <div class="col-lg-6 col-md-12 col-sm-12">
 | 
					
						
							|  |  |  |             <div class="panel panel-default">
 | 
					
						
							|  |  |  |                 <div class="panel-heading">
 | 
					
						
							| 
									
										
										
										
											2015-05-09 22:42:45 +02:00
										 |  |  |                     <i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  |                 </div>
 | 
					
						
							|  |  |  |                 <div class="panel-body">
 | 
					
						
							|  |  |  |                     <!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
 | 
					
						
							|  |  |  |                     {% if what == 'withdrawal' %}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.select('budget_id',budgets,0) }}
 | 
					
						
							|  |  |  |                     {% endif %}
 | 
					
						
							|  |  |  |                     <!-- CATEGORY ALWAYS -->
 | 
					
						
							|  |  |  |                     {{ ExpandedForm.text('category') }}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- TAGS -->
 | 
					
						
							|  |  |  |                     {{ ExpandedForm.text('tags') }}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- RELATE THIS TRANSFER TO A PIGGY BANK -->
 | 
					
						
							|  |  |  |                     {% if what == 'withdrawal' and piggies|length > 0 %}
 | 
					
						
							|  |  |  |                         {{ ExpandedForm.select('piggy_bank_id',piggies) }}
 | 
					
						
							|  |  |  |                     {% endif %}
 | 
					
						
							|  |  |  |                 </div>
 | 
					
						
							|  |  |  |             </div>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             <!-- panel for options -->
 | 
					
						
							|  |  |  |             <div class="panel panel-default">
 | 
					
						
							|  |  |  |                 <div class="panel-heading">
 | 
					
						
							| 
									
										
										
										
											2015-05-09 22:42:45 +02:00
										 |  |  |                     <i class="fa fa-bolt"></i> {{ 'options'|_ }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  |                 </div>
 | 
					
						
							|  |  |  |                 <div class="panel-body">
 | 
					
						
							|  |  |  |                     {{ ExpandedForm.optionsList('create','transaction') }}
 | 
					
						
							|  |  |  |                 </div>
 | 
					
						
							|  |  |  |             </div>
 | 
					
						
							|  |  |  |         </div>
 | 
					
						
							|  |  |  |     </div>
 | 
					
						
							|  |  |  |     <div class="row">
 | 
					
						
							|  |  |  |         <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
 | 
					
						
							|  |  |  |             <p>
 | 
					
						
							|  |  |  |                 <button type="submit" class="btn btn-lg btn-success">
 | 
					
						
							| 
									
										
										
										
											2015-05-14 19:44:20 +02:00
										 |  |  |                     <i class="fa fa-plus-circle"></i> {{ trans('form.store_new_'~what) }}
 | 
					
						
							| 
									
										
										
										
											2015-05-02 19:19:47 +02:00
										 |  |  |                 </button>
 | 
					
						
							|  |  |  |             </p>
 | 
					
						
							|  |  |  |         </div>
 | 
					
						
							|  |  |  |     </div>
 | 
					
						
							|  |  |  | </form>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% endblock %}
 | 
					
						
							|  |  |  | {% block scripts %}
 | 
					
						
							|  |  |  |     <script type="text/javascript">
 | 
					
						
							|  |  |  |         var what = "{{ what }}";
 | 
					
						
							|  |  |  |     </script>
 | 
					
						
							|  |  |  |     <script type="text/javascript" src="js/bootstrap3-typeahead.min.js"></script>
 | 
					
						
							|  |  |  |     <script type="text/javascript" src="js/bootstrap-tagsinput.min.js"></script>
 | 
					
						
							|  |  |  |     <script type="text/javascript" src="js/transactions.js"></script>
 | 
					
						
							|  |  |  | {% endblock %}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% block styles %}
 | 
					
						
							|  |  |  |     <link href="css/bootstrap-tagsinput.css" type="text/css" rel="stylesheet" media="all">
 | 
					
						
							|  |  |  | {% endblock %}
 |