@extends('layouts.app') @section('title', 'Shipment Details') @section('css') @endsection @section('content')

Shipment Details

@can('shipments-update') Edit @endcan Back to List
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
{{ __('shipment_page.shipment_information') }}
{{ __('common.resi_number') }} {{ $shipment->resi_number }}
{{ __('shipment_page.customer') }}: {{ $shipment->customer->full_name }}
{{ __('common.company') }} {{ $shipment->customer->company_name }}
{{ __('common.whatsapp') }} {{ $shipment->customer->whatsapp }} @if($shipment->customer->whatsapp) {{ __('common.available') }} @else Not {{ __('common.available') }} @endif
Status: @php $statusColors = [ 'draft' => 'secondary', 'booked' => 'info', 'loaded' => 'primary', 'in_transit' => 'warning', 'delivered' => 'success' ]; $color = $statusColors[$shipment->status] ?? 'secondary'; @endphp {{ ucfirst(str_replace('_', ' ', $shipment->status)) }}
Tracking Timeline
@php $statuses = ['draft', 'booked', 'loaded', 'in_transit', 'delivered']; $currentStatusIndex = array_search($shipment->status, $statuses); @endphp @foreach($statuses as $index => $status)
{{ ucfirst(str_replace('_', ' ', $status)) }}
@if($index == 0 && $shipment->date_received) {{ date('d M Y', strtotime($shipment->date_received)) }} @elseif($index == 2 && $shipment->date_loaded) {{ date('d M Y', strtotime($shipment->date_loaded)) }} @elseif($index == 3 && $shipment->date_departure) {{ date('d M Y', strtotime($shipment->date_departure)) }} @elseif($index == 4 && $status == $shipment->status) {{ date('d M Y') }} @endif
@endforeach
@can('shipments-update')
@csrf @method('PATCH')
@endcan
Dates & Shipping Details
{{ __('common.date_received') }} {{ date('d M Y', strtotime($shipment->date_received)) }}
{{ __('common.date_loaded') }} {{ isset($shipment->date_loaded) ? date('d M Y', strtotime($shipment->date_loaded)) : '-' }}
{{ __('common.date_departure') }} {{ isset($shipment->date_departure) ? date('d M Y', strtotime($shipment->date_departure)) : '-' }}
Est. Arrival: {{ isset($shipment->estimated_arrival) ? date('d M Y', strtotime($shipment->estimated_arrival)) : '-' }}
Cost Information
{{ __('shipment_page.total_volume_cbm') }}: {{ rtrim(rtrim(number_format($shipment->volume_cbm, 4, ',', '.'), '0'), ',') }} CBM
{{ __('shipment_page.total_weight_kg') }}: {{ $shipment->weight_kg == floor($shipment->weight_kg) ? number_format($shipment->weight_kg, 0, ',', '.') : rtrim(rtrim(number_format($shipment->weight_kg, 2, ',', '.'), '0'), ',') }} KG
{{ __('common.price_per_cbm') }} Rp {{ $shipment->price_per_cbm == floor($shipment->price_per_cbm) ? number_format($shipment->price_per_cbm, 0, ',', '.') : rtrim(rtrim(number_format($shipment->price_per_cbm, 2, ',', '.'), '0'), '.') }}
{{ __('common.price_per_kg') }} Rp {{ $shipment->price_per_kg == floor($shipment->price_per_kg) ? number_format($shipment->price_per_kg, 0, ',', '.') : rtrim(rtrim(number_format($shipment->price_per_kg, 2, ',', '.'), '0'), '.') }}
{{ __('common.discount') }} {{ $shipment->discount_amount == floor($shipment->discount_amount) ? number_format($shipment->discount_amount, 0) : rtrim(rtrim(number_format($shipment->discount_amount, 2), '0'), '.') }}
{{ __('common.total_charge') }} IDR {{ $shipment->total_charge == floor($shipment->total_charge) ? number_format($shipment->total_charge, 0, ',', '.') : rtrim(rtrim(number_format($shipment->total_charge, 2, ',', '.'), '0'), '.') }}
@if($shipment->customer->whatsapp)
@csrf
@else @endif
Shipment Items
@foreach($shipment->items as $index => $item) @endforeach
# {{ __('shipment_page.description') }} Dimensions (cm) Volume Weight {{ __('shipment_page.quantity') }}
{{ $index + 1 }} {{ $item->description }} {{ $item->length_m }} × {{ $item->width_m }} × {{ $item->height_m }} {{ rtrim(rtrim(number_format($item->volume_cbm, 4), '0'), '.') }} CBM {{ $item->weight_kg == floor($item->weight_kg) ? number_format($item->weight_kg, 0) : rtrim(rtrim(number_format($item->weight_kg, 2), '0'), '.') }} KG {{ $item->quantity }}
@endsection @section('footer') @endsection