From 31978d5ea222020601eb4507f9f0c314f928adff Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 23 Jul 2026 20:58:16 +0000 Subject: [PATCH] Show Netto on every invoice, not just non-exempt ones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Netto/Gesamt/MwSt breakdown was gated on !order.vatExempt — on a vatExempt (innergemeinschaftliche Lieferung) invoice, Netto happens to equal Gesamt exactly (0% tax), which read as redundant next to the exemption note, so the row was skipped there. Turns out that's wrong: the ask was for Netto on every invoice this shop issues, B2B/exempt included, for layout consistency — not conditional on the tax rate. Same fix in both invoicePdf.tsx and correctionInvoicePdf.tsx (the latter covers both Storno and Gutschrift via the same summary code). Verified by rendering all three cases (normal 19% invoice, exempt B2B invoice, Storno correction) and visually inspecting the output. Co-Authored-By: Claude Sonnet 5 --- src/correctionInvoicePdf.tsx | 11 +++++++++++ src/invoicePdf.tsx | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/correctionInvoicePdf.tsx b/src/correctionInvoicePdf.tsx index b299b0d..dc8a06e 100644 --- a/src/correctionInvoicePdf.tsx +++ b/src/correctionInvoicePdf.tsx @@ -84,6 +84,8 @@ const styles = StyleSheet.create({ grandTotalRow: { flexDirection: "row", justifyContent: "space-between", paddingTop: 8, marginTop: 6, borderTopWidth: 1, borderTopColor: BORDER }, grandTotalLabel: { fontSize: 12, fontFamily: "Helvetica-Bold" }, grandTotalValue: { fontSize: 12, fontFamily: "Helvetica-Bold" }, + // Netto, right under Gesamt — same as invoicePdf.tsx's own row. + nettoRow: { flexDirection: "row", justifyContent: "space-between", paddingVertical: 2, marginTop: 6 }, // Same "enthält X% MwSt." annotation-under-Gesamt framing as // invoicePdf.tsx now uses, fixing the identical double-counting bug this // file had: the old layout showed Versand as its own row AND ALSO @@ -335,6 +337,15 @@ function CorrectionInvoiceDocument({ kind, order, seller }: { kind: CorrectionIn Gesamt -{formatPrice(grandTotal)} + {/* Netto — same reasoning as invoicePdf.tsx's own row: a + single well-defined figure (Gesamt minus every rate's own + tax, summed) regardless of how many rates are present. + Shown on every correction invoice (Storno and Gutschrift + alike), not just non-exempt ones. */} + + Netto + -{formatPrice(rateGroups.reduce((sum, g) => sum + g.net, 0))} + {order.vatExempt ? ( Steuerfreie innergemeinschaftliche Lieferung (§4 Nr. 1b UStG) diff --git a/src/invoicePdf.tsx b/src/invoicePdf.tsx index 070bd92..9a4cf9c 100644 --- a/src/invoicePdf.tsx +++ b/src/invoicePdf.tsx @@ -76,6 +76,9 @@ const styles = StyleSheet.create({ grandTotalRow: { flexDirection: "row", justifyContent: "space-between", paddingTop: 8, marginTop: 6, borderTopWidth: 1, borderTopColor: BORDER }, grandTotalLabel: { fontSize: 12, fontFamily: "Helvetica-Bold" }, grandTotalValue: { fontSize: 12, fontFamily: "Helvetica-Bold" }, + // Netto, right under Gesamt — a bit of top margin to read as its own + // line following the total, not crowded against the divider above it. + nettoRow: { flexDirection: "row", justifyContent: "space-between", paddingVertical: 2, marginTop: 6 }, // "Enthält X% MwSt.: Y €" annotations under Gesamt — same "contained // within the total, not an additional deduction" framing the website's // own VatBreakdown component already uses on /cart and /checkout. @@ -380,6 +383,19 @@ export function InvoiceDocument({ order, seller }: { order: InvoiceOrder; seller Gesamt {formatPrice(order.total)} + {/* Netto (Gesamt minus every rate's own tax, summed — a + single well-defined figure regardless of how many + distinct rates the order actually has) — businesses read + this off the invoice directly for their own input-tax + deduction instead of having to compute Gesamt minus MwSt + by hand. Shown on every invoice, not just B2B/non-exempt + ones — on a vatExempt order Netto and Gesamt happen to be + the same figure (0% tax), but the row stays for layout + consistency across every invoice this shop issues. */} + + Netto + {formatPrice(rateGroups.reduce((sum, g) => sum + g.net, 0))} + {/* Exempt orders already have every item at 0% (see this file's own InvoiceOrder.vatExempt comment) — "enthält