Add 'cancelled' status to invoices

This commit is contained in:
2025-10-30 15:38:41 +01:00
parent ef6f4a6418
commit 5c579dbd83
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ class InvoiceFactory extends Factory
*/
public function definition(): array
{
$payment_status = $this->faker->randomElement(['draft', 'issued', 'paid', 'due', 'reminded']);
$payment_status = $this->faker->randomElement(['draft', 'issued', 'paid', 'due', 'reminded', 'cancelled']);
return [
'nr' => ($payment_status == 'draft') ? null : $this->faker->unique()->numerify('RE-###'),
@@ -18,6 +18,8 @@ export const statusBadgeVariants = cva(
"border-transparent bg-amber-300 text-amber-900 [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
reminded:
"border-transparent bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
cancelled:
"text-foreground bg-slate-400 dark:bg-zinc-700 [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
},
size: {
@@ -39,7 +41,8 @@ export const statusBadgeLabels: { [key: string]: string } = {
issued: 'Gestellt',
paid: 'Bezahlt',
due: 'Fällig',
reminded: 'Gemahnt'
reminded: 'Gemahnt',
cancelled: 'Storniert'
}
export function statusBadgeTextColor(status: string): string {
+1 -1
View File
@@ -139,7 +139,7 @@ export interface Invoice {
isRecurring: boolean;
isPartialService: boolean;
customer?: Customer | null;
paymentStatus: 'draft' | 'issued' | 'paid' | 'due' | 'reminded';
paymentStatus: 'draft' | 'issued' | 'paid' | 'due' | 'reminded' | 'cancelled';
totalAmount: number;
title: string;
text: string;