feat(customers): add customer-level and device-level update/upgrade buttons with automatic license date calculation for update discount
This commit is contained in:
@@ -120,14 +120,15 @@ function DeviceCard({
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Upgrade / Abo Button */}
|
||||
{/* Update / Upgrade Button für Kasse */}
|
||||
<Link href={upgradeUrl}>
|
||||
<Button
|
||||
size="sm"
|
||||
className="bg-primary/20 hover:bg-primary/30 text-primary border border-primary/30 text-xs font-semibold gap-1.5"
|
||||
className="bg-sky-500/20 hover:bg-sky-500/30 text-sky-300 border border-sky-500/40 text-xs font-bold gap-1.5 shadow-[0_0_12px_rgba(56,189,248,0.2)]"
|
||||
title="Kasse updaten oder upgraden (Erstelldatum wird für den Update-Rabatt genutzt)"
|
||||
>
|
||||
<Sparkles className="w-3.5 h-3.5" />
|
||||
Upgrade / Abo
|
||||
<Sparkles className="w-3.5 h-3.5 text-sky-400" />
|
||||
Update / Upgrade
|
||||
</Button>
|
||||
</Link>
|
||||
|
||||
@@ -272,18 +273,31 @@ export function CustomerAccordionList({ customers }: CustomerAccordionListProps)
|
||||
</Badge>
|
||||
|
||||
{!customer.is_anonymized && (
|
||||
<Link
|
||||
href={`/my-customers/${customer.id}`}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="text-slate-400 hover:text-white hover:bg-white/10 gap-1 text-xs"
|
||||
<>
|
||||
<Link
|
||||
href={`/order?customer_id=${customer.id}`}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<Edit2 className="w-3.5 h-3.5" /> Bearbeiten
|
||||
</Button>
|
||||
</Link>
|
||||
<Button
|
||||
size="sm"
|
||||
className="bg-primary/20 hover:bg-primary/30 text-primary border border-primary/40 gap-1.5 text-xs font-bold shadow-[0_0_10px_rgba(59,130,246,0.2)]"
|
||||
>
|
||||
<Sparkles className="w-3.5 h-3.5" /> Kunde updaten / bestellen
|
||||
</Button>
|
||||
</Link>
|
||||
<Link
|
||||
href={`/my-customers/${customer.id}`}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="text-slate-400 hover:text-white hover:bg-white/10 gap-1 text-xs"
|
||||
>
|
||||
<Edit2 className="w-3.5 h-3.5" /> Bearbeiten
|
||||
</Button>
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
|
||||
<Button
|
||||
|
||||
@@ -90,6 +90,7 @@ export function OrderWizard({
|
||||
upgradeMode?: boolean
|
||||
initialEndCustomerId?: string | null
|
||||
lockedDeviceId?: string | null
|
||||
initialLastLicenseDate?: string
|
||||
}) {
|
||||
const router = useRouter()
|
||||
// Upgrade-Mode: starte direkt bei Schritt 3 (Software)
|
||||
@@ -214,7 +215,7 @@ export function OrderWizard({
|
||||
|
||||
// Falls "one_time" (Kauf) gewählt: optionales Datum der letzten CASPOS-Lizenzierung
|
||||
const [lastLicenseDate, setLastLicenseDate] = useState<string>(
|
||||
initialOrder?.order_data?.last_license_date || ''
|
||||
initialLastLicenseDate || initialOrder?.order_data?.last_license_date || ''
|
||||
)
|
||||
|
||||
// Aktive Auswahllisten initialisieren
|
||||
|
||||
Reference in New Issue
Block a user