From 358688db9e5d465c6736d1cff36f0f652d182787 Mon Sep 17 00:00:00 2001 From: duffyduck Date: Tue, 2 Jun 2026 15:17:48 +0200 Subject: [PATCH] =?UTF-8?q?PDF-Templates:=20billingAddress.full=20und=20.c?= =?UTF-8?q?ountry=20als=20Slots=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Analog zu address.full/.country: wer im Auftragsformular eine Zeile "Rechnungsstraße 1, 10115 Berlin" als Single-Slot braucht, kann jetzt billingAddress.full mappen statt Straße + PLZ + Stadt einzeln. Plus billingAddress.country für Vollständigkeit. Beide Slots greifen auf das gleiche bAddr-Resolve (Fallback auf Lieferadresse) zu, wenn keine separate Rechnungsadresse hinterlegt ist. Co-Authored-By: Claude Opus 4.7 (1M context) --- backend/src/services/pdfTemplate.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/services/pdfTemplate.service.ts b/backend/src/services/pdfTemplate.service.ts index e4bbf1ec..888f872c 100644 --- a/backend/src/services/pdfTemplate.service.ts +++ b/backend/src/services/pdfTemplate.service.ts @@ -45,13 +45,16 @@ export const CRM_FIELDS = [ { path: 'owner.phone', label: 'Telefon', group: 'Eigentümer' }, { path: 'owner.mobile', label: 'Mobil', group: 'Eigentümer' }, { path: 'owner.email', label: 'E-Mail', group: 'Eigentümer' }, - // Rechnungsadresse + // Rechnungsadresse (Fallback auf Lieferadresse, wenn keine separate + // Rechnungsadresse gepflegt ist – siehe billingAddress-Resolve im Code) { path: 'billingAddress.street', label: 'Straße (Rechnung)', group: 'Rechnungsadresse' }, { path: 'billingAddress.houseNumber', label: 'Hausnummer (Rechnung)', group: 'Rechnungsadresse' }, { path: 'billingAddress.streetFull', label: 'Straße + Nr. (Rechnung)', group: 'Rechnungsadresse' }, { path: 'billingAddress.postalCode', label: 'PLZ (Rechnung)', group: 'Rechnungsadresse' }, { path: 'billingAddress.city', label: 'Stadt (Rechnung)', group: 'Rechnungsadresse' }, { path: 'billingAddress.postalCodeCity', label: 'PLZ + Stadt (Rechnung)', group: 'Rechnungsadresse' }, + { path: 'billingAddress.country', label: 'Land (Rechnung)', group: 'Rechnungsadresse' }, + { path: 'billingAddress.full', label: 'Vollständige Adresse (Rechnung)', group: 'Rechnungsadresse' }, // Bankverbindung { path: 'bankCard.iban', label: 'IBAN', group: 'Bank' }, { path: 'bankCard.bic', label: 'BIC', group: 'Bank' }, @@ -442,6 +445,8 @@ export async function generateFilledPdf( 'billingAddress.postalCode': bAddr?.postalCode || '', 'billingAddress.city': bAddr?.city || '', 'billingAddress.postalCodeCity': bAddr ? `${bAddr.postalCode} ${bAddr.city}` : '', + 'billingAddress.country': bAddr?.country || '', + 'billingAddress.full': bAddr ? `${bAddr.street} ${bAddr.houseNumber}, ${bAddr.postalCode} ${bAddr.city}` : '', // Bank 'bankCard.iban': bankCard?.iban || '', 'bankCard.bic': bankCard?.bic || '',