From bc40a635895c38891e7fd0cad2058bd06f4d39ab Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:51:14 +0100 Subject: [PATCH 1/3] =?UTF-8?q?feat(erpsetup):=20quotes=20name=20the=20Lei?= =?UTF-8?q?stungsbeschreibung=20versions;=20Pr=C3=BCfwerk=201.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each Leistungsbeschreibung says the version named in the quote applies, but the quote's Vertragsgrundlagen named none. The default text now lists the LBs that apply by module and version: Breakpilot Plattform always, each module when the quote has one of its lines (catalog.go lbVersions, rendered into the print format as a Jinja expression over item_codes). A per-document "vertragsgrundlage" still replaces the whole text. - Prüfwerk at 1.0.3 (code graph, frozen 09.11.); all others at 1.0.0. - CRA-CSA-CLD-STD description names SBOM and code graph (LB § 4). - "Breakpilot-Kundenportal" (was BreakPilot) in that sentence. Co-Authored-By: Claude Opus 5.5 --- internal/erpsetup/branding.go | 6 +++- internal/erpsetup/catalog.go | 44 ++++++++++++++++++++++++++++-- internal/erpsetup/erpsetup_test.go | 33 ++++++++++++++++++++++ 3 files changed, 80 insertions(+), 3 deletions(-) diff --git a/internal/erpsetup/branding.go b/internal/erpsetup/branding.go index 04d6b62..65dd635 100644 --- a/internal/erpsetup/branding.go +++ b/internal/erpsetup/branding.go @@ -111,6 +111,7 @@ var brand = strings.NewReplacer( "$REGISTER_BR", "Sitz Bodman-Ludwigshafen
Amtsgericht Freiburg, HRB 736403", "$DIRECTORS_BR", "Geschäftsführer:
Benjamin Bönisch
Sharang Deepak Parnerkar", "$REGISTER", legalRegister, "$DIRECTORS", legalDirectors, + "$LB_VERSIONS", lbVersionsJinja(), ) // logoPNG is the chevron from the portal favicon (120×115, rendered from @@ -319,7 +320,10 @@ var documentHTML = brand.Replace(`{%- set is_inv = doc.doctype == "Sales Invoice {%- endif %} {%- if more_users %}{% if pw_overage %} {% endif %}Weitere Nutzer über die enthaltenen Nutzer hinaus werden je Modul nach Preisliste berechnet (Leistungsbeschreibung Breakpilot Plattform, Abschnitt 4).{% endif %} {%- endif %} -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. Auf Anfrage erhalten Sie die Dokumente vorab; nach Vertragsschluss stehen sie im BreakPilot-Kundenportal zum Abruf bereit." }} +{#- The Leistungsbeschreibungen by module and version (catalog.go lbVersions): + each LB says the version named in the quote applies. -#} +{%- set lb_versions = $LB_VERSIONS -%} +Vertragsgrundlagen{{ doc.get("vertragsgrundlage") or ("Es gelten die SaaS-Vertragsbedingungen, die Leistungsbeschreibungen (" ~ lb_versions ~ "), das SLA und die AVV (Art. 28 DSGVO) in der jeweils vereinbarten Fassung. Auf Anfrage erhalten Sie die Dokumente vorab; nach Vertragsschluss stehen sie im Breakpilot-Kundenportal zum Abruf bereit.") }} AnnahmeDurch schriftliche oder elektronische Annahme dieses Angebots{% if doc.valid_till %} bis zum {{ frappe.utils.formatdate(doc.valid_till) }}{% endif %}. diff --git a/internal/erpsetup/catalog.go b/internal/erpsetup/catalog.go index efbc2f5..55c3b55 100644 --- a/internal/erpsetup/catalog.go +++ b/internal/erpsetup/catalog.go @@ -1,15 +1,55 @@ package erpsetup +import "strings" + // The sales catalogue in ERPNext: the SKU items (codes as in the registry's // products table and the "Breakpilot SKU + SLA" sheet), their units and item // group, the SEPA direct-debit mandate on the Customer and the payment method. // Names, descriptions and list prices follow the Leistungsbeschreibungen -// 1.0.0. Every run writes the item description and creates what is missing; +// (versions in lbVersions). Every run writes the item description and creates what is missing; // a list price (net EUR) goes on the Standard Selling price list once. Only a // run with -sync-catalog (Config.SyncCatalog) brings existing items' name, // description and disabled flag and the list prices back to these values; // without it, price changes made in ERPNext stay. +// lbVersions are the frozen Leistungsbeschreibungen a quote names under +// "Vertragsgrundlagen" (each LB's § 1: "Maßgeblich ist die im Angebot … +// genannte Version"). The platform's applies to every quote; a module's when +// the quote has a line whose code starts with one of its prefixes. Raise a +// version here when a new one is frozen in Sellable Documents/ +// Leistungsbeschreibung//FINAL. +var lbVersions = []struct { + Module, Version string + Prefixes []string // item code prefixes; none = every quote +}{ + {"Breakpilot Plattform", "1.0.0", nil}, + {"Prüfwerk", "1.0.3", []string{"CRA-CSA-CLD-"}}, + {"Managed Git", "1.0.0", []string{"INF-GIT-CLD-"}}, + {"Build-Runner", "1.0.0", []string{"INF-CI-CLD-"}}, + {"Werkpilot", "1.0.0", []string{"DEV-WP-"}}, + {"Firmwerk", "1.0.0", []string{"DEV-FWK-"}}, +} + +// lbVersionsJinja is a Jinja expression for the quote template: the names +// and versions of the Leistungsbeschreibungen that apply, comma-separated. +// It reads item_codes (" CODE CODE … ", set by the template). +func lbVersionsJinja() string { + var parts []string + for _, lb := range lbVersions { + name := lb.Module + " " + lb.Version + if len(lb.Prefixes) == 0 { + parts = append(parts, `"`+name+`"`) + continue + } + var conds []string + for _, p := range lb.Prefixes { + conds = append(conds, `" `+p+`" in item_codes`) + } + parts = append(parts, `(", `+name+`" if `+strings.Join(conds, " or ")+` else "")`) + } + return strings.Join(parts, " ~ ") +} + // itemGroup keeps its old spelling: renaming it would touch every item. const itemGroup = "BreakPilot Abonnements" @@ -38,7 +78,7 @@ func skus() []sku { {Code: "PLT-CORE-CLD-ENT", Name: "Breakpilot Plattform – Enterprise", UOM: "Monat", Description: "Arbeitsbereich ohne Nutzergrenze, Enterprise-Support und benannte Ansprechperson.", Price: 1990}, {Code: "PLT-BNDL-CLD-STD", Name: "Breakpilot Starter-Modulpaket", UOM: "Monat", Description: "Plattform Starter (bis 25 Nutzer) mit drei Modulen nach Wahl, je bis 15 Nutzer. Die gewählten Module stehen im Angebot als eigene Positionen zu 0,00 €.", Price: 990}, {Code: "PLT-BNDL-CLD-ADD", Name: "Weiteres Modul im Starter-Modulpaket", UOM: "Monat", Description: "Ein weiteres Modul zum Starter-Modulpaket, bis 15 Nutzer. Das Modul steht im Angebot als eigene Position zu 0,00 €.", Price: 499}, - {Code: "CRA-CSA-CLD-STD", Name: "Prüfwerk Cloud – Standard", UOM: "Monat", Description: "Automatisierte Sicherheitsanalyse von Quellcode, Firmware und SPS-Programmen: 5 enthaltene Prüfobjekte mit unbegrenzten Prüfungen nach Änderungen, dazu 100 weitere Prüfungen im Monat.", Price: 490}, + {Code: "CRA-CSA-CLD-STD", Name: "Prüfwerk Cloud – Standard", UOM: "Monat", Description: "Automatisierte Sicherheitsanalyse von Quellcode, Firmware und SPS-Programmen mit SBOM und Codegraph: 5 enthaltene Prüfobjekte mit unbegrenzten Prüfungen nach Änderungen, dazu 100 weitere Prüfungen im Monat.", Price: 490}, {Code: "CRA-CSA-CLD-BUS", Name: "Prüfwerk Cloud – Business", UOM: "Monat", Description: "Prüfwerk mit 25 enthaltenen Prüfobjekten und 500 weiteren Prüfungen im Monat.", Price: 1290}, {Code: "CRA-CSA-CLD-ENT", Name: "Prüfwerk Cloud – Enterprise", UOM: "Monat", Description: "Prüfwerk ohne Begrenzung der Prüfobjekte und Prüfungen. Preis nach Vereinbarung.", Price: 0}, {Code: "CRA-CSA-CLD-TGT", Name: "Prüfwerk – Zusätzliches Prüfobjekt", UOM: "Monat", Description: "Prüfobjekt über die im Leistungspaket enthaltenen hinaus; seine Prüfungen zählen zum Monatskontingent. Berechnet wird die höchste Zahl gleichzeitig angelegter zusätzlicher Prüfobjekte im Monat.", Price: 5.99}, diff --git a/internal/erpsetup/erpsetup_test.go b/internal/erpsetup/erpsetup_test.go index 5188c94..15c960d 100644 --- a/internal/erpsetup/erpsetup_test.go +++ b/internal/erpsetup/erpsetup_test.go @@ -761,3 +761,36 @@ func TestTotalsPrintTheTaxAfterDiscount(t *testing.T) { } } } + +// The quote names the Leistungsbeschreibungen by module and version: each LB +// says the version named in the quote applies. +func TestQuoteNamesLBVersions(t *testing.T) { + for _, want := range []string{ + `{%- set lb_versions = "Breakpilot Plattform 1.0.0" ~ (", Prüfwerk 1.0.3" if " CRA-CSA-CLD-" in item_codes else "")`, + `(", Managed Git 1.0.0" if " INF-GIT-CLD-" in item_codes else "")`, + `(", Build-Runner 1.0.0" if " INF-CI-CLD-" in item_codes else "")`, + `(", Werkpilot 1.0.0" if " DEV-WP-" in item_codes else "")`, + `(", Firmwerk 1.0.0" if " DEV-FWK-" in item_codes else "")`, + `"Es gelten die SaaS-Vertragsbedingungen, die Leistungsbeschreibungen (" ~ lb_versions ~ "), das SLA`, + "im Breakpilot-Kundenportal zum Abruf bereit.", + } { + if !strings.Contains(documentHTML, want) { + t.Errorf("quote template lacks %q", want) + } + } + if strings.Contains(documentHTML, "$LB_VERSIONS") || strings.Contains(documentHTML, "BreakPilot-Kundenportal") { + t.Error("placeholder left or old brand spelling in the Vertragsgrundlagen") + } + // item_codes must be set before the Vertragsgrundlagen row reads it. + if strings.Index(documentHTML, "{%- set item_codes") > strings.Index(documentHTML, "{%- set lb_versions") { + t.Error("lb_versions is computed before item_codes is set") + } + for _, lb := range lbVersions { + if !strings.Contains(documentHTML, lb.Module+" "+lb.Version) { + t.Errorf("quote template lacks %s %s", lb.Module, lb.Version) + } + } + if !strings.Contains(have(t, "CRA-CSA-CLD-STD").Description, "Codegraph") { + t.Error("Prüfwerk Standard description does not name the code graph (LB Prüfwerk 1.0.3 § 4 Abs. 4)") + } +} -- 2.54.1 From 175703f062d7dbb15ad79c2570182e79bc098765 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:56:48 +0100 Subject: [PATCH 2/3] fix(erpsetup): Breakpilot in the invoice mail and the logo alt text Customer-visible text only. ERPNext record names (print formats, letter head, e-mail template, item group) keep BreakPilot: renaming them would create new records. A test keeps the customer text on Breakpilot. Co-Authored-By: Claude Opus 5.5 --- internal/erpsetup/branding.go | 6 +++--- internal/erpsetup/erpsetup_test.go | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/internal/erpsetup/branding.go b/internal/erpsetup/branding.go index 65dd635..bd20ffd 100644 --- a/internal/erpsetup/branding.go +++ b/internal/erpsetup/branding.go @@ -99,7 +99,7 @@ func emailTemplateDoc() map[string]any { return map[string]any{ "doctype": "Email Template", "name": emailTemplateRE, "enabled": 1, "reference_doctype": "Sales Invoice", - "subject": "Rechnung {{ name }} – BreakPilot", + "subject": "Rechnung {{ name }} – Breakpilot", "use_html": 1, "response_html": invoiceMailHTML, } } @@ -132,7 +132,7 @@ func logoFileDoc() map[string]any { } } -const logoSVG = `BreakPilot` +const logoSVG = `Breakpilot` // Shared Jinja: the company's own address and its bank account. const companyVars = `{%- set bp_addr = frappe.db.get_value("Address", {"is_your_company_address": 1, "is_primary_address": 1, "disabled": 0}, ["address_line1", "pincode", "city", "email_id"], as_dict=1) or {"address_line1": "In Steinäckern 16", "pincode": "78351", "city": "Bodman-Ludwigshafen", "email_id": "kontakt@breakpilot.com"} -%} @@ -370,7 +370,7 @@ var invoiceMailHTML = brand.Replace(`
Mit freundlichen Grüßen
-
Ihr BreakPilot-Team
+
Ihr Breakpilot-Team
{{ company }}
In Steinäckern 16, 78351 Bodman-Ludwigshafen
kontakt@breakpilot.com · www.breakpilot.com
diff --git a/internal/erpsetup/erpsetup_test.go b/internal/erpsetup/erpsetup_test.go index 15c960d..ab49204 100644 --- a/internal/erpsetup/erpsetup_test.go +++ b/internal/erpsetup/erpsetup_test.go @@ -794,3 +794,18 @@ func TestQuoteNamesLBVersions(t *testing.T) { t.Error("Prüfwerk Standard description does not name the code graph (LB Prüfwerk 1.0.3 § 4 Abs. 4)") } } + +// What customers read is spelled "Breakpilot": the documents, the letter +// head and footer, and the invoice e-mail with its subject. ERPNext record +// names (print formats, letter head, item group) keep the old spelling, +// because renaming them would create new records. +func TestCustomerTextSpellsBreakpilot(t *testing.T) { + for name, s := range map[string]string{ + "document": documentHTML, "letter head": letterHeadHTML, "letter footer": letterFooterHTML, + "invoice mail": invoiceMailHTML, "logo": logoSVG, "mail subject": emailTemplateDoc()["subject"].(string), + } { + if strings.Contains(s, "BreakPilot") { + t.Errorf("%s still spells BreakPilot", name) + } + } +} -- 2.54.1 From 9b189686404640ab2f012e5978a452628cca8e10 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:58:45 +0100 Subject: [PATCH 3/3] fix(deps): golang.org/x/net 0.62.0 for CVE-2026-78661 Trivy fails CI on golang.org/x/net v0.60.0 (HIGH, DoS in x/net/html via crafted HTML). The registry does not import x/net/html, so it was not reachable. x/net 0.62.0 brings x/crypto 0.58.0, x/sync 0.24.0, x/sys 0.49.0 and x/text 0.43.0 along. go build and go test ./... pass. Co-Authored-By: Claude Opus 5.5 --- go.mod | 10 +++++----- go.sum | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 10193b5..f2354c2 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 go.opentelemetry.io/otel/sdk v1.47.0 go.opentelemetry.io/otel/trace v1.47.0 - golang.org/x/crypto v0.57.0 + golang.org/x/crypto v0.58.0 ) require ( @@ -87,11 +87,11 @@ require ( go.opentelemetry.io/otel/metric v1.47.0 // indirect go.opentelemetry.io/proto/otlp v1.11.0 // indirect go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/net v0.60.0 // indirect + golang.org/x/net v0.62.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect + golang.org/x/sync v0.24.0 // indirect + golang.org/x/sys v0.49.0 // indirect + golang.org/x/text v0.43.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect google.golang.org/grpc v1.83.2 // indirect diff --git a/go.sum b/go.sum index 767cd42..4c26246 100644 --- a/go.sum +++ b/go.sum @@ -202,23 +202,23 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= -golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= -golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= -golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54= +golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w= +golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= +golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= -golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= -golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= +golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= -golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= -golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE= -golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc= -golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= -golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= +golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM= +golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY= +golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc= +golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -- 2.54.1