@php
$i =1;
$j =1;
$index_i = $index.$i;
$color = [];
if (count($product->sizeChild) > 0) {
if ($request->type == 1) {
$size = $product->sizeChild;
} else {
$size = $product->storeSerial->pluck('size')->unique('id');
$grpBySize = $product->storeSerial->groupBy('size_id');
}
}
@endphp
@if ($product->expiarable_product == 1 && $request->tran_type != 8 && $request->tran_type != 9)
@include('inventory.global.product_serial.warrenty')
@endif
@if ($request->type == 1)
@include('inventory.global.product_serial.create_non_consumable')
@else
@include('inventory.global.product_serial.create_consumable')
@endif
{{--
@php
$i =1;
$j =1;
$color = [];
if (count($product->sizeChild) > 0) {
if ($request->type == 1) {
$size = $product->sizeChild;
} else {
$size = $product->storeSerial->pluck('size')->unique('id');
$grpBySize = $product->storeSerial->groupBy('size_id');
}
}
@endphp
@if ($product->expiarable_product == 1 && $request->tran_type != 8 && $request->tran_type != 9)
@include('inventory.global.product_serial.warrenty')
@endif
@if ($request->type != 1)
@endif
@if ($request->type == 1 && $product->serialized_product == 1)
@endif
@if (count($product->colorChild) > 0)
@php
if ($request->type == 1) {
$color = $product->colorChild;
}
@endphp
@if ($request->type == 2 && $product->serialized_product != 1)
@else
@endif
@elseif (count($product->sizeChild) > 0)
@if ($request->type == 2 && $product->serialized_product != 1)
@else
@endif
@else
@if ($request->type == 2 && $product->serialized_product != 1)
@else
@endif
@endif
@if ($request->type == 1)
@if ($product->size_id || $product->color_id)
@php
$size_len = count($size);
@endphp
@foreach($size as $skey => $s)
@php
$clr_center = intval(count($color)/2);
@endphp
@foreach($color as $ckey => $c)
@php
$j++;
@endphp
@endforeach
@if ($j == 1)
@endif
@php
$i++;
@endphp
@if($skey < ($size_len-1))
@endif
@endforeach
@else
@endif
@else
@if ($product->size_id > 0)
@php
$size_len = count($size);
$skey = 0;
@endphp
@foreach($grpBySize as $size_id => $sz)
@php
$s = $size->where('id', $size_id)->first();
$ckey = 0;
$color = $sz->pluck('color')->unique('id')->flatten(1);
$clr_len = count($color);
$clr_center = intval($clr_len/2);
@endphp
@if ($product->color_id > 0)
@foreach($color as $c)
@if ($product->serialized_product == 1)
{!! colorSizeSerialStock($product->storeSerial->where('size_id', $size_id)->where('color_id', $c->id), $index.$j, $product->serialized_product, $index) !!}
@endif
@php
$j++;
@endphp
@endforeach
@else
@if ($product->serialized_product == 1)
{!! colorSizeSerialStock($product->storeSerial->where('size_id', $size_id), $index.$i, $product->serialized_product, $index) !!}
@endif
@endif
@php
$i++;
@endphp
@if($skey++ < ($size_len-1))
@endif
@endforeach
@else
{!! colorSizeSerialStock($product->storeSerial, $index.'1', $product->serialized_product, $index) !!}
@endif
@endif
--}}