@extends('transporter.templates.layout') @php $ds = config('global.transporter_delivery_statuses')[$delivery->status] ?? ['text'=>'—','class'=>'secondary']; $canScan = ! in_array((int) $delivery->status, [TRANSPORTER_DELIVERY_COLLECTED, TRANSPORTER_DELIVERY_COMPLETED], true); $canConfirm = ! in_array((int) $delivery->status, [TRANSPORTER_DELIVERY_COLLECTED, TRANSPORTER_DELIVERY_COMPLETED], true); // Summary computations $totalVariants = $delivery->deliveryItems->count(); $totalSKUs = $delivery->deliveryItems->sum(fn ($i) => $i->products->count()); $progressPct = $expectedCount > 0 ? round(($scannedCount / $expectedCount) * 100) : 0; $allCollected = $delivery->deliveryItems->every(fn ($i) => (bool) $i->is_collected); @endphp @section('head') @endsection @section('content') {{-- ═══════════════════════════════════════════════════════════ HEADER ═══════════════════════════════════════════════════════════ --}}
| Item / Variant | Expected | Scanned | Amount | Status | Reference IDs | Action |
|---|---|---|---|---|---|---|
|
@if($variant?->image)
{{ $orderItem?->name ?? '—' }}
{{ $variant?->variant ?? '—' }}
|
{{ $expectedQ }} | {{ $scannedQ }} | @if($hasAmount) {{ number_format($amount, 2) }} @else — @endif | @if($isDone) Collected @elseif($scannedQ >= $expectedQ) Ready @else Pending @endif |
@if($allRefs->isEmpty())
—
@else
@foreach($allRefs as $ref)
{{ $ref }}
@endforeach
|
@if(! $isDone && $canConfirm) @else — @endif |
|
No items in this delivery
|
||||||
| Reference ID | Item / Variant | Scanned At |
|---|---|---|
| {{ $row['ref'] }} |
{{ $row['item'] ?? '—' }}
{{ $row['vname'] ?? '—' }}
|
{{ $row['at'] ? web_date_in_timezone($row['at'], 'M d, Y h:i A') : '—' }} |
|
No products scanned yet
|
||
Scan each product to mark it as received.
Once all items are scanned, confirm collection. This sends a "picked up" notification to the merchant and cargo company.
@endif