diff --git a/shop/components/order-wizard.tsx b/shop/components/order-wizard.tsx index 117d8a3..3d2104c 100644 --- a/shop/components/order-wizard.tsx +++ b/shop/components/order-wizard.tsx @@ -939,38 +939,38 @@ export function OrderWizard({

- {/* Left Sidebar Status Stepper */} + {/* Left Sidebar Status Stepper (matching ProgressStepper sky-blue design) */}

Status

-
- +
+
- Kunde + Kunde
- / +
-
- +
+
- Modell + Modell
- / +
-
+
3
- Software + Software
- / +
-
+
4
- Abschluss + Abschluss
diff --git a/shop/components/wizard/summary-sidebar.tsx b/shop/components/wizard/summary-sidebar.tsx index 496eaa0..1fd62c3 100644 --- a/shop/components/wizard/summary-sidebar.tsx +++ b/shop/components/wizard/summary-sidebar.tsx @@ -81,17 +81,26 @@ export function SummarySidebar({ prevStep, }: SummarySidebarProps) { const [isOpen, setIsOpen] = React.useState(false) + const [selectedBasketIdx, setSelectedBasketIdx] = React.useState(null) + + // When editing a basket item via pencil, open the modal for that item + const handleEditBasketItem = (idx: number) => { + editBasketItem(idx) + setIsOpen(true) + } + + const fmt = (val: number) => new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(val) return (
- - Zusammenfassung + + Zusammenfassung - + - {/* Active Selections & Price Calculation (Fixed) */} -
+ {/* Active Selections & Price - scrollable */} +
{visibleCategories.map(cat => { const sel = selections[cat.id] const selectedProds: Product[] = [] @@ -106,13 +115,13 @@ export function SummarySidebar({ } if (selectedProds.length === 0) return ( -
+
{cat.is_required ? ( - + ) : ( - + )} - {cat.name}: {cat.is_required ? 'nicht gewählt' : 'nicht gewählt (optional)'} + {cat.name}: {cat.is_required ? 'nicht gewählt' : 'nicht gewählt (optional)'}
) @@ -121,9 +130,7 @@ export function SummarySidebar({ return (
-
- {cat.name} -
+

{cat.name}

{sortedProds.map((prod, idx) => { const isFree = idx < freeLimit const actualPrice = isFree ? 0 : prod.base_price @@ -131,8 +138,8 @@ export function SummarySidebar({
{prod.name} {isFree && (Frei)} - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(actualPrice)} + + {fmt(actualPrice)} {' '}{billingLabel(prod.billing_interval)}
@@ -142,8 +149,8 @@ export function SummarySidebar({ return mod ? (
+ {mod.name} {mod.has_quantity ? `(x${qty})` : ''} - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(mod.price * qty)} + + {fmt(mod.price * qty)}
) : null @@ -154,6 +161,8 @@ export function SummarySidebar({
) })} + + {/* Pricing block */} {oneTimeTotal > 0 && monthlyTotal > 0 ? (
@@ -161,30 +170,30 @@ export function SummarySidebar({

Einmalig:

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

Monatlich:

Netto: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyNet)} / mtl. + {fmt(monthlyNet)} / mtl.
zzgl. 19% MwSt.: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTax)} / mtl. + {fmt(monthlyTax)} / mtl.
Gesamt (brutto): - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / mtl. + {fmt(monthlyGross)} / mtl.
@@ -192,30 +201,30 @@ export function SummarySidebar({
Netto-Gesamtbetrag: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeNet)} + {fmt(oneTimeNet)}
zzgl. 19% MwSt.: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTax)} + {fmt(oneTimeTax)}
-
+
Gesamtbetrag (brutto): - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)} + {fmt(oneTimeGross)}
) : (
Netto-Gesamtbetrag: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyNet)} / mtl. + {fmt(monthlyNet)} / mtl.
zzgl. 19% MwSt.: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTax)} / mtl. + {fmt(monthlyTax)} / mtl.
-
+
Gesamtbetrag (brutto): - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / mtl. + {fmt(monthlyGross)} / mtl.
)} @@ -242,48 +251,66 @@ export function SummarySidebar({ ))}
- {/* Warenkorb List (Scrollable) */} + {/* Kassen-Liste unten (selectable) */} {basketItems.length > 0 && ( -
-

Warenkorb ({basketItems.length}):

-
+
+

Kassen ({basketItems.length}):

+
{basketItems.map((item, idx) => ( -
-
- {item.deviceName} - - {item.billingInterval === 'one_time' ? 'Kauf' : 'Abo'} - {item.licenseNumber ? ` · Lizenz: ${item.licenseNumber}` : ''} - -
-
- - -
-
+ ))}
+ + {/* Selected basket item actions */} + {selectedBasketIdx !== null && basketItems[selectedBasketIdx] && ( +
+
+

{basketItems[selectedBasketIdx].deviceName}

+

+ {basketItems[selectedBasketIdx].billingInterval === 'one_time' ? 'Kauf' : 'Abo'} + {basketItems[selectedBasketIdx].licenseNumber ? ` · ${basketItems[selectedBasketIdx].licenseNumber}` : ''} +

+
+ + +
+ )}
)} @@ -291,7 +318,7 @@ export function SummarySidebar({