fix(admin): resolve notification and cash-close 500s
This commit is contained in:
@@ -698,15 +698,15 @@ export async function registerPosRoutes(app: FastifyInstance, deps: PosRouteDeps
|
||||
[id],
|
||||
),
|
||||
pool.query<{ method_code: string; method_name: string; total: string; count: string }>(
|
||||
`SELECT pm.code AS method_code, pm.name AS method_name,
|
||||
`SELECT pm.code AS method_code, pm.label AS method_name,
|
||||
COALESCE(SUM(pt.amount_cents), 0)::bigint AS total,
|
||||
COUNT(*)::int AS count
|
||||
FROM payments_transactions pt
|
||||
JOIN orders_orders o ON o.id = pt.order_id
|
||||
LEFT JOIN pos_payment_methods pm ON pm.id = pt.provider_event_id
|
||||
LEFT JOIN pos_payment_methods pm ON pm.id::text = pt.provider_event_id
|
||||
AND pm.store_id = o.store_id
|
||||
WHERE o.cash_session_id = $1 AND o.source = 'pos' AND pt.status = 'succeeded'
|
||||
GROUP BY pm.code, pm.name`,
|
||||
GROUP BY pm.code, pm.label`,
|
||||
[id],
|
||||
),
|
||||
pool.query<{ items_count: string; unique_products: string }>(
|
||||
@@ -770,15 +770,15 @@ export async function registerPosRoutes(app: FastifyInstance, deps: PosRouteDeps
|
||||
[id],
|
||||
),
|
||||
pool.query<{ method_code: string; method_name: string; total: string; count: string }>(
|
||||
`SELECT pm.code AS method_code, pm.name AS method_name,
|
||||
`SELECT pm.code AS method_code, pm.label AS method_name,
|
||||
COALESCE(SUM(pt.amount_cents), 0)::bigint AS total,
|
||||
COUNT(*)::int AS count
|
||||
FROM payments_transactions pt
|
||||
JOIN orders_orders o ON o.id = pt.order_id
|
||||
LEFT JOIN pos_payment_methods pm ON pm.id = pt.provider_event_id
|
||||
LEFT JOIN pos_payment_methods pm ON pm.id::text = pt.provider_event_id
|
||||
AND pm.store_id = o.store_id
|
||||
WHERE o.cash_session_id = $1 AND o.source = 'pos' AND pt.status = 'succeeded'
|
||||
GROUP BY pm.code, pm.name`,
|
||||
GROUP BY pm.code, pm.label`,
|
||||
[id],
|
||||
),
|
||||
pool.query<{ items_count: string; unique_products: string }>(
|
||||
|
||||
Reference in New Issue
Block a user