@extends('layouts.location') @section('title', 'Short Packlist') @section('page-title', 'Short Packlist') @push('styles') @endpush @section('content')
Short Packlist (Hold SOs)
@php $shortPackGroups = collect($shortPacklist ?? [])->groupBy('so_no'); @endphp @if ($shortPackGroups->isEmpty())
No short packlist entries in hold status.
@else
{{-- --}} @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 {{-- --}} @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 @endforeach @endforeach
SO No Boxes Items (Total Qty)Actions
{{ $soNo }} {{ $boxCount }} {{ $totalQty }}
Box: {{ $boxVal }}
Dimension: {{ $r->dimension }} | Weight: {{ $r->weight }}
Status: {{ $r->status }}
@if($diffsForSo->isNotEmpty())
Items:
@foreach($diffsForSo as $d) @endforeach
Item SO Qty Packed Qty Diff
{{ $d['item_name'] ?? '' }} {{ $d['so_qty'] ?? 0 }} {{ $d['packed_qty'] ?? 0 }} {{ $d['diff'] ?? 0 }}
@else
No quantity differences for this SO.
@endif
@endif
@endsection @push('scripts') @endpush