From 0fc07aaeacf94a4f4fba5aade550256f1be197f3 Mon Sep 17 00:00:00 2001 From: Srinath Date: Wed, 28 Jan 2026 15:11:13 +0530 Subject: [PATCH] jut chnge --- .../BookingScreen/BookingData/BookingData.js | 43 + .../BSBillingTable1/BST1Payment.jsx | 61 +- .../BSBillingTable2/BSBillingTable2.jsx | 350 +- .../BSBillingTable3/BSBillingTable3pay.jsx | 350 +- .../BSBillingTable4/BSBilling4Payment.jsx | 365 +- .../BSBillingTable5/BSBillingTable5.jsx | 299 +- .../BSBillingTable6/BST6Payment.jsx | 352 +- .../BSBillingTable7/BSBilling7Payment.jsx | 346 +- .../StandardTable/StandardTablePayment.jsx | 246 +- .../BookingFunctionality/CustomerOrders.jsx | 339 ++ src/Pages/Kiosk/CardPage/CardPage1.jsx | 102 +- src/check.jsx | 4692 ++++++++++++++++- 12 files changed, 6413 insertions(+), 1132 deletions(-) create mode 100644 src/Pages/BookingScreen/Components/BookingFunctionality/CustomerOrders.jsx diff --git a/src/Features/BookingScreen/BookingData/BookingData.js b/src/Features/BookingScreen/BookingData/BookingData.js index 575a15f..9f7d995 100644 --- a/src/Features/BookingScreen/BookingData/BookingData.js +++ b/src/Features/BookingScreen/BookingData/BookingData.js @@ -1419,6 +1419,49 @@ export const getMissedOrderids = createAsyncThunk( ); } ); +// get /LastBuyProductList +export const CustomerOrderList = createAsyncThunk( + 'CustomerOrderList/LastBuyProductList', + async (data) => { + const { AppId, CompId, BranchId, MobileNo,FromDate,ToDate } = data; + if ( + AppId != null && + AppId != undefined && + CompId != null && + CompId != undefined && + BranchId != null && + BranchId != undefined && + FromDate != null && + FromDate != undefined && + ToDate != null && + ToDate != undefined && + MobileNo != null && + MobileNo != undefined + ) { + return await axiosRetailInstanceData.get( + `/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}&fromDate=${FromDate}&toDate=${ToDate}` + ); + } + else if ( + AppId != null && + AppId != undefined && + CompId != null && + CompId != undefined && + BranchId != null && + BranchId != undefined && + MobileNo != null && + MobileNo != undefined + ) { + return await axiosRetailInstanceData.get( + `/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}` + ); + } + + } +); + + + const initialState = { PrintStyle: null, CustId: null, diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BST1Payment.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BST1Payment.jsx index c08fb84..bd078f5 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BST1Payment.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BST1Payment.jsx @@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState, useRef } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { useNavigate } from 'react-router-dom'; import moment from 'moment'; -import { Badge, Popover, Modal } from 'antd'; +import { Badge, Popover, Modal, Tooltip } from 'antd'; import { Tables } from '../../../../../Components/Tables/Table'; import { DefaultModal } from '../../../../../Components/Modal/DefaultModal.jsx'; import { UpOutlined } from '@ant-design/icons'; @@ -181,7 +181,7 @@ import { import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx'; import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx'; import { MdSms } from 'react-icons/md'; -import { FaWhatsapp, FaPrint } from 'react-icons/fa'; +import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa'; import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx'; import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js'; import BSOtherServiceClaim from '../../UtillComponents/BSOtherServiceClaim.jsx'; @@ -204,6 +204,7 @@ import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded import pozologoimg from '../../../../../Images/pozologoimg.png'; import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx'; import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js'; +import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx'; const subDirectory = import.meta.env.ENV_BASE_URL; const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL; @@ -365,6 +366,7 @@ export default function BST1Payment() { const [CardPayOption, setCardPayOption] = useState([]); const [Splitpayment, setSplitpayment] = useState(false); const [UnpaidConfirmation, setUnpaidConfirmation] = useState(false); + const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false); const [unpaidselectedindex, setunpaidselectedindex] = useState(); const GlobaluseOptions = useSelector(GlobalCommonPaymentOptions); const [useOptions, setuseOptions] = useState([]); @@ -3674,6 +3676,43 @@ export default function BST1Payment() { )} + {/* Customer Orders */} + {GetCustId && ( + + + {' '} +
{ + if ( + CheckBookingStatus !== 'Close' && + !addnewAccess && + !(OrderCardDetail?.length > 0) + ) { + setCustomerPreviesOrders(true); + } + }} + style={{ + cursor: OrderCardDetail?.length > 0 && 'not-allowed', + color: + OrderCardDetail?.length > 0 || + (OrderCardDetail?.length > 0 && + GetCustId?.CustMobile === undefined) + ? 'gray' + : 'rgb(18, 146, 238)', + fontSize: '25px', + display: 'flex', + alignItems: 'center', + height: '2.46rem', + width: '1.5rem', + }} + > + +
+
+ )} + + {OtherServicesglobal && OrderCardDetail.length >= 1 && ( {' '} @@ -4344,6 +4383,24 @@ export default function BST1Payment() { Do you want to cancel the payment? )} + + {customerPreviesOrders && ( + setCustomerPreviesOrders(false)} + footer={false} + width={700} + className={'ModalPaymentGatewayEmbedded'} + children={ + <> + setCustomerPreviesOrders(false)} + /> + + } + /> + )} ); } diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BSBillingTable2.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BSBillingTable2.jsx index a1fc9c5..3c8e9c0 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BSBillingTable2.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BSBillingTable2.jsx @@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState, useRef } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { useNavigate } from 'react-router-dom'; import moment from 'moment'; -import { Badge, Popover, Modal } from 'antd'; +import { Badge, Popover, Modal, Tooltip } from 'antd'; import { ArrowRightOutlined, UpCircleOutlined, @@ -189,7 +189,7 @@ import { getCombolist } from '../../../../../Features/ComboMaster/ComboMaster.js import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx'; import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx'; import { MdSms } from 'react-icons/md'; -import { FaWhatsapp, FaPrint } from 'react-icons/fa'; +import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa'; import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx'; import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js'; import { PostOtherServices } from '../../../../../Features/OtherServices/OtherServices.js'; @@ -352,6 +352,7 @@ const BSBillingTable2 = () => { const [Success, SetSuccess] = useState(); const [brachName, setbrachName] = useState(''); const [UpiOpen, setUpiOpen] = useState(false); + const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false); const OverAllSales = useSelector(GlobalOverAllDiscSales); const OverAllEstimate = useSelector(GlobalOverAllDiscEstimate); @@ -1414,7 +1415,7 @@ const BSBillingTable2 = () => { const selectedStyle = stylesMap[ - printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle + printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle ]; if (selectedStyle) { @@ -1966,15 +1967,15 @@ const BSBillingTable2 = () => { OrderStatus: 'O', OrderType: BookingType === 'Dine In' || - BookingTypeBoth || - Estimation?.SettingValue == 'N' + BookingTypeBoth || + Estimation?.SettingValue == 'N' ? 'S' : GlobEstBooking === 'OvrAllEst' ? 'E' : GlobEstBooking === 'ParEst' ? GlobProdwisedata?.includes( - a.InwardDtlId + ' ' + a?.BookingTypeName - ) + a.InwardDtlId + ' ' + a?.BookingTypeName + ) ? 'E' : 'S' : 'S', @@ -2066,7 +2067,7 @@ const BSBillingTable2 = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', OrderDtlDetails: @@ -2083,9 +2084,9 @@ const BSBillingTable2 = () => { ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map((item) => ({ - ...item, - TipsAmount: globalTipAmount, - })) + ...item, + TipsAmount: globalTipAmount, + })) : null, // "Credit": TotalAmount, // "Debit": 0, @@ -2100,8 +2101,8 @@ const BSBillingTable2 = () => { ? PaymentgatewayUPI?.[0]?.ModeId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.ModeId + (busupi) => busupi?.ModeId === UpiId + )?.ModeId : paybtnselected : paybtnselected ? paybtnselected @@ -2110,9 +2111,9 @@ const BSBillingTable2 = () => { Amount: Math.round(TotalAmount), MerchantId: Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'business' + SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantId + ?.MerchantId : null, PaymentOptionType: Paybtnnameselected?.toLowerCase() === 'cash' @@ -2131,26 +2132,26 @@ const BSBillingTable2 = () => { ModeOfPayment: SelectedUPIPayOption?.toLowerCase() === 'default' ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) - ?.UPIDetailId + ?.UPIDetailId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantUPIId + ?.MerchantUPIId : null, AccountDtl: Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( - (upipay) => upipay?.UPIId === UpiId - ) + (upipay) => upipay?.UPIId === UpiId + ) : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pd') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pd') + SelectedUPIPayOption?.toLowerCase() === 'pd') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pd') ? useOptions?.[0]?.PaymentDetails?.PaymentDevice : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pg') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pg') + SelectedUPIPayOption?.toLowerCase() === 'pg') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pg') ? useOptions?.[0]?.PaymentDetails?.PaymentGateway : [], PaymentStatus: @@ -2159,7 +2160,7 @@ const BSBillingTable2 = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', Debit: 0, @@ -2235,14 +2236,14 @@ const BSBillingTable2 = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2394,14 +2395,14 @@ const BSBillingTable2 = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2505,14 +2506,14 @@ const BSBillingTable2 = () => { } setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); if (response?.data?.OrderDetails?.length > 0) { setPrintOrderDetails([response?.data]); @@ -2689,14 +2690,14 @@ const BSBillingTable2 = () => { setMessageType('success'); setMessageData( bookingpaymentupdate?.data?.response + - ' ' + - (bookingpaymentupdate?.data?.OrderDetails?.length > 0 - ? bookingpaymentupdate?.data?.OrderId && - extractLastNumberOrderId( - bookingpaymentupdate?.data?.OrderId, - bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus - ) - : '') + ' ' + + (bookingpaymentupdate?.data?.OrderDetails?.length > 0 + ? bookingpaymentupdate?.data?.OrderId && + extractLastNumberOrderId( + bookingpaymentupdate?.data?.OrderId, + bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus + ) + : '') ); bookingpaymentupdate?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([bookingpaymentupdate?.data]); @@ -2715,7 +2716,7 @@ const BSBillingTable2 = () => { if ( Date.now() - startTime > useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * - 60000 + 60000 ) { // 60,000 ms = 1 minute @@ -3634,16 +3635,16 @@ const BSBillingTable2 = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, width: '2rem', @@ -3663,14 +3664,14 @@ const BSBillingTable2 = () => { width: '1.6rem', cursor: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'not-allowed' : 'pointer', color: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'gray' : 'rgb(18, 146, 238)', display: 'flex', @@ -3696,14 +3697,14 @@ const BSBillingTable2 = () => { width: '1.5rem', cursor: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'not-allowed' : 'pointer', color: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'gray' : 'rgb(18, 146, 238)', display: 'flex', @@ -3805,16 +3806,16 @@ const BSBillingTable2 = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, }} @@ -3825,10 +3826,10 @@ const BSBillingTable2 = () => { - - - ) + Hold +

+ + + + ) : ''} {unpaidFlow == false ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - Holddata?.length > 0 && - OrderCardDetail?.length == 0 && - CheckBookingStatus != 'Close' && - paybtns?.length > 0 && - !addnewAccess && ( - - {' '} - - HandleholdModelOpen()} - style={{ - fontSize: '28px', - cursor: 'pointer', - color: Holddata ? '#52c41a' : 'default', - pointerEvents: - OrderType === 'Failed' ? 'none' : 'auto', - }} - /> - - - ) + BookingType !== 'Dine In' && + !BookingTypeBoth && + Holddata?.length > 0 && + OrderCardDetail?.length == 0 && + CheckBookingStatus != 'Close' && + paybtns?.length > 0 && + !addnewAccess && ( + + {' '} + + HandleholdModelOpen()} + style={{ + fontSize: '28px', + cursor: 'pointer', + color: Holddata ? '#52c41a' : 'default', + pointerEvents: + OrderType === 'Failed' ? 'none' : 'auto', + }} + /> + + + ) : ''} ))} @@ -4092,9 +4128,9 @@ const BSBillingTable2 = () => { addnewAccess ? 'billing-btn-deactive' : FirstPaymentclick === false && - OrderCardDetail?.length > 0 && - paybtnselected && - CheckBookingStatus != 'Close' + OrderCardDetail?.length > 0 && + paybtnselected && + CheckBookingStatus != 'Close' ? 'billing-btn' : 'billing-btn-deactive' } @@ -4460,9 +4496,9 @@ const BSBillingTable2 = () => { const qty = isGroup ? OrderCardDetail.filter((o) => o.id === groupKey).reduce( - (sum, o) => sum + (o.OrderQty || 1), - 0 - ) + (sum, o) => sum + (o.OrderQty || 1), + 0 + ) : item.OrderQty || 1; return ( @@ -4542,6 +4578,7 @@ const BSBillingTable2 = () => { } /> + setShowCancelConfirm(true)} @@ -4579,6 +4616,23 @@ const BSBillingTable2 = () => { Do you want to cancel the payment? )} + {customerPreviesOrders && ( + setCustomerPreviesOrders(false)} + footer={false} + width={700} + className={'ModalPaymentGatewayEmbedded'} + children={ + <> + setCustomerPreviesOrders(false)} + /> + + } + /> + )} ); diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx index 5ec6c92..ecd4b26 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx @@ -11,7 +11,7 @@ import { DownCircleOutlined, UpOutlined, } from '@ant-design/icons'; -import { Popover, Badge, Modal } from 'antd'; +import { Popover, Badge, Modal, Tooltip } from 'antd'; import { printDiv, extractLastNumberOrderId, @@ -186,7 +186,7 @@ import { getCombolist } from '../../../../../Features/ComboMaster/ComboMaster.js import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx'; import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx'; import { MdSms } from 'react-icons/md'; -import { FaWhatsapp, FaPrint } from 'react-icons/fa'; +import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa'; import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx'; import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js'; import { PostOtherServices } from '../../../../../Features/OtherServices/OtherServices.js'; @@ -210,6 +210,7 @@ import UpiPopover from '../StandardTable/Utils/UpiPopOver.jsx'; import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded.jsx'; import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx'; import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js'; +import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx'; const subDirectory = import.meta.env.ENV_BASE_URL; const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL; @@ -898,7 +899,7 @@ const BSBillingTable3Pay = () => { const selectedStyle = stylesMap[ - printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle + printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle ]; if (selectedStyle) { @@ -2112,15 +2113,15 @@ const BSBillingTable3Pay = () => { OrderStatus: 'O', OrderType: BookingType === 'Dine In' || - BookingTypeBoth || - Estimation?.SettingValue == 'N' + BookingTypeBoth || + Estimation?.SettingValue == 'N' ? 'S' : GlobEstBooking === 'OvrAllEst' ? 'E' : GlobEstBooking === 'ParEst' ? GlobProdwisedata?.includes( - a.InwardDtlId + ' ' + a?.BookingTypeName - ) + a.InwardDtlId + ' ' + a?.BookingTypeName + ) ? 'E' : 'S' : 'S', @@ -2212,7 +2213,7 @@ const BSBillingTable3Pay = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', OrderDtlDetails: @@ -2229,9 +2230,9 @@ const BSBillingTable3Pay = () => { ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map((item) => ({ - ...item, - TipsAmount: globalTipAmount, - })) + ...item, + TipsAmount: globalTipAmount, + })) : null, SalesPaymentType: 'normal', PaymentDetail: [ @@ -2244,8 +2245,8 @@ const BSBillingTable3Pay = () => { ? PaymentgatewayUPI?.[0]?.ModeId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.ModeId + (busupi) => busupi?.ModeId === UpiId + )?.ModeId : paybtnselected : paybtnselected ? paybtnselected @@ -2253,9 +2254,9 @@ const BSBillingTable3Pay = () => { Amount: Math.round(TotalAmount), MerchantId: Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'business' + SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantId + ?.MerchantId : null, PaymentOptionType: Paybtnnameselected?.toLowerCase() === 'cash' @@ -2274,26 +2275,26 @@ const BSBillingTable3Pay = () => { ModeOfPayment: SelectedUPIPayOption?.toLowerCase() === 'default' ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) - ?.UPIDetailId + ?.UPIDetailId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantUPIId + ?.MerchantUPIId : null, AccountDtl: Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( - (upipay) => upipay?.UPIId === UpiId - ) + (upipay) => upipay?.UPIId === UpiId + ) : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pd') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pd') + SelectedUPIPayOption?.toLowerCase() === 'pd') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pd') ? useOptions?.[0]?.PaymentDetails?.PaymentDevice : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pg') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pg') + SelectedUPIPayOption?.toLowerCase() === 'pg') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pg') ? useOptions?.[0]?.PaymentDetails?.PaymentGateway : [], PaymentStatus: @@ -2302,7 +2303,7 @@ const BSBillingTable3Pay = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', Debit: 0, @@ -2377,14 +2378,14 @@ const BSBillingTable3Pay = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2539,14 +2540,14 @@ const BSBillingTable3Pay = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2649,14 +2650,14 @@ const BSBillingTable3Pay = () => { } setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); if (response?.data?.OrderDetails?.length > 0) { setPrintOrderDetails([response?.data]); @@ -2833,14 +2834,14 @@ const BSBillingTable3Pay = () => { setMessageType('success'); setMessageData( bookingpaymentupdate?.data?.response + - ' ' + - (bookingpaymentupdate?.data?.OrderDetails?.length > 0 - ? bookingpaymentupdate?.data?.OrderId && - extractLastNumberOrderId( - bookingpaymentupdate?.data?.OrderId, - bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus - ) - : '') + ' ' + + (bookingpaymentupdate?.data?.OrderDetails?.length > 0 + ? bookingpaymentupdate?.data?.OrderId && + extractLastNumberOrderId( + bookingpaymentupdate?.data?.OrderId, + bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus + ) + : '') ); bookingpaymentupdate?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([bookingpaymentupdate?.data]); @@ -2859,7 +2860,7 @@ const BSBillingTable3Pay = () => { if ( Date.now() - startTime > useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * - 60000 + 60000 ) { // 60,000 ms = 1 minute @@ -3571,9 +3572,9 @@ const BSBillingTable3Pay = () => { OrderCardDetail?.length > 0 && 'not-allowed', color: OrderCardDetail?.length > 0 || - (selOption?.value === undefined && - GlobalAddCustomerDetails1?.length === 0 && - GetCustId?.CustMobile === undefined) + (selOption?.value === undefined && + GlobalAddCustomerDetails1?.length === 0 && + GetCustId?.CustMobile === undefined) ? 'gray' : 'rgb(18, 146, 238)', fontSize: '28px', @@ -3595,16 +3596,16 @@ const BSBillingTable3Pay = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, width: '2rem', @@ -3627,14 +3628,14 @@ const BSBillingTable3Pay = () => { width: '1.5rem', cursor: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'not-allowed' : 'pointer', color: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'gray' : 'rgb(18, 146, 238)', display: 'flex', @@ -3648,7 +3649,41 @@ const BSBillingTable3Pay = () => { )} )} + {/* Customer Orders */} + {GetCustId && ( + + {' '} +
{ + if ( + CheckBookingStatus !== 'Close' && + !addnewAccess && + !(OrderCardDetail?.length > 0) + ) { + setCustomerPreviesOrders(true); + } + }} + style={{ + cursor: OrderCardDetail?.length > 0 && 'not-allowed', + color: + OrderCardDetail?.length > 0 || + (OrderCardDetail?.length > 0 && + GetCustId?.CustMobile === undefined) + ? 'gray' + : 'rgb(18, 146, 238)', + fontSize: '25px', + display: 'flex', + alignItems: 'center', + height: '2.46rem', + width: '1.5rem', + }} + > + +
+
+ )} {tabledata?.length > 0 && ( <> {tableOptions @@ -3722,65 +3757,65 @@ const BSBillingTable3Pay = () => { <> {unpaidFlow == false ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - OrderCardDetail?.length != 0 && - CheckOrderType?.length === 0 && - OrderType != 'Failed' && - CheckBookingStatus != 'Close' && - paybtns?.length > 0 && - !addnewAccess && ( - - {' '} - AddBookingDetails('Hold', false)} - style={{ - fontSize: '30px', - cursor: 'pointer', - color: '' ? '#52c41a' : '#1292EE', - }} - /> - - ) + BookingType !== 'Dine In' && + !BookingTypeBoth && + OrderCardDetail?.length != 0 && + CheckOrderType?.length === 0 && + OrderType != 'Failed' && + CheckBookingStatus != 'Close' && + paybtns?.length > 0 && + !addnewAccess && ( + + {' '} + AddBookingDetails('Hold', false)} + style={{ + fontSize: '30px', + cursor: 'pointer', + color: '' ? '#52c41a' : '#1292EE', + }} + /> + + ) : ''} {unpaidFlow == false ? item?.OptionName == 'Hold' && - paybtns?.length > 0 && - BookingType !== 'Dine In' && - !BookingTypeBoth && - Holddata?.length > 0 && - paybtns?.length > 0 && - OrderCardDetail?.length == 0 && - CheckBookingStatus != 'Close' && - !addnewAccess && ( - 0 && + BookingType !== 'Dine In' && + !BookingTypeBoth && + Holddata?.length > 0 && + paybtns?.length > 0 && + OrderCardDetail?.length == 0 && + CheckBookingStatus != 'Close' && + !addnewAccess && ( + + {' '} + - {' '} - - HandleholdModelOpen()} - style={{ - fontSize: '28px', - cursor: 'pointer', - color: Holddata ? '#52c41a' : 'default', - pointerEvents: - OrderType === 'Failed' ? 'none' : 'auto', - }} - /> - - - ) + HandleholdModelOpen()} + style={{ + fontSize: '28px', + cursor: 'pointer', + color: Holddata ? '#52c41a' : 'default', + pointerEvents: + OrderType === 'Failed' ? 'none' : 'auto', + }} + /> + + + ) : ''} ))} @@ -3826,14 +3861,14 @@ const BSBillingTable3Pay = () => { width: '1.5rem', cursor: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'not-allowed' : 'pointer', color: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'gray' : 'rgb(18, 146, 238)', display: 'flex', @@ -3903,16 +3938,16 @@ const BSBillingTable3Pay = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, }} @@ -3923,10 +3958,10 @@ const BSBillingTable3Pay = () => { - - ) + !BookingTypeBoth && + BookingType !== 'Dine In' && + OrderCardDetail?.length != 0 && + CheckOrderType?.length === 0 && + OrderType != 'Failed' && + paybtns?.length > 0 && + CheckBookingStatus != 'Close' && + !addnewAccess && ( + + + + ) : ''} {unpaidFlow === false && item?.OptionName === 'Hold' && @@ -4117,9 +4151,9 @@ const BSBillingTable5 = () => { addnewAccess ? 'BSBIllingTable5-paybtn-noitems-disable' : FirstPaymentclick === false && - OrderCardDetail?.length > 0 && - paybtnselected && - CheckBookingStatus != 'Close' + OrderCardDetail?.length > 0 && + paybtnselected && + CheckBookingStatus != 'Close' ? !OrderStatus ? 'BSBIllingTable5-paybtn-noitems' : 'BSBIllingTable5-paybtn-noitems Order' @@ -4370,14 +4404,14 @@ const BSBillingTable5 = () => { {(filteredSettingNames?.includes('Print') || !MobileNoWhatsApp || !MobileNoWhatsApp.value) && ( - - )} + + )} {filteredSettingNames?.includes('SMS') && isMobile && ( { const qty = isGroup ? OrderCardDetail.filter((o) => o.id === groupKey).reduce( - (sum, o) => sum + (o.OrderQty || 1), - 0 - ) + (sum, o) => sum + (o.OrderQty || 1), + 0 + ) : item.OrderQty || 1; return ( @@ -4595,6 +4629,23 @@ const BSBillingTable5 = () => { Do you want to cancel the payment? )} + {customerPreviesOrders && ( + setCustomerPreviesOrders(false)} + footer={false} + width={700} + className={'ModalPaymentGatewayEmbedded'} + children={ + <> + setCustomerPreviesOrders(false)} + /> + + } + /> + )} ); diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BST6Payment.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BST6Payment.jsx index 4d31ec7..1baef7e 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BST6Payment.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BST6Payment.jsx @@ -6,7 +6,7 @@ import { AiOutlineClose, AiOutlineArrowRight } from 'react-icons/ai'; import { Tables } from '../../../../../Components/Tables/Table'; import { DefaultModal } from '../../../../../Components/Modal/DefaultModal.jsx'; import { UpCircleOutlined, UpOutlined } from '@ant-design/icons'; -import { Popover, Badge, Modal } from 'antd'; +import { Popover, Badge, Modal, Tooltip } from 'antd'; import { printDiv, extractLastNumberOrderId, @@ -187,7 +187,7 @@ import { getCombolist } from '../../../../../Features/ComboMaster/ComboMaster.js import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx'; import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx'; import { MdSms } from 'react-icons/md'; -import { FaWhatsapp, FaPrint } from 'react-icons/fa'; +import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa'; import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx'; import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js'; import { TfiClipboard } from 'react-icons/tfi'; @@ -211,6 +211,7 @@ import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded import pozologoimg from '../../../../../Images/pozologoimg.png'; import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx'; import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js'; +import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx'; const subDirectory = import.meta.env.ENV_BASE_URL; const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL; @@ -360,6 +361,7 @@ const BST6Payment = () => { const [UpiPayOption, setUpiPayOption] = useState([]); const [CardPayOption, setCardPayOption] = useState([]); const [Splitpayment, setSplitpayment] = useState(false); + const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false); //Total calculation const [failedOrderData, setFailedOrderData] = useState(); @@ -671,7 +673,7 @@ const BST6Payment = () => { const selectedStyle = stylesMap[ - printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle + printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle ]; if (selectedStyle) { @@ -2049,15 +2051,15 @@ const BST6Payment = () => { OrderStatus: 'O', OrderType: BookingType === 'Dine In' || - BookingTypeBoth || - Estimation?.SettingValue == 'N' + BookingTypeBoth || + Estimation?.SettingValue == 'N' ? 'S' : GlobEstBooking === 'OvrAllEst' ? 'E' : GlobEstBooking === 'ParEst' ? GlobProdwisedata?.includes( - a.InwardDtlId + ' ' + a?.BookingTypeName - ) + a.InwardDtlId + ' ' + a?.BookingTypeName + ) ? 'E' : 'S' : 'S', @@ -2147,7 +2149,7 @@ const BST6Payment = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', OrderDtlDetails: @@ -2164,9 +2166,9 @@ const BST6Payment = () => { ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map((item) => ({ - ...item, - TipsAmount: globalTipAmount, - })) + ...item, + TipsAmount: globalTipAmount, + })) : null, SalesPaymentType: 'normal', PaymentDetail: [ @@ -2179,8 +2181,8 @@ const BST6Payment = () => { ? PaymentgatewayUPI?.[0]?.ModeId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.ModeId + (busupi) => busupi?.ModeId === UpiId + )?.ModeId : paybtnselected : paybtnselected ? paybtnselected @@ -2188,9 +2190,9 @@ const BST6Payment = () => { Amount: Math.round(TotalAmount), MerchantId: Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'business' + SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantId + ?.MerchantId : null, PaymentOptionType: Paybtnnameselected?.toLowerCase() === 'cash' @@ -2209,26 +2211,26 @@ const BST6Payment = () => { ModeOfPayment: SelectedUPIPayOption?.toLowerCase() === 'default' ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) - ?.UPIDetailId + ?.UPIDetailId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantUPIId + ?.MerchantUPIId : null, AccountDtl: Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( - (upipay) => upipay?.UPIId === UpiId - ) + (upipay) => upipay?.UPIId === UpiId + ) : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pd') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pd') + SelectedUPIPayOption?.toLowerCase() === 'pd') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pd') ? useOptions?.[0]?.PaymentDetails?.PaymentDevice : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pg') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pg') + SelectedUPIPayOption?.toLowerCase() === 'pg') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pg') ? useOptions?.[0]?.PaymentDetails?.PaymentGateway : [], PaymentStatus: @@ -2237,7 +2239,7 @@ const BST6Payment = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', Debit: 0, @@ -2311,14 +2313,14 @@ const BST6Payment = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2474,14 +2476,14 @@ const BST6Payment = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2588,14 +2590,14 @@ const BST6Payment = () => { } setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); if (response?.data?.OrderDetails?.length > 0) { setPrintOrderDetails([response?.data]); @@ -2771,14 +2773,14 @@ const BST6Payment = () => { setMessageType('success'); setMessageData( bookingpaymentupdate?.data?.response + - ' ' + - (bookingpaymentupdate?.data?.OrderDetails?.length > 0 - ? bookingpaymentupdate?.data?.OrderId && - extractLastNumberOrderId( - bookingpaymentupdate?.data?.OrderId, - bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus - ) - : '') + ' ' + + (bookingpaymentupdate?.data?.OrderDetails?.length > 0 + ? bookingpaymentupdate?.data?.OrderId && + extractLastNumberOrderId( + bookingpaymentupdate?.data?.OrderId, + bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus + ) + : '') ); bookingpaymentupdate?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([bookingpaymentupdate?.data]); @@ -2797,7 +2799,7 @@ const BST6Payment = () => { if ( Date.now() - startTime > useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * - 60000 + 60000 ) { // 60,000 ms = 1 minute @@ -3497,59 +3499,59 @@ const BST6Payment = () => { <> {unpaidFlow == false ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - OrderCardDetail?.length != 0 && - CheckOrderType?.length === 0 && - OrderType != 'Failed' && - CheckBookingStatus != 'Close' && - paybtns?.length > 0 && - !addnewAccess && ( - - {' '} - AddBookingDetails('Hold')} - style={{ - fontSize: '30px', - cursor: 'pointer', - color: '' ? '#52c41a' : '#1292EE', - }} - /> - - ) + BookingType !== 'Dine In' && + !BookingTypeBoth && + OrderCardDetail?.length != 0 && + CheckOrderType?.length === 0 && + OrderType != 'Failed' && + CheckBookingStatus != 'Close' && + paybtns?.length > 0 && + !addnewAccess && ( + + {' '} + AddBookingDetails('Hold')} + style={{ + fontSize: '30px', + cursor: 'pointer', + color: '' ? '#52c41a' : '#1292EE', + }} + /> + + ) : ''} {unpaidFlow == false ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - Holddata?.length > 0 && - OrderCardDetail?.length == 0 && - CheckBookingStatus != 'Close' && - !addnewAccess && - paybtns?.length > 0 && - !OtherServicesglobal && ( - - {' '} - - HandleholdModelOpen()} - style={{ - fontSize: '28px', - cursor: 'pointer', - color: Holddata ? '#52c41a' : 'default', - pointerEvents: - OrderType === 'Failed' ? 'none' : 'auto', - }} - /> - - - ) + BookingType !== 'Dine In' && + !BookingTypeBoth && + Holddata?.length > 0 && + OrderCardDetail?.length == 0 && + CheckBookingStatus != 'Close' && + !addnewAccess && + paybtns?.length > 0 && + !OtherServicesglobal && ( + + {' '} + + HandleholdModelOpen()} + style={{ + fontSize: '28px', + cursor: 'pointer', + color: Holddata ? '#52c41a' : 'default', + pointerEvents: + OrderType === 'Failed' ? 'none' : 'auto', + }} + /> + + + ) : ''} ))} @@ -3560,16 +3562,16 @@ const BST6Payment = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, width: '2rem', @@ -3589,14 +3591,14 @@ const BST6Payment = () => { width: '1.5rem', cursor: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'not-allowed' : 'pointer', color: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'gray' : 'rgb(18, 146, 238)', display: 'flex', @@ -3662,16 +3664,16 @@ const BST6Payment = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, }} @@ -3682,10 +3684,10 @@ const BST6Payment = () => { + + )) + ) : ( +
+ Please Set Payment Options +
+ )} + + {paybtns?.length > 1 && ( +
0) && + !unpaidFlow && + OrderStatus + ? 'none' + : 'auto', + opacity: + (BookingType === 'Dine In' || + BookingTypeBoth || + CheckOrderType?.length > 0) && + !unpaidFlow && + OrderStatus + ? 0.5 + : 1, + }} + > + + {' '} +
+
+ + Split Pay +
+
+
+
+ )} + + + + {/*
+ +
*/} + +
+ +
+
+
+
+
Items
+
:
+
+ {' '} + {TotalItems}{' '} +
+
+
+
Qty
+
:
+
{Qty}
+
+
+
+
+
+ +
+ {(addcustomer || hold) && ( + setHold(false)} + /> + )} +
+ {Estimation?.SettingValue == 'Y' && + BookingType !== 'Dine In' && + !BookingTypeBoth && ( +
+ +
+ )} + {BSComboData?.BookingBilling?.[1]?.map((item) => ( + <> + {/* {item?.OptionName=="Hold" && */} + {unpaidFlow == false + ? item?.OptionName == 'Hold' && + BookingType !== 'Dine In' && + !BookingTypeBoth && + OrderCardDetail?.length != 0 && + CheckOrderType?.length === 0 && + OrderType != 'Failed' && + CheckBookingStatus != 'Close' && + !addnewAccess && ( + + {' '} +
+ AddBookingDetails('Hold')} + style={{ + cursor: 'pointer', + // color: '' ? '#52c41a' : '#1292EE', + }} + />{' '} +

Hold

+
+
+ ) + : ''} + + {unpaidFlow == false + ? item?.OptionName == 'Hold' && + BookingType !== 'Dine In' && + !BookingTypeBoth && + Holddata?.length > 0 && + OrderCardDetail?.length == 0 && + CheckBookingStatus != 'Close' && + !addnewAccess && ( + + {' '} + +
+ HandleholdModelOpen()} + style={{ + cursor: 'pointer', + // color: Holddata ? '#52c41a' : 'default', + pointerEvents: + OrderType === 'Failed' ? 'none' : 'auto', + }} + /> +
+
+
+ ) + : ''} + {tabledata?.length > 0 && dinePreference && ( + <> + {item?.OptionName == 'UnpaidBill' && ( + + {' '} +
+ { + (setUnpaidOpen(true), getUnpaiddatas()); + }} + /> +
+
+ )} + + )} + + ))} + {BSComboData?.BookingBilling?.[1]?.filter( + (item) => item.OptionName === 'AddCustomer' + ).length === 1 ? ( + <> + {Object.keys(useOptions)?.length > 0 && + useOptions?.some((flow) => + flow.OptionDetails.some( + (option) => + option.OptionName === 'Pay at the counter' && + option.ModeDetails.some( + (mode) => mode.ModeName === 'Credit' + ) + ) + ) && ( + + +
0 || + (selOption?.value === undefined && + GlobalAddCustomerDetails1?.length === 0 && + GetCustId?.CustMobile === undefined) + ? 'gray' + : '#1292eeff', + color: '#fff', + height: '40px', + width: '45px', + borderRadius: '6px', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + padding: '8px 8px 12px 8px', + }} + > + {' '} + 0 && 'not-allowed', + // color: + // OrderCardDetail?.length > 0 || + // (selOption?.value === undefined && + // GlobalAddCustomerDetails1?.length === 0 && + // GetCustId?.CustMobile === undefined) + // ? 'gray' + // : '#1292eeff', + fontSize: '28px', + }} + />{' '} +

Adv Amt

+
+
+
+ )} + + ) : ( + '' + )} + + {/* Customer Orders */} + {GetCustId && ( + + {' '} +
{ + if ( + CheckBookingStatus !== 'Close' && + !addnewAccess && + !(OrderCardDetail?.length > 0) + ) { + setCustomerPreviesOrders(true); + } + }} + style={{ + cursor: OrderCardDetail?.length > 0 && 'not-allowed', + color: + OrderCardDetail?.length > 0 || + (OrderCardDetail?.length > 0 && + GetCustId?.CustMobile === undefined) + ? 'gray' + : 'rgb(255, 255, 255)', + color: '#fff', + height: '40px', + width: '45px', + borderRadius: '6px', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + padding: '5px 5px 6px 5px', + background: 'rgb(18, 146, 238)' + }} + > + Cust Orders +
+
+ )} + {FeatureAddonData?.FeatureDtls?.find( + (item) => item?.FeatureAddonName?.toLowerCase() === 'preorder' + ) && ( + <> + { +
0 || OrderType === 'Failed' + ? 'none' + : 'auto', + opacity: OrderCardDetail?.length > 0 ? 0.5 : 1, + }} + > + + + { + openPreOrder(); + }} + /> + + +
+ } + + )} + {preOrderOpen && } + {sportsAppPreference && } + {dinePreference && + (BookingType === 'Dine In' || + BookingTypeBoth || + CheckOrderType?.length > 0) && + !unpaidFlow && ( + <> + + {' '} + + FirstPaymentclick === false && !addnewAccess + ? changeOrderStatus() + : '' + } + style={{ + pointerEvents: OrderType === 'Failed' ? 'none' : 'auto', + }} + /> + + {FirstPaymentclick === false && + !addnewAccess && + !OrderStatus && } + + )} + {OrderCardDetail?.length > 0 && ParkingDisplay && ( +
+ +
+ )} + {unpaidFlow == true ? ( + + { + Recipt(); + }} + /> + + ) : ( + '' + )} + {/*
+ + + + } + trigger="click" + open={open} + onOpenChange={handleOpenChange} + > + + +
*/} + {/* {ComboDropDown?.length >= 1 && ( +
+ + + +
+ )} */} + {paymentfeataddon && ( + +
{ + paymentFailedStatusFun(); + }} + style={{ + width: '27px', + cursor: 'pointer', + fontWeight: '600', + color: 'rgb(18, 146, 238)', + }} + > + +
+
+ )} + {OpenFailData && ( + + )} +
+
+
+ {BSComboData?.BookingBilling?.[1]?.map((item) => ( + <> + {item?.OptionName == 'AddCustomer' && !preOrderOpen && ( +
+ + +
+ +
+
+
+ )} + + ))} + +
+ + + + + + + + + + } + trigger="click" + open={open} + onOpenChange={handleOpenChange} + > + + + + +
+
+ {PrintOrderDetails?.length > 0 && + PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => ( +
+ +
+ ))} + {PrintOrderDetails?.length > 0 && + (TokenOnly?.SettingValue === 'Y' || + IndividualToken?.SettingValue === 'Y') && + PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => ( +
+ +
+ ))} + {CreditCustomer && ( +
+ { + handleCreditCustomer('Cancel'); + }} + handleOk={() => { + handleCreditCustomer('Submit'); + }} + /> +
+ )} + + {UpiOpen && ( + { + Upimodel('Cancel'); + }} + footer={false} + children={ +
+ {/*

UPI PAYMENT

*/} + +
+
+ +
+ +
+

+ {' '} + RS : + {OrderType === 'Failed' + ? FailedTotalAmt + : Math.round(TotalAmount)}{' '} +

+
+
+ +
+ {(selOption || SelCustId) && ( +
+ Sent Payment Link + Your Alt Text + {/* */} +
+ )} + +
+ } + handleSubmit={() => { + Upimodel('Submit'); + }} + /> +
+
+
+ } + /> + )} + {unpaidopen && ( + { + setUnpaidOpen(false); + }} + footer={false} + children={ +
+ +
+ } + /> + )} + {/* + + */} + {UnpaidConfirmation && ( + +
+ You have already selected a table. If you click 'OK,' the table + selection will be removed, and the unpaid flow will continue. If + you click 'Cancel,' the dine-in flow will proceed as selected. +
+ + } + onOk={UnpaidOk} + onCancel={Unpaidclose} + /> + )} + {Splitpayment && ( + + )} + {PrintOrderDetails?.length > 0 && ( +
+ {filteredSettingNames?.includes('whatsapp') && + MobileNoWhatsApp?.value && ( + + )} + + + + {filteredSettingNames?.includes('SMS') && isMobile && ( + + )} + {/* WhatsAppShare modal/component */} + {showWhatsAppShare && ( + closePrintOption(false)} + /> + )} + {showSMSShare && isMobile && ( + closePrintOption(false)} + /> + )} +
+ )} + { + dispatch(changeSalesPaymentoption(false)); + }} + footer={false} + children={ +
+ +
+ } + /> + {customerPreviesOrders && ( + setCustomerPreviesOrders(false)} + footer={false} + width={700} + className={'ModalPaymentGatewayEmbedded'} + children={ + <> + setCustomerPreviesOrders(false)} + /> + + } + /> + )} + + ); +}; + +export default BSC1Payment;