@extends('admin.layouts.app') @section('page-title', 'Orders') @section('content')
Orders Management
{{ $orders->count() }}
Total Orders
{{ $orders->where('invoice.status', 'pending')->count() }}
Pending Invoices
{{ $orders->where('invoice.status', 'overdue')->count() }}
Overdue Invoices
@if(isset($orders) && $orders->count() > 0)
@foreach($orders as $order) @php $mark = $order->markList ?? null; $invoice = $order->invoice ?? null; $shipment = $order->shipments->first() ?? null; $invoiceStatus = strtolower($invoice->status ?? ''); $shipmentStatus = strtolower(str_replace('_', ' ', $shipment->status ?? '')); @endphp @endforeach
Order ID Shipment ID Customer ID Company Origin Destination Order Date Invoice No Invoice Date Amount Amount + GST Invoice Status Shipment Status Action
{{ $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) : '-' }} @if($invoice?->status) {{ ucfirst($invoice->status) }} @else Pending @endif @if($shipment?->status) {{ ucfirst($shipmentStatus) }} @else Pending @endif
{{-- End table-wrapper --}}
Showing 1 to {{ min(10, count($orders)) }} of {{ count($orders) }} entries
@else
No orders found

There are currently no orders in the system.

@endif
@endsection