Short Packlist (Hold SOs)
@php
$shortPackGroups = collect($shortPacklist ?? [])->groupBy('so_no');
@endphp
@if ($shortPackGroups->isEmpty())
No short packlist entries in hold status.
@else
|
SO No |
Boxes |
Items (Total Qty) |
{{-- Actions | --}}
@foreach($shortPackGroups as $soNo => $rows)
@php
$boxCount = $rows->count();
$totalQty = 0;
foreach ($rows as $row) {
try {
$items = json_decode($row->items, true);
if (is_array($items)) {
foreach ($items as $it) {
if (is_string($it)) $it = json_decode($it, true);
if (is_array($it) && isset($it['qty'])) {
$totalQty += (float) $it['qty'];
}
}
}
} catch (\Throwable $e) {}
}
$diffsForSo = collect($shortPackDiffs[$soNo] ?? []);
@endphp
|
|
{{ $soNo }} |
{{ $boxCount }} |
{{ $totalQty }} |
{{--
| --}}
@foreach($rows as $r)
@php
$boxVal = $r->box;
try { $decoded = json_decode($r->box, true); }
catch (\Throwable $e) { $decoded = null; }
if (is_array($decoded)) $boxVal = implode(', ', $decoded);
@endphp
|
Box: {{ $boxVal }}
Dimension: {{ $r->dimension }} |
Weight: {{ $r->weight }}
Status: {{ $r->status }}
@if($diffsForSo->isNotEmpty())
Items:
| Item |
SO Qty |
Packed Qty |
Diff |
@foreach($diffsForSo as $d)
| {{ $d['item_name'] ?? '' }} |
{{ $d['so_qty'] ?? 0 }} |
{{ $d['packed_qty'] ?? 0 }} |
{{ $d['diff'] ?? 0 }} |
@endforeach
@else
No quantity differences for this SO.
@endif
|
@endforeach
@endforeach
@endif