@extends('layouts.admin') @section('title', 'Invoices') @section('page-title', 'Invoices') @section('content')
| # | INVOICE ID | CUSTOMER | AMOUNT | PAID | STATUS | CREATED ON | ACTIONS |
|---|---|---|---|---|---|---|---|
| {{ ($invoices->currentPage() - 1) * $invoices->perPage() + $index + 1 }} | {{ $invoice->invoice_number }} |
{{ strtoupper(substr($invoice->customer->name ?? 'N', 0, 1)) }}
{{ $invoice->customer->name ?? 'N/A' }}
{{ $invoice->customer->email ?? 'N/A' }}
|
{{ \App\Models\Currency::formatAmount($invoice->total, $invoice->currency) }} | {{ \App\Models\Currency::formatAmount($invoice->paid_amount, $invoice->currency) }} | @php $statusConfig = [ 'draft' => ['label' => 'Draft', 'bg' => 'bg-gray-100', 'text' => 'text-gray-800', 'icon' => 'description'], 'partial' => ['label' => 'Partially Paid', 'bg' => 'bg-blue-100', 'text' => 'text-blue-800', 'icon' => 'sync'], 'paid' => ['label' => 'Paid', 'bg' => 'bg-green-100', 'text' => 'text-green-800', 'icon' => 'check_circle'], 'sent' => ['label' => 'Sent', 'bg' => 'bg-blue-100', 'text' => 'text-blue-800', 'icon' => 'send'], 'viewed' => ['label' => 'Viewed', 'bg' => 'bg-purple-100', 'text' => 'text-purple-800', 'icon' => 'visibility'], 'unpaid' => ['label' => 'Unpaid', 'bg' => 'bg-yellow-100', 'text' => 'text-yellow-800', 'icon' => 'close'], 'overdue' => ['label' => 'Overdue', 'bg' => 'bg-red-100', 'text' => 'text-red-800', 'icon' => 'warning'], ]; $status = $invoice->status === 'partial' ? 'partial' : ($invoice->balance == 0 && $invoice->status !== 'draft' && $invoice->status !== 'sent' && $invoice->status !== 'viewed' ? 'paid' : ($invoice->balance > 0 && $invoice->status === 'sent' ? 'unpaid' : $invoice->status)); $config = $statusConfig[$status] ?? $statusConfig['draft']; $isViewedStatus = $status === 'viewed'; @endphp @if($isViewedStatus) {{ $config['icon'] }} {{ $config['label'] }} @else @endif | {{ $invoice->created_at->format('m/d/y') }} |
|
|
description
No invoices found |
|||||||
Showing {{ $invoices->firstItem() }} to {{ $invoices->lastItem() }} of {{ $invoices->total() }} entries
This action cannot be undone
Are you sure you want to delete invoice ? This will permanently remove the invoice and all associated data.