@extends('layouts.app') @section('title', 'Shipment Details') @push('styles') @endpush @section('content')
@if(session('success')) @endif @if(session('error')) @endif

Consolidation & Freight

@if(strtolower((string) $shipmentPayment->payment_method) === 'pathway b')
Link: {{ $shipmentPayment->maldivianpost_link_status ?: 'Not sent' }} @if($shipmentPayment->maldivianpost_link_date) · {{ $shipmentPayment->maldivianpost_link_date->format('d M Y, h:i A') }} @endif
Payment: {{ $shipmentPayment->maldivianpost_payment_status ?: 'Not completed' }} @if($shipmentPayment->maldivianpost_payment_date) · {{ $shipmentPayment->maldivianpost_payment_date->format('d M Y, h:i A') }} @endif
@if(strtolower((string) $shipmentPayment->maldivianpost_payment_status) !== 'payment completed')
@csrf
@endif
@endif
@php $allShipments = $shipmentPayment->warehousePaymentShipments->map(function($wps) { return $wps->shipment; })->filter()->unique('id')->values(); if ($allShipments->isEmpty()) { $shipment = $shipmentPayment->shipment; if ($shipment) { $allShipments = collect([$shipment]); } } $firstShipment = $allShipments->first(); $latestTrackingStatus = $shipmentPayment->latestTrackingStatus; $currentStatus = $latestTrackingStatus ? $latestTrackingStatus->status : null; $currentDisplayStatus = $latestTrackingStatus ? $latestTrackingStatus->display_status : 'Unknown'; @endphp
Tracking Number {{ $shipmentPayment->tracking_number ?? 'N/A' }}
Suite Number {{ $firstShipment->suite_number ?? 'N/A' }}
Customer {{ $firstShipment->kuser->profile->first_name ?? '' }} {{ $firstShipment->kuser->profile->last_name ?? '' }}
Payment Amount ₹{{ number_format($shipmentPayment->amount, 2) }}
Payment Status {{ ucfirst($shipmentPayment->payment_status ?? 'pending') }}
Current Status {{ $currentDisplayStatus }}
@if($allShipments->count() > 0)
Packages ({{ $allShipments->count() }}):
@foreach($allShipments as $index => $shipment) @endforeach
Package # Sender Item Name Declared Value (USD)
Package #{{ $index + 1 }} {{ $shipment->sender_name ?? '-' }} @if($shipment->item_name) {{ $shipment->item_name }} @elseif($shipment->item_description) {{ $shipment->item_description }} @else - @endif @if($shipment->declared_value) ${{ number_format($shipment->declared_value, 2) }} @else - @endif
@endif @if($shipmentPayment->trackingStatuses && $shipmentPayment->trackingStatuses->count() > 0)
Tracking History:
@include('partials.mms-tracking-number', ['mmsTrackingNumber' => $shipmentPayment->activeMmsTrackingNumberList()])
@foreach($shipmentPayment->trackingStatuses->sortBy('status_date') as $status) @endforeach
Status Description Date
{{ $status->display_status }} {{ $status->description ?? '-' }} {{ $status->status_date ? $status->status_date->format('d M Y, h:i A') : '-' }}
@endif
Current Status
@if($currentStatusInfo)
{{ $currentStatusInfo['display_status'] }}

{{ $currentStatusInfo['description'] }}

@if(isset($latestStatusDate) && $latestStatusDate)
Last updated: {{ \Carbon\Carbon::parse($latestStatusDate)->format('M d, Y H:i') }}
@endif @else

Status information not available

@endif
@if(count($nextStatuses) > 0)
Update Status
@csrf @method('PUT')

Select the next status to update:

@foreach($nextStatuses as $statusKey => $statusInfo)
@endforeach
@else
This shipment has reached its final destination or no further status update is available.
@endif
@endsection @push('scripts') @endpush