feat(erpsetup): quotes name the Leistungsbeschreibung versions; Prüfwerk 1.0.3
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
1332ad7bc5
commit
60de1b3ace
3 files changed
+80
-3
No files matched your search
@@ -111,6 +111,7 @@ var brand = strings.NewReplacer(
|
||||
"$REGISTER_BR", "Sitz Bodman-Ludwigshafen<br>Amtsgericht Freiburg, HRB 736403",
|
||||
"$DIRECTORS_BR", "Geschäftsführer:<br>Benjamin Bönisch<br>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 %}</td></tr>
|
||||
{%- endif %}
|
||||
<tr><td class="k">Vertragsgrundlagen</td><td>{{ 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." }}</td></tr>
|
||||
{#- The Leistungsbeschreibungen by module and version (catalog.go lbVersions):
|
||||
each LB says the version named in the quote applies. -#}
|
||||
{%- set lb_versions = $LB_VERSIONS -%}
|
||||
<tr><td class="k">Vertragsgrundlagen</td><td>{{ 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.") }}</td></tr>
|
||||
<tr><td class="k">Annahme</td><td>Durch schriftliche oder elektronische Annahme dieses Angebots{% if doc.valid_till %} bis zum {{ frappe.utils.formatdate(doc.valid_till) }}{% endif %}.</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -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/<version>/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},
|
||||
|
||||
@@ -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)")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user