@extends('_version_02.commons.layouts.admin') @section('content') {!!Form::model($model, array("url"=>null,"method"=>"post","class"=>"form-horizontal","files"=>true))!!} @include('_version_02.commons.layouts.partials._alert') {{App\Language::trans('Product Detail')}} @if($model->cover_photo_path) {{App\Language::trans('Cover Photo')}} @endif {{App\Language::trans('Product Cover Photo')}} {!!Form::file("cover_photo_path", array("id"=>"cover_photo_path","class"=>"form-control"))!!} {!!$errors->first('cover_photo_path', ':message')!!} {!! Form::label('code', App\Language::trans('Code'), ['class'=>'control-label col-md-4']) !!} {!! Form::text('code', null, ['class'=>'form-control','autofocus','required']) !!} {!!$errors->first('code', ':message')!!} {!! Form::label('name', App\Language::trans('Name'), ['class'=>'control-label col-md-4']) !!} {!! Form::text('name', null, ['class'=>'form-control','required']) !!} {!!$errors->first('name', ':message')!!} {!! Form::label('barcode', App\Language::trans('Barcode'), ['class'=>'control-label col-md-4']) !!} {!! Form::text('barcode', null, ['class'=>'form-control']) !!} {!!$errors->first('barcode', ':message')!!} {!! Form::label('product_category_id', App\Language::trans('Category'), ['class'=>'control-label col-md-4']) !!} {!! Form::select('product_category_id', App\ProductCategory::combobox(), null, ['class'=>'form-control']) !!} {!!$errors->first('product_category_id', ':message')!!} {!! Form::label('cost_method', App\Language::trans('Cost Method'), ['class'=>'control-label col-md-4']) !!} {!! Form::select('cost_method', App\Setting::costing_method(), null, ['class'=>'form-control']) !!} {!!$errors->first('cost_method', ':message')!!} {!! Form::label('lead_time', App\Language::trans('Lead Time'), ['class'=>'control-label col-md-4']) !!} {!! Form::number('lead_time', null, ['class'=>'form-control']) !!} {!!$errors->first('lead_time', ':message')!!} {{App\Language::trans('Tax And Account Mapping')}} {!! Form::label('deposit_to_account', App\Language::trans('Deposit To'), ['class'=>'control-label col-md-4']) !!} {!! Form::select('deposit_to_account', App\Setting::gl_account_combobox(), null, ['class'=>'form-control','autofocus','required','onchange'=>'init_tax_info(this)']) !!} {!!$errors->first('deposit_to_account', ' :message')!!} {!! Form::label('sale_tax_id', App\Language::trans('Sale Tax'), ['class'=>'control-label col-md-4']) !!} {!! Form::select('sale_tax_id', App\Tax::combobox(App\Tax::sale_tag), null, ['class'=>'form-control','required','onchange'=>'init_tax_info(this)']) !!} {!!$errors->first('sale_tax_id', ':message')!!} {!! Form::label('purchase_tax_id', App\Language::trans('Purchase Tax'), ['class'=>'control-label col-md-4']) !!} {!! Form::select('purchase_tax_id', App\Tax::combobox(App\Tax::purchase_tag), null, ['class'=>'form-control','required','onchange'=>'init_tax_info(this)']) !!} {!!$errors->first('purchase_tax_id', ':message')!!} {!! Form::label('payment_term_id', App\Language::trans('Payment Term'), ['class'=>'control-label col-md-4']) !!} {!! Form::select('payment_term_id', App\PaymentTerm::get_common_combobox(), null, ['class'=>'form-control']) !!} {!!$errors->first('payment_term_id', ':message')!!} {!! Form::label('sale_tax_amount', App\Language::trans('Sales Tax Percent (%)'), ['class'=>'control-label col-md-4']) !!} {!! Form::label('sale_tax_amount', App\Language::trans('-'), ['id'=> 'sale_tax_amount', 'class'=>'control-label']) !!} {!! Form::label('purchase_tax_amount', App\Language::trans('Purchase Tax Percent (%)'), ['class'=>'control-label col-md-4']) !!} {!! Form::label('purchase_tax_amount', App\Language::trans('-'), ['id'=> 'purchase_tax_amount', 'class'=>'control-label']) !!} {{App\Language::trans('Price & Quantity Form')}} {!! Form::label('uom_id', App\Language::trans('Unit Of Measurement'), ['class'=>'control-label col-md-4']) !!} {!! Form::select('uom_id', App\Uom::combobox(), null, ['class'=>'form-control']) !!} {!!$errors->first('uom_id', ':message')!!} {!! Form::label('selling_price', App\Language::trans('Selling Price'), ['class'=>'control-label col-md-4']) !!} {!! Form::number('selling_price', null, ['min'=>0,'step'=>'0.01','class'=>'form-control','onchange'=>'init_double(this)']) !!} {!!$errors->first('selling_price', ':message')!!} {!! Form::label('purchase_price', App\Language::trans('Purchase Price'), ['class'=>'control-label col-md-4']) !!} {!! Form::number('purchase_price', null, ['min'=>0,'step'=>'0.01','class'=>'form-control','onchange'=>'init_double(this)']) !!} {!!$errors->first('purchase_price', ':message')!!} {!! Form::label('standard_cost', App\Language::trans('Standard Cost'), ['class'=>'control-label col-md-4']) !!} {!! Form::number('standard_cost', null, ['min'=>0,'step'=>'0.01','class'=>'form-control','onchange'=>'init_double(this)']) !!} {!!$errors->first('standard_cost', ':message')!!} {!! Form::label('min_quantity', App\Language::trans('Min. Quantity'), ['class'=>'control-label col-md-4']) !!} {!! Form::number('min_quantity', null, ['min'=>0,'step'=>'1','class'=>'form-control']) !!} {!!$errors->first('min_quantity', ':message')!!} {!! Form::label('max_quantity', App\Language::trans('Max. Quantity'), ['class'=>'control-label col-md-4']) !!} {!! Form::number('max_quantity', null, ['min'=>0,'step'=>'1','class'=>'form-control']) !!} {!!$errors->first('max_quantity', ':message')!!} {!! Form::label('reorder_quantity', App\Language::trans('Reorder Quantity'), ['class'=>'control-label col-md-4']) !!} {!! Form::number('reorder_quantity', null, ['min'=>0,'step'=>'1','class'=>'form-control']) !!} {!!$errors->first('reorder_quantity', ':message')!!} @include('_version_02.billings.products.partials.__prices') {{App\Language::trans('Other Detail Form')}} {!! Form::label('status', App\Language::trans('Status'), ['class'=>'control-label col-md-4']) !!} {{App\ExtendModel::status_true_word()}} {{App\ExtendModel::status_false_word()}} {!!$errors->first('status', ':message')!!} {!! Form::label('is_obsolete', App\Language::trans('Is Obsolete'), ['class'=>'control-label col-md-4']) !!} {{App\ExtendModel::answer_true_word()}} {{App\ExtendModel::answer_false_word()}} {!!$errors->first('is_obsolete', ':message')!!} {!! Form::label('remark', App\Language::trans('Remark'), ['class'=>'control-label col-md-2']) !!} {!! Form::textarea('remark', null, ['rows'=>'5','class'=>'form-control']) !!} {!!$errors->first('remark', ':message')!!} @include('_version_02.commons.layouts.partials._form_floaring_footer_standard') {!! Form::close() !!} @endsection @section('script') var taxInfoUrl = "{{action('TaxesController@getInfo')}}"; function init_tax_info(me) { id = $(me).attr('id').replace("_id", "_amount") console.log(id); $.get(taxInfoUrl, {tax_id:$(me).val()}, function(fdata){ for (var key in fdata.data) { if(key == "rate") { $('#'+id).html(fdata.data[key]); } } },"json"); } @endsection