@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 ]) !!}
@if(count($business_locations) == 1) @php $default_location = current(array_keys($business_locations->toArray())) @endphp @else @php $default_location = null; @endphp @endif
{!! Form::label('location_id', __('purchase.business_location').':*') !!} {!! Form::select('location_id', $business_locations, ' ', ['class' => 'form-control select2', 'id' => 'purchase_location_id', 'placeholder' => 'All']); !!}
{!! Form::label('name', __('product.product_name') . ':*') !!} {!! Form::text('name', null, ['class' => 'form-control', 'required', 'placeholder' => __('product.product_name')]); !!}
@if (in_array('brand', $industry_enabled_modules))
{!! Form::label('brand_id', __('product.brand') . ':') !!} {!! Form::select('brand_id', $brands, null, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
@endif
{!! Form::label('unit_id', __('product.unit') . ':*') !!} {!! Form::select('unit_id', $units, session('business.default_unit'), ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2', 'required']); !!}
@if (in_array('category', $industry_enabled_modules))
{!! Form::label('category_id', __('product.category') . ':') !!} {!! Form::select('category_id', $categories, null, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
@endif @if (in_array('sub_category', $industry_enabled_modules))
{!! Form::label('sub_category_id', __('product.sub_category') . ':') !!} {!! Form::select('sub_category_id', array(), null, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
@endif
{!! 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 (in_array('cusine', $industry_enabled_modules)) @if (in_array('kitchen', $enabled_modules))
{!! Form::label('cusine', 'Cusine' . ':') !!} {!! Form::text('cusine', null, ['class' => 'form-control', 'placeholder' => 'Cusine']); !!}
@endif @endif @if (in_array('warranty ', $industry_enabled_modules))
{!! Form::label('warranty ', 'Warranty (in Months)' . ':') !!} {!! Form::text('warranty ', null, ['class' => 'form-control', 'placeholder' => 'Warranty in Months']); !!}
@endif
{!! Form::label('is_promotion', 'Promotion Product' . ':') !!}
{!! Form::hidden('is_promotion', 0, null); !!} {!! Form::checkbox('is_promotion', 1, null , [ 'class' => 'input-icheck']); !!} {{ __( 'Yes' ) }}

@lang('product.promotion_help')

@if (in_array('type', $industry_enabled_modules))
{!! 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']); !!}
@endif
{!! Form::label('distribution_price', 'Distribution Price:*') !!} {!! Form::text('distribution_price', null, ['class' => 'form-control input-sm input_number', 'placeholder' => 'Distribution', 'required']); !!}
  
{!! Form::close() !!}
@endsection @section('javascript') @php $asset_v = env('APP_VERSION'); @endphp @endsection