diff --git a/shop/components/order-wizard.tsx b/shop/components/order-wizard.tsx index b63db5f..990ecbd 100644 --- a/shop/components/order-wizard.tsx +++ b/shop/components/order-wizard.tsx @@ -94,7 +94,6 @@ export function OrderWizard({ const router = useRouter() // Upgrade-Mode: starte direkt bei Schritt 3 (Software) const [step, setStep] = useState(upgradeMode ? 3 : (initialOrder ? 3 : 1)) - const [direction, setDirection] = useState(1) const [isSubmitting, setIsSubmitting] = useState(false) const [selectedCompanyId, setSelectedCompanyId] = useState( initialOrder?.company_id ?? (isAdmin ? 'all' : null) @@ -544,12 +543,10 @@ export function OrderWizard({ addToBasket() } } - setDirection(1) setStep(s => s + 1) } const prevStep = () => { - setDirection(-1) setStep(s => s - 1) } @@ -847,191 +844,152 @@ export function OrderWizard({ } return ( -
- {/* Dynamic Header */} - {step !== 3 && ( -
-

- Konfigurieren Sie Ihre Lösung -

-

- Wählen Sie das passende Paket und die benötigten Module für Ihr Business. -

+
+ {/* Global Main Header over all columns */} +
+

+ Konfigurieren Sie Ihre Lösung +

+

+ Wählen Sie das passende Paket und die benötigten Module für Ihr Business. +

+
+ +
+ {/* Left Side Status Stepper & Categories for ALL steps */} +
+
+

+ Fortschritt +

+

+ Bestell-Wizard +

+
+ + + {/* Step 3 Categories inside left sidebar */} + {step === 3 && ( +
+

+ Kategorien +

+
+ {visibleCategories.map((cat) => { + const sel = selections[cat.id] + const hasSelection = (sel?.productIds && sel.productIds.length > 0) || !!sel?.productId + const isRequired = cat.is_required + const isActive = activeCategoryId === cat.id + + return ( + + ) + })} +
+
+ )}
- )} - {/* Global Stepper for Steps 1, 2, 4 */} - {step !== 3 && ( -
- -
- )} + {/* Right Main Content Column */} +
- - {/* Step 1: Customer */} - {step === 1 && ( - - - - )} + + {/* Step 1: Customer */} + {step === 1 && ( + + + + )} - {/* Step 2: Billing Model */} - {step === 2 && ( - - - - )} - {/* Step 3: Software Selector */} + {/* Step 2: Billing Model */} + {step === 2 && ( + + + + )} {step === 3 && ( -
+
- {/* LEFT: Categories Sidebar Menu */} -
-
-

- Konfigurieren Sie Ihre Lösung -

-

- Wählen Sie das passende Paket und die benötigten Module für Ihr Business. -

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

- Status -

-
-
-
- -
- Kunde -
-
-
-
- -
- Modell -
-
-
-
- 3 -
- Software -
-
-
-
- 4 -
- Abschluss -
-
-
- -
- {visibleCategories.map((cat) => { - const sel = selections[cat.id] - const hasSelection = (sel?.productIds && sel.productIds.length > 0) || !!sel?.productId - const isRequired = cat.is_required - const isActive = activeCategoryId === cat.id - - return ( - - ) - })} -
-
- - {/* CENTER: Scrollable Category Selection */} -
-
+ {/* LEFT: Scrollable Category Selection */} +
+
{/* Upgrade-Modus Hinweis-Banner */} {upgradeMode && lockedDeviceId && (
@@ -1062,9 +1020,8 @@ export function OrderWizard({
- {/* RIGHT: Stepper Header + Summary sidebar */} -
- + {/* RIGHT: Summary sidebar */} +
setToast(null)} /> +
+
) } diff --git a/shop/components/wizard/summary-sidebar.tsx b/shop/components/wizard/summary-sidebar.tsx index a8bd96c..423a762 100644 --- a/shop/components/wizard/summary-sidebar.tsx +++ b/shop/components/wizard/summary-sidebar.tsx @@ -81,19 +81,33 @@ 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 + {basketItems.length > 0 && ( + + {basketItems.length} {basketItems.length === 1 ? 'Kasse' : 'Kassen'} + + )} + - + {/* Active Selections & Price - scrollable */} -
+
{visibleCategories.map(cat => { const sel = selections[cat.id] const selectedProds: Product[] = [] @@ -158,9 +172,9 @@ export function SummarySidebar({ {/* Pricing block */} {oneTimeTotal > 0 && monthlyTotal > 0 ? ( -
+
-

Einmalig:

+

Einmalig:

Netto: {fmt(oneTimeNet)} @@ -169,13 +183,13 @@ export function SummarySidebar({ zzgl. 19% MwSt.: {fmt(oneTimeTax)}
-
- Gesamt (brutto): - {fmt(oneTimeGross)} +
+ Brutto: + {fmt(oneTimeGross)}
-

Monatlich:

+

Monatlich:

Netto: {fmt(monthlyNet)} / mtl. @@ -184,39 +198,39 @@ export function SummarySidebar({ zzgl. 19% MwSt.: {fmt(monthlyTax)} / mtl.
-
- Gesamt (brutto): - {fmt(monthlyGross)} / mtl. +
+ Brutto: + {fmt(monthlyGross)} / mtl.
) : oneTimeTotal > 0 ? ( -
+
- Netto-Gesamtbetrag: + Netto: {fmt(oneTimeNet)}
zzgl. 19% MwSt.: {fmt(oneTimeTax)}
-
- Gesamtbetrag (brutto): +
+ Gesamt (brutto): {fmt(oneTimeGross)}
) : ( -
+
- Netto-Gesamtbetrag: + Netto: {fmt(monthlyNet)} / mtl.
zzgl. 19% MwSt.: {fmt(monthlyTax)} / mtl.
-
- Gesamtbetrag (brutto): +
+ Gesamt (brutto): {fmt(monthlyGross)} / mtl.
@@ -231,56 +245,69 @@ export function SummarySidebar({
)} {!allCategoriesFilled && ( -

- +

+ Bitte aus jeder Pflichtkategorie einen Artikel wählen.

)} {productValidationErrors.map((err, errIdx) => ( -

- +

+ {err}

))}
- {/* 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}` : ''} - +
+
+
+ {item.deviceName} + + {item.billingInterval === 'one_time' ? 'Kauf' : 'Abo'} + +
+ {item.licenseNumber && ( +

{item.licenseNumber}

+ )}
-
+
@@ -289,25 +316,24 @@ export function SummarySidebar({
)} - + - -