@lang('catalogs/product.document_title')

@include('flash::message')

{{ $product->name }}

{!! Form::model($product,['route' => ['products.update',$product->id],'method' => 'PUT','class' => 'form-horizontal','role' => 'form','id' => 'form','files'=>true]) !!} {!! Form::hidden('image', old('image')) !!}
{!! html_entity_decode(Form::label('image', __('catalogs/product.entry_image') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
@lang('catalogs/product.entry_image')

 

{!! Form::file('file_image', ['class'=> 'hidden']) !!} @if ($errors->has('file_image')) {{ $errors->first('file_image') }} @endif
{!! html_entity_decode(Form::label('code', __('catalogs/product.entry_code') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::text('code', old('code'), ['class' => 'form-control', 'placeholder' => __('catalogs/product.entry_code'),'','autofocus']) !!} @if ($errors->has('code')) {{ $errors->first('code') }} @endif
{!! html_entity_decode(Form::label('name', __('catalogs/product.entry_name') . ' *', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::text('name', old('name'), ['class' => 'form-control', 'placeholder' => __('catalogs/product.entry_name'),'required','']) !!} @if ($errors->has('name')) {{ $errors->first('name') }} @endif
{!! html_entity_decode(Form::label('description', __('catalogs/product.entry_description') . ' *', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::textarea('description', old('description'), ['class' => 'form-control', 'placeholder' => __('catalogs/product.entry_description'),'required','rows' => '3']) !!} @if ($errors->has('description')) {{ $errors->first('description') }} @endif
{!! html_entity_decode(Form::label('model', __('catalogs/product.entry_model') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::text('model', old('model'), ['class' => 'form-control', 'placeholder' => __('catalogs/product.entry_model'),'','']) !!}
{!! html_entity_decode(Form::label('manufacturer', __('catalogs/product.entry_manufacturer') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::text('manufacturer', old('manufacturer'), ['class' => 'form-control', 'placeholder' => __('catalogs/product.entry_manufacturer'),'','']) !!}
@php $tmp_unit_measures = []; if(!empty(old('unit_measure_id',$product->unit_measure_id))){ $tmp_unit_measures = \App\Models\Catalogs\UnitMeasure::where('id','=',old('unit_measure_id',$product->unit_measure_id))->get()->pluck('description_select2','id'); } @endphp {!! html_entity_decode(Form::label('unit_measure_id', __('catalogs/product.entry_unit_measure_id') . ' *', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::select('unit_measure_id', $tmp_unit_measures,old('unit_measure_id',$product->unit_measure_id), ['class' => 'form-control', 'placeholder' => __('general.text_select'),'required']) !!}
...@lang('catalogs/product.text_link_unidades_de_medida_sat') @if ($errors->has('unit_measure_id')) {{ $errors->first('unit_measure_id') }} @endif
@php $tmp_sat_products = []; if(!empty(old('sat_product_id',$product->sat_product_id))){ $tmp_sat_products = \App\Models\Catalogs\SatProduct::where('id','=',old('sat_product_id',$product->sat_product_id))->get()->pluck('description_select2','id'); } @endphp {!! html_entity_decode(Form::label('sat_product_id', __('catalogs/product.entry_sat_product_id') . ' *', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::select('sat_product_id', $tmp_sat_products,old('sat_product_id',$product->sat_product_id), ['class' => 'form-control', 'placeholder' => __('general.text_select'),'required']) !!}
...@lang('catalogs/product.text_link_productos_servicios_sat') @if ($errors->has('sat_product_id')) {{ $errors->first('sat_product_id') }} @endif
@if(\App\Helpers\Helper::companyComplementoCfdiForeignTrade())
@php $tmp_tariff_fractions = []; if(!empty(old('tariff_fraction_id',$product->tariff_fraction_id))){ $tmp_tariff_fractions = \App\Models\Catalogs\TariffFraction::where('id','=',old('tariff_fraction_id',$product->tariff_fraction_id))->get()->pluck('description_select2','id'); } @endphp {!! html_entity_decode(Form::label('tariff_fraction_id', __('catalogs/product.entry_tariff_fraction_id') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::select('tariff_fraction_id', $tmp_tariff_fractions,old('tariff_fraction_id',$product->tariff_fraction_id), ['class' => 'form-control', 'placeholder' => __('general.text_select')]) !!}
@if ($errors->has('tariff_fraction_id')) {{ $errors->first('tariff_fraction_id') }} @endif
@php $tmp_uom_customs = []; if(!empty(old('uom_custom_id',$product->uom_custom_id))){ $tmp_uom_customs = \App\Models\Catalogs\UomCustom::where('id','=',old('uom_custom_id',$product->uom_custom_id))->get()->pluck('description_select2','id'); } @endphp {!! html_entity_decode(Form::label('uom_custom_id', __('catalogs/product.entry_uom_custom_id') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::select('uom_custom_id', $tmp_uom_customs,old('uom_custom_id',$product->uom_custom_id), ['class' => 'form-control', 'placeholder' => __('general.text_select')]) !!}
@if ($errors->has('uom_custom_id')) {{ $errors->first('uom_custom_id') }} @endif
@endif
{!! html_entity_decode(Form::label('price_decimal_place', __('catalogs/product.entry_price_decimal_place') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::number('price_decimal_place', old('price_decimal_place', !empty($product->price_decimal_place) ? $product->price_decimal_place : ''), ['class' => 'form-control', 'placeholder' => __('catalogs/product.entry_price_decimal_place'),'','step' => 'any']) !!}
{!! html_entity_decode(Form::label('price', __('catalogs/product.entry_price') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::number('price', old('price',\App\Helpers\Helper::numberFormat($product->price,\App\Helpers\Helper::companyProductPriceDecimalPlace(),false)), ['class' => 'form-control', 'placeholder' => __('catalogs/product.entry_price'),'','step' => 'any']) !!}
{!! html_entity_decode(Form::label('quota_ieps', __('catalogs/product.entry_quota_ieps') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::number('quota_ieps', old('quota_ieps'), ['class' => 'form-control', 'placeholder' => __('catalogs/product.entry_quota_ieps'),'','step' => 'any']) !!}
{!! html_entity_decode(Form::label('taxes[]', __('catalogs/product.entry_taxes') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::select('taxes[]', $taxes,old('taxes'), ['class' => 'form-control my-select2','multiple' => 'multiple']) !!}
{!! html_entity_decode(Form::label('comment', __('catalogs/product.entry_comment') . '', ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::textarea('comment', old('comment'), ['class' => 'form-control', 'placeholder' => __('catalogs/product.entry_comment'),'rows' => '3']) !!}
{!! html_entity_decode(Form::label('status', __('catalogs/product.entry_status') , ['class' => 'col-md-3 col-xs-12 control-label'])) !!}
{!! Form::close() !!}