@extends('layouts.vendor.vendor') @section('title', 'My Orders') @section('content')
My Purchase Orders
@if(session('success'))
✓ {{ session('success') }}
@endif
@forelse($orders as $order) @php $badgeMap = [ 'pending' => ['bg' => 'warning', 'text' => 'dark'], 'accepted' => ['bg' => 'success', 'text' => 'white'], 'dispatched' => ['bg' => 'primary', 'text' => 'white'], 'delivered' => ['bg' => 'success', 'text' => 'white'], 'completed' => ['bg' => 'secondary', 'text' => 'white'], 'cancelled' => ['bg' => 'danger', 'text' => 'white'], ]; $badge = $badgeMap[$order->status] ?? $badgeMap['pending']; @endphp @empty @endforelse
PO Number Material Qty Total Amount Delivery Date Dispatch Date Status Action
{{ $order->po_number }} {{ $order->material_name }} {{ $order->quantity }} {{ $order->unit }} ₹ {{ number_format($order->total_amount, 2) }} {{ \Carbon\Carbon::parse($order->delivery_date)->format('d M Y') }} {{ $order->dispatch_date ? \Carbon\Carbon::parse($order->dispatch_date)->format('d M Y') : '—' }} {{ ucfirst($order->status) }} View →
No purchase orders found
@endsection