On a document with a discount, ERPNext lowers net_total but leaves tax_amount on each tax row at the pre-discount value. The template printed that value next to the gross discount, so the totals didn't add up and the VAT shown was too high.
Example from the first live offer: printed Summe netto 1.008,40, Rabatt −131,61, USt 212,61, Gesamtbetrag 1.200,00. Correct is USt 191,60. The same template is used for Sales Invoices, where a wrong tax amount is a § 14 UStG problem.
Change
Totals are now Zwischensumme (total), Rabatt (net: total − net_total), Summe netto, tax rows from tax_amount_after_discount_amount, Gesamtbetrag. Without a discount it looks as before.
Offers and order confirmations name the debit term from the payment term, e.g. "Zahlungsart: SEPA-Lastschrift, Einzug 21 Tage nach Rechnungsdatum, nach Erteilung eines gültigen SEPA-Lastschriftmandats."
New test TestTotalsPrintTheTaxAfterDiscount.
Rollout
After the merge, run erpsetup against the live ERP. It updates the Print Format, then reprint the offer. That's a live ERP change and needs a go.
## Problem
On a document with a discount, ERPNext lowers `net_total` but leaves `tax_amount` on each tax row at the pre-discount value. The template printed that value next to the gross discount, so the totals didn't add up and the VAT shown was too high.
Example from the first live offer: printed Summe netto 1.008,40, Rabatt −131,61, USt 212,61, Gesamtbetrag 1.200,00. Correct is USt 191,60. The same template is used for Sales Invoices, where a wrong tax amount is a § 14 UStG problem.
## Change
- Totals are now Zwischensumme (`total`), Rabatt (net: `total − net_total`), Summe netto, tax rows from `tax_amount_after_discount_amount`, Gesamtbetrag. Without a discount it looks as before.
- Offers and order confirmations name the debit term from the payment term, e.g. "Zahlungsart: SEPA-Lastschrift, Einzug 21 Tage nach Rechnungsdatum, nach Erteilung eines gültigen SEPA-Lastschriftmandats."
- New test `TestTotalsPrintTheTaxAfterDiscount`.
## Rollout
After the merge, run `erpsetup` against the live ERP. It updates the Print Format, then reprint the offer. That's a live ERP change and needs a go.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
With a discount, ERPNext lowers net_total but keeps each tax row's
tax_amount at the pre-discount value. The document template printed
that value next to the gross discount, so the lines did not add up and
the VAT shown was too high (offer SAL-QTN-2026-00001: 212.61 printed,
191.60 charged). The totals now read Zwischensumme, Rabatt (net),
Summe netto, tax after discount, Gesamtbetrag.
Offers and order confirmations also name the debit term from the
payment term ("Einzug 21 Tage nach Rechnungsdatum").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang
merged commit b4c184c26f into main2026-10-19 20:51:34 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
On a document with a discount, ERPNext lowers
net_totalbut leavestax_amounton each tax row at the pre-discount value. The template printed that value next to the gross discount, so the totals didn't add up and the VAT shown was too high.Example from the first live offer: printed Summe netto 1.008,40, Rabatt −131,61, USt 212,61, Gesamtbetrag 1.200,00. Correct is USt 191,60. The same template is used for Sales Invoices, where a wrong tax amount is a § 14 UStG problem.
Change
total), Rabatt (net:total − net_total), Summe netto, tax rows fromtax_amount_after_discount_amount, Gesamtbetrag. Without a discount it looks as before.TestTotalsPrintTheTaxAfterDiscount.Rollout
After the merge, run
erpsetupagainst the live ERP. It updates the Print Format, then reprint the offer. That's a live ERP change and needs a go.🤖 Generated with Claude Code
With a discount, ERPNext lowers net_total but keeps each tax row's tax_amount at the pre-discount value. The document template printed that value next to the gross discount, so the lines did not add up and the VAT shown was too high (offer SAL-QTN-2026-00001: 212.61 printed, 191.60 charged). The totals now read Zwischensumme, Rabatt (net), Summe netto, tax after discount, Gesamtbetrag. Offers and order confirmations also name the debit term from the payment term ("Einzug 21 Tage nach Rechnungsdatum"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>