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