@extends('_version_02.commons.layouts.admin') @section('content') {!! Form::model($model, ['class'=>'form-horizontal']) !!} @include('_version_02.commons.layouts.partials._alert')

{{App\Language::trans('Refunds')}}

{!! Form::label('type', App\Language::trans('Type'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('type', App\Setting::payment_received_type(), null, ['class'=>'form-control','autofocus','required','onchange'=>'init_payment_received_type_handle(this)']) !!} {!!$errors->first('type', '')!!}
{!! Form::label('customer_id', App\Language::trans('Customer'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('customer_id', App\Customer::combobox(), null, ['class'=>'form-control','autofocus','required','onchange'=>'init_customer_info(this)']) !!} {!!$errors->first('customer_id', '')!!}
{!! Form::label('name', App\Language::trans('Customer Name'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('name', null, ['class'=>'form-control','required']) !!} {!!$errors->first('name', '')!!}
{!! Form::label('payment_from_account', App\Language::trans('Payment From'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('payment_from_account', App\Setting::bank_or_cash_combobox(), null, ['class'=>'form-control','autofocus','required','onchange'=>'init_customer_info(this)']) !!} {!!$errors->first('payment_from_account', '')!!}
{!! Form::label('amount', App\Language::trans('Amount'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('amount', null, ['class'=>'form-control','autofocus','required', 'onkeydown'=>'numeric_input_only(this)']) !!} {!!$errors->first('amount', '')!!}
{!! Form::label('currency_id', App\Language::trans('Currency'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('currency_id', App\Currency::combobox(), null, ['class'=>'form-control','autofocus','required']) !!} {!!$errors->first('currency_id', '')!!}
{!! Form::label('currency_rate', App\Language::trans('Currency Rate'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('currency_rate', null, ['class'=>'form-control','autofocus','required']) !!} {!!$errors->first('currency_rate', '')!!}
{!! Form::label('document_no', App\Language::trans('Payment No.'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('document_no', null, ['class'=>'form-control','autofocus','required']) !!} {!!$errors->first('document_no', '')!!}
{!! Form::label('document_date', App\Language::trans('Document Date'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('document_date', null, ['class'=>'form-control','autofocus','required']) !!} {!!$errors->first('document_date', '')!!}
{!! Form::label('payment_method', App\Language::trans('Payment Method'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('payment_method', App\Setting::payment_method(), null, ['class'=>'form-control','autofocus','required' , 'onchange'=>'change_payment_label_text_by_payment_method(this)']) !!} {!!$errors->first('payment_method', '')!!}
{!! Form::label('doc_payment_no_ref_no', App\Language::trans('Cheque No.'), ['id'=>'doc_payment_no_ref_no', 'class'=>'control-label col-md-4']) !!}
{!! Form::text('reference_no', null, ['class'=>'form-control','autofocus','required']) !!} {!!$errors->first('reference_no', '')!!}
{!! Form::label('sales_person', App\Language::trans('Sales Person'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('sales_person', null, ['class'=>'form-control','autofocus','required']) !!} {!!$errors->first('sales_person', '')!!}

{{ Form::checkbox('return_payment', 1, null, ['id'=>'return_payment', 'class' => 'minimal' , 'onchange'=>"init_return_payment_div('return_payment')"]) }} Return Payment

{!! Form::label('return_payment_date', App\Language::trans('Date'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('return_payment_date', null, ['class'=>'form-control','autofocus','required']) !!} {!!$errors->first('return_payment_date', '')!!}
{!! Form::label('reason', App\Language::trans('Reason'), ['class'=>'control-label col-md-4']) !!}
{!! Form::textarea('reason', null, ['rows'=>7,'class'=>'form-control']) !!} {!!$errors->first('reason', '')!!}
@include('_version_02.utility_charges.meter_refunds.partials.__list')

{{App\Language::trans('Action Bar')}}

{!! Form::close() !!} @endsection @section('script') var customerInfoUrl = "{{action('CustomersController@getInfo')}}"; function init_customer_info(me) { $.get(customerInfoUrl, {customer_id:$(me).val()}, function(fdata){ for (var key in fdata.data) { if(key != "status") { $("input[name="+key+"]").val(fdata.data[key]); if(key == "currency_label") { $(".currency_label").html(fdata.data[key]); } if(key.match(/_id/g)) { $("select[name="+key+"]").val(fdata.data[key]).trigger("change"); } } } },"json"); getCustomerDocumentByIdAndType($(me).val(),'AR_INVOICE','invoice_table'); } init_select2($("select[name=customer_id]")); init_select2($("select[name=currency_id]")); init_select2($("select[name=payment_term_id]")); init_select2($("select[name=billing_country_id]")); init_select2($("select[name=billing_state_id]")); init_select2($("select[name=billing_city_id]")); init_select2($("select[name=delivery_country_id]")); init_select2($("select[name=delivery_state_id]")); init_select2($("select[name=delivery_city_id]")); $("table").find("tr").each(function(){ init_select2($(this).find("select")); }); @endsection