From 276670d0eb732fa65072f9cc75ccc23a44614f57 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Tue, 27 Oct 2026 10:29:19 +0100 Subject: [PATCH] feat(erpsetup): Vertragsbedingungen block on the Quotation print format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Angebot review (§3/§5/§6): the Quotation PDF lacked the contractual terms a B2B-SaaS offer needs. Add a Quotation-GUARDED Vertragsbedingungen block to the shared documentHTML (Vertragsart, Vertragsbeginn, Laufzeit/Kündigung, Abrechnung, monatliche Vergütung + Rabattdauer, Mehrverbrauch, Vertragsgrundlagen, Annahme), the 14-day SEPA Vorabinformation on the non-invoice Zahlungsart line, and a "Monatlicher Gesamtbetrag" label so the recurring nature is unambiguous (the "1 Monat" misread). Every new block is doc.doctype == "Quotation" (or the not-is_inv branch), so the GoBD Sales Invoices are untouched. Terms per the owner's decisions 2026-10-27: no minimum term (monthly cancellable, 1 month to month-end), permanent discount incl. renewals, SEPA-Lastschrift 21 days, per-Prüfung overage. Vertragsgrundlagen renders a placeholder until the SaaS-AGB/SLA/AVV/TOMs land in the portal document store. Structured per-field Custom Fields are a documented follow-up. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4 --- internal/erpsetup/branding.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/internal/erpsetup/branding.go b/internal/erpsetup/branding.go index cf04b5c..3355cd1 100644 --- a/internal/erpsetup/branding.go +++ b/internal/erpsetup/branding.go @@ -273,7 +273,7 @@ var documentHTML = brand.Replace(`{%- set is_inv = doc.doctype == "Sales Invoice {%- for t in doc.taxes %}{% if t.tax_amount_after_discount_amount %} {{ t.description }}{% if t.rate and "%" not in t.description %} ({{ ("%g"|format(t.rate)) | replace(".", ",") }} %){% endif %}{{ t.get_formatted("tax_amount_after_discount_amount", doc) }} {%- endif %}{% endfor %} -Gesamtbetrag{{ doc.get_formatted("rounded_total" if doc.rounded_total else "grand_total") }} +{% if doc.doctype == "Quotation" and interval == "monatlich" %}Monatlicher Gesamtbetrag{% else %}Gesamtbetrag{% endif %}{{ doc.get_formatted("rounded_total" if doc.rounded_total else "grand_total") }}
@@ -282,6 +282,19 @@ var documentHTML = brand.Replace(`{%- set is_inv = doc.doctype == "Sales Invoice {%- elif "Drittland" in tpl %}

Nicht im Inland steuerbare Leistung.

{%- endif %} +{%- if doc.doctype == "Quotation" %} +

Vertragsbedingungen

+ + + + + + + + + +
VertragsartMonatlich wiederkehrende SaaS- und Hosting-Leistungen (Abonnement).
Vertragsbeginn{{ doc.get("contract_start") or "Mit Bereitstellung der gebuchten Dienste gemäß Auftragsbestätigung." }}
Laufzeit / KündigungKeine Mindestlaufzeit; der Vertrag läuft auf unbestimmte Zeit. Monatlich kündbar mit einer Frist von einem Monat zum Monatsende.
AbrechnungMonatlich, jeweils zu Beginn des Leistungszeitraums.
{% if interval == "monatlich" %}Monatliche Vergütung{% else %}Vergütung{% endif %}{{ doc.get_formatted("net_total") }} netto zzgl. gesetzlicher Umsatzsteuer.{% if net_discount > 0.005 %} Der monatliche Nachlass von {{ frappe.utils.fmt_money(net_discount, currency=doc.currency) }} gilt dauerhaft, einschließlich etwaiger Verlängerungen.{% endif %}
MehrverbrauchÜber das gebuchte Kontingent hinausgehende Prüfungen werden je zusätzlicher Prüfung gesondert berechnet.
Vertragsgrundlagen{{ doc.get("vertragsgrundlage") or "Es gelten die SaaS-Vertragsbedingungen, die Leistungsbeschreibungen, das SLA und die AVV (Art. 28 DSGVO) in der jeweils vereinbarten Fassung; die Versionsstände sind in der Anlage bezeichnet." }}
AnnahmeDurch schriftliche oder elektronische Annahme dieses Angebots{% if doc.valid_till %} bis zum {{ frappe.utils.formatdate(doc.valid_till) }}{% endif %}.
+{%- endif %} {%- if is_inv and not doc.is_return %} {%- if sepa and has_mandate %} {%- set creditor = frappe.db.get_value("Company", doc.company, "sepa_creditor_id") %} @@ -295,7 +308,7 @@ Bitte sorgen Sie für ausreichende Kontodeckung.

{%- endif %} {%- elif not is_inv and sepa %} {%- set term = frappe.db.get_value("Payment Term", doc.payment_schedule[0].payment_term, ["credit_days", "due_date_based_on"], as_dict=1) if doc.payment_schedule[0].payment_term else None -%} -

Zahlungsart: SEPA-Lastschrift{% if term and term.credit_days and term.due_date_based_on == "Day(s) after invoice date" %}, Einzug {{ term.credit_days }} Tage nach Rechnungsdatum{% endif %}, {{ "gemäß erteiltem SEPA-Lastschriftmandat" if has_mandate else "nach Erteilung eines gültigen SEPA-Lastschriftmandats" }}.

+

Zahlungsart: SEPA-Lastschrift{% if term and term.credit_days and term.due_date_based_on == "Day(s) after invoice date" %}, Einzug {{ term.credit_days }} Tage nach Rechnungsdatum{% endif %}, {{ "gemäß erteiltem SEPA-Lastschriftmandat" if has_mandate else "nach Erteilung eines gültigen SEPA-Lastschriftmandats" }}. Vor jedem Einzug informieren wir Sie mindestens 14 Tage im Voraus über Betrag und Fälligkeit (Vorabinformation; kürzere Frist nach Vereinbarung).

{%- elif not is_inv and transfer %} {%- set term = frappe.db.get_value("Payment Term", doc.payment_schedule[0].payment_term, ["credit_days", "due_date_based_on"], as_dict=1) if doc.payment_schedule[0].payment_term else None -%}

Zahlungsart: Überweisung{% if term and term.credit_days and term.due_date_based_on == "Day(s) after invoice date" %}, zahlbar innerhalb von {{ term.credit_days }} Tagen nach Rechnungsdatum{% endif %}.

-- 2.54.1