feat(erpsetup): quotes name the Leistungsbeschreibung versions; Prüfwerk 1.0.3 #116
No files matched your search
@@ -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,
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -131,7 +132,7 @@ func logoFileDoc() map[string]any {
|
||||
}
|
||||
}
|
||||
|
||||
const logoSVG = `<img alt="BreakPilot" width="30" height="29" style="display:block;" src="` + logoFileURL + `">`
|
||||
const logoSVG = `<img alt="Breakpilot" width="30" height="29" style="display:block;" src="` + logoFileURL + `">`
|
||||
|
||||
// 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"} -%}
|
||||
@@ -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>
|
||||
@@ -366,7 +370,7 @@ var invoiceMailHTML = brand.Replace(`<div style="font-family:Arial,Helvetica,san
|
||||
<p>Bei Fragen zur Rechnung antworten Sie einfach auf diese E-Mail.</p>
|
||||
<table style="font-size:13px;line-height:1.5;color:$INK;border-collapse:collapse;margin-top:18px;"><tr><td>
|
||||
<div style="font-size:12px;color:#71769B;">Mit freundlichen Grüßen</div>
|
||||
<div style="font-size:16px;font-weight:bold;margin:1px 0 10px;">Ihr BreakPilot-Team</div>
|
||||
<div style="font-size:16px;font-weight:bold;margin:1px 0 10px;">Ihr Breakpilot-Team</div>
|
||||
<div style="font-weight:bold;">{{ company }}</div>
|
||||
<div style="color:#43466A;">In Steinäckern 16, 78351 Bodman-Ludwigshafen</div>
|
||||
<div style="color:#43466A;"><a href="mailto:kontakt@breakpilot.com" style="color:$ACCENT;text-decoration:none;">kontakt@breakpilot.com</a> · <a href="https://www.breakpilot.com" style="color:$ACCENT;text-decoration:none;">www.breakpilot.com</a></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,51 @@ 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)")
|
||||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user