TP-20240927-importfixes #115

Merged
hsh-michaelhoennig merged 33 commits from TP-20240927-importfixes into master 2024-11-21 10:27:36 +01:00
Showing only changes of commit 141f761ded - Show all commits

View File

@ -9,19 +9,20 @@ SELECT
max(p.partnernumber::text) as number, max(p.partnernumber::text) as number,
max(debitor.defaultprefix) as code, max(debitor.defaultprefix) as code,
c.emailaddresses->>'main' as login, c.emailaddresses->>'main' as login,
max(per.salutation) as salut, (CASE WHEN max(per.salutation) <> '' THEN max(per.salutation) ELSE NULL END) as salut,
max(per.givenname) as firstname, (CASE WHEN max(per.givenname) <> '' THEN max(per.givenname) ELSE NULL END) as firstname,
max(per.familyname) as lastname, (CASE WHEN max(per.familyname) <> '' THEN max(per.familyname) ELSE NULL END) as lastname,
max(per.title) as title, (CASE WHEN max(per.title) <> '' THEN max(per.title) ELSE NULL END) as title,
max(per.tradename) as firma, (CASE WHEN max(per.tradename) <> '' THEN max(per.tradename) ELSE NULL END) as firma,
max(c.postaladdress->>'co') as co, (CASE WHEN max(c.postaladdress->>'co') <> '' THEN max(c.postaladdress->>'co') ELSE NULL END) as co,
max(c.postaladdress->>'street') as street, max(c.postaladdress->>'street') as street,
max(c.postaladdress->>'zipcode') as zipcode, max(c.postaladdress->>'zipcode') as zipcode,
max(c.postaladdress->>'city') as city, max(c.postaladdress->>'city') as city,
max(c.postaladdress->>'country') as country, max(c.postaladdress->>'country') as country,
c.phonenumbers->>'phone_office' as phoneoffice, concat_ws(', '::text, c.phonenumbers->>'phone_office', c.phonenumbers->>'phone_private') AS phone,
c.phonenumbers->>'phone_office' as phone_office,
c.phonenumbers->>'phone_private' as phone_private,
c.phonenumbers->>'phone_mobile' as mobile, c.phonenumbers->>'phone_mobile' as mobile,
c.phonenumbers->>'phone_private' as phoneprivate,
c.phonenumbers->>'fax' as fax, c.phonenumbers->>'fax' as fax,
c.emailaddresses->>'main' as email, c.emailaddresses->>'main' as email,
string_agg(CASE WHEN relation.mark IS NULL THEN relation.type::text ELSE CONCAT(relation.type::text, ':', relation.mark::text) END, '/'::text) AS comment, string_agg(CASE WHEN relation.mark IS NULL THEN relation.type::text ELSE CONCAT(relation.type::text, ':', relation.mark::text) END, '/'::text) AS comment,