fix(invoices): show sub-cent Rundung in the editor totals preview

The live totals panel in the quote/invoice editor (LineItemsTable) summed the
per-line rounded totals and showed that as Total — so with crm_invoice_round_total
on, a 4 × (2.5h @ 32.25) invoice previewed CHF 322.52 while the saved invoice +
PDF correctly show 322.50 with a Rundung row. The preview now mirrors the backend.

- LineItemsTable gains a `roundTotal` prop. When set, it computes the clean net
  (full-precision sum rounded once — same rule as backend
  utils/invoiceRounding.cleanNetMinor, including the migration-119 priced
  sub-item override), shows a "Rundung" row for the drift, and folds it into the
  VAT base + Total. Off ⇒ unchanged (no row).
- Bill + Quote editors pass roundTotal from appSettings.crm_invoice_round_total.
- i18n: crm.lineItems.rounding (de "Rundung", en "Rounding").

The saved-invoice detail view already shows the stored clean total, so no change
there.
This commit is contained in:
Luca
2026-06-28 17:28:21 +02:00
parent 4670292139
commit c2bc2b098e
5 changed files with 46 additions and 11 deletions
+1
View File
@@ -4645,6 +4645,7 @@
"total": "Summe",
"subtotal": "Zwischensumme",
"vat": "MwSt.",
"rounding": "Rundung",
"position": "Pos.",
"discount": "Rabatt %",
"descriptionPlaceholder": "Beschreibung (mehrere Zeilen möglich)",
+1
View File
@@ -4645,6 +4645,7 @@
"total": "Total",
"subtotal": "Subtotal",
"vat": "VAT",
"rounding": "Rounding",
"position": "Pos.",
"discount": "Rabatt %",
"descriptionPlaceholder": "Description (multi-line OK)",