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

{{App\Language::trans('Received Payment Flow')}}

@include('_version_02.billings.layouts.partials._progress_stepper')



{!! Form::label('customer_id', App\Language::trans('Customer Code'), ['class'=>'control-label col-md-3']) !!}
{!!Form::hidden('is_tax_inclusive', null)!!} {!! Form::select('customer_id', App\Customer::combobox(), null, ['class'=>'form-control','onchange'=>'init_customer_info(this)']) !!} {!!$errors->first('customer_id', ' ')!!}
{!! Form::label('type', App\Language::trans('Type'), ['class'=>'control-label col-md-3']) !!}
{!! 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('deposit_to_account', App\Language::trans('Deposit To'), ['class'=>'control-label col-md-3']) !!}
{!! Form::select('deposit_to_account', App\Setting::bank_or_cash_combobox(), null, ['class'=>'form-control','autofocus','required','onchange'=>'init_customer_info(this)']) !!} {!!$errors->first('deposit_to_account', ' ')!!}
{!! Form::label('document_no', App\Language::trans('Receipt No.'), ['class'=>'control-label col-md-3']) !!}
{!! Form::text('document_no', null, ['class'=>'form-control','readonly']) !!} {!!$errors->first('document_no', ' ')!!}
{!! Form::label('document_date', App\Language::trans('Document Date'), ['class'=>'control-label col-md-3']) !!}
{!! 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-3']) !!}
{!! 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('Reference No.'), ['id'=>'doc_payment_no_ref_no', 'class'=>'control-label col-md-3']) !!}
{!! Form::text('reference_no', null, ['class'=>'form-control','autofocus','required']) !!} {!!$errors->first('reference_no', ' ')!!}
@include('_version_02.billings.ar_payment_receiveds.partials.__list')

{{App\Language::trans('Received Payment')}}

{{App\Language::trans('More info')}}
{!! 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 Code'), ['class'=>'control-label col-md-4']) !!}
{!!Form::hidden('is_tax_inclusive', null)!!} {!! Form::select('customer_id', App\Customer::combobox(), null, ['class'=>'form-control','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('deposit_to_account', App\Language::trans('Deposit To'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('deposit_to_account', App\Setting::bank_or_cash_combobox(), null, ['class'=>'form-control','autofocus','required','onchange'=>'init_customer_info(this)']) !!} {!!$errors->first('deposit_to_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)','readonly']) !!} {!!$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','onchange'=>'init_currency_rate(this)']) !!} {!!$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('Receipt No.'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('document_no', null, ['class'=>'form-control','readonly']) !!} {!!$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('Reference 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', ' ')!!}
@include('_version_02.billings.ar_payment_receiveds.partials.__list')

{{App\Language::trans('Security Deposit')}} - {{App\Language::trans('money paid in advance to protect the provider of a product or service against damage or nonpayment by the customer')}}.
{{App\Language::trans('Please specify the')}} {{App\Language::trans('bank account')}} {{App\Language::trans('where the money is received into and the')}} {{App\Language::trans('account')}} {{App\Language::trans('to post the security deposit. Any unused Security deposit will then show on your Customer Statement under')}} {{App\Language::trans('Deposit Available')}}.

{{App\Language::trans('Tick the check box next to the outstanding invoice to apply payment received.')}}

{{App\Language::trans('Received Payment')}}

{{App\Language::trans('More info')}}

{{ 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']) !!} {!!$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', ' ')!!}
{!! Form::close() !!} @endsection @section('script') $('#amount').focusout(function() { $('#amount').val(init_decimal_point($('#amount').val())); }); 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"); getCustomerInvoiceById($(me).val(),'invoice_table'); } function init_calculate_row(me, price_adjust) { var tr = $(me).closest("tr"); var is_tax_inclusive = $("input[name*=is_tax_inclusive]"); var quantity = tr.find("input[name*=quantity]"); var discount = tr.find("input[name*=discount]"); var amount = tr.find("input[name*=amount]"); var unit_price = tr.find("input[name*=unit_price]"); var tax_percent = tr.find("input[name*=tax_percent]"); var tax_txt = tr.find("input[name*=tax_txt]"); if (price_adjust) { if(is_tax_inclusive) { var new_unit_price = (unit_price.val() || 0)/(parseFloat(1)+parseFloat(tax_percent.val())); unit_price.val(init_decimal_point(new_unit_price)); } } var tax_total = quantity.val() * unit_price.val() * tax_percent.val(); tax_txt.val(init_decimal_point(tax_total)); var total = quantity.val() * unit_price.val() + tax_total; amount.val(init_decimal_point(total)); init_calculate_product_table("product_table"); } function init_product_info(me, type) { $.get(productInfoUrl, {product_id:$(me).val()}, function(fdata){ var tr = $(me).closest("tr"); for (var key in fdata.data) { tr.find("input[name*="+key+"]").val(fdata.data[key]); if(key == "description") { tr.find("textarea[name*=description]").val(fdata.data[key]); } if(key.match(/_id/g)) { tr.find("select[name*="+key+"]").val(fdata.data[key]).trigger("change");; } } {{-- recalculate the amount --}} init_calculate_product_table("product_table"); },"json"); } init_daterange("input[name=document_date]"); init_daterange("input[name=return_payment_date]"); 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