From 0dc316067837b7d3521a6bb079919e9e1770e8b6 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Wed, 28 Jan 2026 08:21:19 -0600 Subject: [PATCH] Enhancements to invoice list. --- app/Enums/InvoiceStatus.php | 20 +++++++++++++ .../views/components/⚡invoice-list.blade.php | 28 ++++++++++++++++--- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/app/Enums/InvoiceStatus.php b/app/Enums/InvoiceStatus.php index 5f8d995..ec8eedc 100644 --- a/app/Enums/InvoiceStatus.php +++ b/app/Enums/InvoiceStatus.php @@ -8,4 +8,24 @@ enum InvoiceStatus: string case POSTED = 'posted'; case VOID = 'void'; case PAID = 'paid'; + + public function label(): string + { + return match ($this) { + self::DRAFT => 'Draft', + self::POSTED => 'Posted', + self::VOID => 'Voided', + self::PAID => 'Paid', + }; + } + + public function color(): string + { + return match ($this) { + self::DRAFT => 'gray', + self::POSTED => 'green', + self::VOID => 'zinc', + self::PAID => 'blue', + }; + } } diff --git a/resources/views/components/⚡invoice-list.blade.php b/resources/views/components/⚡invoice-list.blade.php index e4b7a8e..18fd3ef 100644 --- a/resources/views/components/⚡invoice-list.blade.php +++ b/resources/views/components/⚡invoice-list.blade.php @@ -1,5 +1,6 @@ - +
@@ -74,10 +75,29 @@ new class extends Component { {{ $invoice->invoice_number }} {{ $invoice->client->abbreviation }} - {{ $invoice->status->value }} + + + {{ $invoice->status->label() }} + + {{ $invoice->invoice_date?->format('m/d/Y') }} - {{ $invoice->sent_at?->format('m/d/Y') }} - {{ $invoice->due_date?->format('m/d/Y') }} + + @if($invoice->sent_at) + {{ $invoice->sent_at->format('m/d/Y') }} + @elseif($invoice->status === InvoiceStatus::POSTED) + Not Sent + @endif + + + + @if($invoice->due_date) + + {{ $invoice->due_date?->format('m/d/Y') }} + + @endif + {{ formatMoney($invoice->total) }}