diff --git a/web/dashboard/src/components/pos2/pos2-screen.tsx b/web/dashboard/src/components/pos2/pos2-screen.tsx index 839607e..4155912 100644 --- a/web/dashboard/src/components/pos2/pos2-screen.tsx +++ b/web/dashboard/src/components/pos2/pos2-screen.tsx @@ -293,10 +293,14 @@ export function Pos2Screen() { notify.success(`پرداخت ${fmt(paid)} تومان ثبت شد`); queryClient.invalidateQueries({ queryKey: ["tables-board", cafeId] }); queryClient.invalidateQueries({ queryKey: ["orders-open", cafeId] }); - backToBoard(); - // Keep the paid order id so the cashier can still print the receipt after - // the cart is cleared (the success sheet below uses it). + // Clear the cart + close the pay sheet, but STAY on the order view so the + // payment-success sheet (which lives in this view) renders and the cashier + // can print the receipt. Going back to the board happens on dismiss. + clearSession(); + setPayTarget(null); + setCartOpen(false); if (!isLocalOrder(justPaidOrderId)) setPaidOrderId(justPaidOrderId); + else backToBoard(); } catch (e) { if (e instanceof ApiClientError && e.code.startsWith("POS_DEVICE")) { notify.error(posDeviceMsg(e)); @@ -616,7 +620,7 @@ export function Pos2Screen() { {paidOrderId && (
-
setPaidOrderId(null)} /> +
{ setPaidOrderId(null); backToBoard(); }} />
@@ -633,7 +637,7 @@ export function Pos2Screen() {