From 147dab560798991e0eb2577919f3447a0519a377 Mon Sep 17 00:00:00 2001 From: DanielS Date: Fri, 3 Jul 2026 01:13:16 +0200 Subject: [PATCH] fix: fix overlapping PDF labels and show net tax gross prices in wizard --- shop/components/invoice-pdf.tsx | 3 - shop/components/order-wizard.tsx | 166 ++++++++++++++++++++++--------- 2 files changed, 118 insertions(+), 51 deletions(-) diff --git a/shop/components/invoice-pdf.tsx b/shop/components/invoice-pdf.tsx index 559fbab..d48004c 100644 --- a/shop/components/invoice-pdf.tsx +++ b/shop/components/invoice-pdf.tsx @@ -213,10 +213,7 @@ export const InvoicePDF = ({ order, orderSnapshot, customer }: any) => { {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(taxAmount)} - Gesamtbetrag (netto): - MwSt.Betrag: Gesamtbetrag (brutto): - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(total)} diff --git a/shop/components/order-wizard.tsx b/shop/components/order-wizard.tsx index 45ba805..ce269b3 100644 --- a/shop/components/order-wizard.tsx +++ b/shop/components/order-wizard.tsx @@ -294,6 +294,14 @@ export function OrderWizard({ return { monthlyTotal: monthly, oneTimeTotal: oneTime } }, [selections, products, categories, moduleQuantities, updatePriceModifier]) + const oneTimeNet = oneTimeTotal + const oneTimeTax = oneTimeNet * 0.19 + const oneTimeGross = oneTimeNet + oneTimeTax + + const monthlyNet = monthlyTotal + const monthlyTax = monthlyNet * 0.19 + const monthlyGross = monthlyNet + monthlyTax + // Helper: update product selection for a category (resets modules) function selectProduct(catId: string, productId: string) { setSelections(prev => { @@ -981,35 +989,67 @@ export function OrderWizard({ })} {oneTimeTotal > 0 && monthlyTotal > 0 ? ( -
-
- Einmalig gesamt: - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTotal)} - +
+
+

Einmalig:

+
+ Netto: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeNet)} +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTax)} +
+
+ Gesamt (brutto): + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)} +
-
- Monatlich gesamt: - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTotal)} - {' '}/ Monat - +
+

Monatlich:

+
+ Netto: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyNet)} / mtl. +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTax)} / mtl. +
+
+ Gesamt (brutto): + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / mtl. +
) : oneTimeTotal > 0 ? ( -
- Gesamt (einmalig): - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTotal)} - +
+
+ Netto-Gesamtbetrag: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeNet)} +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTax)} +
+
+ Gesamtbetrag (brutto): + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)} +
) : ( -
- Gesamt: - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTotal)} - {' '}/ Monat - +
+
+ Netto-Gesamtbetrag: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyNet)} / mtl. +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTax)} / mtl. +
+
+ Gesamtbetrag (brutto): + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / mtl. +
)} {updatePriceModifier.label && ( @@ -1139,47 +1179,77 @@ export function OrderWizard({
{oneTimeTotal > 0 && monthlyTotal > 0 ? ( -
-
- Einmaliger Gesamtbetrag: - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTotal)} - +
+
+

Einmaliger Betrag:

+
+ Netto: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeNet)} +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTax)} +
+
+ Brutto: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)} +
{updatePriceModifier.label && (
{updatePriceModifier.label}
)} -
- Monatlicher Gesamtbetrag: - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTotal)} - {' '}/ Monat - +
+

Monatlicher Betrag:

+
+ Netto: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyNet)} / mtl. +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTax)} / mtl. +
+
+ Brutto: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / mtl. +
) : oneTimeTotal > 0 ? ( -
-
- Gesamtbetrag: - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTotal)} - +
+
+ Netto-Gesamtbetrag: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeNet)} +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTax)}
{updatePriceModifier.label && ( -
+
{updatePriceModifier.label}
)} +
+ Gesamtbetrag (brutto): + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)} +
) : ( -
- Gesamtbetrag: - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTotal)} - {' '}/ Monat - +
+
+ Netto-Gesamtbetrag: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyNet)} / mtl. +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTax)} / mtl. +
+
+ Gesamtbetrag (brutto): + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / mtl. +
)}