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 || '',