diff --git a/shop/app/my-orders/MyOrdersClient.tsx b/shop/app/my-orders/MyOrdersClient.tsx index 9afb86d..120be6a 100644 --- a/shop/app/my-orders/MyOrdersClient.tsx +++ b/shop/app/my-orders/MyOrdersClient.tsx @@ -224,67 +224,80 @@ export function MyOrdersClient({ orders, error }: MyOrdersClientProps) { - {/* Kassen & Produkte Detail-Übersicht (Separate Container-Box je Kasse) */} + {/* Kassen & Produkte Detail-Übersicht (Angelehnt an Kundenliste DeviceCard) */} {items.length > 0 && (

Kassenaufstellung ({items.length} {items.length === 1 ? 'Kasse' : 'Kassen'}):

-
+
{items.map((item, idx) => { - const devName = item.device_name || `K${idx + 1}` + const devName = item.device_name || `Kasse ${idx + 1}` const licNum = item.license_number const modules = item.selected_modules || [] + + // Chips für Hauptprodukt und Module + const chips: string[] = [] + if (item.product_name) chips.push(item.product_name) + for (const mod of modules) { + if (mod.module_name) chips.push(mod.module_name) + } + + const itemPrice = (item as any).price || item.base_price || 0 + const modulesPrice = modules.reduce((sum: number, m: any) => sum + ((m.price || 0) * (m.quantity || 1)), 0) + const deviceTotal = itemPrice + modulesPrice return (
- {/* Kassen Container Header: Name + Lizenznummer daneben */} -
-
+ {/* Kassen-Info links */} +
+ {/* Kassen-Name + Lizenznummer daneben + Intervall */} +
{devName} + {licNum && ( Lizenz: {licNum} )} -
- - {item.billing_interval === 'one_time' ? 'Kauf' : 'Abo'} - -
- {/* Inhalt: Hauptprodukt & Module nach Kategorien */} -
-
- {item.product_name} - {((item as any).price || item.base_price) && ( - {fmt((item as any).price || item.base_price)} - )} + + {item.billing_interval === 'one_time' ? 'Kauf' : 'Abo'} +
- {modules.length > 0 && ( -
- - Enthaltene Zusatzmodule: - -
- {modules.map((mod: any, mIdx: number) => ( - - + {mod.module_name || mod.name} - {mod.quantity > 1 ? ({mod.quantity}x) : ''} - - ))} -
+ {/* Produkt + Modul Chips */} + {chips.length > 0 && ( +
+ {chips.map((chip, cIdx) => ( + + {chip} + + ))}
)}
+ + {/* Preis rechts */} + {deviceTotal > 0 && ( +
+

Kassenwert

+

+ {fmt(deviceTotal)} + {item.billing_interval === 'monthly' && / mtl.} +

+
+ )}
) })}