@php
$selectedStore = isset($result->store_id) ? explode(',', $result->store_id) : [];
$taxes = defaultCompanyTaxes();
@endphp
{!! Form::label('stores', __('global_items.stores'), ['class' => 'control-label mb-2']) !!}
{!! Form::select('stores[]', $stores, $selectedStore, [
'class' => 'form-control select2',
'multiple' => 'true',
'data-actions-box' => 'true',
'data-width' => '100%',
]) !!}
{!! Form::label('main_category_id', __('item.main_category'), ['class' => 'control-label mb-2']) !!}
{!! Form::select('main_category_id', $category, null, [
'class' => 'form-control __select2_change',
'data-target' => '#subCatId',
'data-route' => route('global-items.get-category'),
]) !!}
@php
$subCategory = isset($subCategory) ? $subCategory : [];
@endphp
{!! Form::label('category_id', __('item.category'), ['class' => 'control-label mb-2']) !!}
{!! Form::select('category_id', $subCategory, null, [
'class' => 'form-control',
'id' => 'subCatId',
'title' => __('category.select_sub_category'),
'data-route' => route('global-items.get-skip-variation'),
]) !!}
{!! Form::label('name', __('item.item_name'), ['class' => 'control-label']) !!}
{!! Form::text('name', null, ['class' => 'form-control']) !!}
{!! Form::label('regular_price', __('item.regular_price'), ['class' => 'control-label']) !!}
{!! Form::text('regular_price', null, ['class' => 'form-control']) !!}
{{--
{!! Form::label('night_meny_inside_price', __('item.night_meny_inside_price',['tax' => session('inside_tax') ?? 0]), ['class' => 'control-label']) !!}
{!! Form::text('night_meny_inside_price', null, ['class' => 'form-control __night_meny_inside_price __night_meny_price']) !!}
@if (isset($result))
@php
$itemVat = ($result->inside_rate + 100) / 100;
$priceExclVat = $result->night_meny_inside_price > 0 ? $result->night_meny_inside_price / $itemVat : 0;
$priceNight = $result->night_meny_inside_price;
@endphp
{!! __('item.price') !!}:
{!! numberFormat($result->night_meny_inside_price) !!}
(
{!! numberFormat($priceExclVat) !!}
Ex.VAT)
@if (!empty($rawMaterialResult))
@php
$sumOfPrice = 0;
$rawpriceExclVat = 0;
@endphp
@foreach ($rawMaterialResult as $rItem)
@if ($rItem->status == 1)
@php
$sumOfPrice += $rItem->total_price;
$rawpriceExclVat += $rItem->sub_total_price;
@endphp
@endif
@endforeach
{!! __('item.raw_cost') !!}:
{!! numberFormat($sumOfPrice) . '(' . numberFormat($rawpriceExclVat) . ' Ex.VAT)' !!}
@php
$percentageExc = $percentage = 0;
@endphp
@if ($rawpriceExclVat > 0 && $priceNight > 0)
@php
$percentage = round(($sumOfPrice / $priceNight) * 100, 2);
@endphp
@endif
@if ($rawpriceExclVat > 0 && $priceExclVat > 0)
@php
$percentageExc = round(($rawpriceExclVat / $priceExclVat) * 100, 2);
@endphp
@endif
{!! __('item.percentage') !!}:
{{ $percentage }} % ({{ $percentageExc }}
%)
@endif
@endif
--}}
{!! Form::label('report_group_id', __('item.report_group_id'), ['class' => 'control-label']) !!}
{!! Form::select('report_group_id', zReportGroup(), null, ['class' => 'form-control ']) !!}
{!! Form::label('choose_design', __('item.choose_design'), ['class' => 'control-label']) !!}
{!! Form::select('choose_design', buildItemDesign(), $chooseDesign, ['class' => 'form-control']) !!}
@php
$selectedPlatform = isset($result->platform) ? explode(',', $result->platform) : [];
@endphp
{!! Form::label('platform', __('global_items.platform'), ['class' => 'control-label mb-2']) !!}
{!! Form::select('platform[]', itemFor(), $selectedPlatform, [
'class' => 'form-control select2',
'multiple' => 'true',
'data-actions-box' => 'true',
'data-width' => '100%',
]) !!}
{!! Form::label('description', __('item.description'), ['class' => 'control-label']) !!}
{!! Form::textarea('description', null, ['class' => 'form-control', 'rows' => 3]) !!}
{!! Form::label('en_description', __('item.en_description'), ['class' => 'control-label']) !!}
{!! Form::textarea('en_description', null, ['class' => 'form-control', 'rows' => 3]) !!}