erpsetup: state the permanent discount when it is a negative line #96

Merged
sharang merged 1 commits from fix/erpsetup-quotation-discount-sentence into main 2026-10-28 07:17:57 +00:00
Owner

What

Follow-up to #95, found in the regenerated SAL-QTN-2026-00001 PDF:

  • Permanent discount not stated. The "Monatliche Vergütung" row only mentioned the discount for a document-level discount. The Pilotrabatt is a negative line item (by design — eu_einvoice can't carry a document-level discount), so the sentence never rendered and the Rabattdauer — one of the reviewer's required terms — was missing. Now negative lines (rate < 0) are counted too, and the text says the discount is already contained in the net amount ("Der darin enthaltene monatliche Nachlass von 119,00 € gilt dauerhaft …").
  • Block split across pages 1–2. Wrapped in page-break-inside: avoid.

Verified

go build, go vet, go test ./internal/erpsetup/ green. Because Go tests don't render Jinja (that's how this slipped through #95), the Quotation block was rendered against mocks: line-item discount, document-level discount and no discount all give the expected text. Still Quotation-only — invoices untouched.

Apply

After merge: re-run erpsetup against the live ERP (same as for #95), then reprint the quotation.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4

## What Follow-up to #95, found in the regenerated SAL-QTN-2026-00001 PDF: - **Permanent discount not stated.** The "Monatliche Vergütung" row only mentioned the discount for a *document-level* discount. The Pilotrabatt is a **negative line item** (by design — eu_einvoice can't carry a document-level discount), so the sentence never rendered and the Rabattdauer — one of the reviewer's required terms — was missing. Now negative lines (`rate < 0`) are counted too, and the text says the discount is already contained in the net amount ("Der darin enthaltene monatliche Nachlass von 119,00 € gilt dauerhaft …"). - **Block split across pages 1–2.** Wrapped in `page-break-inside: avoid`. ## Verified `go build`, `go vet`, `go test ./internal/erpsetup/` green. Because Go tests don't render Jinja (that's how this slipped through #95), the Quotation block was rendered against mocks: line-item discount, document-level discount and no discount all give the expected text. Still Quotation-only — invoices untouched. ## Apply After merge: re-run `erpsetup` against the live ERP (same as for #95), then reprint the quotation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
sharang added 1 commit 2026-10-27 16:12:17 +00:00
fix(erpsetup): state the permanent discount when it is a negative line
ci / shared (pull_request) Successful in 14s
ci / test (pull_request) Successful in 24m42s
ci / image (pull_request) Skipped
01a1b5b8fd
The Vertragsbedingungen block (#95) only stated the permanent discount for a
document-level discount (total - net_total). The K-00001 Pilotrabatt is a
negative line item, by design, because eu_einvoice cannot carry a
document-level discount, so the sentence never rendered and the Rabattdauer
(one of the reviewer's required terms) was missing from the PDF.

Count negative lines (rate < 0) as well, and say the discount is already
contained in the stated net amount. Keep the block on one page
(page-break-inside: avoid); it split across pages 1-2.

Rendered against mocks: line-item discount, document-level discount and no
discount all produce the expected text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
sharang merged commit 07213016d7 into main 2026-10-28 07:17:57 +00:00
Sign in to join this conversation.