{!! Form::label('tax_id', __('item.tax_outside'), ['class' => 'control-label']) !!}
{!! Form::select('tax_id', $tax, (isset($result) && $result->tax_id > 0) ? $result->tax_id : session('outside_tax_id'), ['class' => 'form-control ', 'title' => __('tax.select_tax')]) !!}
{!! Form::label('tax_inside_id', __('item.tax_inside'), ['class' => 'control-label']) !!}
{!! Form::select('tax_inside_id', $tax, (isset($result) && $result->tax_inside_id > 0) ? $result->tax_inside_id : session('inside_tax_id'), ['class' => 'form-control ', 'title' => __('tax.select_tax')]) !!}
{!! Form::label('regular_price', __('item.regular_price'), ['class' => 'control-label']) !!}
{!! Form::text('regular_price', null, ['class' => 'form-control']) !!}
{!! Form::label('offer_price', __('item.offer_price'), ['class' => 'control-label']) !!}
{!! Form::text('offer_price', null, ['class' => 'form-control __offer_price']) !!}
@if (isset($result))
@php
$itemVat = ($result->outside_rate + 100) / 100;
$priceExclVat = $result->offer_price / $itemVat;
$offerPrice = $result->offer_price;
@endphp
{!! __('item.price') !!}:
{!! numberFormat($result->offer_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 ($sumOfPrice > 0 && $offerPrice > 0)
@php
$percentage = round(($sumOfPrice / $offerPrice) * 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('inside_price', __('item.inside_price'), ['class' => 'control-label']) !!}
{!! Form::text('inside_price', null, ['class' => 'form-control __inside_price']) !!}
@if (isset($result))
@php
$itemVat = ($result->inside_rate + 100) / 100;
$priceExclVat = $result->inside_price / $itemVat;
$insidePrice = $result->inside_price;
@endphp
{!! __('item.price') !!}:
{{ numberFormat($result->inside_price) }}
({{ numberFormat($priceExclVat) }} Ex.VAT)
@if (!empty($rawMaterialResult))
@php
$sumOfPrice = 0;
$rawpriceExclVat = 0;
@endphp
@foreach ($rawMaterialResult as $rItem)
@if ($rItem->status_2 == 1)
@php
$sumOfPrice += $rItem->total_price;
$rawpriceExclVat += $rItem->sub_total_price;
@endphp
@endif
@endforeach
{{-- @php
$rawpriceExclVat = 0;
@endphp
@if ($sumOfPrice > 0 && $itemVat > 0)
@php
$rawpriceExclVat = $sumOfPrice / $itemVat;
@endphp
@endif --}}
{!! __('item.raw_cost') !!}:
{!! numberFormat($sumOfPrice) . '(' . numberFormat($rawpriceExclVat) . ' Ex.VAT)' !!}
@php
$percentageExc = $percentage = 0;
@endphp
@if ($sumOfPrice > 0 && $insidePrice > 0)
@php
$percentage = round(($sumOfPrice / $insidePrice) * 100, 2);
@endphp
@endif
@if ($rawpriceExclVat > 0 && $priceExclVat > 0)
@php
$percentageExc = round(($rawpriceExclVat / $priceExclVat) * 100, 2);
@endphp
@endif
{!! __('item.percentage') !!}:
{{ $percentage }}% ({{ $percentageExc }}
%)
@endif
@endif
@php
$dataJson = isset($result) && $result->data_json ? json_decode($result->data_json,true) : [];
$storeNightMenyPrices = [];
if ($dataJson) {
$storeNightMenyPrices = isset($dataJson['night_meny_prices']) ? $dataJson['night_meny_prices'] : [];
}
@endphp
@foreach ($nightMenyDetails as $key=>$value)
@php
$menyPrices = isset($storeNightMenyPrices[$key]) && isset($storeNightMenyPrices[$key]['price']) ? $storeNightMenyPrices[$key]['price'] : '';
$menyInsidePrices = isset($storeNightMenyPrices[$key]) && isset($storeNightMenyPrices[$key]['inside_price']) ? $storeNightMenyPrices[$key]['inside_price'] : '';
@endphp
{!! Form::label($key.'_inside_price', __('item.meny_inside_price',['NightMeny' => $value['night_meny_title'], 'tax' => session('inside_tax') ?? 0]), ['class' => 'control-label']) !!}
{!! Form::text($key.'_inside_price', $menyInsidePrices, ['class' => 'form-control __night_meny_inside_price '.$key]) !!}
@if (isset($result))
@php
$itemVat = ($result->inside_rate + 100) / 100;
$priceExclVat = $menyInsidePrices > 0 ? $menyInsidePrices / $itemVat : 0;
$priceNight = $menyInsidePrices;
@endphp
{!! __('item.price') !!}:
{!! numberFormat($menyInsidePrices) !!}
(
{!! 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
@endforeach