@extends('layouts.admin', [ 'title' => 'Invoices', 'pageTitle' => 'Invoices', 'active' => 'invoices', ]) @php $statusVariants = [ 'draft' => 'muted', 'unpaid' => 'warning', 'partial' => 'purple', 'paid' => 'success', 'overdue' => 'danger', 'cancelled' => 'muted', ]; $money = fn ($amount, $currency = 'USD') => $currency.' '.number_format((float) $amount, 2); $summary = [ ['label' => 'Total Invoices', 'value' => number_format($stats['total']), 'note' => number_format($stats['this_month']).' this month', 'icon' => 'file-text', 'class' => 'bg-blue-50 text-booklio-primary'], ['label' => 'Paid Revenue', 'value' => $money($stats['paid_revenue'], $currentBusiness?->currency ?? 'USD'), 'note' => 'Recorded payments', 'icon' => 'dollar-sign', 'class' => 'bg-emerald-50 text-emerald-600'], ['label' => 'Outstanding', 'value' => $money($stats['outstanding'], $currentBusiness?->currency ?? 'USD'), 'note' => number_format($stats['due_count']).' invoices due', 'icon' => 'clock', 'class' => 'bg-amber-50 text-amber-600'], ['label' => 'Overdue', 'value' => number_format($stats['overdue_count']), 'note' => $money($stats['overdue_total'], $currentBusiness?->currency ?? 'USD').' needs action', 'icon' => 'alert-triangle', 'class' => 'bg-red-50 text-red-600'], ]; @endphp @section('content')

Manage invoice billing, payments, balances, and PDF previews.

Create Invoice
@foreach ($summary as $item)

{{ $item['label'] }}

{{ $item['value'] }}

{{ $item['note'] }}

@endforeach
Filter Reset
@if ($invoices->isEmpty()) @else
@foreach ($invoices as $invoice)

{{ $invoice->invoice_number }}

{{ $invoice->customer?->name ?? 'Walk-in customer' }}

{{ $invoice->status_label }}

Amount

{{ $money($invoice->total, $invoice->currency) }}

Balance

{{ $money($invoice->balance_due, $invoice->currency) }}

Issued

{{ $invoice->issue_date?->format('M d, Y') ?? '-' }}

Due

{{ $invoice->due_date?->format('M d, Y') ?? '-' }}

View Payment
@endforeach
@endif
@push('modals') @foreach ($invoices as $invoice) @include('admin.invoices.partials.payment-modal', ['invoice' => $invoice, 'paymentMethods' => $paymentMethods]) @endforeach @endpush @endsection