| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  | @extends('layouts.default') | 
					
						
							|  |  |  | @section('content') | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  | {!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $journal) !!} | 
					
						
							|  |  |  | {!! Form::open(['class' => 'form-horizontal','id' => 'update','url' => route('transactions.update',$journal->id)]) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  | <input type="hidden" name="id" value="{{$journal->id}}" /> | 
					
						
							|  |  |  | <input type="hidden" name="what" value="{{$what}}" /> | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | <div class="row"> | 
					
						
							|  |  |  |     <div class="col-lg-6 col-md-12 col-sm-12"> | 
					
						
							|  |  |  |     <!-- panel for mandatory fields --> | 
					
						
							|  |  |  |             <div class="panel panel-primary"> | 
					
						
							|  |  |  |                 <div class="panel-heading"> | 
					
						
							|  |  |  |                     <i class="fa fa-exclamation-circle"></i> Mandatory fields | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |                 <div class="panel-body"> | 
					
						
							|  |  |  |                     <!-- ALWAYS AVAILABLE --> | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                     {!! ExpandedForm::text('description',$journal->description) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |                     <!-- SHOW ACCOUNT (FROM) ONLY FOR WITHDRAWALS AND DEPOSITS --> | 
					
						
							|  |  |  |                     @if($what == 'deposit' || $what == 'withdrawal') | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                         {!! ExpandedForm::select('account_id',$accounts,$data['account_id']) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  |                     @endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- SHOW EXPENSE ACCOUNT ONLY FOR WITHDRAWALS --> | 
					
						
							|  |  |  |                     @if($what == 'withdrawal') | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                         {!! ExpandedForm::text('expense_account',$data['expense_account']) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  |                     @endif | 
					
						
							|  |  |  |                     <!-- SHOW REVENUE ACCOUNT ONLY FOR DEPOSITS --> | 
					
						
							|  |  |  |                     @if($what == 'deposit') | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                         {!! ExpandedForm::text('revenue_account',$data['revenue_account']) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  |                     @endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- ONLY SHOW FROM/TO ACCOUNT WHEN CREATING TRANSFER --> | 
					
						
							|  |  |  |                     @if($what == 'transfer') | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                         {!! ExpandedForm::select('account_from_id',$accounts,$data['account_from_id']) !!} | 
					
						
							|  |  |  |                         {!! ExpandedForm::select('account_to_id',$accounts,$data['account_to_id']) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  |                     @endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <!-- ALWAYS SHOW AMOUNT --> | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                     {!! ExpandedForm::amount('amount',$data['amount'],['currency' => $journal->transactionCurrency]) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |                     <!-- ALWAYS SHOW DATE --> | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                     {!! ExpandedForm::date('date',$data['date']) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  |             </div> | 
					
						
							|  |  |  |         </div> <!-- close panel --> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         <p> | 
					
						
							|  |  |  |             <button type="submit" class="btn btn-lg btn-success"> | 
					
						
							|  |  |  |                 <i class="fa fa-plus-circle"></i> Update {{{$what}}} | 
					
						
							|  |  |  |             </button> | 
					
						
							|  |  |  |         </p> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |     <div class="col-lg-6 col-md-12 col-sm-12"> | 
					
						
							|  |  |  |         <!-- panel for optional fields --> | 
					
						
							|  |  |  |         <div class="panel panel-default"> | 
					
						
							|  |  |  |             <div class="panel-heading"> | 
					
						
							|  |  |  |                 <i class="fa fa-smile-o"></i> Optional fields | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |             <div class="panel-body"> | 
					
						
							|  |  |  |                 <!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL --> | 
					
						
							|  |  |  |                 @if($what == 'withdrawal') | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                     {!! ExpandedForm::select('budget_id',$budgets,$data['budget_id']) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  |                 @endif | 
					
						
							|  |  |  |                 <!-- CATEGORY ALWAYS --> | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                 {!! ExpandedForm::text('category',$data['category']) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 <!-- TAGS --> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 <!-- RELATE THIS TRANSFER TO A PIGGY BANK --> | 
					
						
							|  |  |  |                 @if($what == 'transfer' && count($piggies) > 0) | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                     {!! ExpandedForm::select('piggy_bank_id',$piggies,$data['piggy_bank_id']) !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  |                 @endif | 
					
						
							|  |  |  |                     </div> | 
					
						
							|  |  |  |             </div><!-- end of panel for options--> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             <!-- panel for options --> | 
					
						
							|  |  |  |             <div class="panel panel-default"> | 
					
						
							|  |  |  |                 <div class="panel-heading"> | 
					
						
							|  |  |  |                     <i class="fa fa-bolt"></i> Options | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |                 <div class="panel-body"> | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  |                     {!! ExpandedForm::optionsList('update','transaction') !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  |                 </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |         </div> | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  | {!! Form::close() !!} | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @stop | 
					
						
							|  |  |  | @section('scripts') | 
					
						
							| 
									
										
										
										
											2015-02-27 14:27:04 +01:00
										 |  |  | <script type="text/javascript" src="js/bootstrap3-typeahead.min.js"></script> | 
					
						
							|  |  |  | <script type="text/javascript" src="js/transactions.js"></script> | 
					
						
							| 
									
										
										
										
											2015-02-23 21:55:52 +01:00
										 |  |  | @stop |