From 00f6b9842ec147293f0bbdeac18315a6ff7f514a Mon Sep 17 00:00:00 2001 From: Thomas Reitz Date: Wed, 11 Mar 2026 11:20:07 +0100 Subject: [PATCH] fix(crm): link imported Ansprechpartner to CRM company via companyId When importing contact persons from Lexware, if the parent company is already in the CRM (detected via linkedMap), the companyId is now passed to createContact so the contact is properly associated. Co-Authored-By: Claude Opus 4.6 --- packages/frontend/src/crm/lexware/LexwareSyncPage.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/frontend/src/crm/lexware/LexwareSyncPage.tsx b/packages/frontend/src/crm/lexware/LexwareSyncPage.tsx index 1ff5252..627ff8a 100644 --- a/packages/frontend/src/crm/lexware/LexwareSyncPage.tsx +++ b/packages/frontend/src/crm/lexware/LexwareSyncPage.tsx @@ -146,6 +146,7 @@ function ImportTab() { const handleImportContactPerson = ( person: LexwareContactPersonEntry, companyName: string, + companyId?: string, ) => { const cpName = [person.firstName, person.lastName].filter(Boolean).join(' ') || @@ -156,6 +157,7 @@ function ImportTab() { lastName: person.lastName || undefined, email: person.emailAddress || undefined, phone: person.phoneNumber || undefined, + companyId: companyId || undefined, companyName: companyName || undefined, type: 'PERSON', }, @@ -417,6 +419,7 @@ function ImportTab() { handleImportContactPerson( cp, contact.company?.name ?? '', + linked?.type === 'company' ? linked.id : undefined, ) } title={`${cpName} als CRM-Kontakt importieren`}