Files
tenant-registry/internal/erpsetup/catalog.go
T
sharangandClaude Opus 5.5 5668895055
ci / shared (push) Successful in 14s
ci / test (push) Successful in 24m12s
ci / image (push) Successful in 36s
feat(erpsetup): Managed Git items INF-GIT-CLD/OPR-STD/BUS/ENT (#60)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-10-04 19:07:36 +00:00

175 lines
11 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package erpsetup
// 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.
// List prices (net EUR, from the SKU sheet) go on the Standard Selling price
// list once; later changes are made in ERPNext and never overwritten here.
const itemGroup = "BreakPilot Abonnements"
type sku struct {
Code, Name, UOM, Description string
Price float64 // list price, net EUR per UOM
}
// priceList carries the list prices.
const priceList = "Standard Selling"
// skus lists every item a sales order may carry. The registry unlocks a
// product for the product SKUs; the platform fee (PLT-CORE-*) is billed but
// unlocks nothing on its own, and so is Managed Git (INF-GIT-*) until the
// registry has a `git` product (instances are provisioned by hand, v0).
func skus() []sku {
return []sku{
{"PLT-CORE-CLD-STD", "BreakPilot Plattform – Starter", "Monat", "Arbeitsbereich mit Anmeldung, Team und Rechnungen: bis 25 Nutzer, bis 3 Produkte, Standard-Support.", 290},
{"PLT-CORE-CLD-BUS", "BreakPilot Plattform – Growth", "Monat", "Arbeitsbereich für bis 100 Nutzer, beliebig viele Produkte, monatlicher Nutzungsbericht, vorrangiger Support.", 790},
{"PLT-CORE-CLD-ENT", "BreakPilot Plattform – Enterprise", "Monat", "Arbeitsbereich ohne Nutzergrenze, persönliche Betreuung, individuelle Verträge (AVV), Wahl der EU-Region.", 1990},
{"CRA-CSA-CLD-STD", "Prüfwerk Cloud – Standard", "Monat", "Automatisierte Cybersecurity-Analyse von Quellcode, Firmware und SPS-Programmen für CRA-bezogene Compliance-Prozesse: 5 Prüfobjekte, 50 Prüfungen im Monat, monatliches Nachweispaket.", 1490},
{"CRA-CSA-CLD-BUS", "Prüfwerk Cloud – Business", "Monat", "Prüfwerk für 25 Prüfobjekte und 500 Prüfungen im Monat, mit Schnittstelle (MCP) für eigene Werkzeuge.", 3990},
{"CRA-CSA-CLD-ENT", "Prüfwerk Cloud – Enterprise", "Monat", "Prüfwerk ohne Obergrenzen, eigener Kontrollkatalog, Nachweisexport für abgeschottete Umgebungen.", 9900},
{"CRA-CSA-CLD-SCAN", "Prüfwerk – Zusätzliche Prüfung", "Prüfung", "Einzelne Prüfung über das Monatskontingent hinaus; nur zu einem aktiven Prüfwerk-Abonnement.", 12},
{"CRA-WBK-CLD-STD", "Werkbank Runner Cloud – Standard", "Monat", "Prüfmaschine für aktive Tests externer Systeme (1 vCPU / 2 GB); Zusatz zu Prüfwerk.", 490},
{"CRA-WBK-CLD-BUS", "Werkbank Runner Cloud – Business", "Monat", "Prüfmaschine mit parallelen Prüfungen (2 vCPU / 4 GB); Zusatz zu Prüfwerk.", 990},
{"CRA-WBK-CLD-ENT", "Werkbank Runner Cloud – Enterprise", "Monat", "Prüfmaschine mit eigenen Prüfmodulen (4 vCPU / 8 GB); Zusatz zu Prüfwerk.", 1990},
{"DEV-WP-CLD-STD", "Werkpilot Cloud – Standard", "Monat", "KI-Assistent für Code und SPS-Programme, gemeinsame KI-Kapazität in der EU; je Nutzer und Monat.", 59},
{"DEV-WP-CLD-BUS", "Werkpilot Cloud – Business", "Monat", "Werkpilot mit reservierter KI-Kapazität und Single Sign-on; je Nutzer und Monat.", 119},
{"DEV-WP-CLD-ENT", "Werkpilot Cloud – Enterprise", "Monat", "Werkpilot auf eigener KI-Instanz, optional auf Ihren Code abgestimmt; je Nutzer und Monat.", 249},
{"DEV-WP-OPR-STD", "Werkpilot On-Prem – Standard", "Jahr", "Werkpilot im eigenen Netz, ohne dass Quellcode das Haus verlässt; Jahreslizenz.", 7900},
{"DEV-WP-OPR-BUS", "Werkpilot On-Prem – Business", "Jahr", "Werkpilot im eigenen Netz für mittlere Teams; Jahreslizenz.", 19900},
{"DEV-WP-OPR-ENT", "Werkpilot On-Prem – Enterprise", "Jahr", "Werkpilot im eigenen Netz für große Entwicklungsorganisationen; Jahreslizenz.", 49900},
{"DEV-FWK-CLD-STD", "Firmwerk Cloud – Standard", "Monat", "Reproduzierbare Firmware-Builds mit Stückliste und Nachweis, 10 Umgebungen je Nutzer; je Nutzer und Monat.", 89},
{"DEV-FWK-CLD-BUS", "Firmwerk Cloud – Business", "Monat", "Firmwerk mit beliebig vielen Umgebungen und Team-Freigabe; je Nutzer und Monat.", 149},
{"DEV-FWK-CLD-ENT", "Firmwerk Cloud – Enterprise", "Monat", "Firmwerk mit eigenen Toolchains und LTS-Stand; je Nutzer und Monat.", 299},
{"DEV-FWK-OPR-STD", "Firmwerk On-Prem – Standard", "Jahr", "Firmwerk im eigenen Netz; Jahreslizenz.", 6900},
{"DEV-FWK-OPR-BUS", "Firmwerk On-Prem – Business", "Jahr", "Firmwerk im eigenen Netz für größere Teams; Jahreslizenz.", 15900},
{"DEV-FWK-OPR-ENT", "Firmwerk On-Prem – Enterprise", "Jahr", "Firmwerk im eigenen Netz für große Organisationen; Jahreslizenz.", 39900},
{"INF-GIT-CLD-STD", "Managed Git Cloud – Standard", "Monat", "Eigene Gitea-Instanz für Ihr Unternehmen, betrieben von BreakPilot in Deutschland: Anmeldung über Ihr BreakPilot-Konto, Sicherung und Updates inklusive; für Teams bis ca. 50 Entwickler.", 190},
{"INF-GIT-CLD-BUS", "Managed Git Cloud – Business", "Monat", "Eigene Gitea-Instanz für mittelgroße Entwicklerteams (bis ca. 200 Entwickler) mit Business-SLA.", 390},
{"INF-GIT-CLD-ENT", "Managed Git Cloud – Enterprise", "Monat", "Eigene Gitea-Instanz für große Entwicklungsorganisationen, unbegrenzter Speicher, Enterprise-SLA und persönliche Betreuung.", 790},
{"INF-GIT-OPR-STD", "Managed Git On-Prem – Standard", "Jahr", "Gitea im eigenen Netz, kein Quellcode verlässt das Haus; Installation, Patches und Überwachung durch BreakPilot; Jahreslizenz.", 4900},
{"INF-GIT-OPR-BUS", "Managed Git On-Prem – Business", "Jahr", "Gitea im eigenen Netz für mittelgroße Teams, schnellerer Patch-Rhythmus; Jahreslizenz.", 9900},
{"INF-GIT-OPR-ENT", "Managed Git On-Prem – Enterprise", "Jahr", "Gitea im eigenen Netz mit Hochverfügbarkeit und Enterprise-SLA; Jahreslizenz.", 19900},
}
}
func uoms() []map[string]any {
out := []map[string]any{}
for _, u := range []string{"Monat", "Jahr", "Prüfung"} {
out = append(out, map[string]any{"doctype": "UOM", "name": u, "uom_name": u, "must_be_whole_number": 1})
}
return out
}
func itemGroupDoc() map[string]any {
return map[string]any{"doctype": "Item Group", "name": itemGroup, "item_group_name": itemGroup, "parent_item_group": "All Item Groups", "is_group": 0}
}
func itemDoc(s sku) map[string]any {
return map[string]any{
"doctype": "Item", "name": s.Code, "item_code": s.Code, "item_name": s.Name,
"item_group": itemGroup, "stock_uom": s.UOM, "description": s.Description,
"is_stock_item": 0, "is_sales_item": 1, "is_purchase_item": 0, "include_item_in_manufacturing": 0,
}
}
// sepaFields put the direct-debit mandate on the Customer: reference, date of
// signature and type (Basislastschrift/CORE or Firmenlastschrift/B2B).
func sepaFields() []map[string]any {
section := customField("Customer", "sepa_section", "SEPA-Lastschriftmandat", "Section Break", "tenant_slug", false)
ref := customField("Customer", "sepa_mandate_reference", "Mandatsreferenz", "Data", "sepa_section", false)
date := customField("Customer", "sepa_mandate_date", "Mandat unterschrieben am", "Date", "sepa_mandate_reference", false)
kind := customField("Customer", "sepa_mandate_type", "Mandatsart", "Select", "sepa_mandate_date", false)
kind["options"] = "\nBasislastschrift (CORE)\nFirmenlastschrift (B2B)"
for _, f := range []map[string]any{section, ref, date, kind} {
f["description"] = "SEPA-Lastschriftmandat des Kunden; von Hand gepflegt."
}
section["collapsible"] = 1
return []map[string]any{section, ref, date, kind}
}
func modeOfPaymentDoc() map[string]any {
return map[string]any{"doctype": "Mode of Payment", "name": "SEPA-Lastschrift", "mode_of_payment": "SEPA-Lastschrift", "type": "Bank", "enabled": 1}
}
// invoiceSeries is the outgoing-invoice number range from the GoBD
// Verfahrensdokumentation (§ 9): RE-JJJJ-NNNN, a new range each calendar year
// (the year is part of the series key), one range for invoices and returns.
const invoiceSeries = "RE-.YYYY.-.####"
// invoiceSeriesSetters make it the only and the default naming series of the
// Sales Invoice (ERPNext ships ACC-SINV-.YYYY.- and ACC-SINV-RET-.YYYY.-).
func invoiceSeriesSetters() []map[string]any {
setter := func(prop, typ string) map[string]any {
return map[string]any{
"doctype": "Property Setter", "name": "Sales Invoice-naming_series-" + prop,
"doctype_or_field": "DocField", "doc_type": "Sales Invoice", "field_name": "naming_series",
"property": prop, "property_type": typ, "value": invoiceSeries,
}
}
return []map[string]any{setter("options", "Text"), setter("default", "Text")}
}
func itemPriceDoc(s sku) map[string]any {
return map[string]any{
"doctype": "Item Price", "item_code": s.Code, "price_list": priceList, "uom": s.UOM,
"price_list_rate": s.Price, "currency": "EUR", "selling": 1,
}
}
// Customers created from now on are numbered K-00001, K-00002, … (the
// number is what documents show as "Kundennummer"); existing customers keep
// their name. The registry stores whatever name ERPNext assigns.
const customerSeries = "K-.#####"
func customerNumbering() (settings map[string]any, setters []map[string]any) {
settings = map[string]any{"doctype": "Selling Settings", "name": "Selling Settings", "cust_master_name": "Naming Series"}
setter := func(prop string) map[string]any {
return map[string]any{
"doctype": "Property Setter", "name": "Customer-naming_series-" + prop,
"doctype_or_field": "DocField", "doc_type": "Customer", "field_name": "naming_series",
"property": prop, "property_type": "Text", "value": customerSeries,
}
}
return settings, []map[string]any{setter("options"), setter("default")}
}
// paymentTerms21 is the default for new customers: SEPA direct debit 21 days
// after the invoice date, so the invoice (the SEPA pre-notification) reaches
// the customer at least 14 days before the debit.
const paymentTerms21 = "SEPA-Lastschrift 21 Tage"
func paymentTermDoc() map[string]any {
return map[string]any{
"doctype": "Payment Term", "name": paymentTerms21, "payment_term_name": paymentTerms21,
"invoice_portion": 100, "mode_of_payment": "SEPA-Lastschrift",
"due_date_based_on": "Day(s) after invoice date", "credit_days": 21,
"description": "Der Rechnungsbetrag wird per SEPA-Lastschrift von Ihrem Konto eingezogen.",
}
}
func paymentTemplateDoc() map[string]any {
return map[string]any{
"doctype": "Payment Terms Template", "name": paymentTerms21, "template_name": paymentTerms21,
"terms": []map[string]any{{
"payment_term": paymentTerms21, "invoice_portion": 100, "mode_of_payment": "SEPA-Lastschrift",
"due_date_based_on": "Day(s) after invoice date", "credit_days": 21,
"description": "Der Rechnungsbetrag wird per SEPA-Lastschrift von Ihrem Konto eingezogen.",
}},
}
}
// contractBasisFields: "Vertragsgrundlage" on order and invoice, filled by
// hand for now (e.g. "SaaS-Vertrag vom 30.09.2026"); printed only when set.
func contractBasisFields() []map[string]any {
out := []map[string]any{}
for _, dt := range []string{"Sales Order", "Sales Invoice"} {
f := customField(dt, "vertragsgrundlage", "Vertragsgrundlage", "Data", "po_no", false)
f["description"] = "Z. B. \"SaaS-Vertrag vom 30.09.2026\". Erscheint auf Auftragsbestätigung und Rechnung."
f["allow_on_submit"] = 0
delete(f, "no_copy") // carried from the order to the invoice
out = append(out, f)
}
return out
}