fix(erpsetup): quote overage price, portal doc basis, USt-IdNr. glyph
- Mehrverbrauch: only on quotes with Prüfwerk, priced from the CRA-CSA-CLD-SCAN Item Price (falls back to the price list). - Vertragsgrundlagen default no longer cites a missing Anlage: documents on request beforehand, in the customer portal after signing. - USt-IdNr.: NimbusSans sets "Nr." as one № glyph; a ZWNJ keeps it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
This commit is contained in:
1 parent
04e52efe0f
commit
b96f319380
2 files changed
+14
-6
No files matched your search
@@ -153,13 +153,15 @@ var letterHeadHTML = brand.Replace(strings.ReplaceAll(`${companyVars}
|
||||
</table>
|
||||
<div style="border-bottom:1.5px solid $ACCENT;margin:2px 0 0 0;"></div>`, "${companyVars}", companyVars))
|
||||
|
||||
// USt-IdN‌r.: the server's Arial substitute (NimbusSans) sets "Nr." as
|
||||
// a single № glyph; the zero-width non-joiner keeps the letters.
|
||||
var letterFooterHTML = brand.Replace(strings.ReplaceAll(`${companyVars}
|
||||
{%- set bp_bic = frappe.db.get_value("Bank", bp_bank.bank, "swift_number") if bp_bank.bank else "" -%}
|
||||
<div style="border-top:1px solid $LINE;"></div>
|
||||
<table style="width:100%;border-collapse:collapse;font-family:Arial,Helvetica,sans-serif;color:$FAINT;">
|
||||
<tr>
|
||||
<td style="vertical-align:top;padding:5px 8px 0 0;width:24%;font-size:6.5pt;line-height:1.45;white-space:nowrap;"><b style="color:$MUTED;">{{ doc.company }}</b><br>{{ bp_addr.address_line1 }}<br>{{ bp_addr.pincode }} {{ bp_addr.city }}</td>
|
||||
<td style="vertical-align:top;padding:5px 8px 0 0;width:27%;font-size:6.5pt;line-height:1.45;">$REGISTER_BR<br>USt-IdNr. {{ frappe.db.get_value("Company", doc.company, "tax_id") or "" }}</td>
|
||||
<td style="vertical-align:top;padding:5px 8px 0 0;width:27%;font-size:6.5pt;line-height:1.45;">$REGISTER_BR<br>USt-IdN‌r. {{ frappe.db.get_value("Company", doc.company, "tax_id") or "" }}</td>
|
||||
<td style="vertical-align:top;padding:5px 8px 0 0;width:21%;font-size:6.5pt;line-height:1.45;">$DIRECTORS_BR</td>
|
||||
<td style="vertical-align:top;padding:5px 0 0 0;width:28%;font-size:6.5pt;line-height:1.45;">{% if bp_bank.iban %}{{ bp_bank.bank }}<br>IBAN {{ bp_bank.iban }}{% if bp_bic %}<br>BIC {{ bp_bic }}{% endif %}{% endif %}</td>
|
||||
</tr>
|
||||
@@ -232,7 +234,7 @@ var documentHTML = brand.Replace(`{%- set is_inv = doc.doctype == "Sales Invoice
|
||||
{%- if doc.get("vertragsgrundlage") %}<tr><td class="k">Vertragsgrundlage</td><td>{{ doc.vertragsgrundlage }}</td></tr>{% endif %}
|
||||
{%- if is_so and service_start %}<tr><td class="k">Leistungsbeginn</td><td>{{ frappe.utils.formatdate(service_start) }}</td></tr>{% endif %}
|
||||
{%- if is_so and interval %}<tr><td class="k">Abrechnungsintervall</td><td>{{ interval }}</td></tr>{% endif %}
|
||||
{%- if doc.get("tax_id") %}<tr><td class="k">Ihre USt-IdNr.</td><td>{{ doc.tax_id }}</td></tr>{% endif %}
|
||||
{%- if doc.get("tax_id") %}<tr><td class="k">Ihre USt-IdN‌r.</td><td>{{ doc.tax_id }}</td></tr>{% endif %}
|
||||
{%- if is_inv and not doc.is_return %}<tr><td class="k">Fällig am</td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>{% endif %}
|
||||
{%- if doc.doctype == "Quotation" and doc.valid_till %}<tr><td class="k">Gültig bis</td><td>{{ frappe.utils.formatdate(doc.valid_till) }}</td></tr>{% endif %}
|
||||
{%- if doc.get("po_no") %}<tr><td class="k">Ihre Bestellung</td><td>{{ doc.po_no }}</td></tr>{% endif %}
|
||||
@@ -298,8 +300,14 @@ var documentHTML = brand.Replace(`{%- set is_inv = doc.doctype == "Sales Invoice
|
||||
<tr><td class="k">Laufzeit / Kündigung</td><td>Keine Mindestlaufzeit; der Vertrag läuft auf unbestimmte Zeit. Monatlich kündbar mit einer Frist von einem Monat zum Monatsende.</td></tr>
|
||||
<tr><td class="k">Abrechnung</td><td>Monatlich, jeweils zu Beginn des Leistungszeitraums.</td></tr>
|
||||
<tr><td class="k">{% if interval == "monatlich" %}Monatliche Vergütung{% else %}Vergütung{% endif %}</td><td>{{ doc.get_formatted("net_total") }} netto zzgl. gesetzlicher Umsatzsteuer.{% if total_discount > 0.005 %} Der darin enthaltene monatliche Nachlass von {{ frappe.utils.fmt_money(total_discount, currency=doc.currency) }} gilt dauerhaft, einschließlich etwaiger Verlängerungen.{% endif %}</td></tr>
|
||||
<tr><td class="k">Mehrverbrauch</td><td>Über das gebuchte Kontingent hinausgehende Prüfungen werden je zusätzlicher Prüfung gesondert berechnet.</td></tr>
|
||||
<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; die Versionsstände sind in der Anlage bezeichnet." }}</td></tr>
|
||||
{#- Overage only applies to Prüfwerk; the per-check price is the catalogue's
|
||||
CRA-CSA-CLD-SCAN on the quote's price list. -#}
|
||||
{%- set item_codes = " " ~ ((doc.items or []) | map(attribute="item_code") | join(" ")) -%}
|
||||
{%- if " CRA-CSA-" in item_codes %}
|
||||
{%- set scan_rate = frappe.db.get_value("Item Price", {"item_code": "CRA-CSA-CLD-SCAN", "price_list": doc.selling_price_list or "Standard Selling", "selling": 1}, "price_list_rate") %}
|
||||
<tr><td class="k">Mehrverbrauch</td><td>Prüfungen über das gebuchte Monatskontingent hinaus werden {% if scan_rate %}mit {{ frappe.utils.fmt_money(scan_rate, currency=doc.currency) }} netto je zusätzlicher Prüfung{% else %}je zusätzlicher Prüfung gemäß der jeweils gültigen Preisliste{% endif %} berechnet.</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>
|
||||
<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>
|
||||
|
||||
@@ -492,12 +492,12 @@ func TestEverySKUHasAListPrice(t *testing.T) {
|
||||
|
||||
// § 14 Abs. 4 UStG and § 35a GmbHG: what the documents must show.
|
||||
func TestDocumentsCarryTheLegalDetails(t *testing.T) {
|
||||
for _, want := range []string{"Leistungszeitraum", "Leistungsdatum entspricht dem Rechnungsdatum", "USt-IdNr.", "doc.taxes", "net_total", "grand_total", "Reverse Charge", "Mandatsreferenz", "Gläubiger-Identifikationsnummer", "Leistungsbeginn", "Abrechnungsintervall", "Vertragsgrundlage", "Auftragsnummer", "nach Erteilung eines gültigen SEPA-Lastschriftmandats", "gemäß erteiltem SEPA-Lastschriftmandat", "cust != doc.customer_name", "doc.customer_address", `ca.country != "Germany"`, "{{ letter_head }}", `id="footer-html"`} {
|
||||
for _, want := range []string{"Leistungszeitraum", "Leistungsdatum entspricht dem Rechnungsdatum", "USt-IdN‌r.", "doc.taxes", "net_total", "grand_total", "Reverse Charge", "Mandatsreferenz", "Gläubiger-Identifikationsnummer", "Leistungsbeginn", "Abrechnungsintervall", "Vertragsgrundlage", "Auftragsnummer", "nach Erteilung eines gültigen SEPA-Lastschriftmandats", "gemäß erteiltem SEPA-Lastschriftmandat", "cust != doc.customer_name", "doc.customer_address", `ca.country != "Germany"`, "{{ letter_head }}", `id="footer-html"`} {
|
||||
if !strings.Contains(documentHTML, want) {
|
||||
t.Errorf("document template lacks %q", want)
|
||||
}
|
||||
}
|
||||
for _, want := range []string{"HRB 736403", "Amtsgericht Freiburg", "Geschäftsführer", "tax_id", "IBAN"} {
|
||||
for _, want := range []string{"HRB 736403", "Amtsgericht Freiburg", "Geschäftsführer", "USt-IdN‌r.", "tax_id", "IBAN"} {
|
||||
if !strings.Contains(letterFooterHTML, want) {
|
||||
t.Errorf("letter footer lacks %q", want)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user