Model Stammkapital/Grundkapital and Gesellschafter for the not-yet-needed legal forms
Mirrors the backend's new CompanySettings.shareCapital/generalPartners fields: rendered in the Impressum (AnbieterAngaben.tsx — new "Gesellschafter" section, Stammkapital line under Handelsregister, and the "Verantwortlich für den Inhalt" fallback now considers a general partner before falling back to sellerName) and wired into buildLegalFooterLines() for the invoice/email footer, same as registerCourt/registerNumber/managingDirector already were. No visible change today (current legalForm is sole-proprietorship, neither field is set) — this is prep so a future legalForm change in company-settings updates the Impressum automatically instead of needing a manual Impressum edit at that point.
This commit is contained in:
@@ -15,6 +15,8 @@ const FALLBACK: CompanySettings = {
|
||||
registerCourt: null,
|
||||
registerNumber: null,
|
||||
managingDirector: null,
|
||||
shareCapital: null,
|
||||
generalPartners: null,
|
||||
sellerStreet: "",
|
||||
sellerZip: "",
|
||||
sellerCity: "",
|
||||
|
||||
@@ -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 }) {
|
||||
<Heading>Handelsregister</Heading>
|
||||
<P>{seller.registerCourt}</P>
|
||||
<P>{seller.registerNumber}</P>
|
||||
{seller.shareCapital ? <P>Stammkapital: {seller.shareCapital.toLocaleString("de-DE")} €</P> : null}
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -80,8 +85,22 @@ export function AnbieterAngaben({ seller }: { seller: CompanySettings }) {
|
||||
</>
|
||||
)}
|
||||
|
||||
{seller.generalPartners && seller.generalPartners.length > 0 && (
|
||||
<>
|
||||
<Heading>Gesellschafter</Heading>
|
||||
{seller.generalPartners.map((partner) => (
|
||||
<P key={partner.name}>{partner.name}</P>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
|
||||
<Heading>Verantwortlich für den Inhalt</Heading>
|
||||
<P>{seller.managingDirector || seller.sellerName}</P>
|
||||
{/* §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). */}
|
||||
<P>{seller.managingDirector || seller.generalPartners?.[0]?.name || seller.sellerName}</P>
|
||||
<P>{seller.sellerStreet}</P>
|
||||
<P>
|
||||
{seller.sellerZip} {seller.sellerCity}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+10
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user