@extends('layouts.master') @section('title') {{translate('edit expense')}} @endsection @section('content')
{{translate('edit expense')}}
{!! Form::open(array('url' => url('expense/'.$expense->id.'/update'), 'method' => 'post','class'=>'', 'name' => 'form',"enctype"=>"multipart/form-data")) !!}
{!! Form::label('expense_type_id',translate('expense').' '.translate('type'),array('class'=>' control-label')) !!} {!! Form::select('expense_type_id',$types,$expense->expense_type_id, array('class' => 'form-control','required'=>'required')) !!}
{!! Form::label('amount',translate('expense').' '.translate('amount'),array('class'=>'')) !!} {!! Form::text('amount',$expense->amount, array('class' => 'form-control touchspin', 'placeholder'=>"",'required'=>'required')) !!}
{!! Form::label('account_id',translate('account from'),array('class'=>' control-label')) !!} {!! Form::select('account_id',$chart_assets,$expense->account_id, array('class' => 'form-control select2','placeholder'=>"",'required'=>'required')) !!}
{!! Form::label('date',translate('date'),array('class'=>'')) !!} {!! Form::text('date',$expense->date, array('class' => 'form-control date-picker', 'placeholder'=>"",'required'=>'required')) !!}
{!! Form::label('Recurring',translate('is_expenses_recurring'),array('class'=>'active')) !!} {!! Form::select('recurring', array('1'=>translate('yes'),'0'=>translate('no')),$expense->recurring, array('class' => 'form-control','id'=>'recurring')) !!}
{!! Form::label('recur_frequency',translate('recur_frequency'),array('class'=>'')) !!} {!! Form::number('recur_frequency',$expense->recur_frequency, array('class' => 'form-control','id'=>'recurF')) !!}
{!! Form::label('recur_type',translate('recur_type'),array('class'=>'active')) !!} {!! Form::select('recur_type', array('day'=>'Day(s)','week'=>'Week(s)','month'=>'Month(s)','year'=>'Year(s)'),$expense->recur_type, array('class' => 'form-control','id'=>'recurT')) !!}
{!! Form::label('recur_start_date',translate('recur_starts'),array('class'=>'')) !!} {!! Form::text('recur_start_date',$expense->recur_start_date, array('class' => 'form-control date-picker','id'=>'recur_start_date')) !!}
{!! Form::label('recur_end_date',translate('recur_ends'),array('class'=>'')) !!} {!! Form::text('recur_end_date',$expense->recur_end_date, array('class' => 'form-control date-picker','id'=>'recur_end_date')) !!}
{!! Form::label('notes',translate('description'),array('class'=>'')) !!} {!! Form::textarea('notes',$expense->notes, array('class' => 'form-control','rows'=>'3')) !!}
{!! Form::label('files',translate('file').'('.translate('borrower_file_types').')',array('class'=>'')) !!} {!! Form::file('files[]', array('class' => 'form-control', 'multiple'=>"",'rows'=>'3')) !!}
@foreach(unserialize($expense->files) as $key=>$value) {!! $value!!}
@endforeach

{{translate('custom_field')}}

@foreach($custom_fields as $key)
{!! Form::label($key->id,$key->name,array('class'=>'')) !!} @if($key->field_type=="number") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$expense->id)->where('category','expenses')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$expense->id)->where('category','expenses')->first()->name}} @endif"> @endif @if($key->field_type=="textfield") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$expense->id)->where('category','expenses')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$expense->id)->where('category','expenses')->first()->name}} @endif"> @endif @if($key->field_type=="date") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$expense->id)->where('category','expenses')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$expense->id)->where('category','expenses')->first()->name}} @endif"> @endif @if($key->field_type=="textarea") @endif @if($key->field_type=="decimal") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$expense->id)->where('category','expenses')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$expense->id)->where('category','expenses')->first()->name}} @endif"> @endif
@endforeach
{!! Form::close() !!}
@endsection @section('footer-scripts') @endsection