@extends('layouts.app') @section('title', __('product.add_new_product')) @section('content')

@lang('product.add_new_product')

{!! Form::open(['url' => action('ProductController@store'), 'method' => 'post', 'id' => 'product_add_form','class' => 'product_form', 'files' => true ]) !!}
{!! Form::label('name', __('product.product_name') . ':*') !!} {!! Form::text('name', null, ['class' => 'form-control', 'required', 'placeholder' => __('product.product_name')]); !!}
{!! Form::label('brand_id', __('product.brand') . ':') !!} {!! Form::select('brand_id', $brands, null, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
{!! Form::label('unit_id', __('product.unit') . ':*') !!} {!! Form::select('unit_id', $units, session('business.default_unit'), ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2', 'required']); !!}
{!! Form::label('category_id', __('product.category') . ':') !!} {!! Form::select('category_id', $categories, null, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
{!! Form::label('sub_category_id', __('product.sub_category') . ':') !!} {!! Form::select('sub_category_id', array(), null, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
{!! Form::label('sku', __('product.sku') . ':') !!} @show_tooltip(__('tooltip.sku')) {!! Form::text('sku', null, ['class' => 'form-control', 'placeholder' => __('product.sku')]); !!}
{!! Form::label('barcode_type', __('product.barcode_type') . ':*') !!} {!! Form::select('barcode_type', $barcode_types, $barcode_default, ['class' => 'form-control select2', 'required']); !!}

@show_tooltip(__('tooltip.enable_stock'))

@lang('product.enable_stock_help')

{!! Form::label('alert_quantity', __('product.alert_quantity') . ':*') !!} @show_tooltip(__('tooltip.alert_quantity')) {!! Form::number('alert_quantity', null, ['class' => 'form-control', 'required', 'placeholder' => __('product.alert_quantity'), 'min' => '0']); !!}
{!! Form::label('image', __('lang_v1.product_image') . ':') !!} {!! Form::file('image', ['id' => 'upload_image', 'accept' => 'image/*']); !!}

@lang('purchase.max_file_size', ['size' => (config('constants.document_size_limit') / 1000000)])
@lang('lang_v1.aspect_ratio_should_be_1_1')

@if(session('business.enable_product_expiry')) @if(session('business.expiry_type') == 'add_expiry') @php $expiry_period = 12; $hide = true; @endphp @else @php $expiry_period = null; $hide = false; @endphp @endif
{!! Form::label('expiry_period', __('product.expires_in') . ':') !!}
{!! Form::text('expiry_period', $expiry_period, ['class' => 'form-control pull-left input_number', 'placeholder' => __('product.expiry_period'), 'style' => 'width:60%;']); !!} {!! Form::select('expiry_period_type', ['months'=>__('product.months'), 'days'=>__('product.days'), '' =>__('product.not_applicable') ], 'months', ['class' => 'form-control select2 pull-left', 'style' => 'width:40%;', 'id' => 'expiry_period_type']); !!}
@endif

@show_tooltip(__('lang_v1.tooltip_sr_no'))
@if(session('business.enable_racks') || session('business.enable_row') || session('business.enable_position'))

@lang('lang_v1.rack_details'): @show_tooltip(__('lang_v1.tooltip_rack_details'))

@foreach($business_locations as $id => $location)
{!! Form::label('rack_' . $id, $location . ':') !!} @if(session('business.enable_racks')) {!! Form::text('product_racks[' . $id . '][rack]', null, ['class' => 'form-control', 'id' => 'rack_' . $id, 'placeholder' => __('lang_v1.rack')]); !!} @endif @if(session('business.enable_row')) {!! Form::text('product_racks[' . $id . '][row]', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.row')]); !!} @endif @if(session('business.enable_position')) {!! Form::text('product_racks[' . $id . '][position]', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.position')]); !!} @endif
@endforeach @endif
{!! Form::label('weight', __('lang_v1.weight') . ':') !!} {!! Form::text('weight', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.weight')]); !!}
{!! Form::label('product_custom_field1', __('lang_v1.product_custom_field1') . ':') !!} {!! Form::text('product_custom_field1', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.product_custom_field1')]); !!}
{!! Form::label('product_custom_field2', __('lang_v1.product_custom_field2') . ':') !!} {!! Form::text('product_custom_field2', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.product_custom_field2')]); !!}
{!! Form::label('product_custom_field3', __('lang_v1.product_custom_field3') . ':') !!} {!! Form::text('product_custom_field3', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.product_custom_field3')]); !!}
{!! Form::label('product_custom_field4', __('lang_v1.product_custom_field4') . ':') !!} {!! Form::text('product_custom_field4', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.product_custom_field4')]); !!}
{!! Form::label('tax', __('product.applicable_tax') . ':') !!} {!! Form::select('tax', $taxes, null, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2'], $tax_attributes); !!}
{!! Form::label('tax_type', __('product.selling_price_tax_type') . ':*') !!} {!! Form::select('tax_type', ['inclusive' => __('product.inclusive'), 'exclusive' => __('product.exclusive')], 'exclusive', ['class' => 'form-control select2', 'required']); !!}
{!! Form::label('type', __('product.product_type') . ':*') !!} @show_tooltip(__('tooltip.product_type')) {!! Form::select('type', ['single' => 'Single', 'variable' => 'Variable'], null, ['class' => 'form-control select2', 'required', 'data-action' => 'add', 'data-product_id' => '0']); !!}
  
{!! Form::close() !!}
@endsection @section('javascript') @php $asset_v = env('APP_VERSION'); @endphp @endsection