@extends('cargo_company.templates.layout') @php $quote = $order->activeQuote; $quoteInfo = $quote ? (config("global.quote_statuses.{$quote->status}") ?? ['text'=>'—','class'=>'secondary']) : null; $totalExpected = collect($variantAssignment)->sum('total'); $totalAssigned = collect($variantAssignment)->sum('assigned'); $totalRemaining = collect($variantAssignment)->sum('remaining'); $progressPct = $totalExpected > 0 ? round(($totalAssigned / $totalExpected) * 100) : 0; @endphp @section('head') @endsection @section('content') {{-- ═══════════════════════════════════════════════════════════ CREATE DELIVERY CTA (inline, above the header card) ═══════════════════════════════════════════════════════════ --}} @if($canCreateDelivery)
{{ $totalAssigned }} of {{ $totalExpected }} units assigned. @if($totalRemaining > 0) {{ $totalRemaining }} remaining — assign them to a transporter. @endif
Submit your price per variant. The sum becomes your total quote.
{{-- SUBMITTED → waiting + breakdown --}} @elseif($quote && $quote->status == QUOTE_SUBMITTED)| # | Item | Variants | Total | Assigned | Remaining | Amount |
|---|---|---|---|---|---|---|
| {{ $i + 1 }} |
@if($item->image)
{{ $item->name ?: '—' }}
@if($item->min_variant_price)
@endif
|
@endif
@if($variant->image)
{{ $variant->variant }}
|
{{ $a['total'] }} |
{{ $a['assigned'] }}
|
@if($a['remaining'] > 0) {{ $a['remaining'] }} @else Full @endif | @if($vIdx === 0){{ number_format((float) ($item->total_items_amount ?: 0), 2) }} | @endif
| No items. | ||||||
| Tracking # | Transporter | Qty | Charges | Status | Published | Arrival Estimate | Delivered At | History |
|---|---|---|---|---|---|---|---|---|
| {{ $delivery->tracking_number }} | {{ $delivery->transporter?->company_name ?: ($delivery->transporter?->name ?: '—') }} | {{ $delivery->quantity }} | {{ number_format((float) $delivery->total_charges, 2) }} AED | {{ $dInfo['text'] }} | @if($delivery->is_published) Yes @else No @endif | {{ $delivery->arrival_estimate ? web_date_in_timezone($delivery->arrival_estimate, 'M d, Y h:i A') : '—' }} | {{ $delivery->delivered_at ? web_date_in_timezone($delivery->delivered_at, 'M d, Y h:i A') : '—' }} | @if($delivery->statusHistories->isEmpty()) — @else @endif |
|
Delivery Status History — {{ $delivery->tracking_number }}
@foreach($delivery->statusHistories->sortByDesc('created_at') as $sh)
@php
$shInfo = config("global.transporter_delivery_statuses.{$sh->status}")
?? ['text' => 'Unknown', 'class' => 'secondary'];
@endphp
{{ $shInfo['text'] }}
{{ web_date_in_timezone($sh->created_at, 'M d, Y h:i A') }}
|
||||||||
|
No deliveries yet.
@if($canCreateDelivery)
Create First Delivery
@endif
|
||||||||