Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
112 lines
7.3 KiB
Go
112 lines
7.3 KiB
Go
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.
|
||
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", "Automatische CRA-Prüfung von Quellcode, Firmware und SPS-Programmen: 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},
|
||
}
|
||
}
|
||
|
||
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,
|
||
}
|
||
}
|