diff --git a/app/company-settings-preview/page.tsx b/app/company-settings-preview/page.tsx index 578532f..26aa1c2 100644 --- a/app/company-settings-preview/page.tsx +++ b/app/company-settings-preview/page.tsx @@ -15,6 +15,8 @@ const FALLBACK: CompanySettings = { registerCourt: null, registerNumber: null, managingDirector: null, + shareCapital: null, + generalPartners: null, sellerStreet: "", sellerZip: "", sellerCity: "", diff --git a/app/impressum/components/AnbieterAngaben.tsx b/app/impressum/components/AnbieterAngaben.tsx index d774c9f..1058a27 100644 --- a/app/impressum/components/AnbieterAngaben.tsx +++ b/app/impressum/components/AnbieterAngaben.tsx @@ -4,8 +4,8 @@ import type { CompanySettings } from "../../lib/payload"; import type { TOCSection } from "../../components/SectionTOC"; // Renders "Angaben zum Anbieter"/"Umsatzsteuer"/(conditionally) -// "Handelsregister"/"Geschäftsführung"/"Verantwortlich für den Inhalt" -// straight from company-settings, matching RichText.tsx's own heading/ +// "Handelsregister"/"Geschäftsführung"/"Gesellschafter"/"Verantwortlich für +// den Inhalt" straight from company-settings, matching RichText.tsx's own heading/ // paragraph classes so it reads as one continuous page with the CMS // content below it, not a bolted-on block. This used to be hand-typed // prose baked into the Impressum's richText (seed-legal-pages.ts on the @@ -17,17 +17,21 @@ import type { TOCSection } from "../../components/SectionTOC"; // already uses (see page.tsx's comment on that). // // Also closes a real compliance gap the old hand-typed text had: it never -// showed Handelsregister/Geschäftsführung at all, even though -// company-settings already models both (§37a HGB/§35a GmbHG) — those -// fields just weren't wired into the Impressum. A sole proprietorship -// (this shop's current legalForm) has neither, so neither section shows -// today, but the moment that changes in company-settings, the Impressum -// picks it up automatically instead of needing a second manual edit. +// showed Handelsregister/Geschäftsführung/Gesellschafter/Stammkapital at +// all, even though company-settings models all of them (§37a HGB/§35a +// GmbHG/§80 AktG) — those fields just weren't wired into the Impressum. A +// sole proprietorship (this shop's current legalForm) needs none of them, +// so nothing extra shows today, but the moment legalForm changes in +// company-settings (e.g. incorporating as a GmbH), the Impressum picks up +// Handelsregister/Geschäftsführung/Stammkapital automatically — same for +// generalPartners/"Gesellschafter" on an OHG/KG — instead of needing a +// second manual edit here. export function anbieterAngabenHeadings(seller: CompanySettings | null): TOCSection[] { if (!seller) return []; const sections = ["Angaben zum Anbieter", "Umsatzsteuer"]; if (seller.registerCourt && seller.registerNumber) sections.push("Handelsregister"); if (seller.managingDirector) sections.push("Geschäftsführung"); + if (seller.generalPartners && seller.generalPartners.length > 0) sections.push("Gesellschafter"); sections.push("Verantwortlich für den Inhalt"); return sections.map((title) => ({ id: headingId(title), title })); } @@ -70,6 +74,7 @@ export function AnbieterAngaben({ seller }: { seller: CompanySettings }) { Handelsregister

{seller.registerCourt}

{seller.registerNumber}

+ {seller.shareCapital ?

Stammkapital: {seller.shareCapital.toLocaleString("de-DE")} €

: null} )} @@ -80,8 +85,22 @@ export function AnbieterAngaben({ seller }: { seller: CompanySettings }) { )} + {seller.generalPartners && seller.generalPartners.length > 0 && ( + <> + Gesellschafter + {seller.generalPartners.map((partner) => ( +

{partner.name}

+ ))} + + )} + Verantwortlich für den Inhalt -

{seller.managingDirector || seller.sellerName}

+ {/* §18 Abs. 2 MStV wants a natural person — managingDirector first + (Kapitalgesellschaften), falling back to the first named + Gesellschafter (OHG/KG, no separate managingDirector field), + then finally sellerName itself (sole proprietorship/e.K., + already a natural person's own name). */} +

{seller.managingDirector || seller.generalPartners?.[0]?.name || seller.sellerName}

{seller.sellerStreet}

{seller.sellerZip} {seller.sellerCity} diff --git a/app/lib/emailTemplates.ts b/app/lib/emailTemplates.ts index 3c9ecb3..1e72946 100644 --- a/app/lib/emailTemplates.ts +++ b/app/lib/emailTemplates.ts @@ -102,6 +102,10 @@ export function buildLegalFooterLines(seller: CompanySettings | null): string[] if (seller.vatId) lines.push(`USt-IdNr.: ${seller.vatId}`); if (seller.registerCourt && seller.registerNumber) lines.push(`${seller.registerCourt} · ${seller.registerNumber}`); if (seller.managingDirector) lines.push(`Geschäftsführung: ${seller.managingDirector}`); + if (seller.shareCapital) lines.push(`Stammkapital: ${seller.shareCapital.toLocaleString("de-DE")} €`); + if (seller.generalPartners && seller.generalPartners.length > 0) { + lines.push(`Gesellschafter: ${seller.generalPartners.map((p) => p.name).join(", ")}`); + } return lines; } diff --git a/app/lib/payload.ts b/app/lib/payload.ts index 2eb29c0..28cf0a9 100644 --- a/app/lib/payload.ts +++ b/app/lib/payload.ts @@ -723,13 +723,20 @@ export async function getEmailTemplate( export type CompanySettings = { sellerName: string; - // Drives whether registerCourt/registerNumber/managingDirector are - // populated — mirrors Payload's CompanySettings.ts collection exactly - // (same option values), see buildLegalFooterLines() in emailTemplates.ts. + // Drives whether registerCourt/registerNumber/managingDirector/ + // shareCapital/generalPartners are populated — mirrors Payload's + // CompanySettings.ts collection exactly (same option values), see + // buildLegalFooterLines() in emailTemplates.ts. legalForm: "sole-proprietorship" | "e-k" | "gbr" | "ohg" | "kg" | "gmbh" | "ug" | "ag"; registerCourt: string | null; registerNumber: string | null; managingDirector: string | null; + // Stammkapital (GmbH/UG) / Grundkapital (AG) — only present for those + // legal forms, see CompanySettings.ts's SHARE_CAPITAL_REQUIRED_FORMS. + shareCapital: number | null; + // Komplementäre/Gesellschafter — only present for OHG/KG, see + // CompanySettings.ts's GENERAL_PARTNERS_REQUIRED_FORMS. + generalPartners: { name: string }[] | null; sellerStreet: string; sellerZip: string; sellerCity: string;