fix(erpsetup): domestic customer address without capitals and country (#54)
ci / shared (push) Successful in 13s
ci / test (push) Successful in 23m41s
ci / image (push) Successful in 34s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
This commit was merged in pull request #54.
This commit is contained in:
sharangandClaude Opus 5.5 committed 2026-09-30 12:20:07 +00:00
1 parent fb241befcc
commit 2c365b9b3d
2 files changed
+10 -4

No files matched your search

+9 -3
View File
@@ -144,9 +144,9 @@ 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 "" -%}
<table style="width:100%;border-collapse:collapse;border-top:0.5px solid $LINE;font-family:Arial,Helvetica,sans-serif;color:$FAINT;">
<tr>
<td style="vertical-align:top;padding:5px 8px 0 0;width:23%;font-size:6.5pt;line-height:1.45;"><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:25%;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:22%;font-size:6.5pt;line-height:1.45;">$DIRECTORS_BR</td>
<td style="vertical-align:top;padding:5px 8px 0 0;width:21%;font-size:6.5pt;line-height:1.45;"><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:28%;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:21%;font-size:6.5pt;line-height:1.45;">$DIRECTORS_BR</td>
<td style="vertical-align:top;padding:5px 0 0 0;width:30%;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>
</table>`, "${companyVars}", companyVars))
@@ -193,7 +193,13 @@ var documentHTML = brand.Replace(`{%- set is_inv = doc.doctype == "Sales Invoice
<td style="vertical-align:top;width:58%;">
<div class="sender">{{ doc.company }} · {{ bp_addr.address_line1 }} · {{ bp_addr.pincode }} {{ bp_addr.city }}</div>
<b>{{ doc.customer_name }}</b><br>
{%- set ca = frappe.db.get_value("Address", doc.customer_address, ["address_line1", "address_line2", "pincode", "city", "country"], as_dict=1) if doc.customer_address else None %}
{%- if ca %}
{{ ca.address_line1 }}<br>{% if ca.address_line2 %}{{ ca.address_line2 }}<br>{% endif %}
{{ ca.pincode or "" }} {{ ca.city }}{% if ca.country and ca.country != "Germany" %}<br>{{ _(ca.country) | upper }}{% endif %}
{%- else %}
{{ doc.address_display or "" }}
{%- endif %}
</td>
<td style="vertical-align:top;">
<table class="meta" style="margin-left:auto;">
+1 -1
View File
@@ -447,7 +447,7 @@ 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-ID", "doc.address_display", "{{ letter_head }}", `id="footer-html"`} {
for _, want := range []string{"Leistungszeitraum", "Leistungsdatum entspricht dem Rechnungsdatum", "USt-IdNr.", "doc.taxes", "net_total", "grand_total", "Reverse Charge", "Mandatsreferenz", "Gläubiger-ID", "doc.customer_address", `ca.country != "Germany"`, "{{ letter_head }}", `id="footer-html"`} {
if !strings.Contains(documentHTML, want) {
t.Errorf("document template lacks %q", want)
}