From b2a5f7cc6432b7e42151180640eae34d8b321c7d Mon Sep 17 00:00:00 2001 From: DanielS Date: Tue, 11 Aug 2026 23:34:35 +0200 Subject: [PATCH] feat(customers): add customer-level and device-level update/upgrade buttons with automatic license date calculation for update discount --- shop/app/my-customers/[id]/page.tsx | 7 ++++ shop/app/order/page.tsx | 5 +++ shop/components/customer-accordion-list.tsx | 44 ++++++++++++++------- shop/components/order-wizard.tsx | 3 +- 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/shop/app/my-customers/[id]/page.tsx b/shop/app/my-customers/[id]/page.tsx index a6702d0..0f6c15a 100644 --- a/shop/app/my-customers/[id]/page.tsx +++ b/shop/app/my-customers/[id]/page.tsx @@ -104,6 +104,13 @@ export default function CustomerDetailPage({ params }: { params: Promise<{ id: s Kunden-ID: {customer.id.slice(0, 8)}…

+ {!customer.is_anonymized && ( + + + + )} {customer.is_anonymized && ( Anonymisiert diff --git a/shop/app/order/page.tsx b/shop/app/order/page.tsx index 3a6dd3c..47e0233 100644 --- a/shop/app/order/page.tsx +++ b/shop/app/order/page.tsx @@ -138,6 +138,10 @@ async function OrderDataWrapper({ companies = await getCompanies().catch(() => []) } + const initialLastLicenseDate = initialOrder + ? (initialOrder.order_data?.last_license_date || (initialOrder.created_at ? new Date(initialOrder.created_at).toISOString().split('T')[0] : '')) + : '' + return ( ) } diff --git a/shop/components/customer-accordion-list.tsx b/shop/components/customer-accordion-list.tsx index ec52468..bdbce0a 100644 --- a/shop/components/customer-accordion-list.tsx +++ b/shop/components/customer-accordion-list.tsx @@ -120,14 +120,15 @@ function DeviceCard({

- {/* Upgrade / Abo Button */} + {/* Update / Upgrade Button für Kasse */} @@ -272,18 +273,31 @@ export function CustomerAccordionList({ customers }: CustomerAccordionListProps)
{!customer.is_anonymized && ( - e.stopPropagation()} - > - - + + + e.stopPropagation()} + > + + + )}