From 8177f71b3b38d721d16c68e755acb079561a1c7f Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Thu, 30 Apr 2026 10:53:44 +0330 Subject: [PATCH] print for kitchen --- src/pages/orders/Details.tsx | 6 + src/pages/orders/components/OrderActions.tsx | 22 ++- src/pages/orders/print/orderReceiptPrint.ts | 160 +++++++++++++++++++ src/shared/print/printHtmlDocument.ts | 77 +++++++++ 4 files changed, 257 insertions(+), 8 deletions(-) create mode 100644 src/pages/orders/print/orderReceiptPrint.ts create mode 100644 src/shared/print/printHtmlDocument.ts diff --git a/src/pages/orders/Details.tsx b/src/pages/orders/Details.tsx index f76faab..21cf632 100644 --- a/src/pages/orders/Details.tsx +++ b/src/pages/orders/Details.tsx @@ -17,6 +17,7 @@ import PaymentInfo from './components/PaymentInfo' import OrderActions from './components/OrderActions' import { toast } from 'react-toastify' import { extractErrorMessage } from '@/config/func' +import { printOrderReceipt } from './print/orderReceiptPrint' const OrderDetails: FC = () => { const { id } = useParams() @@ -197,6 +198,10 @@ const OrderDetails: FC = () => { setShowRefundModal(false) } + const handlePrintOrder = () => { + printOrderReceipt(order) + } + return (
@@ -228,6 +233,7 @@ const OrderDetails: FC = () => { getPaymentStatusText={getPaymentStatusText} /> void showVerifyCashPaymentButton: boolean showSendToKitchenButton: boolean showCancelButton: boolean @@ -21,6 +22,7 @@ interface OrderActionsProps { } const OrderActions: FC = ({ + onPrint, showVerifyCashPaymentButton, showSendToKitchenButton, showCancelButton, @@ -71,11 +73,15 @@ const OrderActions: FC = ({ onCancelOrder() } - if (isCanceled) return null - return (
- {showVerifyCashPaymentButton && ( +