@extends('layouts.admin') @section('title', 'Purchases') @section('page-title', 'Purchases') @section('content')
| # | PURCHASE NUMBER | PURCHASE DATE | SUPPLIER | AMOUNT | PAYMENT MODE | CREATED ON | STATUS | ACTION |
|---|---|---|---|---|---|---|---|---|
| {{ ($purchases->currentPage() - 1) * $purchases->perPage() + $index + 1 }} | {{ $purchase->purchase_number }} | {{ $purchase->purchase_date ? $purchase->purchase_date->format('M d, Y') : 'Invalid Date' }} |
@if($purchase->supplier)
@if($purchase->supplier->image && \Illuminate\Support\Facades\Storage::disk('public')->exists($purchase->supplier->image))
{{ $purchase->supplier->name ?? 'N/A' }}
?
Deleted User
|
{{ \App\Models\Currency::formatAmount($purchase->total, $purchase->currency ?? null) }} | @php $paymentMethod = $purchase->payment_method ?? 'cash'; $paymentConfig = [ 'cash' => ['label' => 'Cash $', 'bg' => 'bg-green-100', 'text' => 'text-green-800'], 'bank_transfer' => ['label' => 'Bank Transfer', 'bg' => 'bg-blue-100', 'text' => 'text-blue-800'], 'credit_card' => ['label' => 'Credit Card', 'bg' => 'bg-purple-100', 'text' => 'text-purple-800'], 'cheque' => ['label' => 'Cheque', 'bg' => 'bg-yellow-100', 'text' => 'text-yellow-800'], ]; $config = $paymentConfig[$paymentMethod] ?? $paymentConfig['cash']; @endphp {{ $config['label'] }} | {{ $purchase->created_at ? $purchase->created_at->format('M d, Y') : 'Invalid Date' }} | @php $statusConfig = [ 'new' => ['label' => 'New', 'bg' => 'bg-sky-100', 'text' => 'text-sky-900', 'icon' => 'fiber_new'], 'pending' => ['label' => 'Pending', 'bg' => 'bg-amber-100', 'text' => 'text-amber-900', 'icon' => 'schedule'], 'partially_paid' => ['label' => 'Partially Paid', 'bg' => 'bg-blue-100', 'text' => 'text-blue-900', 'icon' => 'payments'], 'completed' => ['label' => 'Completed', 'bg' => 'bg-green-100', 'text' => 'text-blue-900', 'icon' => 'check_circle'], 'cancelled' => ['label' => 'Cancelled', 'bg' => 'bg-red-100', 'text' => 'text-red-900', 'icon' => 'cancel'], ]; $status = $purchase->status ?? 'new'; $config = $statusConfig[$status] ?? $statusConfig['new']; @endphp {{ $config['label'] }} |
|
|
shopping_cart
No purchases found |
||||||||
Showing {{ $purchases->firstItem() }} to {{ $purchases->lastItem() }} of {{ $purchases->total() }} entries
Are you sure you want to delete ? This cannot be undone.