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

{{App\Language::trans('Basic Detail Form')}}

{!! 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('phone_no', App\Language::trans('Phone No'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('phone_no', null, ['class'=>'form-control']) !!} {!!$errors->first('phone_no', '')!!}
{!! Form::label('contact_person', App\Language::trans('Contact Person'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('contact_person', null, ['class'=>'form-control']) !!} {!!$errors->first('contact_person', '')!!}
{!! 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','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']) !!} {!!$errors->first('currency_rate', '')!!}
{!! Form::label('document_no', App\Language::trans('Document 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']) !!} {!!$errors->first('document_date', '')!!}
{!! Form::label('po_no', App\Language::trans('P.O. No.'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('po_no', null, ['class'=>'form-control']) !!} {!!$errors->first('po_no', '')!!}
{!! Form::label('payment_term_id', App\Language::trans('Payment Term'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('payment_term_id', App\PaymentTerm::combobox(), null, ['class'=>'form-control']) !!} {!!$errors->first('payment_term_id', '')!!}
{!! Form::label('status', App\Language::trans('Document Status'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('status', null, ['class'=>'form-control','readonly']) !!} {!!$errors->first('status', '')!!}
{!! Form::label('sales_person', App\Language::trans('Sales Person'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('sales_person', null, ['class'=>'form-control']) !!} {!!$errors->first('sales_person', '')!!}
@include('billings.ar_invoices.partials.__address') @include('billings.ar_invoices.partials.__list')

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

{!! Form::close() !!} @endsection @section('script') var customerInfoUrl = "{{action('CustomersController@getInfo')}}"; var productInfoUrl = "{{action('ProductsController@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 == "phone_no_1") { $("input[name=phone_no]").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"); } } } setTimeout(function(){ var billingStateSelectbox = $("select[name*=billing_state_id]"); billingStateSelectbox.empty(); var billing_state = $.get(statesComboboxUrl, {country_id:fdata.data["billing_country_id"]}, function(data){ for (var i = 0; i < data.length; i++) { billingStateSelectbox.append($("