From 0ecb4d80c1e8d90a5aee2da6755b804c65acdc83 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 18 Feb 2026 13:35:11 +0200 Subject: [PATCH] feat: integrate template picker into invoice create and preview views --- src/views/Invoices.vue | 645 ++++++++++++++++++++++++++++++----------- 1 file changed, 476 insertions(+), 169 deletions(-) diff --git a/src/views/Invoices.vue b/src/views/Invoices.vue index f85bd0a..0906b14 100644 --- a/src/views/Invoices.vue +++ b/src/views/Invoices.vue @@ -119,99 +119,272 @@ -
-

Create Invoice

+
+
+ +
+ +
+
+ +
+ +
+ +
+

Available tokens:

+
+

{YYYY} — {{ new Date().getFullYear() }}

+

{YY} — {{ String(new Date().getFullYear()).slice(-2) }}

+

{MM} — {{ String(new Date().getMonth() + 1).padStart(2, '0') }}

+

{DD} — {{ String(new Date().getDate()).padStart(2, '0') }}

+

{###} — next number ({{ String(invoicesStore.invoices.length + 1).padStart(3, '0') }})

+
+

e.g. INV-{YYYY}-{###}

+
+
+
+

+ Preview: {{ resolvedInvoiceNumber }} +

+
- - +
+ + +
+ +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+

{{ selectedClient.name }}

+ Bill To +
+
+

{{ selectedClient.company }}

+

{{ selectedClient.email }}

+

{{ selectedClient.phone }}

+

{{ selectedClient.address }}

+

Tax ID: {{ selectedClient.tax_id }}

+
+

+ Terms: {{ selectedClient.payment_terms }} +

+
+
+

Select a client to see their billing info

+
+
+
+ + +
+
+

Line Items

+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + +
DescriptionQtyRateAmount
+ + + + + + + {{ formatCurrency(item.quantity * item.unit_price) }} + + +
+
+ No line items. Import from a project or add rows manually. +
+
+ + +
+ +
+ + +
+ + +
+
+
+ + +
+
+ + +
+
+
+
+ Subtotal: + {{ formatCurrency(calculateSubtotal()) }} +
+
+ Tax ({{ createForm.tax_rate }}%): + {{ formatCurrency(calculateTax()) }} +
+
+ Discount: + -{{ formatCurrency(createForm.discount) }} +
+
+ Total: + {{ formatCurrency(calculateTotal()) }} +
+
+
+
+ +
- - Invoice Template +
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
- - -
- - -
-
- Subtotal: - {{ formatCurrency(calculateSubtotal()) }} -
-
- Tax ({{ createForm.tax_rate }}%): - {{ formatCurrency(calculateTax()) }} -
-
- Discount: - -{{ formatCurrency(createForm.discount) }} -
-
- Total: - {{ formatCurrency(calculateTotal()) }} -
-
- -
+
- +
-
-
-
-

{{ selectedInvoice?.invoice_number }}

-

{{ getClientName(selectedInvoice?.client_id || 0) }}

-
- -
+ +
+ + + +
-
-
-
-

Invoice Date

-

{{ formatDate(selectedInvoice?.date || '') }}

-
-
-

Due Date

-

{{ selectedInvoice?.due_date ? formatDate(selectedInvoice.due_date) : '-' }}

-
-
- -
-
- Subtotal: - {{ formatCurrency(selectedInvoice?.subtotal || 0) }} -
-
- Tax ({{ selectedInvoice?.tax_rate || 0 }}%): - {{ formatCurrency(selectedInvoice?.tax_amount || 0) }} -
-
- Discount: - -{{ formatCurrency(selectedInvoice?.discount || 0) }} -
-
- Total: - {{ formatCurrency(selectedInvoice?.total || 0) }} -
-
- -
-

Notes

-

{{ selectedInvoice.notes }}

-
-
- -
- -
+ +
+
@@ -334,19 +479,35 @@