Add 'cancelled' status to invoices
This commit is contained in:
@@ -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 {
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user