@extends('layouts.app') @section('title', 'List Orders') @section('content')
{{-- ========================================================= PAGE HEADER ========================================================== --}}

Order Management

View, search, and manage all customer orders.

{{-- ========================================================= SUMMARY CARDS ========================================================== --}}
{{-- TOTAL ORDERS --}}

Total Orders

{{ $totalOrders }}

{{-- PENDING ORDERS --}}

Pending Orders

{{ $pendingOrders }}

{{-- COMPLETED ORDERS --}}

Completed Orders

{{ $completedOrders }}

{{-- CREATE NEW ORDER --}}
{{-- ========================================================= SEARCH & FILTER ========================================================== --}}

Search & Filter Orders

{{-- SEARCH ORDER --}}
{{-- STATUS --}}
{{-- DATE --}}
{{-- SEARCH BUTTON --}}
{{-- RESET --}}
{{-- ========================================================= ORDERS TABLE ========================================================== --}}

All Orders

{{ $orders->count() }} order(s)
@forelse($orders as $order) {{-- ORDER NUMBER --}} {{-- ORDER DATE --}} {{-- CUSTOMER --}} {{-- TOTAL ITEMS --}} {{-- GRAND TOTAL --}} {{-- PAYMENT STATUS --}} {{-- ORDER STATUS --}} {{-- TAKEN BY --}} {{-- ACTIONS --}} @empty @endforelse
Order Number Order Date Customer Name Total Items Grand Total Payment Status Order Status Taken By Actions
{{ $order->serial_number }} @if($order->taken_at) {{ \Carbon\Carbon::parse($order->taken_at)->format('d M Y') }} @else N/A @endif @if($order->customer) {{ $order->customer->customer_name }} @if($order->customer->shop_name)
{{ $order->customer->shop_name }} @endif @else N/A @endif
{{ $order->details->sum('quantity') }} Rs. {{ number_format((float) $order->total_amount, 2) }} Pending @php $statusName = strtolower( $order->status->status_name ?? '' ); @endphp @if( $statusName === 'delivered' || $statusName === 'completed' ) {{ $order->status->status_name }} @elseif($statusName === 'pending') {{ $order->status->status_name }} @elseif($statusName === 'cancelled') {{ $order->status->status_name }} @else {{ $order->status->status_name ?? 'N/A' }} @endif @if($order->takenBy) {{ $order->takenBy->user_name }} @else N/A @endif @if($order->invoice) {{-- VIEW INVOICE --}} {{-- EDIT ORDER --}} {{-- DELETE INVOICE --}}
@csrf @method('DELETE')
@else No Invoice @endif
No Orders Found

There are no orders matching your search.

@endsection