@foreach($orders as $order)
@php
$mark = $order->markList ?? null;
$invoice = $order->invoice ?? null;
$shipment = $order->shipments->first() ?? null;
// Normalized status values for consistent CSS classes
$invoiceStatus = strtolower($invoice?->status ?? 'pending');
$shipmentStatus = strtolower($shipment?->status ?? 'pending');
$shipmentStatusForCss = str_replace([' ', '-'], '_', $shipmentStatus);
@endphp
| {{ $order->order_id ?? '-' }} |
{{ $shipment?->shipment_id ?? '-' }} |
{{ $mark?->customer_id ?? '-' }} |
{{ $mark?->company_name ?? '-' }} |
{{ $mark?->origin ?? $order->origin ?? '-' }} |
{{ $mark?->destination ?? $order->destination ?? '-' }} |
{{ $order->created_at ? $order->created_at->format('d-m-Y') : '-' }} |
{{ $invoice?->invoice_number ?? '-' }} |
{{ $invoice?->invoice_date ? date('d-m-Y', strtotime($invoice->invoice_date)) : '-' }}
|
{{ $invoice?->final_amount ? '₹'.number_format($invoice->final_amount, 2) : '-' }}
|
{{ $invoice?->final_amount_with_gst ? '₹'.number_format($invoice->final_amount_with_gst, 2) : '-' }}
|
{{ ucfirst($invoiceStatus) }}
|
{{ ucfirst($shipmentStatus) }}
|
|
@endforeach