@extends('layouts.admin') @section('title', 'Invoices') @section('page-title', 'Invoices') @section('content')

Invoices

add New Invoice
@if(request('search')) @endif @if(request('status')) @endif
@if(request('per_page')) @endif @if(request('status')) @endif @if(request('search')) close @endif
@forelse($invoices as $index => $invoice) @empty @endforelse
# 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

@if($invoices->hasPages())

Showing {{ $invoices->firstItem() }} to {{ $invoices->lastItem() }} of {{ $invoices->total() }} entries

@if($invoices->onFirstPage()) @else Previous @endif @php $currentPage = $invoices->currentPage(); $lastPage = $invoices->lastPage(); $startPage = max(1, $currentPage - 1); $endPage = min($lastPage, $currentPage + 1); @endphp @if($startPage > 1) 1 @if($startPage > 2) ... @endif @endif @for($page = $startPage; $page <= $endPage; $page++) {{ $page }} @endfor @if($endPage < $lastPage) @if($endPage < $lastPage - 1) ... @endif {{ $lastPage }} @endif @if($invoices->hasMorePages()) Next @else @endif
@endif
@endsection