feat(admin): update B2B PDF, mail and admin table

- format PDF order number as AE- and add upgrade flags

- style status emails with sleek modern dark theme

- add badge counts to admin table status filter buttons

- implement preiskorrektur inline editing inside admin detail modal

- trigger DB and total price recalculations on snapshot changes
This commit is contained in:
DanielS
2026-08-20 17:16:40 +02:00
parent e0d9c1d20e
commit 49a7a0768d
4 changed files with 368 additions and 145 deletions

View File

@@ -468,7 +468,7 @@ export async function updateOrderStatus(
const oldLabel = statusLabelMap[oldStatus] || oldStatus
const newLabel = statusLabelMap[newStatus] || newStatus
const statusEmail = getStatusEmailTemplate(orderNumber, oldLabel, newLabel)
const statusEmail = getStatusEmailTemplate(orderNumber, oldLabel, newLabel, newStatus)
const mailOptions: any = {
to: user.email,
@@ -642,7 +642,7 @@ export async function rejectOrder(
const { data: { user: orderUser }, error: userError } = await admin.auth.admin.getUserById(order.user_id)
if (!userError && orderUser && orderUser.email) {
const orderNumber = order.order_number || order.id.slice(0, 8)
const statusEmail = getStatusEmailTemplate(orderNumber, 'Wartet auf Freigabe', `Abgelehnt (Grund: ${reason})`)
const statusEmail = getStatusEmailTemplate(orderNumber, 'Wartet auf Freigabe', 'Abgelehnt', 'rejected', reason)
await sendMail({
to: orderUser.email,