From f7226604e2f7a508f5e496fca3198a67e2d02854 Mon Sep 17 00:00:00 2001 From: Sven Carstensen Date: Wed, 18 Mar 2026 11:51:44 +0100 Subject: [PATCH] feat: Split customer address into separate fields in invoice template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace combined 'customer-address' with 4 separate elements: - customer-street (Straße) - customer-house-number (Hausnummer) - customer-postal-code (PLZ) - customer-city (Ort) Update starter layout to use new separate fields with appropriate positioning. --- frontend/src/pages/InvoiceTemplatePage.tsx | 53 +++++++++++++++++++--- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/frontend/src/pages/InvoiceTemplatePage.tsx b/frontend/src/pages/InvoiceTemplatePage.tsx index fd464cb..9b1eb7d 100644 --- a/frontend/src/pages/InvoiceTemplatePage.tsx +++ b/frontend/src/pages/InvoiceTemplatePage.tsx @@ -36,7 +36,10 @@ const INVOICE_LOCKED_TEXT_PALETTE_IDS = new Set([ "invoice-due-date", "customer-number", "customer-name", - "customer-address", + "customer-street", + "customer-house-number", + "customer-postal-code", + "customer-city", "customer-email", "customer-phone", "invoice-subtotal", @@ -225,15 +228,48 @@ const INVOICE_PALETTE_ITEMS: PaletteItem[] = [ defaultContent: () => "VoS, Dirk Schwissel", }, { - id: "customer-address", + id: "customer-street", category: "customer-data", - label: "Kundenadresse", - description: "Adresse des Kunden", - width: 280, + label: "Kunden-Straße", + description: "Straße des Kunden", + width: 200, fontSize: 14, fontWeight: 400, textAlign: "left", - defaultContent: () => "Musterstraße 123\n12345 Musterstadt", + defaultContent: () => "Musterstraße", + }, + { + id: "customer-house-number", + category: "customer-data", + label: "Kunden-Hausnummer", + description: "Hausnummer des Kunden", + width: 80, + fontSize: 14, + fontWeight: 400, + textAlign: "left", + defaultContent: () => "123", + }, + { + id: "customer-postal-code", + category: "customer-data", + label: "Kunden-PLZ", + description: "Postleitzahl des Kunden", + width: 80, + fontSize: 14, + fontWeight: 400, + textAlign: "left", + defaultContent: () => "12345", + }, + { + id: "customer-city", + category: "customer-data", + label: "Kunden-Ort", + description: "Ort des Kunden", + width: 200, + fontSize: 14, + fontWeight: 400, + textAlign: "left", + defaultContent: () => "Musterstadt", }, { id: "customer-email", @@ -922,7 +958,10 @@ function createInvoiceStarterLayout(user: UserOption | null, paletteItems: Palet createElementFromPalette(requirePaletteItem(paletteItems, "invoice-due-date"), user, { x: 480, y: 148 }), horizontalLine(56, 200, 646), createElementFromPalette(requirePaletteItem(paletteItems, "customer-name"), user, { x: 56, y: 220 }), - createElementFromPalette(requirePaletteItem(paletteItems, "customer-address"), user, { x: 56, y: 246 }), + createElementFromPalette(requirePaletteItem(paletteItems, "customer-street"), user, { x: 56, y: 246 }), + createElementFromPalette(requirePaletteItem(paletteItems, "customer-house-number"), user, { x: 260, y: 246 }), + createElementFromPalette(requirePaletteItem(paletteItems, "customer-postal-code"), user, { x: 56, y: 270 }), + createElementFromPalette(requirePaletteItem(paletteItems, "customer-city"), user, { x: 140, y: 270 }), createElementFromPalette(requirePaletteItem(paletteItems, "customer-number"), user, { x: 56, y: 290 }), horizontalLine(56, 330, 646), createElementFromPalette(requirePaletteItem(paletteItems, "invoice-subtotal"), user, { x: 500, y: 460 }),