@extends('layouts.master') @section('title') {{translate('edit loan')}} @endsection @section('content')
{{translate('edit loan')}}
{!! Form::open(array('url' => url('loan/'.$loan->id.'/update'), 'method' => 'post', 'class' => 'form-horizontal',"enctype"=>"multipart/form-data",'id'=>'loan_form')) !!}
{!! Form::label('borrower_id',translate('borrower')." *",array('class'=>'col-sm-3 control-label')) !!}
{!! Form::select('borrower_id',$borrowers,$loan->borrower_id, array('class' => ' select2 form-control', 'placeholder'=>"Select",'required'=>'required')) !!}
{!! Form::label('loan_officer_id',translate('loan_officer')." *",array('class'=>'col-sm-3 control-label')) !!}
{!! Form::select('loan_officer_id',$users,$loan->loan_officer_id, array('class' => ' select2 form-control', 'placeholder'=>"Select",'required'=>'required')) !!}
{!! Form::label('loan_product_id',translate('loan').' '.translate('product')." *",array('class'=>'col-sm-3 control-label')) !!}
{!! Form::select('loan_product_id',$loan_products,$loan->loan_product_id, array('class' => ' select2 form-control', 'placeholder'=>"Select",'required'=>'required','id'=>'loanProduct')) !!}
{!! Form::label('principal',translate('principal').' '.translate('amount')." *",array('class'=>'col-sm-3 control-label')) !!}
{!! Form::text('principal',$loan->principal, array('class' => 'form-control touchspin', 'placeholder'=>"",'required'=>'required')) !!}

{{translate('duration')}}:

{!! Form::label('loan_duration',translate('loan').' '.translate('duration')." *",array('class'=>'col-sm-3 control-label')) !!}
{!! Form::number('loan_duration',$loan->loan_duration, array('class' => 'form-control', 'placeholder'=>"5",'required'=>'required')) !!}
{!! Form::select('loan_duration_type',array('day'=>translate('day').'(s)','week'=>translate('week').'(s)','month'=>translate('month').'(s)','year'=>translate('year').'(s)'),$loan->loan_duration_type, array('class' => 'form-control', 'placeholder'=>"","id"=>"inputMaxInterestPeriod",'required'=>'required')) !!}
{!! Form::label('repayment_cycle',translate('repayment_cycle')." *",array('class'=>'col-sm-3 control-label')) !!}
{!! Form::select('repayment_cycle',array('daily'=>translate('daily'),'weekly'=>translate('weekly'),'monthly'=>translate('monthly'),'bi_monthly'=>translate('bi_monthly'),'quarterly'=>translate('quarterly'),'semi_annual'=>translate('semi_annually'),'annual'=>translate('annual')),$loan->repayment_cycle, array('class' => 'form-control', 'placeholder'=>"","id"=>"",'required'=>'required')) !!}
{!! Form::label('release_date',translate('loan').' '.translate('disbursement').' '.translate('date')." *",array('class'=>'col-sm-3 control-label')) !!}
{!! Form::text('release_date',$loan->release_date, array('class' => 'form-control date-picker', 'placeholder'=>"yyyy-mm-dd",'required'=>'required','id'=>'releaseDate')) !!}
{!! Form::label('first_payment_date',translate('first').' '.translate('repayment').' '.translate('date')." *",array('class'=>'col-sm-3 control-label')) !!}
{!! Form::text('first_payment_date',$loan->first_payment_date, array('class' => 'form-control date-picker', 'placeholder'=>"yyyy-mm-dd",''=>'','id'=>'firstPayment')) !!}
{!! Form::label('interest_method',translate('interest').' '.translate('method')." *",array('class'=>'col-sm-3 control-label')) !!}
{!! Form::select('interest_method',array('flat_rate'=>translate('flat_rate'),'declining_balance_equal_installments'=>translate('declining_balance_equal_installments'),'declining_balance_equal_principal'=>translate('declining_balance_equal_principal'),'interest_only'=>translate('interest_only')),$loan->interest_method, array('class' => 'form-control', 'placeholder'=>"Select",'required'=>'required')) !!}
{!! Form::label('interest_rate',translate('loan').' '.translate('interest').' (%) *',array('class'=>'col-sm-3 control-label')) !!}
{!! Form::text('interest_rate',$loan->interest_rate, array('class' => 'form-control touchspin', 'placeholder'=>"",'required'=>'required')) !!}
{!! Form::select('interest_period',array('day'=>translate('per_day'),'week'=>translate('per_week'),'month'=>translate('per_month'),'year'=>translate('per_year')),$loan->interest_period, array('class' => 'form-control', 'placeholder'=>"Select","id"=>"inputDefaultInterestPeriod",'required'=>'required')) !!}
{!! Form::label('pay_off_interest_rate',translate('loan').' '.translate('pay_off_interest_rate').' (%) *',array('class'=>'col-sm-3 control-label')) !!}
{!! Form::text('pay_off_interest_rate',$loan->pay_off_interest_rate, array('class' => 'form-control touchspin', 'placeholder'=>"",'required'=>'required')) !!}
{!! Form::label('decimal_places',translate('decimal_place'),array('class'=>'col-sm-3 control-label')) !!}
{!! Form::select('decimal_places',array('round_off_to_two_decimal'=>translate('round_off_to_two_decimal'),'round_off_to_integer'=>translate('round_off_to_integer')),$loan->decimal_places, array('class' => 'form-control', 'placeholder'=>"","id"=>"",'required'=>'required')) !!}

{!! Form::label('description',translate('description'),array('class'=>'col-sm-3 control-label')) !!}
{!! Form::textarea('description',$loan->description, array('class' => 'form-control', 'rows'=>"3")) !!}
{!! Form::label('files',translate('loan').' '.translate('file').'('.translate('borrower_file_types').')',array('class'=>'col-sm-3 control-label')) !!}
{!! Form::file('files[]', array('class' => 'form-control file-styled', 'multiple'=>"multiple")) !!}
@foreach(unserialize($loan->files) as $key=>$value) {!! $value!!}
@endforeach
@foreach($loan->loan_product->charges as $key) @if(!empty($key->charge))
{{translate('name')}} {{translate('type')}} {{translate('amount')}} {{translate('collected on')}} {{translate('date')}}
{{ $key->charge->name }} @if($key->charge->charge_option=="fixed") {{translate('fixed')}} @endif @if($key->charge->charge_option=="principal_due") % {{translate('principal due')}} @endif @if($key->charge->charge_option=="principal_interest") % {{translate('principal')}} + {{translate('interest due')}} @endif @if($key->charge->charge_option=="interest_due") % {{translate('interest due')}} @endif @if($key->charge->charge_option=="total_due") % {{translate('total due')}} @endif @if($key->charge->charge_option=="original_principal") % {{translate('original principal')}} @endif