@extends('layouts.app') @section('title', 'View Arrival & Item Intake') @push('styles') @include('wuser.shipments.partials.intake-layout-styles') @include('wuser.partials.delivery-badge-styles') @endpush @section('content') @php $weightUnit = $parsedMeasurements['weight_unit'] ?? 'kg'; $dimensionUnit = $parsedMeasurements['dimension_unit'] ?? 'cm'; $weightNumber = isset($parsedMeasurements['weight']) ? (float) $parsedMeasurements['weight'] : 0; $lengthNumber = isset($parsedMeasurements['length']) ? (float) $parsedMeasurements['length'] : 0; $widthNumber = isset($parsedMeasurements['width']) ? (float) $parsedMeasurements['width'] : 0; $heightNumber = isset($parsedMeasurements['height']) ? (float) $parsedMeasurements['height'] : 0; $dimensional = null; $chargeable = null; if ($weightNumber > 0 && $lengthNumber > 0 && $widthNumber > 0 && $heightNumber > 0) { $lengthIn = $dimensionUnit === 'cm' ? $lengthNumber / 2.54 : $lengthNumber; $widthIn = $dimensionUnit === 'cm' ? $widthNumber / 2.54 : $widthNumber; $heightIn = $dimensionUnit === 'cm' ? $heightNumber / 2.54 : $heightNumber; $dimensionalLb = ($lengthIn * $widthIn * $heightIn) / 166; $dimensional = $weightUnit === 'kg' ? $dimensionalLb / 2.20462 : $dimensionalLb; $chargeable = max($weightNumber, $dimensional); } $figures = $shipment->shippingFigures(); $items = $shipment->items; $qtyTotal = 0; $inrTotal = 0; $usdTotal = 0; foreach ($items as $item) { $qtyTotal += (float) ($item->unit_quantity ?? 0); $inrTotal += (float) ($item->declared_value_inr ?? 0); $usdTotal += (float) ($item->declared_value_usd ?? 0); } $summaryWeight = $weightNumber > 0 ? number_format($weightNumber, 2).' '.$weightUnit : ($shipment->weight ?: '—'); $summaryDims = ($lengthNumber > 0 && $widthNumber > 0 && $heightNumber > 0) ? rtrim(rtrim(number_format($lengthNumber, 2), '0'), '.').' × '.rtrim(rtrim(number_format($widthNumber, 2), '0'), '.').' × '.rtrim(rtrim(number_format($heightNumber, 2), '0'), '.').' '.$dimensionUnit : ($shipment->dimensions ?: '—'); $statusLabel = is_array($currentStatusData ?? null) && !empty($currentStatusData['display_status']) ? $currentStatusData['display_status'] : ucfirst(str_replace('_', ' ', (string) ($shipment->status ?: 'N/A'))); $customer = $shipment->kuser; $phone = optional(optional($customer)->profile)->phone; $address = optional($shipment->virtualAddress)->formattedDeliveryAddress(); $editUrl = route('wuser.shipments.edit', \Illuminate\Support\Facades\Crypt::encrypt($shipment->id)); $portLabel = $shipment->port_of_destination === 'rest' ? 'Rest of Maldives' : ($shipment->port_of_destination === 'male' ? 'Male' : '—'); $cargoLabel = $shipment->cargo_type === 'walkin' ? 'Walk-in' : ($shipment->cargo_type === 'ecommerce' ? 'E-commerce / Assisted Purchase' : '—'); $weightText = $weightNumber > 0 ? number_format($weightNumber, 2).' '.$weightUnit : '—'; @endphp
| # | Item name | HS code | Description | UOM | Unit qty | Unit price (INR) | Declared value |
|---|---|---|---|---|---|---|---|
| {{ $loop->iteration }} | {{ $item->item_name ?: '—' }} | {{ $item->hscode ?: '—' }} | {{ $item->item_description ?: '—' }} | {{ optional($item->unitOfMeasurement)->code ?: '—' }} | {{ $item->unit_quantity !== null ? rtrim(rtrim(number_format((float) $item->unit_quantity, 2), '0'), '.') : '—' }} | {{ $item->unit_price !== null ? number_format((float) $item->unit_price, 2) : '—' }} |
₹ {{ number_format((float) ($item->declared_value_inr ?? 0), 2) }}
$ {{ number_format((float) ($item->declared_value_usd ?? 0), 2) }} USD
|
| 1 | {{ $shipment->item_name ?: '—' }} | — | {{ $shipment->item_description ?: '—' }} | — | — | — | — |
| {{ rtrim(rtrim(number_format($qtyTotal, 2), '0'), '.') }} |
₹ {{ number_format($inrTotal, 2) }}
${{ number_format($usdTotal, 2) }} USD
|
||||||
{{ $shipment->notes ?: 'No notes recorded for this package.' }}