@extends('commons.layouts.admin') @section('content') {!!Form::model($model, array("url"=>null,"method"=>"post","class"=>"form-horizontal","files"=>true))!!} @include('commons.layouts.partials._alert')

{{App\Language::trans('Product Pictures')}}

@if($model->cover_photo_path)
@endif

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

{!!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', '')!!}
{!! Form::label('name', App\Language::trans('Name'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('name', null, ['class'=>'form-control','required']) !!} {!!$errors->first('name', '')!!}
{!! Form::label('barcode', App\Language::trans('Barcode'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('barcode', null, ['class'=>'form-control']) !!} {!!$errors->first('barcode', '')!!}
{!! 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', '')!!}
{!! 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', '')!!}
{!! Form::label('lead_time', App\Language::trans('Lead Time'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('lead_time', null, ['class'=>'form-control']) !!} {!!$errors->first('lead_time', '')!!}

{{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::bank_or_cash_combobox(), null, ['class'=>'form-control','autofocus','required','onchange'=>'init_tax_info(this)']) !!} {!!$errors->first('deposit_to_account', ' ')!!}
{!! 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', '')!!}
{!! 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', '')!!}
{!! 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', '')!!}
{!! 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', '')!!}
{!! Form::label('selling_price', App\Language::trans('Selling Price'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('selling_price', null, ['class'=>'form-control','onchange'=>'init_double(this)']) !!} {!!$errors->first('selling_price', '')!!}
{!! Form::label('purchase_price', App\Language::trans('Purchase Price'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('purchase_price', null, ['class'=>'form-control','onchange'=>'init_double(this)']) !!} {!!$errors->first('purchase_price', '')!!}
{!! Form::label('standard_cost', App\Language::trans('Standard Cost'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('standard_cost', null, ['class'=>'form-control','onchange'=>'init_double(this)']) !!} {!!$errors->first('standard_cost', '')!!}
{!! Form::label('min_quantity', App\Language::trans('Min. Quantity'), ['class'=>'control-label col-md-4']) !!}
{!! Form::number('min_quantity', null, ['min'=>0,'step'=>'0.01','class'=>'form-control']) !!} {!!$errors->first('min_quantity', '')!!}
{!! Form::label('max_quantity', App\Language::trans('Max. Quantity'), ['class'=>'control-label col-md-4']) !!}
{!! Form::number('max_quantity', null, ['min'=>0,'step'=>'0.01','class'=>'form-control']) !!} {!!$errors->first('max_quantity', '')!!}
{!! Form::label('reorder_quantity', App\Language::trans('Reorder Quantity'), ['class'=>'control-label col-md-4']) !!}
{!! Form::number('reorder_quantity', null, ['min'=>0,'step'=>'0.01','class'=>'form-control']) !!} {!!$errors->first('reorder_quantity', '')!!}
@include('billings.products.partials.__prices')

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

{!! Form::label('status', App\Language::trans('Status'), ['class'=>'control-label col-md-4']) !!}
{!!$errors->first('status', '')!!}
{!! Form::label('is_obsolete', App\Language::trans('Is Obsolete'), ['class'=>'control-label col-md-4']) !!}
{!!$errors->first('is_obsolete', '')!!}
{!! 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', '')!!}
{!! 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