diff --git a/src/App.jsx b/src/App.jsx index a53f14e..6a8cd59 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,4 +1,4 @@ -import { useEffect, lazy, Suspense, useRef, useState } from 'react'; +import { useEffect, lazy, Suspense, useRef, useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import { App as CapacitorApp } from '@capacitor/app'; import { Routes, Route } from 'react-router-dom'; @@ -20,7 +20,6 @@ const IndividualBooking = lazy( const commonSubDir = import.meta.env.ENV_COMMON_BASE_URL; const subDirectory = import.meta.env.ENV_BASE_URL; import '../ownLib/my-ui-lib.css'; -import CardSkeleton from './Components/Skeleton/CardSkeleton.jsx'; import CustomerMenuPage from './Pages/Reports/MenuQRCode/CustomerMenuPage.jsx'; import WeightScaleApp from './Pages/BookingScreen/WeightscaleApp.jsx'; import useSubscriptionManager from './useSubscriptionManager.js'; @@ -52,7 +51,7 @@ const AppRoutes = () => { } = useSubscriptionManager(sessionData, logout); const location = useLocation(); const navigate = useNavigate(); - const [devToolsOpen, setDevToolsOpen] = useState(false); + const [devToolsOpen, setDevToolsOpen] = useState(false); // ✅ Flag to prevent stack push when back button navigates const isBackNav = useRef(false); @@ -189,47 +188,46 @@ const AppRoutes = () => { } catch (err) {} }; }, [navigate, location.pathname, location.search]); -// mohan - useEffect(() => { - if (isMobile || isIOS) { - console.log("📱 Mobile/iOS device → skipping DevTools detection"); - return; + // mohan + useEffect(() => { + if (isMobile || isIOS) { + console.log('📱 Mobile/iOS device → skipping DevTools detection'); + return; + } + const checkDevTools = setInterval(() => { + if (devtools.isOpen && !devToolsOpen) { + setDevToolsOpen(true); + document.body.innerHTML = + "

Close Inspect to continue using the application.

"; + } else if (!devtools.isOpen && devToolsOpen) { + setDevToolsOpen(false); + + setTimeout(() => { + window.location.reload(); + }, 100); + + clearInterval(checkDevTools); + } + + if (!devtools.isOpen) { + let before = performance.now(); + + let after = performance.now(); + + let executionDelay = after - before; + + if (executionDelay > 100) { + setDevToolsOpen(true); + document.body.innerHTML = + "

Close Inspect to continue using the application.

"; + } else { + setDevToolsOpen(false); } - const checkDevTools = setInterval(() => { - if (devtools.isOpen && !devToolsOpen) { - setDevToolsOpen(true); - document.body.innerHTML = - "

Close Inspect to continue using the application.

"; - } - else if (!devtools.isOpen && devToolsOpen) { - setDevToolsOpen(false); - - setTimeout(() => { - window.location.reload(); - }, 100); - - clearInterval(checkDevTools); - } - - if (!devtools.isOpen) { - let before = performance.now(); - - let after = performance.now(); - - let executionDelay = after - before; - - if (executionDelay > 100) { - setDevToolsOpen(true); - document.body.innerHTML = - "

Close Inspect to continue using the application.

"; - } else { - setDevToolsOpen(false); - } - } - }, 1000); - - return () => clearInterval(checkDevTools); - }, [devToolsOpen]); + } + }, 1000); + + return () => clearInterval(checkDevTools); + }, [devToolsOpen]); if (extendModel) { return ( { ); } return ( - }> + import('../BSBillingTable1/BSBillingTable1.jsx') @@ -129,132 +128,126 @@ export default function BSBTOverall1() { }, [width]); return ( - }> - <> -
- {width > 768 && } - {(addcustomer || hold) && ( - + <> +
+ {width > 768 && } + {(addcustomer || hold) && ( + + )} +
+ {width <= 768 && ( +
+ {tableData && } +
)} -
- {width <= 768 && ( -
- {tableData && } +
+ {summeryopen == true && ( +
+
)} -
- {summeryopen == true && ( -
- + +
+
+ {tableOptions.find( + (item) => item.OptionName === 'AddCustomer' + ) && ( +
- X - -
- )} + - - - - - - - ) - } - trigger="click" - open={open} - onOpenChange={handleOpenChange} - > - - -
-
- {tableOptions.find( - (item) => item.OptionName === 'AddCustomer' - ) && ( -
- - - - {' '} - - -
- )} -
+ + {' '} + + +
+ )}
- {tableData && ( -
- {width <= 768 && ( -
- -
- )} -
- )} -
-
-
+ {tableData && ( +
+ {width <= 768 && ( +
+ +
+ )} +
+ )} +
+
+
- - +
+ ); } diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx index eb0c3a3..6ab29b5 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, lazy, Suspense } from 'react'; +import React, { useState, useEffect, lazy } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { Popconfirm, Tooltip } from 'antd'; import { AiOutlineClose, AiFillDelete } from 'react-icons/ai'; @@ -83,7 +83,6 @@ const CustomerPriceHistory = lazy( () => import('../../UtillComponents/CustomerPriceHistory.jsx') ); // Scss File import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.scss'; -import BillingTableSkeleton from '../../../../../Components/Skeleton/BillingTableSkeleton.jsx'; const BSBillingTable1 = () => { const { removeExtraCharge } = useUtilsComponent(); @@ -161,8 +160,8 @@ const BSBillingTable1 = () => { OrderType === 'Hold' ? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway') : tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId - ); + (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId + ); const OldtableDataDinein = tableData?.filter( (a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId @@ -170,8 +169,8 @@ const BSBillingTable1 = () => { const OldtableDataTakeAway = OrderType != 'Hold' ? tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId - ) + (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId + ) : []; const [OpenEditTotalAmt, setOpenEditTotalAmt] = useState(false); const [OpenImeiDetail, setOpenImeiDetail] = useState(false); @@ -1120,9 +1119,9 @@ const BSBillingTable1 = () => { )?.map((item, idx) => idx === 0 ? { - ...item, - FreeQty, - } + ...item, + FreeQty, + } : item ), }; @@ -2034,211 +2033,196 @@ const BSBillingTable1 = () => { }; return ( - }> - <> -
-
- - - - {tableOptions?.map((item) => ( - <> - {item.OptionName == 'Sl.No' && BookingTypeBoth && ( - - )} - {item.OptionName == 'Sl.No' && ( - - )} - {item.OptionName == 'Item' && ( - - )} - {item.OptionName == 'MRP' && ( - - )} - {item.OptionName == 'Discount' && ( - - )} - {item.OptionName == 'Quantity' && ( - + )} + + ))} + + ))} + {tableDataDinein?.length > 0 && EditQuantity && ( + + )} + + )} +
- {!isMobile ? ( - {''} - ) : ( -
{''}
- )} -
- {!isMobile ? ( - Sl.No - ) : ( -
Sl.No
- )} -
- {!isMobile ? ( - Item - ) : ( -
Item
- )} -
- {!isMobile ? ( - MRP - ) : ( -
MRP
- )} -
- {!isMobile ? ( - ₹/% - ) : ( -
₹/%
- )} -
{ - if (tableData?.length > 0) { - OpenEditTotalAmount(); - } - }} + <> +
+
+ + + + {tableOptions?.map((item) => ( + <> + {item.OptionName == 'Sl.No' && BookingTypeBoth && ( + + )} + {item.OptionName == 'Sl.No' && ( + + )} + {item.OptionName == 'Item' && ( + + )} + {item.OptionName == 'MRP' && ( + + )} + {item.OptionName == 'Discount' && ( + + )} + {item.OptionName == 'Quantity' && ( + - )} - {item.OptionName == 'Rate' && ( - - )} - {item.OptionName == 'Amount' && ( - - )} + > + {!isMobile ? ( + Qty + ) : ( +
Qty
+ )} + + )} + {item.OptionName == 'Rate' && ( + + )} + {item.OptionName == 'Amount' && ( + + )} - {item.OptionName == 'Delete' && ( - - )} - - ))} - - - {OldtableDataTakeAway?.length > 0 && ( - - {OldtableDataTakeAway?.map((item, index) => ( - + ) : ( +
+ {!isMobile ? ( + + + + ) : ( +
+ {' '} + {' '} +
+ )} +
+ )} + + )} + + ))} + + + {OldtableDataTakeAway?.length > 0 && ( + + {OldtableDataTakeAway?.map((item, index) => ( + = - PreviousdataLength - ? 'wheat' - : triggerAnimation && + tableDataTakeAway?.length >= PreviousdataLength + ? 'wheat' + : triggerAnimation && index === 0 && tableDataTakeAway?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - item?.SalesId && OrderType !== 'Hold' - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + item?.SalesId && OrderType !== 'Hold' + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( - item?.InwardDtlId + - ' ' + - item?.BookingTypeName + item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : index % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + ? '#b2d1f7' + : index % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + - )} + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} - {EditQuantity && OldtableDataTakeAway?.length > 0 && ( - - )} - - )} - {OldtableDataDinein?.length > 0 && ( - - {OldtableDataDinein?.map((item, index) => ( - removeFromCart(item)} + > + + + )} + + ))} + + ))} + {EditQuantity && OldtableDataTakeAway?.length > 0 && ( + + )} + + )} + {OldtableDataDinein?.length > 0 && ( + + {OldtableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && + ? 'wheat' + : BookingType !== 'Dine In' && triggerAnimation && - OldtableDataTakeAway?.length + index === - 0 && + OldtableDataTakeAway?.length + index === 0 && tableDataDinein?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + index) % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + index) % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + - )} + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} - {OldtableDataDinein?.length > 0 && EditQuantity && ( - - )} - - )} - {/* TakeWay */} - {tableDataTakeAway?.length > 0 && ( - - {tableDataTakeAway?.map((item, index) => ( - removeFromCart(item)} + > + + + )} + + ))} + + ))} + {OldtableDataDinein?.length > 0 && EditQuantity && ( + + )} + + )} + {/* TakeWay */} + {tableDataTakeAway?.length > 0 && ( + + {tableDataTakeAway?.map((item, index) => ( + = - PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && tableDataTakeAway?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + ? 'wheat' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' + ? 'white' + : SelectedBillColor?.[ + 'OverallBackgroundColor' ] - : '#d6d6d6' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + ? SelectedBillColor?.[ + 'OverallBackgroundColor' + ] + : '#d6d6d6' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + background: + BookingType === 'Dine In' && item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) + ? '#b2d1f7' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] : '#d6d6d6', - background: - BookingType === 'Dine In' && item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + - ' ' + - item?.BookingTypeName - ) - ? '#b2d1f7' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataDinein?.length + + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + - )} + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} - {tableDataTakeAway?.length > 0 && EditQuantity && ( - - )} - - )} - {/* DineIn */} - {tableDataDinein?.length > 0 && ( - - {tableDataDinein?.map((item, index) => ( - removeFromCart(item)} + > + + + )} + + ))} + + ))} + {tableDataTakeAway?.length > 0 && EditQuantity && ( + + )} + + )} + {/* DineIn */} + {tableDataDinein?.length > 0 && ( + + {tableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && tableDataDinein?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - BookingType === 'Dine In' && - item?.SalesId && - !BookingTypeBoth - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + BookingType === 'Dine In' && + item?.SalesId && + !BookingTypeBoth + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( - item?.InwardDtlId + - ' ' + - item?.BookingTypeName + item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index) % - 2 === + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + - )} + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} - {tableDataDinein?.length > 0 && EditQuantity && ( - - )} - - )} -
+ {!isMobile ? ( + {''} + ) : ( +
{''}
+ )} +
+ {!isMobile ? ( + Sl.No + ) : ( +
Sl.No
+ )} +
+ {!isMobile ? ( + Item + ) : ( +
Item
+ )} +
+ {!isMobile ? ( + MRP + ) : ( +
MRP
+ )} +
+ {!isMobile ? ( + ₹/% + ) : ( +
₹/%
+ )} +
{ + if (tableData?.length > 0) { + OpenEditTotalAmount(); + } + }} // onClick={tableData?.length>0? OpenEditTotalAmount :""} - > - {!isMobile ? ( - Qty - ) : ( -
Qty
- )} -
- {!isMobile ? ( - Rt - ) : ( -
Rt
- )} -
- {!isMobile ? ( - Amt - ) : ( -
Amt
- )} -
+ {!isMobile ? ( + Rt + ) : ( +
Rt
+ )} +
+ {!isMobile ? ( + Amt + ) : ( +
Amt
+ )} +
- {tableData?.length > 0 ? ( - { - Clearall(); - }} - > -
- {' '} - {!isMobile ? ( - - {' '} - {' '} - - ) : ( -
- {' '} - {' '} -
- )} -
-
- ) : ( + {item.OptionName == 'Delete' && ( +
+ {tableData?.length > 0 ? ( + { + Clearall(); + }} + >
+ {' '} {!isMobile ? ( - - + + {' '} + {' '} ) : (
@@ -2247,1301 +2231,1314 @@ const BSBillingTable1 = () => {
)}
- )} -
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowSpan={tableData.length} + style={{ backgroundColor: '#CFB59D' }} > - {index + 1} + - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 || imeiModal) - ? handleImeiDetails(item) - : editField && handleEditQuantity(item) + {tableitem.OptionName == 'Sl.No' && ( + { + if (editField) { + handleEditQuantity(item); } - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.UomName} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+ {index + 1} +
+ item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || + imeiModal + ? handleImeiDetails(item) + : editField && handleEditQuantity(item) + } + > + {item.ProdName} +  {' '} + {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size}{' '} - {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.UomName} + ) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {allowDecimal - ? Number(item?.OrderRate || 0).toFixed(2) - : Number(item?.OrderRate || 0)} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {allowDecimal - ? Number( + + )} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {allowDecimal + ? Number(item?.OrderRate || 0).toFixed(2) + : Number(item?.OrderRate || 0)} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {allowDecimal + ? Number( item?.TotalAmt - (item?.Offer || 0) || 0 ).toFixed(2) - : Number( + : Number( item?.TotalAmt - (item?.Offer || 0) || 0 )} - removeFromCart(item)} - > - -
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowSpan={tableData.length} + style={{ backgroundColor: '#A2C3CD' }} > - {OldtableDataTakeAway?.length + index + 1} + { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.UomName} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {OldtableDataTakeAway?.length + index + 1} +
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.ProdName} +  {' '} + {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size}{' '} - {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.UomName} + ) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {allowDecimal - ? Number(item?.OrderRate || 0).toFixed(2) - : Number(item?.OrderRate || 0)} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {allowDecimal - ? Number( + + )} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {allowDecimal + ? Number(item?.OrderRate || 0).toFixed(2) + : Number(item?.OrderRate || 0)} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {allowDecimal + ? Number( item?.TotalAmt - (item?.Offer || 0) || 0 ).toFixed(2) - : Number( + : Number( item?.TotalAmt - (item?.Offer || 0) || 0 )} - removeFromCart(item)} - > - -
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowSpan={tableData.length} + style={{ backgroundColor: '#CFB59D' }} > - {OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index + - 1} + - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 || imeiModal) - ? handleImeiDetails(item) - : editField && handleEditQuantity(item) + {tableitem.OptionName == 'Sl.No' && ( + { + if (editField) { + handleEditQuantity(item); } - > - {item?.Type !== 'OS' - ? item.ProdName - : item.ServiceName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- {item?.Type !== 'OS' && ( - <> - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && ( - {item?.ProdVariantName} - )} - {item?.Size} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.UomName} - - )} -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+ {OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index + + 1} +
+ item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || + imeiModal + ? handleImeiDetails(item) + : editField && handleEditQuantity(item) + } + > + {item?.Type !== 'OS' + ? item.ProdName + : item.ServiceName} +  {' '} + {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size}{' '} - {prod.UomName} + {item?.Type !== 'OS' && ( + <> + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && ( + {item?.ProdVariantName} + )} + {item?.Size} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.UomName} + + )} +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {allowDecimal - ? Number(item?.OrderRate || 0).toFixed(2) - : Number(item?.OrderRate || 0)} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {allowDecimal - ? Number( + + )} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {allowDecimal + ? Number(item?.OrderRate || 0).toFixed(2) + : Number(item?.OrderRate || 0)} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {allowDecimal + ? Number( item?.TotalAmt - (item?.Offer || 0) || 0 ).toFixed(2) - : Number( + : Number( item?.TotalAmt - (item?.Offer || 0) || 0 )} - removeFromCart(item)} - > - -
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowSpan={tableData.length} + style={{ backgroundColor: '#A2C3CD' }} > - {OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index + - 1} + { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.UomName} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index + + 1} +
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.ProdName} +  {' '} + {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size}{' '} - {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.UomName} + ) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {allowDecimal - ? Number(item?.OrderRate || 0).toFixed(2) - : Number(item?.OrderRate || 0)} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {allowDecimal - ? Number( + + )} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {allowDecimal + ? Number(item?.OrderRate || 0).toFixed(2) + : Number(item?.OrderRate || 0)} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {allowDecimal + ? Number( item?.TotalAmt - (item?.Offer || 0) || 0 ).toFixed(2) - : Number( + : Number( item?.TotalAmt - (item?.Offer || 0) || 0 )} - removeFromCart(item)} - > - -
+ {tableitem.OptionName == 'Delete' && ( +
removeFromCart(item)} + > + +
- {OpenEditTotalAmt && ( - - )} - {OpenImeiDetail && ( - - )} - {customerPriceHistoryOpen && GetCustId && ( - - )} -
+ {OpenEditTotalAmt && ( + + )} + {OpenImeiDetail && ( + + )} + {customerPriceHistoryOpen && GetCustId && ( + + )}
- -
+
+ ); }; diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BSBillingTable2.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BSBillingTable2.jsx index 31ec053..846c415 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BSBillingTable2.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BSBillingTable2.jsx @@ -1,11 +1,4 @@ -import React, { - useCallback, - useEffect, - useState, - useRef, - lazy, - Suspense, -} from 'react'; +import React, { useCallback, useEffect, useState, useRef, lazy } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { useNavigate } from 'react-router-dom'; import moment from 'moment'; @@ -220,7 +213,6 @@ const OtherServicePrintStyle1 = lazy( import('../../../PrintTemplates/ThermalPrinter/OtherServicePrintStyle1.jsx') ); import OtherServiceMobilePrint from '../../BookingFunctionality/OtherServiceMobilePrint.jsx'; -import BillingTableSkeleton from '../../../../../Components/Skeleton/BillingTableSkeleton.jsx'; const BSOtherServiceClaim = lazy( () => import('../../UtillComponents/BSOtherServiceClaim.jsx') ); @@ -722,38 +714,41 @@ const BSBillingTable2 = () => { Discount, ]); useEffect(() => { - - const fetchPrinterMapping = async () => { - try { - if (UserType !== 'Super Admin' && isMobile && MobileA4Print) { - const data = { - CompId: CompId, - BranchId: BranchId, - AppId: AppId, - UserId: UserId, - }; - // && isMobile && MobileA4Print - const response = await dispatch(getPrinterMappingDetails(data)).unwrap(); - if (response?.data?.statusCode === 0) { - handlePrintMappingClick() - } - console.log(response, "printer mapping response"); - } - } catch (error) { - console.error("Error fetching printer mapping:", error); - } - }; - - fetchPrinterMapping(); - - }, []); + const fetchPrinterMapping = async () => { + try { + if (UserType !== 'Super Admin' && isMobile && MobileA4Print) { + const data = { + CompId: CompId, + BranchId: BranchId, + AppId: AppId, + UserId: UserId, + }; + // && isMobile && MobileA4Print + const response = await dispatch( + getPrinterMappingDetails(data) + ).unwrap(); + if (response?.data?.statusCode === 0) { + handlePrintMappingClick(); + } + console.log(response, 'printer mapping response'); + } + } catch (error) { + console.error('Error fetching printer mapping:', error); + } + }; + + fetchPrinterMapping(); + }, []); const handlePrintMappingClick = () => { - // setReprint1(true) - window.dispatchEvent(new Event('CLICK PRINTER MAPPING')); - }; + // setReprint1(true) + window.dispatchEvent(new Event('CLICK PRINTER MAPPING')); + }; useEffect(() => { if (CompId && BranchId && AppId) { - if (holdCheckedSalesSetup || NavBarOptions?.some((e) => e?.OptionName == 'Hold')) { + if ( + holdCheckedSalesSetup || + NavBarOptions?.some((e) => e?.OptionName == 'Hold') + ) { getHolddata(); } @@ -1564,7 +1559,7 @@ const BSBillingTable2 = () => { const selectedStyle = stylesMap[ - printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle + printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle ]; if (selectedStyle) { @@ -1947,7 +1942,10 @@ const BSBillingTable2 = () => { setCurrentOrderNetAmount(0); setPreviousNetAmount(0); - if (holdCheckedSalesSetup || NavBarOptions?.some((e) => e?.OptionName == 'Hold')) { + if ( + holdCheckedSalesSetup || + NavBarOptions?.some((e) => e?.OptionName == 'Hold') + ) { getHolddata(); } if (defaultBookingType === 'Both') { @@ -2125,15 +2123,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', @@ -2151,7 +2149,7 @@ const BSBillingTable2 = () => { PackageDtl: a.PackageDtl, ...(a?.DiscountValue && { DiscountValue: a.DiscountValue }), ...(a?.DiscountType && { DiscountType: a.DiscountType }), - ...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt }) + ...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt }), })); const NotSlectedTypeFind = temporderdetail?.find( (a) => a?.BookingType != SelectedBookingType @@ -2227,7 +2225,7 @@ const BSBillingTable2 = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', OrderDtlDetails: @@ -2244,9 +2242,9 @@ const BSBillingTable2 = () => { ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map((item) => ({ - ...item, - TipsAmount: globalTipAmount, - })) + ...item, + TipsAmount: globalTipAmount, + })) : null, // "Credit": TotalAmount, // "Debit": 0, @@ -2263,8 +2261,8 @@ const BSBillingTable2 = () => { ? PaymentgatewayUPI?.[0]?.ModeId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.ModeId + (busupi) => busupi?.ModeId === UpiId + )?.ModeId : paybtnselected : paybtnselected ? paybtnselected @@ -2277,15 +2275,15 @@ const BSBillingTable2 = () => { salesBillEdit && currentOrderNetAmount < previousNetAmount ? null : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'business' + SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantId + ?.MerchantId : null, PaymentOptionType: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - (refundPaySelectedName?.toLowerCase() === 'cash' || - refundPaySelectedName?.toLowerCase() === 'credit') + currentOrderNetAmount < previousNetAmount && + (refundPaySelectedName?.toLowerCase() === 'cash' || + refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' : Paybtnnameselected?.toLowerCase() === 'cash' ? 'PC' @@ -2305,29 +2303,29 @@ const BSBillingTable2 = () => { ? null : SelectedUPIPayOption?.toLowerCase() === 'default' ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) - ?.UPIDetailId + ?.UPIDetailId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.MerchantUPIId + (busupi) => busupi?.ModeId === UpiId + )?.MerchantUPIId : null, AccountDtl: salesBillEdit && currentOrderNetAmount < previousNetAmount ? [] : 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: @@ -2338,13 +2336,13 @@ const BSBillingTable2 = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', Debit: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - refundPaySelectedName?.toLowerCase() === 'credit' + currentOrderNetAmount < previousNetAmount && + refundPaySelectedName?.toLowerCase() === 'credit' ? Math.round(previousNetAmount - currentOrderNetAmount) : 0, Credit: salesBillEdit @@ -2423,14 +2421,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]); @@ -2587,14 +2585,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]); @@ -2698,14 +2696,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]); @@ -2882,14 +2880,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]); @@ -2908,7 +2906,7 @@ const BSBillingTable2 = () => { if ( Date.now() - startTime > useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * - 60000 + 60000 ) { // 60,000 ms = 1 minute @@ -3681,626 +3679,621 @@ const BSBillingTable2 = () => { ); }; return ( - }> -
-
- {(addcustomer || hold) && ( - - )} - {creditCustomerOpen && ( - - )} - {TotalAmount == 0 && Success && ( -
- -
- )} - {TotalAmount > 0 && - qrCode && - PaymentUpiOptions?.length > 0 && - SelectedUpiOption && ( -
- -
- )} - - {PaymentUpiOptions?.length > 0 && OrderId && ( +
+
+ {(addcustomer || hold) && ( + + )} + {creditCustomerOpen && ( + + )} + {TotalAmount == 0 && Success && ( +
+ +
+ )} + {TotalAmount > 0 && + qrCode && + PaymentUpiOptions?.length > 0 && + SelectedUpiOption && (
)} -
-
- -
- -
+ + {PaymentUpiOptions?.length > 0 && OrderId && ( +
+ +
+ )} +
+
+ +
+
-
- {/* {Array.isArray(OrderCardDetail) && OrderCardDetail?.length >= 1 && ( +
+
+ {/* {Array.isArray(OrderCardDetail) && OrderCardDetail?.length >= 1 && ( {" "} )} */} -
- {Array.isArray(OrderCardDetail) && OrderCardDetail?.length >= 1 && ( -
- -
- )} -
-
- {Array.isArray(OrderCardDetail) && OrderCardDetail?.length >= 1 && ( -
-
- {' '} - {' '} -
-
- )} -
-
-
-
- {tableOptions - ?.filter((item) => item.OptionName === 'AddCustomer') - .map((filteredItem) => ( - -
- - - - {' '} - - -
-
- ))} -
- {paybtns?.length > 1 && ( -
0) && - !unpaidFlow && - OrderStatus - ? 'none' - : 'auto', - opacity: - (BookingType === 'Dine In' || - BookingTypeBoth || - CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus - ? 0.5 - : 1, - width: '2rem', - }} - > - {!OtherServicesglobal && ( - - {' '} -
- -
-
- )} - {OtherServicesglobal && OrderCardDetail.length >= 1 && ( - - {' '} -
- -
-
- )} -
- )} +
+ {Array.isArray(OrderCardDetail) && OrderCardDetail?.length >= 1 && ( +
+
- + )} +
+
+ {Array.isArray(OrderCardDetail) && OrderCardDetail?.length >= 1 && (
- - {OrderCardDetail?.length > 0 && - ParkingDisplay && - !OtherServicesglobal && ( -
- -
- )} - {!OtherServicesglobal && unpaidFlow == true ? ( - - {' '} - { - Recipt(); - }} - /> - - ) : ( - '' - )} -
- - - - - {/* - {" "} - - */} - - - } - trigger="click" - // width={1000} - open={open} - onOpenChange={handleOpenChange} - > - - -
-
-
- -
-
+ {' '} + {' '} +
+
+ )} +
+
+
+
+ {tableOptions + ?.filter((item) => item.OptionName === 'AddCustomer') + .map((filteredItem) => ( + +
+ + + + {' '} + + +
+
+ ))} +
+ {paybtns?.length > 1 && ( +
0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, + width: '2rem', }} > - {paybtns?.length > 0 && - currentOrderNetAmount >= previousNetAmount ? ( - paybtns?.map((payment) => ( -
- + {!OtherServicesglobal && ( + + {' '} +
+
- )) - ) : currentOrderNetAmount < previousNetAmount && - salesBillEdit && - refundPayBtns.length > 0 ? ( - refundPayBtns.map((payment) => ( -
- + + )} + {OtherServicesglobal && OrderCardDetail.length >= 1 && ( + + {' '} +
+
- )) - ) : ( -
- Please Set Payment Options -
+
)}
-
- {tableOptions?.filter((item) => item.OptionName === 'AddCustomer') - .length === 1 || navCust === true ? ( -
- {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' - ) - ) - ) && ( - - {!OtherServicesglobal && ( - - {' '} - 0 && 'not-allowed', - color: - OrderCardDetail?.length > 0 || - (selOption?.value === undefined && - GlobalAddCustomerDetails1?.length === 0 && - GetCustId?.CustMobile === undefined) - ? 'gray' - : 'rgb(18, 146, 238)', - fontSize: '28px', - }} - /> - - )} - - )} -
+ )} +
+ +
+ + {OrderCardDetail?.length > 0 && + ParkingDisplay && + !OtherServicesglobal && ( +
+ +
+ )} + {!OtherServicesglobal && unpaidFlow == true ? ( + + {' '} + { + Recipt(); + }} + /> + ) : ( '' )} +
+ + + + + {/* + {" "} + + */} + + + } + trigger="click" + // width={1000} + open={open} + onOpenChange={handleOpenChange} + > + + +
+
+
- {/* Customer Orders */} - {(SelCustId && tableOptions?.filter((item) => item.OptionName === 'PreviousBillFetch') - .length === 1) && ( - - {' '} -
{ - 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 - ?.filter((item) => item.OptionName === 'UnpaidBill') - .map((filteredItem) => ( - - {!OtherServicesglobal && ( - - {' '} - { - (setUnpaidOpen(true), getUnpaiddatas()); - }} - /> - - )} - - ))} -
- )} - - {dinePreference && ( -
- {(BookingType === 'Dine In' || - BookingTypeBoth || - CheckOrderType?.length > 0) && +
+ +
0) && !unpaidFlow && - SelectedTableDetails?.length !== 0 && ( -
- + OrderStatus + ? 'none' + : 'auto', + opacity: + (BookingType === 'Dine In' || + BookingTypeBoth || + CheckOrderType?.length > 0) && + !unpaidFlow && + OrderStatus + ? 0.5 + : 1, + }} + > + {paybtns?.length > 0 && + currentOrderNetAmount >= previousNetAmount ? ( + paybtns?.map((payment) => ( +
+ +
+ )) + ) : currentOrderNetAmount < previousNetAmount && + salesBillEdit && + refundPayBtns.length > 0 ? ( + refundPayBtns.map((payment) => ( +
+ +
+ )) + ) : ( +
+ Please Set Payment Options +
+ )} +
+ + {tableOptions?.filter((item) => item.OptionName === 'AddCustomer') + .length === 1 || navCust === true ? ( +
+ {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' + ) + ) + ) && ( + + {!OtherServicesglobal && ( + {' '} - - FirstPaymentclick === false && !addnewAccess - ? changeOrderStatus() - : '' - } + 0 && 'not-allowed', + color: + OrderCardDetail?.length > 0 || + (selOption?.value === undefined && + GlobalAddCustomerDetails1?.length === 0 && + GetCustId?.CustMobile === undefined) + ? 'gray' + : 'rgb(18, 146, 238)', + fontSize: '28px', + }} /> - {FirstPaymentclick === false && - !addnewAccess && - !OrderStatus && } -
- )} -
+ )} + + )} +
+ ) : ( + '' + )} + + {/* Customer Orders */} + {SelCustId && + tableOptions?.filter( + (item) => item.OptionName === 'PreviousBillFetch' + ).length === 1 && ( + + {' '} +
{ + 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 && ( -
- {tableOptions?.map((item) => ( - <> - {unpaidFlow == false - ? item?.OptionName == 'Hold' && + {tabledata?.length > 0 && ( +
+ {tableOptions + ?.filter((item) => item.OptionName === 'UnpaidBill') + .map((filteredItem) => ( + + {!OtherServicesglobal && ( + + {' '} + { + (setUnpaidOpen(true), getUnpaiddatas()); + }} + /> + + )} + + ))} +
+ )} + + {dinePreference && ( +
+ {(BookingType === 'Dine In' || + BookingTypeBoth || + CheckOrderType?.length > 0) && + !unpaidFlow && + SelectedTableDetails?.length !== 0 && ( +
+ + {' '} + + FirstPaymentclick === false && !addnewAccess + ? changeOrderStatus() + : '' + } + /> + + {FirstPaymentclick === false && + !addnewAccess && + !OrderStatus && } +
+ )} +
+ )} + {!OtherServicesglobal && ( +
+ {tableOptions?.map((item) => ( + <> + {unpaidFlow == false + ? item?.OptionName == 'Hold' && BookingType !== 'Dine In' && !BookingTypeBoth && OrderCardDetail?.length != 0 && @@ -4332,9 +4325,9 @@ const BSBillingTable2 = () => { ) - : ''} - {unpaidFlow == false - ? item?.OptionName == 'Hold' && + : ''} + {unpaidFlow == false + ? item?.OptionName == 'Hold' && BookingType !== 'Dine In' && !BookingTypeBoth && Holddata?.length > 0 && @@ -4363,558 +4356,550 @@ const BSBillingTable2 = () => { ) - : ''} - - ))} -
- )} -
+ : ''} + + ))} +
+ )} +
-
- - + +
+ {UpiOpen && ( + { + Upimodel('Cancel'); + }} + footer={false} + children={ +
+
+
+ +
+ +
+

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

+
+
+ +
+ {(selOption || SelCustId) && ( +
+ Sent Payment Link + Your Alt Text +
+ )} - - - -
- {UpiOpen && ( - { - Upimodel('Cancel'); - }} - footer={false} - children={ -
-
- -
- -
-

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

-
-
- -
- {(selOption || SelCustId) && ( -
- Sent Payment Link - Your Alt Text -
- )} - -
} + handleSubmit={() => { + Upimodel('Submit'); }} - > - } - handleSubmit={() => { - Upimodel('Submit'); - }} - /> -
+ />
- } - /> - )} - {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 && ( + } + /> + )} + {PrintOrderDetails?.length > 0 && + PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => (
- { - handleCreditCustomer('Cancel'); - }} - handleOk={() => { - handleCreditCustomer('Submit'); - }} +
- )} - {unpaidopen && ( - { - setUnpaidOpen(false); + ))} + {PrintOrderDetails?.length > 0 && + (TokenOnly?.SettingValue === 'Y' || + IndividualToken?.SettingValue === 'Y') && + PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => ( +
+ +
+ ))} + {CreditCustomer && ( +
+ { + handleCreditCustomer('Cancel'); }} - footer={false} - children={ -
- + handleOk={() => { + handleCreditCustomer('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.
- } - /> - )} - {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 && ( - + } + onOk={UnpaidOk} + onCancel={Unpaidclose} + /> + )} + {Splitpayment && ( + data?.TotalAmt + acc, 0 ) - - ((OverAllSales > 0 ? OverAllSales : 0) + - (OverAllEstimate > 0 ? OverAllEstimate : 0) + - (Discount > 0 ? Discount : 0)) + ((OverAllSales > 0 ? OverAllSales : 0) + + (OverAllEstimate > 0 ? OverAllEstimate : 0) + + (Discount > 0 ? Discount : 0)) ) - } - failedOrderData={failedOrderData} - /> - )} - {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={ -
- -
} + failedOrderData={failedOrderData} /> - - { - OtherServicesPrintDetails?.length > 0 && ( - // PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => ( -
- -
- ) - // )) - } - - { - setOtherServicesModal(false); + )} + {PrintOrderDetails?.length > 0 && ( +
- {OrderCardDetail.map((item, i) => { - const isGroup = item.ServiceType === 'G'; - const groupKey = item.id; // 🔁 using `id` for groups now - const uniqueKey = `${item.ServiceId}__${item.__index}`; + > + {filteredSettingNames?.includes('whatsapp') && + MobileNoWhatsApp?.value && ( + + )} - // For G-type: render input only once for the group - if ( - isGroup && - i !== OrderCardDetail.findIndex((o) => o.id === groupKey) - ) { - return null; - } + - const qty = isGroup - ? OrderCardDetail.filter((o) => o.id === groupKey).reduce( + {filteredSettingNames?.includes('SMS') && isMobile && ( + + )} + {/* WhatsAppShare modal/component */} + {showWhatsAppShare && ( + closePrintOption(false)} + /> + )} + {showSMSShare && isMobile && ( + closePrintOption(false)} + /> + )} +
+ )} + + { + dispatch(changeSalesPaymentoption(false)); + }} + footer={false} + children={ +
+ +
+ } + /> + + { + OtherServicesPrintDetails?.length > 0 && ( + // PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => ( +
+ +
+ ) + // )) + } + + { + setOtherServicesModal(false); + }} + // handleSubmit={Handlevehiclenumbers} + footer={false} + children={ +
+ {OrderCardDetail.map((item, i) => { + const isGroup = item.ServiceType === 'G'; + const groupKey = item.id; // 🔁 using `id` for groups now + const uniqueKey = `${item.ServiceId}__${item.__index}`; + + // For G-type: render input only once for the group + if ( + isGroup && + i !== OrderCardDetail.findIndex((o) => o.id === groupKey) + ) { + return null; + } + + const qty = isGroup + ? OrderCardDetail.filter((o) => o.id === groupKey).reduce( (sum, o) => sum + (o.OrderQty || 1), 0 ) - : item.OrderQty || 1; + : item.OrderQty || 1; - return ( -
-

{item.ServiceName}

- - {Array.from({ length: qty }).map((_, index) => { - const inputKey = isGroup - ? item.id - : `${item.ServiceId}__${item.__index}`; - const value = vehicleInputs[inputKey]?.[index] || ''; - const error = errors[inputKey]?.[index] || ''; - - return ( -
- - handleInputChange( - isGroup ? item.id : item.ServiceId, - index, - e.target.value, - item.ServiceType, - item - ) - } - onKeyPress={(e) => { - if (!/[A-Za-z0-9]/.test(e.key)) { - e.preventDefault(); - } - }} - style={{ - width: '100%', - padding: 8, - borderRadius: 4, - border: error - ? '1px solid red' - : '1px solid #ccc', - }} - /> - {error && ( - - {error} - - )} -
- ); - })} -
- ); - })} -
- -
-
- } - /> +

{item.ServiceName}

+ {Array.from({ length: qty }).map((_, index) => { + const inputKey = isGroup + ? item.id + : `${item.ServiceId}__${item.__index}`; + const value = vehicleInputs[inputKey]?.[index] || ''; + const error = errors[inputKey]?.[index] || ''; + + return ( +
+ + handleInputChange( + isGroup ? item.id : item.ServiceId, + index, + e.target.value, + item.ServiceType, + item + ) + } + onKeyPress={(e) => { + if (!/[A-Za-z0-9]/.test(e.key)) { + e.preventDefault(); + } + }} + style={{ + width: '100%', + padding: 8, + borderRadius: 4, + border: error + ? '1px solid red' + : '1px solid #ccc', + }} + /> + {error && ( + + {error} + + )} +
+ ); + })} +
+ ); + })} +
+ +
+
+ } + /> + + setShowCancelConfirm(true)} + footer={false} + width={500} + children={ + <> + + + } + /> + {showCancelConfirm && ( + { + setBusinessUPI(false); + setShowCancelConfirm(false); + ClearAllGlobalStateDatas(); + CustomerDisplay(); + }} + onCancel={() => setShowCancelConfirm(false)} + okText="Yes" + cancelText="No" + > + Do you want to cancel the payment? + + )} + {customerPreviesOrders && ( setShowCancelConfirm(true)} + open={customerPreviesOrders} + handleCancel={() => setCustomerPreviesOrders(false)} footer={false} - width={500} + width={700} + className={'ModalPaymentGatewayEmbedded'} children={ <> - setCustomerPreviesOrders(false)} /> } /> - {showCancelConfirm && ( - { - setBusinessUPI(false); - setShowCancelConfirm(false); - ClearAllGlobalStateDatas(); - CustomerDisplay(); - }} - onCancel={() => setShowCancelConfirm(false)} - okText="Yes" - cancelText="No" - > - 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 d6ecf2f..7633b7c 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx @@ -3,8 +3,7 @@ import React, { useEffect, useState, useRef, - lazy, - Suspense, + lazy, } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { useNavigate } from 'react-router-dom'; @@ -214,8 +213,7 @@ import CardPopover from '../StandardTable/Utils/CardPopover.jsx'; import UpiPopover from '../StandardTable/Utils/UpiPopOver.jsx'; import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx'; import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js'; -import BillingTableSkeleton from '../../../../../Components/Skeleton/BillingTableSkeleton.jsx'; -import CustomerMobileNumberModal from '../../BookingFunctionality/CustomerOTP.jsx'; + import CustomerMobileNumberModal from '../../BookingFunctionality/CustomerOTP.jsx'; const PaymentGatewayEmbedded = lazy( () => import('../../UtillComponents/PaymentGatewayEmbedded.jsx') ); @@ -3631,8 +3629,7 @@ const BSBillingTable3Pay = () => { (arr) => Array.isArray(arr) && arr.some((err) => err) ); }; - return ( - }> + return ( <>
{screenwidth <= 768 && ( @@ -4969,8 +4966,7 @@ const BSBillingTable3Pay = () => { HandleCloseModal={() => setCustomerOtpmodalopen(false)} /> )} - - + ); }; diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.jsx index c91e682..355b630 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.jsx @@ -1,4 +1,4 @@ -import React, { lazy, useEffect, useState, Suspense } from 'react'; +import React, { lazy, useEffect, useState } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { isMobile } from 'react-device-detect'; import { AiFillDelete, AiOutlineClose } from 'react-icons/ai'; @@ -83,7 +83,6 @@ import { import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js'; import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js'; import { useUtilsComponent } from '../../../../../Services/utils.js'; -import BillingTableSkeleton from '../../../../../Components/Skeleton/BillingTableSkeleton.jsx'; const CustomerPriceHistory = lazy( () => import('../../UtillComponents/CustomerPriceHistory.jsx') ); @@ -195,16 +194,16 @@ const BSBillingTable4 = () => { OrderType === 'Hold' ? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway') : tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId - ); + (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId + ); const OldtableDataDinein = tableData?.filter( (a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId ); const OldtableDataTakeAway = OrderType != 'Hold' ? tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId - ) + (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId + ) : []; useEffect(() => { @@ -1008,9 +1007,9 @@ const BSBillingTable4 = () => { )?.map((item, idx) => idx === 0 ? { - ...item, - FreeQty, - } + ...item, + FreeQty, + } : item ), }; @@ -1626,7 +1625,6 @@ const BSBillingTable4 = () => { BuyInwardDtlId: null, Offer: item?.Offer, OrderRate: item?.OrderRate, - }); } else { const isCheck = GlobalOfferAppliedProductsData?.find( @@ -2040,9 +2038,9 @@ const BSBillingTable4 = () => { AppId: AppId, ...(AvailableDate && selectedDate ? { - fromDate: selectedDate?.[0], - toDate: selectedDate?.[1], - } + fromDate: selectedDate?.[0], + toDate: selectedDate?.[1], + } : {}), }; await dispatch(getSelectedFavItems(data)).unwrap(); @@ -2054,9 +2052,9 @@ const BSBillingTable4 = () => { ProdSubCat: ProdSubCat, ...(AvailableDate && selectedDate ? { - fromDate: selectedDate?.[0], - toDate: selectedDate?.[1], - } + fromDate: selectedDate?.[0], + toDate: selectedDate?.[1], + } : {}), }; @@ -2067,9 +2065,9 @@ const BSBillingTable4 = () => { prodCat: prodCat, ...(AvailableDate && selectedDate ? { - fromDate: selectedDate?.[0], - toDate: selectedDate?.[1], - } + fromDate: selectedDate?.[0], + toDate: selectedDate?.[1], + } : {}), }; @@ -2192,200 +2190,184 @@ const BSBillingTable4 = () => { }; return ( - }> -
- - - - {tableOptions?.map((item) => ( - <> - {item.OptionName == 'Sl.No' && BookingTypeBoth && ( - - )} - {item.OptionName == 'Sl.No' && ( - - )} - {item.OptionName == 'Item' && ( - - )} - {item.OptionName == 'MRP' && ( - - )} - {item.OptionName == 'Discount' && ( - - )} - {item.OptionName == 'Quantity' && ( -
- {!isMobile ? ( - {''} - ) : ( -
{''}
- )} -
- {!isMobile ? ( - Sl.No - ) : ( -
Sl.No
- )} -
- {!isMobile ? ( - Item - ) : ( -
Item
- )} -
- {!isMobile ? ( - MRP - ) : ( -
MRP
- )} -
- {!isMobile ? ( - ₹/% - ) : ( -
₹/%
- )} -
{ - if (tableData?.length > 0) { - OpenEditTotalAmount(); - } - }} +
+ + + + {tableOptions?.map((item) => ( + <> + {item.OptionName == 'Sl.No' && BookingTypeBoth && ( + + )} + {item.OptionName == 'Sl.No' && ( + + )} + {item.OptionName == 'Item' && ( + + )} + {item.OptionName == 'MRP' && ( + + )} + {item.OptionName == 'Discount' && ( + + )} + {item.OptionName == 'Quantity' && ( + - )} - {item.OptionName == 'Rate' && ( - - )} - {item.OptionName == 'Amount' && ( - - )} + > + {!isMobile ? ( + Qty + ) : ( +
Qty
+ )} + + )} + {item.OptionName == 'Rate' && ( + + )} + {item.OptionName == 'Amount' && ( + + )} - {item.OptionName == 'Delete' && ( - - )} - - ))} - - + + ) : ( +
+ {' '} + {!isMobile ? ( + + + + ) : ( +
+ {' '} + {' '} +
+ )}{' '} +
+ )} + + )} + + ))} + + - {OldtableDataTakeAway?.length > 0 && ( - - {OldtableDataTakeAway?.map((item, index) => ( - 0 && ( + + {OldtableDataTakeAway?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && + ? 'wheat' + : BookingType !== 'Dine In' && triggerAnimation && index === 0 && - tableDataTakeAway?.length >= - PreviousdataLength && + tableDataTakeAway?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - item?.SalesId && OrderType !== 'Hold' - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + item?.SalesId && OrderType !== 'Hold' + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : index % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - {tableitem.OptionName == 'Sl.No' && ( + ? '#b2d1f7' + : index % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} + + )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} + {tableitem.OptionName == 'Delete' && ( + + )} + + ))} + + ))} - {EditQuantity && OldtableDataTakeAway?.length > 0 && ( - - )} - - )} - {OldtableDataDinein?.length > 0 && ( - - {OldtableDataDinein?.map((item, index) => ( - 0 && ( + + )} + + )} + {OldtableDataDinein?.length > 0 && ( + + {OldtableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && + ? 'wheat' + : BookingType !== 'Dine In' && triggerAnimation && OldtableDataTakeAway?.length + index === 0 && tableDataDinein?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + index) % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - {tableitem.OptionName == 'Sl.No' && ( + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + index) % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} + + )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} + {tableitem.OptionName == 'Delete' && ( + + )} + + ))} + + ))} - {OldtableDataDinein?.length > 0 && EditQuantity && ( - - )} - - )} - {tableDataTakeAway?.length > 0 && ( - - {tableDataTakeAway?.map((item, index) => ( - 0 && EditQuantity && ( + + )} + + )} + {tableDataTakeAway?.length > 0 && ( + + {tableDataTakeAway?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && - tableDataTakeAway?.length >= - PreviousdataLength && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && + tableDataTakeAway?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + ? 'wheat' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - : '#d6d6d6' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + //change + background: + BookingType === 'Dine In' && item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) + ? '#b2d1f7' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] : '#d6d6d6', - //change - background: - BookingType === 'Dine In' && item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) - ? '#b2d1f7' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataDinein?.length + + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - {tableitem?.OptionName == 'Sl.No' && ( + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem?.OptionName == 'Item' && ( - + )} + {tableitem?.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} + + )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} + {tableitem.OptionName == 'Delete' && ( + + )} + + ))} + + ))} - {tableDataTakeAway?.length > 0 && EditQuantity && ( - - )} - - )} - {tableDataDinein?.length > 0 && ( - - {tableDataDinein?.map((item, index) => ( - 0 && EditQuantity && ( + + )} + + )} + {tableDataDinein?.length > 0 && ( + + {tableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && tableDataDinein?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - BookingType === 'Dine In' && - item?.SalesId && - !BookingTypeBoth - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + BookingType === 'Dine In' && + item?.SalesId && + !BookingTypeBoth + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index) % - 2 === + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - {tableitem.OptionName == 'Sl.No' && ( + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} + + )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} + {tableitem.OptionName == 'Delete' && ( + + )} + + ))} + + ))} - {tableDataDinein?.length > 0 && EditQuantity && ( - - )} - - )} -
+ {!isMobile ? ( + {''} + ) : ( +
{''}
+ )} +
+ {!isMobile ? ( + Sl.No + ) : ( +
Sl.No
+ )} +
+ {!isMobile ? ( + Item + ) : ( +
Item
+ )} +
+ {!isMobile ? ( + MRP + ) : ( +
MRP
+ )} +
+ {!isMobile ? ( + ₹/% + ) : ( +
₹/%
+ )} +
{ + if (tableData?.length > 0) { + OpenEditTotalAmount(); + } + }} // onClick={tableData?.length>0? OpenEditTotalAmount :""} - > - {!isMobile ? ( - Qty - ) : ( -
Qty
- )} -
- {!isMobile ? ( - Rt - ) : ( -
Rt
- )} -
- {!isMobile ? ( - Amt - ) : ( -
Amt
- )} -
+ {!isMobile ? ( + Rt + ) : ( +
Rt
+ )} +
+ {!isMobile ? ( + Amt + ) : ( +
Amt
+ )} +
- {tableData?.length > 0 ? ( - { - Clearall(); - }} - > -
- {' '} - {!isMobile ? ( - - {' '} - {' '} - - ) : ( -
- {' '} - {' '} -
- )}{' '} -
-
- ) : ( + {item.OptionName == 'Delete' && ( +
+ {tableData?.length > 0 ? ( + { + Clearall(); + }} + >
{' '} {!isMobile ? ( - - + + {' '} + {' '} ) : (
@@ -2394,1211 +2376,1237 @@ const BSBillingTable4 = () => {
)}{' '}
- )} -
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowspan={tableData.length} + style={{ backgroundColor: '#CFB59D' }} > - {index + 1} + - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 || imeiModal) - ? handleImeiDetails(item) - : editField && handleEditQuantity(item) + {tableitem.OptionName == 'Sl.No' && ( + { + if (editField) { + handleEditQuantity(item); } - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {AvailableDate ? ( - <> - {' '} - ( - {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} - )   - {item?.SinglePc == 'Y' && 'Single'} - - ) : ( - <> - {item?.Size} - {item?.SinglePc == 'Y' - ? 'Single' - : item?.UomName} - - )} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+ {index + 1} +
+ item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || + imeiModal + ? handleImeiDetails(item) + : editField && handleEditQuantity(item) + } + > + {item.ProdName} +   {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {AvailableDate ? ( + <> + {' '} + ( + {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} + )   + {item?.SinglePc == 'Y' && 'Single'} + + ) : ( + <> + {item?.Size} + {item?.SinglePc == 'Y' + ? 'Single' + : item?.UomName} + + )} + ) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item?.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - ).toFixed(2)} - { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {Number( + item?.TotalAmt - (item?.Offer || 0) || 0 + ).toFixed(2)} + - removeFromCart(item)} - style={{ color: '#FF4D4F', cursor: 'pointer' }} - /> -
+ removeFromCart(item)} + style={{ color: '#FF4D4F', cursor: 'pointer' }} + /> +
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowspan={tableData.length} + style={{ backgroundColor: '#A2C3CD' }} > - {OldtableDataTakeAway?.length + index + 1} + { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {AvailableDate ? ( - <> - {' '} - ( - {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} - )   - {item?.SinglePc == 'Y' && 'Single'} - - ) : ( - <> - {item?.Size} - {item?.SinglePc == 'Y' - ? 'Single' - : item?.UomName} - - )} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {OldtableDataTakeAway?.length + index + 1} +
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.ProdName} +   {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {AvailableDate ? ( + <> + {' '} + ( + {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} + )   + {item?.SinglePc == 'Y' && 'Single'} + + ) : ( + <> + {item?.Size} + {item?.SinglePc == 'Y' + ? 'Single' + : item?.UomName} + + )} + ) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item?.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - ).toFixed(2)} - { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {Number( + item?.TotalAmt - (item?.Offer || 0) || 0 + ).toFixed(2)} + - removeFromCart(item)} - style={{ color: '#FF4D4F', cursor: 'pointer' }} - /> -
+ removeFromCart(item)} + style={{ color: '#FF4D4F', cursor: 'pointer' }} + /> +
- - { - if (editField) { - handleEditQuantity(item, index); - } - }} + rowspan={tableData.length} + style={{ backgroundColor: '#CFB59D' }} > - {OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index + - 1} + - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 || imeiModal) - ? handleImeiDetails(item) - : editField && handleEditQuantity(item, index) + {tableitem?.OptionName == 'Sl.No' && ( + { + if (editField) { + handleEditQuantity(item, index); } - > - {item?.Type !== 'OS' - ? item.ProdName - : item.ServiceName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- {/* ( + }} + > + {OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index + + 1} +

+ item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || + imeiModal + ? handleImeiDetails(item) + : editField && handleEditQuantity(item, index) + } + > + {item?.Type !== 'OS' ? item.ProdName : item.ServiceName} +   {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

+ {/* ( {!item?.ProdVariantName?.toLowerCase()?.includes( 'variant' ) && {item?.ProdVariantName} } {item?.Size} {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) */} - {item?.Type !== 'OS' && ( - <> - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } + {item?.Type !== 'OS' && ( + <> + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } - {AvailableDate ? ( - <> - {' '} - ( - {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} - )   - {item?.SinglePc == 'Y' && 'Single'} - - ) : ( - <> - {item?.Size} - {item?.SinglePc == 'Y' - ? 'Single' - : item?.UomName} - - )} - - )} -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + {AvailableDate ? ( + <> + {' '} + ( + {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} + )   + {item?.SinglePc == 'Y' && 'Single'} + + ) : ( + <> + {item?.Size} + {item?.SinglePc == 'Y' + ? 'Single' + : item?.UomName} + + )} + + )} +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} -
- )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item, index); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item?.MRP} -
{ - if (editField) { - handleEditQuantity(item, index); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item, index); - } - }} - > - {item?.OrderQty} - { - if (editField) { - handleEditQuantity(item, index); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item, index); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - ).toFixed(2)} - { + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {item?.OrderQty} + { + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item, index); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {Number( + item?.TotalAmt - (item?.Offer || 0) || 0 + ).toFixed(2)} + - removeFromCart(item)} - style={{ color: '#FF4D4F', cursor: 'pointer' }} - /> -
+ removeFromCart(item)} + style={{ color: '#FF4D4F', cursor: 'pointer' }} + /> +
- - { - if (editField) { - handleEditQuantity(item, index); - } - }} + rowspan={tableData.length} + style={{ backgroundColor: '#A2C3CD' }} > - {tableDataTakeAway?.length + - OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index + - 1} + { - if (editField) { - handleEditQuantity(item, index); - } - }} - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {AvailableDate ? ( - <> - {' '} - ( - {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} - )   - {item?.SinglePc == 'Y' && 'Single'} - - ) : ( - <> - {item?.Size} - {item?.SinglePc == 'Y' - ? 'Single' - : item?.UomName} - - )} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
{ + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {tableDataTakeAway?.length + + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index + + 1} +
{ + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {item.ProdName} +   {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {AvailableDate ? ( + <> + {' '} + ( + {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} + )   + {item?.SinglePc == 'Y' && 'Single'} + + ) : ( + <> + {item?.Size} + {item?.SinglePc == 'Y' + ? 'Single' + : item?.UomName} + + )} + ) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item, index); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item?.MRP} -
{ - if (editField) { - handleEditQuantity(item, index); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item, index); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item, index); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - ).toFixed(2)} - { + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item, index); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {Number( + item?.TotalAmt - (item?.Offer || 0) || 0 + ).toFixed(2)} + - removeFromCart(item)} - style={{ color: '#FF4D4F', cursor: 'pointer' }} - /> -
+ removeFromCart(item)} + style={{ color: '#FF4D4F', cursor: 'pointer' }} + /> +
- {OpenEditTotalAmt && ( - + {tableDataDinein?.length > 0 && EditQuantity && ( + + )} + )} - {OpenImeiDetail && ( - - )} - {customerPriceHistoryOpen && GetCustId && ( - - )} -
- +
+ {OpenEditTotalAmt && ( + + )} + {OpenImeiDetail && ( + + )} + {customerPriceHistoryOpen && GetCustId && ( + + )} +
); }; diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable5/BSBillingTable5.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable5/BSBillingTable5.jsx index f688d3b..132dd92 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable5/BSBillingTable5.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable5/BSBillingTable5.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState, useRef, lazy, Suspense } from 'react'; +import React, { useEffect, useState, useRef, lazy } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import moment from 'moment'; import { Popover, Badge, Modal, Tooltip } from 'antd'; @@ -197,7 +197,6 @@ import { import CardPopover from '../StandardTable/Utils/CardPopover.jsx'; import UpiPopover from '../StandardTable/Utils/UpiPopOver.jsx'; import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js'; -import BillingTableSkeleton from '../../../../../Components/Skeleton/BillingTableSkeleton.jsx'; import OtherServiceMobilePrint from '../../BookingFunctionality/OtherServiceMobilePrint.jsx'; // Jsx Files const OtherServicePrintStyle1 = lazy( @@ -565,35 +564,35 @@ const BSBillingTable5 = () => { } }, [OrderCardDetail]); useEffect(() => { - - const fetchPrinterMapping = async () => { - try { - if (UserType !== 'Super Admin' && isMobile && MobileA4Print) { - const data = { - CompId: CompId, - BranchId: BranchId, - AppId: AppId, - UserId: UserId, - }; - // && isMobile && MobileA4Print - const response = await dispatch(getPrinterMappingDetails(data)).unwrap(); - if (response?.data?.statusCode === 0) { - handlePrintMappingClick() - } - console.log(response, "printer mapping response"); - } - } catch (error) { - console.error("Error fetching printer mapping:", error); - } - }; - - fetchPrinterMapping(); - - }, []); + const fetchPrinterMapping = async () => { + try { + if (UserType !== 'Super Admin' && isMobile && MobileA4Print) { + const data = { + CompId: CompId, + BranchId: BranchId, + AppId: AppId, + UserId: UserId, + }; + // && isMobile && MobileA4Print + const response = await dispatch( + getPrinterMappingDetails(data) + ).unwrap(); + if (response?.data?.statusCode === 0) { + handlePrintMappingClick(); + } + console.log(response, 'printer mapping response'); + } + } catch (error) { + console.error('Error fetching printer mapping:', error); + } + }; + + fetchPrinterMapping(); + }, []); const handlePrintMappingClick = () => { - // setReprint1(true) - window.dispatchEvent(new Event('CLICK PRINTER MAPPING')); - }; + // setReprint1(true) + window.dispatchEvent(new Event('CLICK PRINTER MAPPING')); + }; useEffect(() => { if (selOption) { closePrintOption(); @@ -777,7 +776,10 @@ const BSBillingTable5 = () => { useEffect(() => { if (CompId && BranchId && AppId) { - if (holdCheckedSalesSetup || NavBarOptions?.some((e) => e?.OptionName == 'Hold')) { + if ( + holdCheckedSalesSetup || + NavBarOptions?.some((e) => e?.OptionName == 'Hold') + ) { getHolddata(); } getCustomerData(); @@ -1185,7 +1187,7 @@ const BSBillingTable5 = () => { const selectedStyle = stylesMap[ - printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle + printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle ]; if (selectedStyle) { @@ -1963,7 +1965,10 @@ const BSBillingTable5 = () => { setUpinotSelected(false); setCurrentOrderNetAmount(0); setPreviousNetAmount(0); - if (holdCheckedSalesSetup || NavBarOptions?.some((e) => e?.OptionName == 'Hold')) { + if ( + holdCheckedSalesSetup || + NavBarOptions?.some((e) => e?.OptionName == 'Hold') + ) { getHolddata(); } if (defaultBookingType === 'Both') { @@ -2141,15 +2146,15 @@ const BSBillingTable5 = () => { 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', @@ -2168,7 +2173,7 @@ const BSBillingTable5 = () => { SetCount: a.SetCount, ...(a?.DiscountValue && { DiscountValue: a.DiscountValue }), ...(a?.DiscountType && { DiscountType: a.DiscountType }), - ...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt }) + ...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt }), })); const NotSlectedTypeFind = temporderdetail?.find( (a) => a?.BookingType != SelectedBookingType @@ -2243,7 +2248,7 @@ const BSBillingTable5 = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', OrderDtlDetails: @@ -2260,9 +2265,9 @@ const BSBillingTable5 = () => { ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map((item) => ({ - ...item, - TipsAmount: globalTipAmount, - })) + ...item, + TipsAmount: globalTipAmount, + })) : null, SalesPaymentType: 'normal', PaymentDetail: [ @@ -2277,8 +2282,8 @@ const BSBillingTable5 = () => { ? PaymentgatewayUPI?.[0]?.ModeId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.ModeId + (busupi) => busupi?.ModeId === UpiId + )?.ModeId : paybtnselected : paybtnselected ? paybtnselected @@ -2291,15 +2296,15 @@ const BSBillingTable5 = () => { salesBillEdit && currentOrderNetAmount < previousNetAmount ? null : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'business' + SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantId + ?.MerchantId : null, PaymentOptionType: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - (refundPaySelectedName?.toLowerCase() === 'cash' || - refundPaySelectedName?.toLowerCase() === 'credit') + currentOrderNetAmount < previousNetAmount && + (refundPaySelectedName?.toLowerCase() === 'cash' || + refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' : Paybtnnameselected?.toLowerCase() === 'cash' ? 'PC' @@ -2319,29 +2324,29 @@ const BSBillingTable5 = () => { ? null : SelectedUPIPayOption?.toLowerCase() === 'default' ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) - ?.UPIDetailId + ?.UPIDetailId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.MerchantUPIId + (busupi) => busupi?.ModeId === UpiId + )?.MerchantUPIId : null, AccountDtl: salesBillEdit && currentOrderNetAmount < previousNetAmount ? [] : 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: @@ -2352,13 +2357,13 @@ const BSBillingTable5 = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', Debit: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - refundPaySelectedName?.toLowerCase() === 'credit' + currentOrderNetAmount < previousNetAmount && + refundPaySelectedName?.toLowerCase() === 'credit' ? Math.round(previousNetAmount - currentOrderNetAmount) : 0, Credit: salesBillEdit @@ -2433,14 +2438,14 @@ const BSBillingTable5 = () => { 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]); @@ -2599,14 +2604,14 @@ const BSBillingTable5 = () => { 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]); @@ -2713,14 +2718,14 @@ const BSBillingTable5 = () => { } 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]); @@ -2896,14 +2901,14 @@ const BSBillingTable5 = () => { setMessageType('success'); setMessageData( bookingpaymentupdate?.data?.response + - ' ' + - (bookingpaymentupdate?.data?.OrderDetails?.length > 0 - ? bookingpaymentupdate?.data?.OrderId && - extractLastNumberOrderId( - bookingpaymentupdate?.data?.OrderId, - rbookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus - ) - : '') + ' ' + + (bookingpaymentupdate?.data?.OrderDetails?.length > 0 + ? bookingpaymentupdate?.data?.OrderId && + extractLastNumberOrderId( + bookingpaymentupdate?.data?.OrderId, + rbookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus + ) + : '') ); bookingpaymentupdate?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([bookingpaymentupdate?.data]); @@ -2922,7 +2927,7 @@ const BSBillingTable5 = () => { if ( Date.now() - startTime > useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * - 60000 + 60000 ) { // 60,000 ms = 1 minute @@ -3628,697 +3633,689 @@ const BSBillingTable5 = () => { }; return ( <> - }> -
- {(addcustomer || hold) && ( - - )} - {creditCustomerOpen && ( - - )} - {TotalAmount == 0 && Success && ( -
- -
- )} - {TotalAmount > 0 && - qrCode && - PaymentUpiOptions?.length > 0 && - SelectedUpiOption && ( -
- -
- )} - - {PaymentUpiOptions?.length > 0 && OrderId && ( +
+ {(addcustomer || hold) && ( + + )} + {creditCustomerOpen && ( + + )} + {TotalAmount == 0 && Success && ( +
+ +
+ )} + {TotalAmount > 0 && + qrCode && + PaymentUpiOptions?.length > 0 && + SelectedUpiOption && (
)} - {screenwidth > 768 && ( + {PaymentUpiOptions?.length > 0 && OrderId && ( +
+ +
+ )} + + {screenwidth > 768 && ( +
+ +
+ )} + + {/* bill table */} + +
+ {screenwidth <= 768 && (
- + {Array.isArray(OrderCardDetail) && + OrderCardDetail?.length >= 1 && + (isMobile || screenwidth <= 768) && }
)} - - {/* bill table */} - -
- {screenwidth <= 768 && ( -
- {Array.isArray(OrderCardDetail) && - OrderCardDetail?.length >= 1 && - (isMobile || screenwidth <= 768) && } -
- )} - {screenwidth <= 768 && ( -
- {Array.isArray(OrderCardDetail) && - OrderCardDetail?.length >= 1 && ( -
- {responsiveBill ? ( -
- {' '} - {' '} -
- ) : ( -
- {' '} - {' '} -
- )} -
- )} -
- )} -
-
-
- -
- -
- -
0) && - !unpaidFlow && - OrderStatus - ? 'none' - : 'auto', - opacity: - (BookingType === 'Dine In' || - BookingTypeBoth || - CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus - ? 0.5 - : 1, - }} - > - {paybtns?.length > 0 && - currentOrderNetAmount >= previousNetAmount ? ( - paybtns?.map((payment) => ( -
- -
- )) - ) : currentOrderNetAmount < previousNetAmount && - salesBillEdit && - refundPayBtns.length > 0 ? ( - refundPayBtns.map((payment) => ( -
- -
- )) - ) : ( -
- Please Set Payment Options -
- )} -
-
-
- -
-
- -
- - - - - - - - - -
- Items :  - - {TotalItems}{' '} -
- Qty :  - - {Qty} -
-
-
- {OrderCardDetail?.length > 0 && - ParkingDisplay && - !OtherServicesglobal && ( -
- -
- )} - {!OtherServicesglobal && unpaidFlow == true ? ( - - {' '} - { - Recipt(); - }} - /> - - ) : ( - '' - )} -
- - - - - - - - } - trigger="click" - open={open2} - onOpenChange={handleOpenChange2} - > - - {!open2 ? ( - - ) : ( - - )} - - -
-
-
+ {screenwidth <= 768 && (
-
- {tableOptions - .filter((item) => item.OptionName === 'AddCustomer') - .map((filteredItem) => ( - + {Array.isArray(OrderCardDetail) && + OrderCardDetail?.length >= 1 && ( +
+ {responsiveBill ? (
- - - - {' '} - - + {' '} + {' '}
- - ))} + ) : ( +
+ {' '} + {' '} +
+ )} +
+ )} +
+ )} +
+
+
+
- {paybtns?.length > 1 && ( -
0) && - !unpaidFlow && - OrderStatus - ? 'none' - : 'auto', - opacity: - (BookingType === 'Dine In' || - BookingTypeBoth || - CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus - ? 0.5 - : 1, - width: '2rem', - }} + +
+ - {!OtherServicesglobal && ( - - {' '} +
0) && + !unpaidFlow && + OrderStatus + ? 'none' + : 'auto', + opacity: + (BookingType === 'Dine In' || + BookingTypeBoth || + CheckOrderType?.length > 0) && + !unpaidFlow && + OrderStatus + ? 0.5 + : 1, + }} + > + {paybtns?.length > 0 && + currentOrderNetAmount >= previousNetAmount ? ( + paybtns?.map((payment) => ( +
+ +
+ )) + ) : currentOrderNetAmount < previousNetAmount && + salesBillEdit && + refundPayBtns.length > 0 ? ( + refundPayBtns.map((payment) => ( +
+ +
+ )) + ) : (
- + Please Set Payment Options
- - )} -
- )} + )} +
+ +
+ +
- {/* btns */} - -
- {tableOptions?.filter((item) => item.OptionName === 'AddCustomer') - .length === 1 || navCust === true ? ( -
- {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' - ) - ) - ) && - !OtherServicesglobal && ( - - - {' '} - 0 && 'not-allowed', - color: - OrderCardDetail?.length > 0 || - (selOption?.value === undefined && - GlobalAddCustomerDetails1?.length === 0 && - GetCustId?.CustMobile === undefined) - ? 'gray' - : 'rgb(18, 146, 238)', - fontSize: '28px', - }} - /> - - - )} -
- ) : ( - '' - )} - {/* Customer Orders */} - {(SelCustId && tableOptions?.filter((item) => item.OptionName === 'PreviousBillFetch') - .length === 1) && ( - - {' '} -
{ - 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 && dinePreference && ( -
- {tableOptions - .filter((item) => item.OptionName === 'UnpaidBill') - .map((filteredItem) => ( - - {!OtherServicesglobal && ( - - {' '} - { - (setUnpaidOpen(true), getUnpaiddatas()); - }} - /> - - )} - - ))} -
- )} - {OtherServicesglobal && OrderCardDetail.length >= 1 && ( - - {' '} +
+ + + + + + + + + +
+ Items :  + + {TotalItems}{' '} +
+ Qty :  + + {Qty} +
+
+
+ {OrderCardDetail?.length > 0 && + ParkingDisplay && + !OtherServicesglobal && (
- +
+ )} + {!OtherServicesglobal && unpaidFlow == true ? ( + + {' '} + { + Recipt(); + }} + /> + ) : ( + '' )} - {dinePreference && ( -
- {(BookingType === 'Dine In' || - BookingTypeBoth || - CheckOrderType?.length > 0) && +
+ + + + + + + + } + trigger="click" + open={open2} + onOpenChange={handleOpenChange2} + > + + {!open2 ? ( + + ) : ( + + )} + + +
+
+
+
+
+ {tableOptions + .filter((item) => item.OptionName === 'AddCustomer') + .map((filteredItem) => ( + +
+ + + + {' '} + + +
+
+ ))} +
+ {paybtns?.length > 1 && ( +
0) && !unpaidFlow && - SelectedTableDetails?.length !== 0 && ( - <> - + OrderStatus + ? 'none' + : 'auto', + opacity: + (BookingType === 'Dine In' || + BookingTypeBoth || + CheckOrderType?.length > 0) && + !unpaidFlow && + OrderStatus + ? 0.5 + : 1, + width: '2rem', + }} + > + {!OtherServicesglobal && ( + + {' '} +
+ +
+
+ )} +
+ )} +
+ + {/* btns */} + +
+ {tableOptions?.filter((item) => item.OptionName === 'AddCustomer') + .length === 1 || navCust === true ? ( +
+ {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' + ) + ) + ) && + !OtherServicesglobal && ( + + + {' '} + 0 && 'not-allowed', + color: + OrderCardDetail?.length > 0 || + (selOption?.value === undefined && + GlobalAddCustomerDetails1?.length === 0 && + GetCustId?.CustMobile === undefined) + ? 'gray' + : 'rgb(18, 146, 238)', + fontSize: '28px', + }} + /> + + + )} +
+ ) : ( + '' + )} + {/* Customer Orders */} + {SelCustId && + tableOptions?.filter( + (item) => item.OptionName === 'PreviousBillFetch' + ).length === 1 && ( + + {' '} +
{ + 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 && dinePreference && ( +
+ {tableOptions + .filter((item) => item.OptionName === 'UnpaidBill') + .map((filteredItem) => ( + + {!OtherServicesglobal && ( + {' '} - - FirstPaymentclick === false && !addnewAccess - ? changeOrderStatus() - : '' - } + { + (setUnpaidOpen(true), getUnpaiddatas()); + }} /> - {FirstPaymentclick === false && - !addnewAccess && - !OrderStatus && } - - )} + )} + + ))} +
+ )} + {OtherServicesglobal && OrderCardDetail.length >= 1 && ( + + {' '} +
+
- )} - {!OtherServicesglobal && ( -
- {tableOptions?.map((item) => ( + + )} + {dinePreference && ( +
+ {(BookingType === 'Dine In' || + BookingTypeBoth || + CheckOrderType?.length > 0) && + !unpaidFlow && + SelectedTableDetails?.length !== 0 && ( <> - {unpaidFlow == false - ? item?.OptionName == 'Hold' && + + {' '} + + FirstPaymentclick === false && !addnewAccess + ? changeOrderStatus() + : '' + } + /> + + {FirstPaymentclick === false && + !addnewAccess && + !OrderStatus && } + + )} +
+ )} + {!OtherServicesglobal && ( +
+ {tableOptions?.map((item) => ( + <> + {unpaidFlow == false + ? item?.OptionName == 'Hold' && !BookingTypeBoth && BookingType !== 'Dine In' && OrderCardDetail?.length != 0 && @@ -4341,571 +4338,560 @@ const BSBillingTable5 = () => { ) - : ''} - {unpaidFlow === false && - item?.OptionName === 'Hold' && - !BookingTypeBoth && - BookingType !== 'Dine In' && - Holddata?.length > 0 && - OrderCardDetail?.length === 0 && - paybtns?.length > 0 && - CheckBookingStatus != 'Close' && - !addnewAccess && ( - - - - - - )} - - ))} -
- )} - - + + + )} + + ))} +
+ )} + + + +
+ { + Upimodel('Cancel'); + }} + footer={false} + children={ +
+ {/*

UPI PAYMENT

*/} + +
+
+ +
+ +
+

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

+
+
+ +
+ {(selOption || SelCustId) && ( +
+ Sent Payment Link + Your Alt Text + {/* */} +
)} - - -
- { - 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'); }} - > - } - handleSubmit={() => { - Upimodel('Submit'); - }} - /> -
+ />
- } - /> - {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'); - }} - />
- )} -
- {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 && ( - data?.TotalAmt + acc, - 0 - ) - - ((OverAllSales > 0 ? OverAllSales : 0) + - (OverAllEstimate > 0 ? OverAllEstimate : 0) + - (Discount > 0 ? Discount : 0)) - ) - } - failedOrderData={failedOrderData} - /> - )} - {PrintOrderDetails?.length > 0 && ( -
- {filteredSettingNames?.includes('whatsapp') && - MobileNoWhatsApp?.value && ( - - )} - - {(filteredSettingNames?.includes('Print') || - !MobileNoWhatsApp || - !MobileNoWhatsApp.value) && ( - - )} - - {filteredSettingNames?.includes('SMS') && isMobile && ( - - )} - {/* WhatsAppShare modal/component */} - {showWhatsAppShare && ( - closePrintOption(false)} - /> - )} - {showSMSShare && isMobile && ( - closePrintOption(false)} - /> - )} -
- )} - { - OtherServicesPrintDetails?.length > 0 && ( - // PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => ( + } + /> + {PrintOrderDetails?.length > 0 && + PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => (
-
- ) - // )) - } - { - setOtherServicesModal(false); - }} - // handleSubmit={Handlevehiclenumbers} - footer={false} - children={ -
- {OrderCardDetail.map((item, i) => { - const isGroup = item.ServiceType === 'G'; - const groupKey = item.id; // 🔁 using `id` for groups now - const uniqueKey = `${item.ServiceId}__${item.__index}`; - - // For G-type: render input only once for the group - if ( - isGroup && - i !== OrderCardDetail.findIndex((o) => o.id === groupKey) - ) { - return null; - } - - const qty = isGroup - ? OrderCardDetail.filter((o) => o.id === groupKey).reduce( - (sum, o) => sum + (o.OrderQty || 1), - 0 + ))} + {PrintOrderDetails?.length > 0 && + (TokenOnly?.SettingValue === 'Y' || + IndividualToken?.SettingValue === 'Y') && + PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => ( +
+ -

{item.ServiceName}

- - {Array.from({ length: qty }).map((_, index) => { - const inputKey = isGroup - ? item.id - : `${item.ServiceId}__${item.__index}`; - const value = vehicleInputs[inputKey]?.[index] || ''; - const error = errors[inputKey]?.[index] || ''; - - return ( -
- - handleInputChange( - isGroup ? item.id : item.ServiceId, - index, - e.target.value, - item.ServiceType, - item - ) - } - onKeyPress={(e) => { - if (!/[A-Za-z0-9]/.test(e.key)) { - e.preventDefault(); - } - }} - style={{ - width: '100%', - padding: 8, - borderRadius: 4, - border: error - ? '1px solid red' - : '1px solid #ccc', - }} - /> - {error && ( - - {error} - - )} -
- ); - })} -
- ); - })} -
- -
+ } + CreatedDate={orderDetail?.CreatedDate} + PaymentStatus={PrintOrderDetails?.[0]?.PaymentOrderDtl} + />
- } - /> + ))} + {CreditCustomer && ( +
+ { + handleCreditCustomer('Cancel'); + }} + handleOk={() => { + handleCreditCustomer('Submit'); + }} + /> +
+ )} +
+ {unpaidopen && ( { - dispatch(changeSalesPaymentoption(false)); + setUnpaidOpen(false); }} footer={false} children={ -
- +
+
} /> - setShowCancelConfirm(true)} - footer={false} + )} + {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 && ( + data?.TotalAmt + acc, + 0 + ) - + ((OverAllSales > 0 ? OverAllSales : 0) + + (OverAllEstimate > 0 ? OverAllEstimate : 0) + + (Discount > 0 ? Discount : 0)) + ) + } + failedOrderData={failedOrderData} + /> + )} + {PrintOrderDetails?.length > 0 && ( +
+ {filteredSettingNames?.includes('whatsapp') && + MobileNoWhatsApp?.value && ( + + )} + + {(filteredSettingNames?.includes('Print') || + !MobileNoWhatsApp || + !MobileNoWhatsApp.value) && ( + + )} + + {filteredSettingNames?.includes('SMS') && isMobile && ( + + )} + {/* WhatsAppShare modal/component */} + {showWhatsAppShare && ( + closePrintOption(false)} + /> + )} + {showSMSShare && isMobile && ( + closePrintOption(false)} + /> + )} +
+ )} + { + OtherServicesPrintDetails?.length > 0 && ( + // PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => ( +
+ +
+ ) + // )) + } + { + setOtherServicesModal(false); + }} + // handleSubmit={Handlevehiclenumbers} + footer={false} + children={ +
+ {OrderCardDetail.map((item, i) => { + const isGroup = item.ServiceType === 'G'; + const groupKey = item.id; // 🔁 using `id` for groups now + const uniqueKey = `${item.ServiceId}__${item.__index}`; + + // For G-type: render input only once for the group + if ( + isGroup && + i !== OrderCardDetail.findIndex((o) => o.id === groupKey) + ) { + return null; + } + + const qty = isGroup + ? OrderCardDetail.filter((o) => o.id === groupKey).reduce( + (sum, o) => sum + (o.OrderQty || 1), + 0 + ) + : item.OrderQty || 1; + + return ( +
+

{item.ServiceName}

+ + {Array.from({ length: qty }).map((_, index) => { + const inputKey = isGroup + ? item.id + : `${item.ServiceId}__${item.__index}`; + const value = vehicleInputs[inputKey]?.[index] || ''; + const error = errors[inputKey]?.[index] || ''; + + return ( +
+ + handleInputChange( + isGroup ? item.id : item.ServiceId, + index, + e.target.value, + item.ServiceType, + item + ) + } + onKeyPress={(e) => { + if (!/[A-Za-z0-9]/.test(e.key)) { + e.preventDefault(); + } + }} + style={{ + width: '100%', + padding: 8, + borderRadius: 4, + border: error + ? '1px solid red' + : '1px solid #ccc', + }} + /> + {error && ( + + {error} + + )} +
+ ); + })} +
+ ); + })} +
+ +
+
+ } + /> + { + dispatch(changeSalesPaymentoption(false)); + }} + footer={false} + children={ +
+ +
+ } + /> + setShowCancelConfirm(true)} + footer={false} + width={500} + children={ + <> + + + } + /> + {showCancelConfirm && ( + { + setBusinessUPI(false); + setShowCancelConfirm(false); + ClearAllGlobalStateDatas(); + CustomerDisplay(); + }} + onCancel={() => setShowCancelConfirm(false)} + okText="Yes" + cancelText="No" + > + Do you want to cancel the payment? + + )} + {customerPreviesOrders && ( + setCustomerPreviesOrders(false)} + footer={false} + width={700} + className={'ModalPaymentGatewayEmbedded'} + children={ + <> + setCustomerPreviesOrders(false)} /> } /> - {showCancelConfirm && ( - { - setBusinessUPI(false); - setShowCancelConfirm(false); - ClearAllGlobalStateDatas(); - CustomerDisplay(); - }} - onCancel={() => setShowCancelConfirm(false)} - okText="Yes" - cancelText="No" - > - 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/BSBillingTable6.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx index c4e3046..76dd20c 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx @@ -1,4 +1,4 @@ -import React, { Suspense, useEffect, useState, lazy } from 'react'; +import React, { useEffect, useState, lazy } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { Popconfirm, Tooltip } from 'antd'; import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.scss'; @@ -75,7 +75,6 @@ import { import { getCustomerDisplayWindow } from '../../../../../Features/customerDisplayWindow/customerDisplayWindow.js'; import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx'; import { useUtilsComponent } from '../../../../../Services/utils.js'; -import BillingTableSkeleton from '../../../../../Components/Skeleton/BillingTableSkeleton.jsx'; const BSEditTotalAmt = lazy( () => import('../BSEditTotalAmount/BSEditTotalAmt.jsx') ); @@ -172,16 +171,16 @@ const BSBillingTable6 = () => { OrderType === 'Hold' ? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway') : tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId - ); + (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId + ); const OldtableDataDinein = tableData?.filter( (a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId ); const OldtableDataTakeAway = OrderType != 'Hold' ? tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId - ) + (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId + ) : []; const [OpenEditTotalAmt, setOpenEditTotalAmt] = useState(false); useEffect(() => { @@ -1066,9 +1065,9 @@ const BSBillingTable6 = () => { )?.map((item, idx) => idx === 0 ? { - ...item, - FreeQty, - } + ...item, + FreeQty, + } : item ), }; @@ -2004,1348 +2003,1355 @@ const BSBillingTable6 = () => { }; return ( - }> -
- - - - {tableOptions?.map((item) => ( - <> - {item.OptionName == 'Sl.No' && BookingTypeBoth && ( - - )} - {item.OptionName == 'Sl.No' && ( - - )} - {item.OptionName == 'Item' && ( - - )} - {item.OptionName == 'MRP' && ( - - )} - {item.OptionName == 'Discount' && ( - - )} - {item.OptionName == 'Quantity' && ( - - )} - {item.OptionName == 'Rate' && ( - - )} - {item.OptionName == 'Amount' && ( - - )} +
+
- {!isMobile ? ( - {''} - ) : ( -
{''}
- )} -
- {!isMobile ? ( - Sl.No - ) : ( -
Sl.No
- )} -
- {!isMobile ? ( - Item - ) : ( -
Item
- )} -
- {!isMobile ? ( - MRP - ) : ( -
MRP
- )} -
- {!isMobile ? ( - ₹/% - ) : ( -
₹/%
- )} -
0 ? OpenEditTotalAmount : ""} - onClick={() => { - if (tableData?.length > 0) { - OpenEditTotalAmount(); - } - }} - > - {!isMobile ? ( - Qty - ) : ( -
Qty
- )} -
- {!isMobile ? ( - Rt - ) : ( -
Rt
- )} -
- {!isMobile ? ( - Amt - ) : ( -
Amt
- )} -
+ + + {tableOptions?.map((item) => ( + <> + {item.OptionName == 'Sl.No' && BookingTypeBoth && ( + + )} + {item.OptionName == 'Sl.No' && ( + + )} + {item.OptionName == 'Item' && ( + + )} + {item.OptionName == 'MRP' && ( + + )} + {item.OptionName == 'Discount' && ( + + )} + {item.OptionName == 'Quantity' && ( + + )} + {item.OptionName == 'Rate' && ( + + )} + {item.OptionName == 'Amount' && ( + + )} - {item.OptionName == 'Delete' && ( - - )} - - ))} - - - {/* For Reorder TakeWay */} - {OldtableDataTakeAway?.length > 0 && ( - - {OldtableDataTakeAway?.map((item, index) => ( - + ) : ( +
+ {!isMobile ? ( + + + + ) : ( +
+ {' '} + {' '} +
+ )} +
+ )} + + )} + + ))} + + + {/* For Reorder TakeWay */} + {OldtableDataTakeAway?.length > 0 && ( + + {OldtableDataTakeAway?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : triggerAnimation && + ? 'wheat' + : triggerAnimation && index === 0 && - tableDataTakeAway?.length >= - PreviousdataLength && + tableDataTakeAway?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - item?.SalesId && OrderType !== 'Hold' - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + item?.SalesId && OrderType !== 'Hold' + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : index % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + ? '#b2d1f7' + : index % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} + + )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} - {EditQuantity && OldtableDataTakeAway?.length > 0 && ( - - )} - - )} - {/* Reorder DineIn */} - {OldtableDataDinein?.length > 0 && ( - - {OldtableDataDinein?.map((item, index) => ( - removeFromCart(item)} + > + + + )} + + ))} + + ))} + {EditQuantity && OldtableDataTakeAway?.length > 0 && ( + + )} + + )} + {/* Reorder DineIn */} + {OldtableDataDinein?.length > 0 && ( + + {OldtableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && + ? 'wheat' + : BookingType !== 'Dine In' && triggerAnimation && OldtableDataTakeAway?.length + index === 0 && tableDataDinein?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + index) % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - {tableitem.OptionName == 'Sl.No' && ( + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + index) % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} + + )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} - {OldtableDataDinein?.length > 0 && EditQuantity && ( - - )} - - )} - {/* TakeWay */} - {tableDataTakeAway?.length > 0 && ( - - {tableDataTakeAway?.map((item, index) => ( - removeFromCart(item)} + > + + + )} + + ))} + + ))} + {OldtableDataDinein?.length > 0 && EditQuantity && ( + + )} + + )} + {/* TakeWay */} + {tableDataTakeAway?.length > 0 && ( + + {tableDataTakeAway?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && - tableDataTakeAway?.length >= - PreviousdataLength && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && + tableDataTakeAway?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + ? 'wheat' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - : '#d6d6d6' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + background: + BookingType === 'Dine In' && item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) + ? '#b2d1f7' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] : '#d6d6d6', - background: - BookingType === 'Dine In' && item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) - ? '#b2d1f7' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataDinein?.length + + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - {tableitem.OptionName == 'Sl.No' && ( + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} - {tableDataTakeAway?.length > 0 && EditQuantity && ( - - )} - - )} - {/* DineIn */} - {tableDataDinein?.length > 0 && ( - - {tableDataDinein?.map((item, index) => ( - + )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} + {tableitem.OptionName == 'Delete' && ( + + )} + + ))} + + ))} + {tableDataTakeAway?.length > 0 && EditQuantity && ( + + )} + + )} + {/* DineIn */} + {tableDataDinein?.length > 0 && ( + + {tableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && tableDataDinein?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - BookingType === 'Dine In' && - item?.SalesId && - !BookingTypeBoth - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + BookingType === 'Dine In' && + item?.SalesId && + !BookingTypeBoth + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index) % - 2 === + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - {tableitem.OptionName == 'Sl.No' && ( + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} - - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} - {tableDataDinein?.length > 0 && EditQuantity && ( - - )} - - )} -
+ {!isMobile ? ( + {''} + ) : ( +
{''}
+ )} +
+ {!isMobile ? ( + Sl.No + ) : ( +
Sl.No
+ )} +
+ {!isMobile ? ( + Item + ) : ( +
Item
+ )} +
+ {!isMobile ? ( + MRP + ) : ( +
MRP
+ )} +
+ {!isMobile ? ( + ₹/% + ) : ( +
₹/%
+ )} +
0 ? OpenEditTotalAmount : ""} + onClick={() => { + if (tableData?.length > 0) { + OpenEditTotalAmount(); + } + }} + > + {!isMobile ? ( + Qty + ) : ( +
Qty
+ )} +
+ {!isMobile ? ( + Rt + ) : ( +
Rt
+ )} +
+ {!isMobile ? ( + Amt + ) : ( +
Amt
+ )} +
- {tableData?.length > 0 ? ( - { - Clearall(); - }} - > -
- {' '} - {!isMobile ? ( - - {' '} - {' '} - - ) : ( -
- {' '} - {' '} -
- )}{' '} -
-
- ) : ( + {item.OptionName == 'Delete' && ( +
+ {tableData?.length > 0 ? ( + { + Clearall(); + }} + >
+ {' '} {!isMobile ? ( - - + + {' '} + {' '} ) : (
{' '} {' '}
- )} + )}{' '}
- )} -
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowspan={tableData.length} + style={{ backgroundColor: '#CFB59D' }} > - {index + 1} + - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 || imeiModal) - ? handleImeiDetails(item) - : editField && handleEditQuantity(item) + + {tableitem.OptionName == 'Sl.No' && ( + { + if (editField) { + handleEditQuantity(item); } - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+ {index + 1} +
+ item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || + imeiModal + ? handleImeiDetails(item) + : editField && handleEditQuantity(item) + } + > + {item.ProdName} +   {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item?.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {item.TotalAmt} - { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {item.TotalAmt} + removeFromCart(item)} - > - -
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowspan={tableData.length} + style={{ backgroundColor: '#A2C3CD' }} > - {OldtableDataTakeAway?.length + index + 1} + { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {OldtableDataTakeAway?.length + index + 1} +
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.ProdName} +   {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item?.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {item.TotalAmt} - { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {item.TotalAmt} + removeFromCart(item)} - > - -
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowspan={tableData.length} + style={{ backgroundColor: '#CFB59D' }} > - {OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index + - 1} + - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 || imeiModal) - ? handleImeiDetails(item) - : editField && handleEditQuantity(item) + {tableitem.OptionName == 'Sl.No' && ( + { + if (editField) { + handleEditQuantity(item); } - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- {item?.Type !== 'OS' && ( - <> - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.UomName} - - )} -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+ {OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index + + 1} +
+ item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || + imeiModal + ? handleImeiDetails(item) + : editField && handleEditQuantity(item) + } + > + {item.ProdName} +   {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + {item?.Type !== 'OS' && ( + <> + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.UomName} + + )} +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item?.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {item.TotalAmt} - removeFromCart(item)} - > - -
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {item.TotalAmt} + removeFromCart(item)} + > + +
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowspan={tableData.length} + style={{ backgroundColor: '#A2C3CD' }} > - {OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index + - 1} + { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.ProdName} -  {' '} - {item?.BrandName !== null ? item?.BrandName : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index + + 1} +
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.ProdName} +   {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt } - }} - > - {item?.MRP} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > + + )} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {item.TotalAmt} + { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {item.TotalAmt} - removeFromCart(item)} - > - -
- {OpenEditTotalAmt && ( - + {tableitem.OptionName == 'Delete' && ( + removeFromCart(item)} + > + + + )} + + ))} + + ))} + {tableDataDinein?.length > 0 && EditQuantity && ( + + )} + )} - {OpenImeiDetail && ( - - )} - {customerPriceHistoryOpen && GetCustId && ( - - )} -
-
+ + {OpenEditTotalAmt && ( + + )} + {OpenImeiDetail && ( + + )} + {customerPriceHistoryOpen && GetCustId && ( + + )} +
); }; diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBilling7Payment.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBilling7Payment.jsx index 7d58b8b..6d43dbf 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBilling7Payment.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBilling7Payment.jsx @@ -94,7 +94,6 @@ import { GlobalOverAllDiscSales, ChangeOverAllDiscSales, ChangeOverAllDiscEstimate, - GlobalBranchFinancialStatus, changeSummeryComboOfferAmount, ChangeComboCarddata, @@ -176,7 +175,7 @@ import PozoSplitPaymentIcon from '../../UtillComponents/Pozo retail icons/PozoSp import PozoCartIcon from '../../../../../Pages/BookingScreen/Components/UtillComponents/PozoCartIcon.jsx'; import { Global_OrderOfferDetail, - Global_OverallOfferAmount + Global_OverallOfferAmount, } from '../../../../../Features/Offer/Offer.js'; import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx'; import TooltipWrapper from '../../../../../Components/Tooltip/Tooltip'; @@ -234,13 +233,15 @@ const BSBilling7Payment = () => { const navigate = useNavigate(); const salesBillEdit = useSelector(GlobalSalesBillEdit); const previousOrderPayment = useSelector(GlobalPreviousOrderPayment); - const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails); + const previousOrderOfferDetails = useSelector( + GlobalPreviousOrderOfferDetails + ); const AllPaymentOptions = useSelector(GlobalpaymentOptionData); const Discount = useSelector(GlobalOverAllOfferAmt); const screenwidth = useSelector(GlobalScreenSize); const defaultBookingType = useSelector(GlobalDefaultBookingType); const printerTemplateStyle = useSelector(SelectedPrintTemplate); - const AllBookingType = useSelector(GlobalAllBookingType) + const AllBookingType = useSelector(GlobalAllBookingType); const FontFamily = useSelector(GlobalSelectedFont); const OrderCardDetail = useSelector(GlobalOrderCardDetails); const GetCustId = useSelector(GlobalCustId); @@ -342,7 +343,8 @@ const BSBilling7Payment = () => { const [previousNetAmount, setPreviousNetAmount] = useState(0); const [addcustomer, setAddCustomer] = useState(false); const [PrintOrderDetails, setPrintOrderDetails] = useState([]); - const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false); const OverAllSales = useSelector(GlobalOverAllDiscSales); + const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false); + const OverAllSales = useSelector(GlobalOverAllDiscSales); const OverAllEstimate = useSelector(GlobalOverAllDiscEstimate); //Total calculation const TotalItems = OrderCardDetail?.length; @@ -361,7 +363,12 @@ const BSBilling7Payment = () => { return acc + Math.round(Number(item?.OrderQty || 0)); }, 0); - console.log(salesBillEdit, currentOrderNetAmount, previousNetAmount, "previousNetAmount") + console.log( + salesBillEdit, + currentOrderNetAmount, + previousNetAmount, + 'previousNetAmount' + ); const [UpiOption, setUpiOption] = useState(''); const [BusinessPayOption, setBusinessPayoption] = useState([]); const [paymentSucess, setPaymentSuccess] = useState(false); @@ -507,7 +514,6 @@ const BSBilling7Payment = () => { }, [salesBillEdit]); useEffect(() => { - if (salesBillEdit) { if (SelCustId) { setRefundPayBtns(AllPaymentOptions); @@ -522,9 +528,7 @@ const BSBilling7Payment = () => { setRefundPayBtns(withoutCustomer); } } - - }, [AllPaymentOptions, SelCustId, salesBillEdit]) - + }, [AllPaymentOptions, SelCustId, salesBillEdit]); // Usage useEffect(() => { @@ -626,14 +630,21 @@ const BSBilling7Payment = () => { const filteredPayments = previousOrderPayment?.filter( - p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment + (p) => + p?.LastOrderTran === 'Y' && + p?.AfterAdjustment != null && + p?.AfterAdjustment !== '' && + p?.AfterAdjustment ) || []; const paymentsToUse = - filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || []; + filteredPayments.length > 0 + ? filteredPayments + : previousOrderPayment || []; const totalPreviouspayment = paymentsToUse?.reduce( - (acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0), + (acc, payment) => + acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0), 0 ); @@ -642,8 +653,7 @@ const BSBilling7Payment = () => { 0 ); - const previousNetAmount = - (totalPreviouspayment) || 0; + const previousNetAmount = totalPreviouspayment || 0; let withdiscTotal = Total - @@ -655,13 +665,34 @@ const BSBilling7Payment = () => { withdiscTotal >= 0 ? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2) : (Number(Total) + Number(globalTipAmount)).toFixed(2) - ) - console.log(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount, "totalPreviouspayment") + ); + console.log( + salesBillEdit + ? currentOrderNetAmount > previousNetAmount + ? currentOrderNetAmount - previousNetAmount + : 0 + : currentOrderNetAmount, + 'totalPreviouspayment' + ); - setTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount); + setTotalAmount( + salesBillEdit + ? currentOrderNetAmount > previousNetAmount + ? currentOrderNetAmount - previousNetAmount + : 0 + : currentOrderNetAmount + ); setCurrentOrderNetAmount(currentOrderNetAmount); setPreviousNetAmount(previousNetAmount); - dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount)); + dispatch( + changeSummeryTotalAmount( + salesBillEdit + ? currentOrderNetAmount > previousNetAmount + ? currentOrderNetAmount - previousNetAmount + : 0 + : currentOrderNetAmount + ) + ); dispatch(changeSummeryComboOfferAmount(withComboSum)); @@ -683,36 +714,36 @@ const BSBilling7Payment = () => { OtherServiceTicketClaim, Discount, ]); - useEffect(() => { - + useEffect(() => { const fetchPrinterMapping = async () => { try { - if (UserType !== 'Super Admin' && isMobile && MobileA4Print) { + if (UserType !== 'Super Admin' && isMobile && MobileA4Print) { const data = { CompId: CompId, BranchId: BranchId, AppId: AppId, UserId: UserId, }; - // && isMobile && MobileA4Print - const response = await dispatch(getPrinterMappingDetails(data)).unwrap(); + // && isMobile && MobileA4Print + const response = await dispatch( + getPrinterMappingDetails(data) + ).unwrap(); if (response?.data?.statusCode === 0) { - handlePrintMappingClick() - } - console.log(response, "printer mapping response"); + handlePrintMappingClick(); + } + console.log(response, 'printer mapping response'); } } catch (error) { - console.error("Error fetching printer mapping:", error); + console.error('Error fetching printer mapping:', error); } }; - + fetchPrinterMapping(); - }, []); - const handlePrintMappingClick = () => { - // setReprint1(true) - window.dispatchEvent(new Event('CLICK PRINTER MAPPING')); - }; + const handlePrintMappingClick = () => { + // setReprint1(true) + window.dispatchEvent(new Event('CLICK PRINTER MAPPING')); + }; useEffect(() => { if (CompId && BranchId && AppId) { if (holdCheckedSalesSetup) { @@ -834,7 +865,6 @@ const BSBilling7Payment = () => { : parseInt(value || 0); }; const getCustomerData = async () => { - await dispatch( getAddCustomerDetails({ CompId: CompId, @@ -895,7 +925,7 @@ const BSBilling7Payment = () => { const selectedStyle = stylesMap[ - printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle + printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle ]; if (selectedStyle) { @@ -904,8 +934,9 @@ const BSBilling7Payment = () => { async (orderDetail, index) => { await printDiv(`${selectedStyle}-${index}`, style); // Use unique IDs for each print if (orderDetail?.BookingTypeName !== 'Dine In') { - const groupedTokens = orderDetail?.productDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce( - (acc, item, idx) => { + const groupedTokens = orderDetail?.productDetails + ?.filter((data) => data?.EditTokenAvailable !== 'N') + ?.reduce((acc, item, idx) => { if (item.TokenAvailable === 'Y') { if (!item.CounterName) { // If CounterName is null or empty @@ -918,9 +949,7 @@ const BSBilling7Payment = () => { } } return acc; - }, - {} - ); + }, {}); // Iterate over grouped tokens and print them const tokensToPrint = Object.entries(groupedTokens).map( @@ -984,7 +1013,11 @@ const BSBilling7Payment = () => { const handleButtonClick = () => { if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) { UpiPayment(); - } else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) { + } else if ( + salesBillEdit && + currentOrderNetAmount < previousNetAmount && + !refundPaySelected + ) { setMessageType('warning'); setMessageData('Please Select Refund Payment Method'); return; @@ -1649,9 +1682,7 @@ const BSBilling7Payment = () => { let configdata = AllBookingType; let checkName = BookingTypeBoth ? 'DineIn,TakeAway' : BookingType; - let filterconfigdata = configdata?.find( - (a) => a?.ConfigName === checkName - ); + let filterconfigdata = configdata?.find((a) => a?.ConfigName === checkName); setSelectedBookingType(filterconfigdata?.ConfigId); }; const gettodaydate = () => { @@ -1725,7 +1756,7 @@ const BSBilling7Payment = () => { const handleRefundPaymentMode = (id, name) => { setRefundPaySelected(id); setRefundPaySelectedName(name); - } + }; const addUpiOption = async (id, name, UPIId) => { await dispatch(changeUpiIDprint(UPIId)); @@ -2114,15 +2145,15 @@ const BSBilling7Payment = () => { 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', @@ -2141,7 +2172,7 @@ const BSBilling7Payment = () => { SetCount: a.SetCount, ...(a?.DiscountValue && { DiscountValue: a.DiscountValue }), ...(a?.DiscountType && { DiscountType: a.DiscountType }), - ...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt }) + ...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt }), })); const NotSlectedTypeFind = temporderdetail?.find( (a) => a?.BookingType != SelectedBookingType @@ -2216,7 +2247,7 @@ const BSBilling7Payment = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', OrderDtlDetails: @@ -2233,85 +2264,113 @@ const BSBilling7Payment = () => { ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map((item) => ({ - ...item, - TipsAmount: globalTipAmount, - })) + ...item, + TipsAmount: globalTipAmount, + })) : null, SalesPaymentType: 'normal', PaymentDetail: [ { - PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected : - Paybtnnameselected?.toLowerCase() === 'upi' - ? SelectedUPIPayOption?.toLowerCase() === 'pd' - ? PaymentDeviceUPI?.[0]?.ModeId - : SelectedUPIPayOption?.toLowerCase() === 'pg' - ? PaymentgatewayUPI?.[0]?.ModeId - : SelectedUPIPayOption?.toLowerCase() === 'business' - ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.ModeId - : paybtnselected - : paybtnselected - ? paybtnselected - : null, - Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount), - MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null : - Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'business' - ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantId - : null, - PaymentOptionType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' : - Paybtnnameselected?.toLowerCase() === 'cash' - ? 'PC' - : Paybtnnameselected?.toLowerCase() === 'credit' - ? 'PC' - : Paybtnnameselected?.toLowerCase() === 'card' - ? SelectedCardOption - : Paybtnnameselected?.toLowerCase() === 'upi' - ? SelectedUPIPayOption?.toLowerCase() === 'default' - ? 'PC' - : SelectedUPIPayOption?.toLowerCase() === 'business' - ? 'BU' - : SelectedUPIPayOption - : null, - ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null : - SelectedUPIPayOption?.toLowerCase() === 'default' - ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) - ?.UPIDetailId - : SelectedUPIPayOption?.toLowerCase() === 'business' + PaymentType: + salesBillEdit && currentOrderNetAmount < previousNetAmount + ? refundPaySelected + : Paybtnnameselected?.toLowerCase() === 'upi' + ? SelectedUPIPayOption?.toLowerCase() === 'pd' + ? PaymentDeviceUPI?.[0]?.ModeId + : SelectedUPIPayOption?.toLowerCase() === 'pg' + ? PaymentgatewayUPI?.[0]?.ModeId + : SelectedUPIPayOption?.toLowerCase() === 'business' + ? BusinessPayOption?.find( + (busupi) => busupi?.ModeId === UpiId + )?.ModeId + : paybtnselected + : paybtnselected + ? paybtnselected + : null, + Amount: + salesBillEdit && currentOrderNetAmount < previousNetAmount + ? previousNetAmount - currentOrderNetAmount + : Math.round(TotalAmount), + MerchantId: + salesBillEdit && currentOrderNetAmount < previousNetAmount + ? null + : Paybtnnameselected?.toLowerCase() === 'upi' && + SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantUPIId + ?.MerchantId : null, - AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] : - Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' - ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( - (upipay) => upipay?.UPIId === UpiId - ) - : (Paybtnnameselected?.toLowerCase() === 'upi' && - 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') - ? useOptions?.[0]?.PaymentDetails?.PaymentGateway - : [], - PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' : - Paybtnnameselected?.toLowerCase() === 'cash' - ? 'S' - : Paybtnnameselected?.toLowerCase() === 'credit' - ? 'S' - : Paybtnnameselected?.toLowerCase() === 'upi' && + PaymentOptionType: + salesBillEdit && + currentOrderNetAmount < previousNetAmount && + (refundPaySelectedName?.toLowerCase() === 'cash' || + refundPaySelectedName?.toLowerCase() === 'credit') + ? 'PC' + : Paybtnnameselected?.toLowerCase() === 'cash' + ? 'PC' + : Paybtnnameselected?.toLowerCase() === 'credit' + ? 'PC' + : Paybtnnameselected?.toLowerCase() === 'card' + ? SelectedCardOption + : Paybtnnameselected?.toLowerCase() === 'upi' + ? SelectedUPIPayOption?.toLowerCase() === 'default' + ? 'PC' + : SelectedUPIPayOption?.toLowerCase() === 'business' + ? 'BU' + : SelectedUPIPayOption + : null, + ModeOfPayment: + salesBillEdit && currentOrderNetAmount < previousNetAmount + ? null + : SelectedUPIPayOption?.toLowerCase() === 'default' + ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) + ?.UPIDetailId + : SelectedUPIPayOption?.toLowerCase() === 'business' + ? BusinessPayOption?.find( + (busupi) => busupi?.ModeId === UpiId + )?.MerchantUPIId + : null, + AccountDtl: + salesBillEdit && currentOrderNetAmount < previousNetAmount + ? [] + : Paybtnnameselected?.toLowerCase() === 'upi' && SelectedUPIPayOption?.toLowerCase() === 'default' + ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( + (upipay) => upipay?.UPIId === UpiId + ) + : (Paybtnnameselected?.toLowerCase() === 'upi' && + 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') + ? useOptions?.[0]?.PaymentDetails?.PaymentGateway + : [], + PaymentStatus: + salesBillEdit && currentOrderNetAmount < previousNetAmount + ? 'S' + : Paybtnnameselected?.toLowerCase() === 'cash' + ? 'S' + : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' - : 'P', - Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0, - Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && Paybtnnameselected?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 : - Paybtnnameselected?.toLowerCase() === 'credit' + : Paybtnnameselected?.toLowerCase() === 'upi' && + SelectedUPIPayOption?.toLowerCase() === 'default' + ? 'S' + : 'P', + Debit: + salesBillEdit && + currentOrderNetAmount < previousNetAmount && + refundPaySelectedName?.toLowerCase() === 'credit' + ? Math.round(previousNetAmount - currentOrderNetAmount) + : 0, + Credit: salesBillEdit + ? currentOrderNetAmount > previousNetAmount && + Paybtnnameselected?.toLowerCase() === 'credit' + ? Math.round(TotalAmount) + : 0 + : Paybtnnameselected?.toLowerCase() === 'credit' ? Math.round(TotalAmount) : 0, }, @@ -2380,14 +2439,14 @@ const BSBilling7Payment = () => { 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]); @@ -2545,14 +2604,14 @@ const BSBilling7Payment = () => { 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]); @@ -2659,14 +2718,14 @@ const BSBilling7Payment = () => { } 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]); @@ -2841,14 +2900,14 @@ const BSBilling7Payment = () => { 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]); @@ -2867,7 +2926,7 @@ const BSBilling7Payment = () => { if ( Date.now() - startTime > useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * - 60000 + 60000 ) { // 60,000 ms = 1 minute @@ -3509,884 +3568,909 @@ const BSBilling7Payment = () => {
{screenwidth <= 768 && ( -
- {Array.isArray(OrderCardDetail) && OrderCardDetail?.length >= 1 && ( - - )} -
- )} - {screenwidth <= 768 && ( -
- {Array.isArray(OrderCardDetail) && OrderCardDetail?.length >= 1 && ( -
- {responsiveBill ? ( +
+
+ {Array.isArray(OrderCardDetail) && + OrderCardDetail?.length >= 1 && ( + + )} +
+ +
+ {Array.isArray(OrderCardDetail) && + OrderCardDetail?.length >= 1 && (
- {' '} - {' '} -
- ) : ( -
- {' '} - {' '} + {responsiveBill ? ( +
+ {' '} + {' '} +
+ ) : ( +
+ {' '} + {' '} +
+ )}
)} -
- )} -
- )} - {/* {Array.isArray(OrderCardDetail) && OrderCardDetail?.length >= 1 && ( - - {" "} - - - )} */} -
- -
-
- {tableOptions - ?.filter((item) => item.OptionName === 'AddCustomer') - ?.map((filteredItem) => ( - -
- - - - {' '} - - -
-
- ))}
-
- {(addcustomer || hold) && ( - - )} - {creditCustomerOpen && ( - - )} - {tableOptions?.filter((item) => item.OptionName === 'AddCustomer') - .length === 1 || navCust === true ? ( -
- {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' - ) - ) - ) && - !OtherServicesglobal && ( - - - {' '} - 0 && 'not-allowed', - color: - OrderCardDetail?.length > 0 || - (selOption?.value === undefined && - GlobalAddCustomerDetails1?.length === 0 && - GetCustId?.CustMobile === undefined) - ? 'gray' - : 'rgb(18, 146, 238)', - fontSize: '28px', - }} - /> - - - )} -
- ) : ( - '' - )} - - {/* Customer Orders */} - {(SelCustId && tableOptions?.filter((item) => item.OptionName === 'PreviousBillFetch') - .length === 1) && ( - - {' '} -
{ - 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 && dinePreference && ( -
+ )} +
+
+ +
+
{tableOptions - .filter((item) => item.OptionName === 'UnpaidBill') - .map((filteredItem) => ( + ?.filter((item) => item.OptionName === 'AddCustomer') + ?.map((filteredItem) => ( - {!OtherServicesglobal && ( +
+ + {' '} - { - (setUnpaidOpen(true), getUnpaiddatas()); + fontSize: '25px', + color: + selOption || GetCustId ? '#52c41a' : '#1292EE', + cursor: Custdisable ? 'not-allowed' : 'pointer', }} /> - )} +
))}
- )} - {paybtns?.length > 1 && ( +
+
+ {(addcustomer || hold) && ( + + )} + {creditCustomerOpen && ( + + )} + {tableOptions?.filter((item) => item.OptionName === 'AddCustomer') + .length === 1 || navCust === true ? ( +
+ {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' + ) + ) + ) && + !OtherServicesglobal && ( + + + {' '} + 0 && 'not-allowed', + color: + OrderCardDetail?.length > 0 || + (selOption?.value === undefined && + GlobalAddCustomerDetails1?.length === 0 && + GetCustId?.CustMobile === undefined) + ? 'gray' + : 'rgb(18, 146, 238)', + fontSize: '28px', + }} + /> + + + )} +
+ ) : ( + '' + )} + + {/* Customer Orders */} + {SelCustId && + tableOptions?.filter( + (item) => item.OptionName === 'PreviousBillFetch' + ).length === 1 && ( + + {' '} +
{ + 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 && dinePreference && ( +
+ {tableOptions + .filter((item) => item.OptionName === 'UnpaidBill') + .map((filteredItem) => ( + + {!OtherServicesglobal && ( + + {' '} + { + (setUnpaidOpen(true), getUnpaiddatas()); + }} + /> + + )} + + ))} +
+ )} + {paybtns?.length > 1 && ( +
0) && + !unpaidFlow && + OrderStatus + ? 'none' + : 'auto', + opacity: + (BookingType === 'Dine In' || + BookingTypeBoth || + CheckOrderType?.length > 0) && + !unpaidFlow && + OrderStatus + ? 0.5 + : 1, + width: '2rem', + }} + > + {!OtherServicesglobal && ( + + {' '} +
+ +
+
+ )} +
+ )} + {OtherServicesglobal && OrderCardDetail.length >= 1 && ( + + {' '} +
+ +
+
+ )} + {dinePreference && ( +
+ {(BookingType === 'Dine In' || + BookingTypeBoth || + CheckOrderType?.length > 0) && + !unpaidFlow && + SelectedTableDetails?.length !== 0 && ( + <> + + {' '} + + FirstPaymentclick === false && !addnewAccess + ? changeOrderStatus() + : '' + } + /> + + {FirstPaymentclick === false && + !addnewAccess && + !OrderStatus && } + + )} +
+ )} + {!OtherServicesglobal && ( +
+ {tableOptions?.map((item) => ( + <> + {unpaidFlow == false + ? item?.OptionName == 'Hold' && + BookingType !== 'Dine In' && + !BookingTypeBoth && + OrderCardDetail?.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' && + paybtns?.length > 0 && + !addnewAccess && + !OtherServicesglobal && ( + + {' '} + + HandleholdModelOpen()} + style={{ + fontSize: '28px', + cursor: 'pointer', + color: Holddata ? '#52c41a' : 'default', + pointerEvents: + OrderType === 'Failed' ? 'none' : 'auto', + }} + /> + + + ) + : ''} + + ))} +
+ )}
+
+ +
0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, - width: '2rem', }} > - {!OtherServicesglobal && ( - - {' '} -
- + {paybtns?.length > 0 && + currentOrderNetAmount >= previousNetAmount ? ( + paybtns?.map((payment) => ( +
+
- + )) + ) : currentOrderNetAmount < previousNetAmount && + salesBillEdit && + refundPayBtns.length > 0 ? ( + refundPayBtns.map((payment) => ( +
+ +
+ )) + ) : ( +
+ Please Set Payment Options +
)}
- )} - {OtherServicesglobal && OrderCardDetail.length >= 1 && ( - - {' '} -
- -
-
- )} - {dinePreference && ( -
- {(BookingType === 'Dine In' || - BookingTypeBoth || - CheckOrderType?.length > 0) && - !unpaidFlow && - SelectedTableDetails?.length !== 0 && ( - <> - - {' '} - - FirstPaymentclick === false && !addnewAccess - ? changeOrderStatus() - : '' - } - /> - - {FirstPaymentclick === false && - !addnewAccess && - !OrderStatus && } - + + {PrintOrderDetails?.length > 0 && ( +
+ {filteredSettingNames?.includes('whatsapp') && + MobileNoWhatsApp?.value && ( + )} -
- )} - {!OtherServicesglobal && ( -
- {tableOptions?.map((item) => ( - <> - {unpaidFlow == false - ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - OrderCardDetail?.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' && - paybtns?.length > 0 && - !addnewAccess && - !OtherServicesglobal && ( - - {' '} - - HandleholdModelOpen()} - style={{ - fontSize: '28px', - cursor: 'pointer', - color: Holddata ? '#52c41a' : 'default', - pointerEvents: - OrderType === 'Failed' ? 'none' : 'auto', - }} - /> - - - ) - : ''} - - ))} -
- )} -
-
- -
0) && - !unpaidFlow && - OrderStatus - ? 'none' - : 'auto', - opacity: - (BookingType === 'Dine In' || - BookingTypeBoth || - CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus - ? 0.5 - : 1, - }} - > - {paybtns?.length > 0 && (currentOrderNetAmount >= previousNetAmount) ? ( - paybtns?.map((payment) => ( -
- -
- )) - ) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? ( - refundPayBtns.map((payment) => ( -
- -
- )) - ) : ( -
- Please Set Payment Options -
- )} -
-
- {PrintOrderDetails?.length > 0 && ( -
- {filteredSettingNames?.includes('whatsapp') && - MobileNoWhatsApp?.value && ( - + + {filteredSettingNames?.includes('SMS') && isMobile && ( + + )} + {/* WhatsAppShare modal/component */} + {showWhatsAppShare && ( + closePrintOption(false)} + /> + )} + {showSMSShare && isMobile && ( + closePrintOption(false)} /> )} - - - - {filteredSettingNames?.includes('SMS') && isMobile && ( - - )} - {/* WhatsAppShare modal/component */} - {showWhatsAppShare && ( - closePrintOption(false)} - /> - )} - {showSMSShare && isMobile && ( - closePrintOption(false)} - /> - )} -
- )} -
- - {/* {(selectCustomerDisplay === true || paymentModeDisplay === true) && ( -
- )} */} - -
-
-
-
- - - - - - - - - - -
- Items: - - {TotalItems} -
- Qty: - - {Qty} -
-
- {!OtherServicesglobal && - OrderCardDetail?.length > 0 && - ParkingDisplay && ( -
- -
- )} -
- {' '} - {!OtherServicesglobal && unpaidFlow == true ? ( - - {' '} - { - Recipt(); - }} - /> - - ) : ( - '' - )} -
+ )} +
-
- - - - - {/* +
+
+
+
+ + + + + + + + + + +
+ Items: + + {TotalItems} +
+ Qty: + + {Qty} +
+
+
+ {!OtherServicesglobal && + OrderCardDetail?.length > 0 && + ParkingDisplay && ( +
+ +
+ )} +
+ {' '} + {!OtherServicesglobal && unpaidFlow == true ? ( + + {' '} + { + Recipt(); + }} + /> + + ) : ( + '' + )} +
+ +
+ + + + + {/* {" "} */} - - - } - trigger="click" - // width={1000} - open={open} - onOpenChange={handleOpenChange} - > - - + + + } + trigger="click" + // width={1000} + open={open} + onOpenChange={handleOpenChange} + > + + +
- -
-
-
- -
- - ) : ( -
ORDER
- )} - - -
- {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'); - }} - /> +
+ +
+
+ + ) + ) : ( +
ORDER
+ )} + +
- )} + {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'); + }} + /> +
+ )} +
@@ -4494,9 +4578,9 @@ const BSBilling7Payment = () => { 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 ( @@ -4588,8 +4672,8 @@ const BSBilling7Payment = () => { columns={columns} data={TableData} dataSource={TableData} - // pagination={handlePageChange} - // onChange={handleChange} + // pagination={handlePageChange} + // onChange={handleChange} />
} @@ -4616,10 +4700,17 @@ const BSBilling7Payment = () => { SplitPaymentModal={Splitpayment} handlesplitpaymentclose={handlesplitpaymentclose} TotalNetAmount={ - OrderType === 'Failed' ? FailedTotalAmt : Math.round(OrderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) - - ((OverAllSales > 0 ? OverAllSales : 0) + - (OverAllEstimate > 0 ? OverAllEstimate : 0) + - (Discount > 0 ? Discount : 0))) + OrderType === 'Failed' + ? FailedTotalAmt + : Math.round( + OrderCardDetail?.reduce( + (acc, data) => data?.TotalAmt + acc, + 0 + ) - + ((OverAllSales > 0 ? OverAllSales : 0) + + (OverAllEstimate > 0 ? OverAllEstimate : 0) + + (Discount > 0 ? Discount : 0)) + ) } failedOrderData={failedOrderData} /> @@ -4697,9 +4788,9 @@ const BSBilling7Payment = () => { 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 ( diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBillingTable7.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBillingTable7.jsx index 634155e..8727990 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBillingTable7.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBillingTable7.jsx @@ -1,4 +1,4 @@ -import React, { lazy, Suspense, useEffect, useState } from 'react'; +import React, { lazy, useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBillingTable7.scss'; import { @@ -71,7 +71,6 @@ const CustomerPriceHistory = lazy( () => import('../../UtillComponents/CustomerPriceHistory.jsx') ); import { useUtilsComponent } from '../../../../../Services/utils.js'; -import BillingTableSkeleton from '../../../../../Components/Skeleton/BillingTableSkeleton.jsx'; const BSBillingTable7 = () => { const { removeExtraCharge } = useUtilsComponent(); @@ -140,16 +139,16 @@ const BSBillingTable7 = () => { OrderType === 'Hold' ? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway') : tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId - ); + (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId + ); const OldtableDataDinein = tableData?.filter( (a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId ); const OldtableDataTakeAway = OrderType != 'Hold' ? tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId - ) + (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId + ) : []; const productBasedExtraCharges = GlobalExtraCharge.filter( (obj) => 'ProdName' in obj @@ -947,9 +946,9 @@ const BSBillingTable7 = () => { )?.map((item, idx) => idx === 0 ? { - ...item, - FreeQty, - } + ...item, + FreeQty, + } : item ), }; @@ -1912,1256 +1911,1260 @@ const BSBillingTable7 = () => { }; return ( - }> - <> -
-
- {editField && ( -
- - -
- )} - {deleteField && ( -
- - -
- )} -
+ <> +
+
+ {editField && ( +
+ + +
+ )} + {deleteField && ( +
+ + +
+ )} +
-
- - - - {tableOptions?.map((item) => ( - <> - {item.OptionName == 'Sl.No' && BookingTypeBoth && ( - - )} - {item.OptionName == 'Sl.No' && ( - - )} +
+
- {!isMobile ? ( - {''} - ) : ( -
{''}
- )} -
- {!isMobile ? ( - Sl.No - ) : ( -
Sl.No
- )} -
+ + + {tableOptions?.map((item) => ( + <> + {item.OptionName == 'Sl.No' && BookingTypeBoth && ( + + )} + {item.OptionName == 'Sl.No' && ( + + )} - {item.OptionName == 'Item' && ( - - )} - {item.OptionName == 'MRP' && ( - - )} - {item.OptionName == 'Discount' && ( - - )} - {item.OptionName == 'Quantity' && ( - - )} - {item.OptionName == 'Rate' && ( - - )} - {item.OptionName == 'Amount' && ( - - )} - - ))} - - - {/* For Reorder TakeWay */} - {OldtableDataTakeAway?.length > 0 && ( - - {OldtableDataTakeAway?.map((item, index) => ( - + {!isMobile ? ( + Item + ) : ( +
Item
+ )} + + )} + {item.OptionName == 'MRP' && ( + + )} + {item.OptionName == 'Discount' && ( + + )} + {item.OptionName == 'Quantity' && ( + + )} + {item.OptionName == 'Rate' && ( + + )} + {item.OptionName == 'Amount' && ( + + )} + + ))} + + + {/* For Reorder TakeWay */} + {OldtableDataTakeAway?.length > 0 && ( + + {OldtableDataTakeAway?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : triggerAnimation && + ? 'wheat' + : triggerAnimation && index === 0 && tableDataTakeAway?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - item?.SalesId && OrderType !== 'Hold' - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + item?.SalesId && OrderType !== 'Hold' + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : index % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - key={index} - onClick={ - editdelete === 'Edit' - ? () => handleEditQuantity(item) - : editdelete === 'Delete' - ? () => removeFromCart(item) - : () => { } - } - // onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""} + ? '#b2d1f7' + : index % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + key={index} + onClick={ + editdelete === 'Edit' + ? () => handleEditQuantity(item) + : editdelete === 'Delete' + ? () => removeFromCart(item) + : () => {} + } + // onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""} - className={`${item?.SalesId && OrderType !== 'Hold' - ? 'BSBill-Table7-content-disabled' - : 'BSBill-Table7-content' - } + className={`${ + item?.SalesId && OrderType !== 'Hold' + ? 'BSBill-Table7-content-disabled' + : 'BSBill-Table7-content' + } `} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} - - ))} - - ))} - - )} - {/* Reorder DineIn */} - {OldtableDataDinein?.length > 0 && ( - - {OldtableDataDinein?.map((item, index) => ( - + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} + + ))} + + ))} + + )} + {/* Reorder DineIn */} + {OldtableDataDinein?.length > 0 && ( + + {OldtableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && + ? 'wheat' + : BookingType !== 'Dine In' && triggerAnimation && OldtableDataTakeAway?.length + index === 0 && - tableDataDinein?.length >= - PreviousdataLength && + tableDataDinein?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + index) % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - key={OldtableDataTakeAway?.length + index} - onClick={ - editdelete === 'Edit' - ? () => handleEditQuantity(item) - : editdelete === 'Delete' - ? () => removeFromCart(item) - : () => { } - } - // onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""} + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + index) % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + key={OldtableDataTakeAway?.length + index} + onClick={ + editdelete === 'Edit' + ? () => handleEditQuantity(item) + : editdelete === 'Delete' + ? () => removeFromCart(item) + : () => {} + } + // onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""} - className={`${item?.SalesId - ? 'BSBill-Table7-content-disabled' - : 'BSBill-Table7-content' - } + className={`${ + item?.SalesId + ? 'BSBill-Table7-content-disabled' + : 'BSBill-Table7-content' + } `} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} - - ))} - - ))} - - )} - {/* TakeWay */} - {tableDataTakeAway?.length > 0 && ( - - {tableDataTakeAway?.map((item, index) => ( - + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} + + ))} + + ))} + + )} + {/* TakeWay */} + {tableDataTakeAway?.length > 0 && ( + + {tableDataTakeAway?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && tableDataTakeAway?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + ? 'wheat' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.[ + 'OverallBackgroundColor' ] - : '#d6d6d6' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + : '#d6d6d6' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + background: + BookingType === 'Dine In' && item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) + ? '#b2d1f7' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] : '#d6d6d6', - background: - BookingType === 'Dine In' && item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) - ? '#b2d1f7' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataDinein?.length + + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - key={ - OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index - } - onClick={ - editdelete === 'Edit' - ? () => + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + key={ + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index + } + onClick={ + editdelete === 'Edit' + ? () => item.Type == 'P' || item.Type == 'C' ? handleEditQuantity(item) : item.ServiceType == 'G' ? handleEditQuantity(item) : '' - : editdelete === 'Delete' - ? () => removeFromCart(item) - : () => { } - } - // onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""} + : editdelete === 'Delete' + ? () => removeFromCart(item) + : () => {} + } + // onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""} - className={`${BookingType === 'Dine In' && item?.SalesId - ? 'BSBill-Table7-content-disabled' - : 'BSBill-Table7-content' - } + className={`${ + BookingType === 'Dine In' && item?.SalesId + ? 'BSBill-Table7-content-disabled' + : 'BSBill-Table7-content' + } `} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} - - ))} - - ))} - - )} - {/* DineIn */} - {tableDataDinein?.length > 0 && ( - - {tableDataDinein?.map((item, index) => ( - + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} + + ))} + + ))} + + )} + {/* DineIn */} + {tableDataDinein?.length > 0 && ( + + {tableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && - tableDataDinein?.length >= - PreviousdataLength && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && + tableDataDinein?.length >= PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - BookingType === 'Dine In' && - item?.SalesId && - !BookingTypeBoth - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + BookingType === 'Dine In' && + item?.SalesId && + !BookingTypeBoth + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index) % - 2 === + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - key={ - OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index - } - onClick={ - editdelete === 'Edit' - ? () => handleEditQuantity(item) - : editdelete === 'Delete' - ? () => removeFromCart(item) - : () => { } - } - // onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""} + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + key={ + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index + } + onClick={ + editdelete === 'Edit' + ? () => handleEditQuantity(item) + : editdelete === 'Delete' + ? () => removeFromCart(item) + : () => {} + } + // onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""} - className={`${BookingType === 'Dine In' && item?.SalesId - ? 'BSBill-Table7-content-disabled' - : 'BSBill-Table7-content' - } + className={`${ + BookingType === 'Dine In' && item?.SalesId + ? 'BSBill-Table7-content-disabled' + : 'BSBill-Table7-content' + } `} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - + )} + {tableitem.OptionName == 'Item' && ( + - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} - - ))} - - ))} - - )} -
+ {!isMobile ? ( + {''} + ) : ( +
{''}
+ )} +
+ {!isMobile ? ( + Sl.No + ) : ( +
Sl.No
+ )} +
- {!isMobile ? ( - Item - ) : ( -
Item
- )} -
- {!isMobile ? ( - MRP - ) : ( -
MRP
- )} -
- {!isMobile ? ( - ₹/% - ) : ( -
₹/%
- )} -
0? OpenEditTotalAmount :""} - onClick={() => { - if (tableData?.length > 0) { - OpenEditTotalAmount(); - } - }} - > - {!isMobile ? ( - Qty - ) : ( -
Qty
- )} -
- {!isMobile ? ( - Rt - ) : ( -
Rt
- )} -
- {!isMobile ? ( - Amt - ) : ( -
Amt
- )} -
+ {!isMobile ? ( + MRP + ) : ( +
MRP
+ )} +
+ {!isMobile ? ( + ₹/% + ) : ( +
₹/%
+ )} +
0? OpenEditTotalAmount :""} + onClick={() => { + if (tableData?.length > 0) { + OpenEditTotalAmount(); + } + }} + > + {!isMobile ? ( + Qty + ) : ( +
Qty
+ )} +
+ {!isMobile ? ( + Rt + ) : ( +
Rt
+ )} +
+ {!isMobile ? ( + Amt + ) : ( +
Amt
+ )} +
- - - {index + 1} + - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0) && - handleImeiDetails(item) - } - > - {item?.ProdName} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.UomName} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+ {index + 1} +
+ (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0) && + handleImeiDetails(item) + } + > + {item?.ProdName} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
- {item?.MRP} - - {item?.Type != 'C' + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} +
+ {item?.MRP} + + {item?.Type != 'C' ? item.Offer && item.Offer > 0 ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' + : item.DiscountAmt + ? item.DiscountAmt + : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - - {item?.OrderQty} - - {item?.OrderRate} - { - e.stopPropagation(); - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - style={{ fontFamily: 'Poppins' }} - > - {safeRound(item?.TotalAmt)} -
+ {item?.OrderQty} + + {item?.OrderRate} + { + e.stopPropagation(); + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + style={{ fontFamily: 'Poppins' }} + > + {safeRound(item?.TotalAmt)} +
- - - {OldtableDataTakeAway?.length + index + 1} + - {item?.ProdName} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.UomName} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+ {OldtableDataTakeAway?.length + index + 1} +
+ {item?.ProdName} + + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
- {item?.MRP} - - {item?.Type != 'C' + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} +
+ {item?.MRP} + + {item?.Type != 'C' ? item.Offer && item.Offer > 0 ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' + : item.DiscountAmt + ? item.DiscountAmt + : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - - {item?.OrderQty} - - {item?.OrderRate} - { - e.stopPropagation(); - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - style={{ fontFamily: 'Poppins' }} - > - {safeRound(item?.TotalAmt)} -
+ {item?.OrderQty} + + {item?.OrderRate} + { + e.stopPropagation(); + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + style={{ fontFamily: 'Poppins' }} + > + {safeRound(item?.TotalAmt)} +
- - - {OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index + - 1} + - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 || imeiModal) && - handleImeiDetails(item) - } - > - {item?.Type !== 'OS' - ? item.ProdName - : item.ServiceName} - {item?.Type != 'C' && ( - <> -

- {' '} - {item?.Type !== 'OS' && ( - <> - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && ( - {item?.ProdVariantName} - )} - {item?.Size} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.UomName} - - )} -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+ {OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index + + 1} +
+ (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || + imeiModal) && + handleImeiDetails(item) + } + > + {item?.Type !== 'OS' + ? item.ProdName + : item.ServiceName} + + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + {' '} + {item?.Type !== 'OS' && ( + <> + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.UomName} + + )} +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
- {item?.MRP} - - {item?.Type != 'C' + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} +
+ {item?.MRP} + + {item?.Type != 'C' ? item.Offer && item.Offer > 0 ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' + : item.DiscountAmt + ? item.DiscountAmt + : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - - {item?.OrderQty} - - {safeRound(item?.OrderRate)} - { - e.stopPropagation(); - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - style={{ fontFamily: 'Poppins' }} - > - {item?.TotalAmt} -
+ {item?.OrderQty} + + {safeRound(item?.OrderRate)} + { + e.stopPropagation(); + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + style={{ fontFamily: 'Poppins' }} + > + {item?.TotalAmt} +
- - - {OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index + - 1} + - {item?.ProdName} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && {item?.ProdVariantName} } - {item?.Size} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.UomName} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+ {OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index + + 1} +
+ {item?.ProdName} + + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size} {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {item?.Size} + {item?.SinglePc == 'Y' ? 'PCS' : item?.UomName}) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
- {item?.MRP} - - {item?.Type != 'C' + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size} {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} +
+ {item?.MRP} + + {item?.Type != 'C' ? item.Offer && item.Offer > 0 ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' + : item.DiscountAmt + ? item.DiscountAmt + : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - - {item?.OrderQty} - - {item?.OrderRate} - { - e.stopPropagation(); - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - style={{ fontFamily: 'Poppins' }} - > - {safeRound(item?.TotalAmt)} -
- {OpenEditTotalAmt && ( - + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + + )} + {tableitem.OptionName == 'Quantity' && ( + + {item?.OrderQty} + + )} + {tableitem.OptionName == 'Rate' && ( + + {item?.OrderRate} + + )} + {tableitem.OptionName == 'Amount' && ( + { + e.stopPropagation(); + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + style={{ fontFamily: 'Poppins' }} + > + {safeRound(item?.TotalAmt)} + + )} + + ))} + + ))} + )} -
- {EditQuantity && ( - + {OpenEditTotalAmt && ( + )} - {OpenImeiDetail && ( - - )} - {customerPriceHistoryOpen && GetCustId && ( - - )} - -
+
+ {EditQuantity && ( + + )} + {OpenImeiDetail && ( + + )} + {customerPriceHistoryOpen && GetCustId && ( + + )} + ); }; diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/StandardTable/StandardTable.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/StandardTable/StandardTable.jsx index d0cb10d..f6e57b5 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/StandardTable/StandardTable.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/StandardTable/StandardTable.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState, lazy, Suspense } from 'react'; +import { useEffect, useState, lazy } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { Popconfirm, Tooltip } from 'antd'; import WebFont from 'webfontloader'; @@ -93,7 +93,6 @@ import { import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js'; import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js'; import { useUtilsComponent } from '../../../../../Services/utils.js'; -import BillingTableSkeleton from '../../../../../Components/Skeleton/BillingTableSkeleton.jsx'; const StandardTable = () => { const { removeExtraCharge } = useUtilsComponent(); @@ -166,8 +165,8 @@ const StandardTable = () => { OrderType === 'Hold' ? OrderCardDetail?.filter((a, b) => a.BookingTypeName === 'TakeAway') : OrderCardDetail?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId - ); + (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId + ); console.log('HoldOrderDtl', OrderCardDetail); const OldtableDataDinein = OrderCardDetail?.filter( (a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId @@ -175,8 +174,8 @@ const StandardTable = () => { const OldtableDataTakeAway = OrderType != 'Hold' ? OrderCardDetail?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId - ) + (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId + ) : []; const [EditQuantity, setEditQuantity] = useState(false); @@ -309,9 +308,9 @@ const StandardTable = () => { AppId: AppId, ...(AvailableDate && selectedDate ? { - fromDate: selectedDate?.[0], - toDate: selectedDate?.[1], - } + fromDate: selectedDate?.[0], + toDate: selectedDate?.[1], + } : {}), }; await dispatch(getSelectedFavItems(data)).unwrap(); @@ -323,9 +322,9 @@ const StandardTable = () => { ProdSubCat: ProdSubCat, ...(AvailableDate && selectedDate ? { - fromDate: selectedDate?.[0], - toDate: selectedDate?.[1], - } + fromDate: selectedDate?.[0], + toDate: selectedDate?.[1], + } : {}), }; @@ -336,9 +335,9 @@ const StandardTable = () => { prodCat: prodCat, ...(AvailableDate && selectedDate ? { - fromDate: selectedDate?.[0], - toDate: selectedDate?.[1], - } + fromDate: selectedDate?.[0], + toDate: selectedDate?.[1], + } : {}), }; @@ -1138,9 +1137,9 @@ const StandardTable = () => { )?.map((item, idx) => idx === 0 ? { - ...item, - FreeQty, - } + ...item, + FreeQty, + } : item ), }; @@ -1244,7 +1243,7 @@ const StandardTable = () => { InwardDtlId: isPaidproduct?.InwardDtlId, BuyInwardDtlId: null, Offer: 0, - localid: isPaidproduct?.localid + localid: isPaidproduct?.localid, }); } else if (isPaidproduct?.OrderQty > item?.OrderQty) { // Just Decrease Paid Qty @@ -1418,7 +1417,7 @@ const StandardTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - localid: item?.localid + localid: item?.localid, }); await ChangeFreeprodlistFn({ OverAllFreeQty: isCheckFreeProduct?.OverAllFreeQty, @@ -1498,7 +1497,7 @@ const StandardTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - localid: item?.localid + localid: item?.localid, }); await ChangeFreeprodlistFn({ OverAllFreeQty: isCheckFreeProduct?.OverAllFreeQty, @@ -2123,248 +2122,233 @@ const StandardTable = () => { const isAndroid = /Android/i.test(navigator.userAgent); return ( - }> +
-
-
-
-
Shopping Cart
-

{OrderCardDetail?.length} items

-
-
-
- {window.innerWidth <= 768 ? ( - mobileTableVisible ? ( - <> - Close - - ) : ( - <> - Show - - ) +
+
+
Shopping Cart
+

{OrderCardDetail?.length} items

+
+
+
+ {window.innerWidth <= 768 ? ( + mobileTableVisible ? ( + <> + Close + ) : ( <> Show - )} -
+ ) + ) : ( + <> + Show + + )}
+
- - - - {tableOptions?.map((item) => ( - <> - {item.OptionName == 'Sl.No' && BookingTypeBoth && ( - - )} - {item.OptionName == 'Sl.No' && ( - - )} - {item.OptionName == 'Item' && ( - - )} - {item.OptionName == 'MRP' && ( - - )} - {item.OptionName == 'Discount' && ( - - )} - {item.OptionName == 'Quantity' && ( - - )} - {item.OptionName == 'Rate' && ( - - )} - {item.OptionName == 'Amount' && ( - - )} +
- {!isMobile ? ( - {''} - ) : ( -
{''}
- )} -
- {!isMobile ? ( - Sl.No - ) : ( -
- Sl.No -
- )} -
- {!isMobile ? ( - Item - ) : ( -
Item
- )} -
- {!isMobile ? ( - MRP - ) : ( -
MRP
- )} -
- {!isMobile ? ( - ₹/% - ) : ( -
₹/%
- )} -
0 ? OpenEditTotalAmount : ""} - onClick={() => { - if (OrderCardDetail?.length > 0) { - OpenEditTotalAmount(); - } - }} - > - {!isMobile ? ( - Qty - ) : ( -
Qty
- )} -
- {!isMobile ? ( - Rt - ) : ( -
Rt
- )} -
- {!isMobile ? ( - Amt - ) : ( -
Amt
- )} -
+ + + {tableOptions?.map((item) => ( + <> + {item.OptionName == 'Sl.No' && BookingTypeBoth && ( + + )} + {item.OptionName == 'Sl.No' && ( + + )} + {item.OptionName == 'Item' && ( + + )} + {item.OptionName == 'MRP' && ( + + )} + {item.OptionName == 'Discount' && ( + + )} + {item.OptionName == 'Quantity' && ( + + )} + {item.OptionName == 'Rate' && ( + + )} + {item.OptionName == 'Amount' && ( + + )} - {item.OptionName == 'Delete' && ( - - )} - - ))} - - + + ) : ( +
+ {!isMobile ? ( + + + + ) : ( +
+ {' '} + {' '} +
+ )} +
+ )} + + )} + + ))} + + - {/* For Reorder TakeWay */} - {OldtableDataTakeAway?.length > 0 && ( - - {OldtableDataTakeAway?.map((item, index) => ( - 0 && ( + + {OldtableDataTakeAway?.map((item, index) => ( + = - PreviousdataLength - ? 'wheat' - : triggerAnimation && + tableDataTakeAway?.length >= PreviousdataLength + ? 'wheat' + : triggerAnimation && index === 0 && tableDataTakeAway?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - item?.SalesId && OrderType !== 'Hold' - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + item?.SalesId && OrderType !== 'Hold' + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( - item?.InwardDtlId + - ' ' + - item?.BookingTypeName + item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : index % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + ? '#b2d1f7' + : index % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( )} - {tableitem.OptionName == 'Item' && ( - <> - + )} + {tableitem.OptionName == 'Item' && ( + <> + - - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} + {tableitem.OptionName == 'Delete' && ( + + )} + + ))} + + ))} - {!sportsAppPreference && - EditQuantity && - OldtableDataTakeAway?.length > 0 && ( - - )} - - )} + {!sportsAppPreference && + EditQuantity && + OldtableDataTakeAway?.length > 0 && ( + + )} + + )} - {/* Reorder DineIn */} - {OldtableDataDinein?.length > 0 && ( - - {OldtableDataDinein?.map((item, index) => ( - 0 && ( + + {OldtableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && + ? 'wheat' + : BookingType !== 'Dine In' && triggerAnimation && - OldtableDataTakeAway?.length + index === - 0 && + OldtableDataTakeAway?.length + index === 0 && tableDataDinein?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + index) % 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.['OverallBackgroundColor'] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + index) % 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( + )} + + {tableitem.OptionName == 'Sl.No' && ( + + )} + {tableitem.OptionName == 'Item' && ( + <> + - )} - {tableitem.OptionName == 'Item' && ( - <> - - - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} + {tableitem.OptionName == 'Delete' && ( + + )} + + ))} + + ))} - {!sportsAppPreference && - OldtableDataDinein?.length > 0 && - EditQuantity && ( - - )} - - )} - {/* TakeWay */} + {!sportsAppPreference && + OldtableDataDinein?.length > 0 && + EditQuantity && ( + + )} + + )} + {/* TakeWay */} - {tableDataTakeAway?.length > 0 && ( - - {tableDataTakeAway?.map((item, index) => ( - 0 && ( + + {tableDataTakeAway?.map((item, index) => ( + = - PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && tableDataTakeAway?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + ? 'wheat' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' + ? 'white' + : SelectedBillColor?.[ + 'OverallBackgroundColor' ] - : '#d6d6d6' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === + ? SelectedBillColor?.[ + 'OverallBackgroundColor' + ] + : '#d6d6d6' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === 0 + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + background: + BookingType === 'Dine In' && item?.SalesId + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) + ? '#b2d1f7' + : (OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] : '#d6d6d6', - background: - BookingType === 'Dine In' && item?.SalesId - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + - ' ' + - item?.BookingTypeName - ) - ? '#b2d1f7' - : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataDinein?.length + + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataDinein?.length + OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( + )} + + {tableitem.OptionName == 'Sl.No' && ( + + )} + {tableitem.OptionName == 'Item' && ( + <> + - )} - {tableitem.OptionName == 'Item' && ( - <> - - - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {!sportsAppPreference && - tableDataTakeAway?.length > 0 && - EditQuantity && ( - - )} - - )} - {/* DineIn */} - {tableDataDinein?.length > 0 && ( - - {tableDataDinein?.map((item, index) => ( - + removeFromCart(item)} + style={{ color: '#FF4D4F', cursor: 'pointer' }} + /> + + )} + + ))} + + ))} + + {!sportsAppPreference && + tableDataTakeAway?.length > 0 && + EditQuantity && ( + + )} + + )} + {/* DineIn */} + {tableDataDinein?.length > 0 && ( + + {tableDataDinein?.map((item, index) => ( + = PreviousdataLength - ? 'wheat' - : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength + ? 'wheat' + : BookingType !== 'Dine In' && + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && tableDataDinein?.length >= - PreviousdataLength && + PreviousdataLength && !HoldOrderDtl && !UnpaidData - ? 'wheat' - : 'inherit' - : 'none', - background: - BookingType === 'Dine In' && - item?.SalesId && - !BookingTypeBoth - ? 'rgb(243, 248, 213)' - : GlobEstBooking === 'ParEst' && + ? 'wheat' + : 'inherit' + : 'none', + background: + BookingType === 'Dine In' && + item?.SalesId && + !BookingTypeBoth + ? 'rgb(243, 248, 213)' + : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( - item?.InwardDtlId + - ' ' + - item?.BookingTypeName + item?.InwardDtlId + ' ' + item?.BookingTypeName ) - ? '#b2d1f7' - : (OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index) % - 2 === + ? '#b2d1f7' + : (OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index) % + 2 === 0 - ? 'white' - : SelectedBillColor?.['OverallBackgroundColor'] - ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] - : '#d6d6d6', - animation: - BillOrderPre === 'Y' && !BookingTypeBoth - ? triggerAnimation && - OldtableDataTakeAway?.length + + ? 'white' + : SelectedBillColor?.['OverallBackgroundColor'] + ? SelectedBillColor?.['OverallBackgroundColor'] + : '#d6d6d6', + animation: + BillOrderPre === 'Y' && !BookingTypeBoth + ? triggerAnimation && + OldtableDataTakeAway?.length + OldtableDataDinein?.length + tableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData - ? 'splashAnimation 0.5s ease-in-out' - : 'none' - : 'none', - }} - > - {tableOptions?.map((tableitem) => ( - <> - {BookingTypeBoth && - index == 0 && - tableitem.OptionName == 'Sl.No' && ( - - )} - - {tableitem.OptionName == 'Sl.No' && ( + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData + ? 'splashAnimation 0.5s ease-in-out' + : 'none' + : 'none', + }} + > + {tableOptions?.map((tableitem) => ( + <> + {BookingTypeBoth && + index == 0 && + tableitem.OptionName == 'Sl.No' && ( + )} + + {tableitem.OptionName == 'Sl.No' && ( + + )} + {tableitem.OptionName == 'Item' && ( + <> + - )} - {tableitem.OptionName == 'Item' && ( - <> - - - )} - {tableitem.OptionName == 'MRP' && ( - - )} - {tableitem.OptionName == 'Discount' && ( - - )} - {tableitem.OptionName == 'Quantity' && ( - - )} - {tableitem.OptionName == 'Rate' && ( - - )} - {tableitem.OptionName == 'Amount' && ( - - )} + + )} + {tableitem.OptionName == 'MRP' && ( + + )} + {tableitem.OptionName == 'Discount' && ( + + )} + {tableitem.OptionName == 'Quantity' && ( + + )} + {tableitem.OptionName == 'Rate' && ( + + )} + {tableitem.OptionName == 'Amount' && ( + + )} - {tableitem.OptionName == 'Delete' && ( - - )} - - ))} - - ))} + {tableitem.OptionName == 'Delete' && ( + + )} + + ))} + + ))} - {!sportsAppPreference && - tableDataDinein?.length > 0 && - EditQuantity && ( - - )} - - )} -
+ {!isMobile ? ( + {''} + ) : ( +
{''}
+ )} +
+ {!isMobile ? ( + Sl.No + ) : ( +
+ Sl.No +
+ )} +
+ {!isMobile ? ( + Item + ) : ( +
Item
+ )} +
+ {!isMobile ? ( + MRP + ) : ( +
MRP
+ )} +
+ {!isMobile ? ( + ₹/% + ) : ( +
₹/%
+ )} +
0 ? OpenEditTotalAmount : ""} + onClick={() => { + if (OrderCardDetail?.length > 0) { + OpenEditTotalAmount(); + } + }} + > + {!isMobile ? ( + Qty + ) : ( +
Qty
+ )} +
+ {!isMobile ? ( + Rt + ) : ( +
Rt
+ )} +
+ {!isMobile ? ( + Amt + ) : ( +
Amt
+ )} +
- {OrderCardDetail?.length > 0 ? ( - { - Clearall(); - }} - > -
- {' '} - {!isMobile ? ( - - {' '} - {' '} - - ) : ( -
- {' '} - {' '} -
- )} -
-
- ) : ( + {item.OptionName == 'Delete' && ( +
+ {OrderCardDetail?.length > 0 ? ( + { + Clearall(); + }} + >
+ {' '} {!isMobile ? ( - - + + {' '} + {' '} ) : (
@@ -2373,432 +2357,459 @@ const StandardTable = () => {
)}
- )} -
- - { - if (editField) { - handleEditQuantity(item); - } - }} + rowSpan={OrderCardDetail.length} + style={{ backgroundColor: '#CFB59D' }} > - {index + 1} + - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 - ? handleImeiDetails(item) - : editField && handleEditQuantity(item) - } - > - {item?.ProdName} -  {' '} - {item?.BrandName !== null - ? item?.BrandName - : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && ( - {item?.ProdVariantName} - )} - {AvailableDate ? ( - <> - {' '} - ( - {`${to12Hour(item?.VariantAvailableFrom || item?.AvailableFrom)} - ${to12Hour(item?.VariantAvailableTo || item?.AvailableTo)}`} - )   - {item?.SinglePc == 'Y' && 'Single'} - - ) : ( - <> - {item?.Size} - {item?.SinglePc == 'Y' - ? 'Single' - : item?.UomName} - - )} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {index + 1} +
+ item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 + ? handleImeiDetails(item) + : editField && handleEditQuantity(item) + } + > + {item?.ProdName} +  {' '} + {item?.BrandName !== null ? item?.BrandName : ''} + {item?.Type != 'C' && ( + <> +

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size}{' '} - {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {AvailableDate ? ( + <> + {' '} + ( + {`${to12Hour(item?.VariantAvailableFrom || item?.AvailableFrom)} - ${to12Hour(item?.VariantAvailableTo || item?.AvailableTo)}`} + )   + {item?.SinglePc == 'Y' && 'Single'} + + ) : ( + <> + {item?.Size} + {item?.SinglePc == 'Y' + ? 'Single' + : item?.UomName} + + )} + ) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} - - )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.MRP} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {safeRound( - item?.TotalAmt - (item?.Offer || 0) || 0 + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size}{' '} + {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
)}
- removeFromCart(item)} - style={{ color: '#FF4D4F', cursor: 'pointer' }} - /> -
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {safeRound( + item?.TotalAmt - (item?.Offer || 0) || 0 + )} + + removeFromCart(item)} + style={{ color: '#FF4D4F', cursor: 'pointer' }} + /> +
- - + + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {OldtableDataTakeAway?.length + index + 1} + { } }} > - {OldtableDataTakeAway?.length + index + 1} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.ProdName} -  {' '} - {item?.BrandName !== null - ? item?.BrandName - : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && ( - {item?.ProdVariantName} - )} - {AvailableDate ? ( - <> - {' '} - ( - {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} - )   - {item?.SinglePc == 'Y' && 'Single'} - - ) : ( - <> - {item?.Size} - {item?.SinglePc == 'Y' - ? 'Single' - : item?.UomName} - - )} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size}{' '} - {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {AvailableDate ? ( + <> + {' '} + ( + {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} + )   + {item?.SinglePc == 'Y' && 'Single'} + + ) : ( + <> + {item?.Size} + {item?.SinglePc == 'Y' + ? 'Single' + : item?.UomName} + + )} + ) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} -
- )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.MRP} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {safeRound( - item?.TotalAmt - (item?.Offer || 0) || 0 + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size}{' '} + {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
)}
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {safeRound( + item?.TotalAmt - (item?.Offer || 0) || 0 + )} + - removeFromCart(item)} - style={{ color: '#FF4D4F', cursor: 'pointer' }} - /> -
+ removeFromCart(item)} + style={{ color: '#FF4D4F', cursor: 'pointer' }} + /> +
- - + + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index + + 1} + { - if (editField) { - handleEditQuantity(item); - } - }} + onClick={() => + item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || + imeiModal + ? handleImeiDetails(item) + : editField && handleEditQuantity(item) + } > - {OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index + - 1} - - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 || imeiModal) - ? handleImeiDetails(item) - : editField && handleEditQuantity(item) - } - > - {item?.Type !== 'OS' - ? item.ProdName - : item.ServiceName} -  {' '} - {item?.BrandName !== null - ? item?.BrandName - : ''} - {item?.Type != 'C' && ( - <> -

- {item?.Type !== 'OS' && ( - <> - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && ( - - {item?.ProdVariantName}{' '} - - )} - {AvailableDate ? ( - <> - {' '} - ( - {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} - )   - {item?.SinglePc == 'Y' && - 'Single'} - - ) : ( - <> - {item?.Size} - {item?.SinglePc == 'Y' - ? 'Single' - : item?.UomName} - - )} - - )} -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size}{' '} - {prod.UomName} + {item?.Type !== 'OS' && ( + <> + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && ( + {item?.ProdVariantName} + )} + {AvailableDate ? ( + <> + {' '} + ( + {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} + )   + {item?.SinglePc == 'Y' && 'Single'} + + ) : ( + <> + {item?.Size} + {item?.SinglePc == 'Y' + ? 'Single' + : item?.UomName} + + )} + + )} +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} -
- )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.MRP} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {safeRound( - item?.TotalAmt - (item?.Offer || 0) || 0 + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size}{' '} + {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
)}
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + - removeFromCart(item)} - style={{ color: '#FF4D4F', cursor: 'pointer' }} - /> -
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {safeRound( + item?.TotalAmt - (item?.Offer || 0) || 0 + )} +
- - + + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index + + 1} + { } }} > - {OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index + - 1} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.ProdName} -  {' '} - {item?.BrandName !== null - ? item?.BrandName - : ''} - {item?.Type != 'C' && ( - <> -

- ( - {!item?.ProdVariantName?.toLowerCase()?.includes( - 'variant' - ) && ( - {item?.ProdVariantName} - )} - {AvailableDate ? ( - <> - {' '} - ( - {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} - )   - {item?.SinglePc == 'Y' && 'Single'} - - ) : ( - <> - {item?.Size} - {item?.SinglePc == 'Y' - ? 'Single' - : item?.UomName} - - )} - ) -

- {item?.OfferMessage && - !Array.isArray(item.OfferMessage) && ( -

- {item.OfferMessage?.split('>')?.[0] + - `> ${item?.OrderQty} Eligible Free`} -

- )} - - )} - {item?.Type === 'C' && ( -
+

- {item.ProdDetail?.map((prod, index) => ( -

- {prod.ProdName} - {prod.Size}{' '} - {prod.UomName} + ( + {!item?.ProdVariantName?.toLowerCase()?.includes( + 'variant' + ) && {item?.ProdVariantName} } + {AvailableDate ? ( + <> + {' '} + ( + {`${to12Hour(item?.VariantAvailableFrom)} - ${to12Hour(item?.VariantAvailableTo)}`} + )   + {item?.SinglePc == 'Y' && 'Single'} + + ) : ( + <> + {item?.Size} + {item?.SinglePc == 'Y' + ? 'Single' + : item?.UomName} + + )} + ) +

+ {item?.OfferMessage && + !Array.isArray(item.OfferMessage) && ( +

+ {item.OfferMessage?.split('>')?.[0] + + `> ${item?.OrderQty} Eligible Free`}

- ))} -
- )} - {productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} -
{ - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.MRP} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.Type != 'C' - ? item.Offer && item.Offer > 0 - ? item.Offer - : item.DiscountAmt ? item.DiscountAmt : '-' - : item?.OfferPrice && item?.OfferPrice > 0 - ? item?.OfferType === 'F' - ? `₹${safeRound(item.OfferPrice)}` - : `${item.OfferPrice}%` - : item.DiscountAmt ? item.DiscountAmt : '-'} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderQty} - { - if (editField) { - handleEditQuantity(item); - } - }} - > - {item?.OrderRate} - { - // if (editField) { - // handleEditQuantity(item); - // } - if (GetCustId) { - handleCustomerProductPriceHistory(item); - } - }} - > - {safeRound( - item?.TotalAmt - (item?.Offer || 0) || 0 + )} + + )} + {item?.Type === 'C' && ( +
+ {item.ProdDetail?.map((prod, index) => ( +

+ {prod.ProdName} - {prod.Size}{' '} + {prod.UomName} +

+ ))} +
+ )} + {productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + ) !== undefined && ( +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
)}
{ + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.MRP} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 + ? item.Offer + : item.DiscountAmt + ? item.DiscountAmt + : '-' + : item?.OfferPrice && item?.OfferPrice > 0 + ? item?.OfferType === 'F' + ? `₹${safeRound(item.OfferPrice)}` + : `${item.OfferPrice}%` + : item.DiscountAmt + ? item.DiscountAmt + : '-'} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderQty} + { + if (editField) { + handleEditQuantity(item); + } + }} + > + {item?.OrderRate} + { + // if (editField) { + // handleEditQuantity(item); + // } + if (GetCustId) { + handleCustomerProductPriceHistory(item); + } + }} + > + {safeRound( + item?.TotalAmt - (item?.Offer || 0) || 0 + )} + - removeFromCart(item)} - style={{ color: '#FF4D4F', cursor: 'pointer' }} - /> -
+ removeFromCart(item)} + style={{ color: '#FF4D4F', cursor: 'pointer' }} + /> +
+ {!sportsAppPreference && + tableDataDinein?.length > 0 && + EditQuantity && ( + + )} + + )} + - {OpenEditTotalAmt && ( - - )} - {OpenImeiDetail && ( - - )} - {customerPriceHistoryOpen && GetCustId && ( - - )} -
-
- -
+ {OpenEditTotalAmt && ( + + )} + {OpenImeiDetail && ( + + )} + {customerPriceHistoryOpen && GetCustId && ( + + )} +
+
+
- +
); }; diff --git a/src/Pages/BookingScreen/Components/UtillComponents/BSExpireProductsList.jsx b/src/Pages/BookingScreen/Components/UtillComponents/BSExpireProductsList.jsx index b3279a9..0c784f0 100644 --- a/src/Pages/BookingScreen/Components/UtillComponents/BSExpireProductsList.jsx +++ b/src/Pages/BookingScreen/Components/UtillComponents/BSExpireProductsList.jsx @@ -15,13 +15,11 @@ import { PreferenceData, } from '../../../../Features/BookingScreen/BookingData/BookingData'; import { ExtractDateFormate } from '../../../../Services/Others'; -import { RiArchiveLine } from 'react-icons/ri'; import { AiFillAlert } from 'react-icons/ai'; -import { TbAlertTriangleFilled } from 'react-icons/tb'; import { IoEye } from 'react-icons/io5'; import { DefaultModal } from '../../../../Components/Modal/DefaultModal'; import { Tables } from '../../../../Components/Tables/Table'; - import '../../../../Styles/OverAllStyle/OverAllStyle.scss'; +import '../../../../Styles/OverAllStyle/OverAllStyle.scss'; const NoDataComponent = () => (
@@ -351,25 +349,31 @@ const BSExpireProductsList = () => { messageData={message.data} onComplete={onComplete} /> +
+ , + }, + { + label: 'Expired', + value: 'expired', + icon: , + }, + ]} + /> - , - }, - { - label: 'Expired', - value: 'expired', - icon: , - }, - ]} - /> -
@@ -381,7 +385,7 @@ const BSExpireProductsList = () => {
{ setListOfInvoices(false); }; return ( - }> + }> <> { - + ); }; diff --git a/src/Pages/BookingScreen/Template/RetailBookingClose.jsx b/src/Pages/BookingScreen/Template/RetailBookingClose.jsx index eedd86c..f709de7 100644 --- a/src/Pages/BookingScreen/Template/RetailBookingClose.jsx +++ b/src/Pages/BookingScreen/Template/RetailBookingClose.jsx @@ -21,7 +21,11 @@ const RetailBookingClosing = (props) => { const dispatch = useDispatch(); const UserType = getSession('UserType'); const preferenceDatas = useSelector(PreferenceData); - const allowDecimal = preferenceDatas?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y'); + const allowDecimal = preferenceDatas?.[0]?.SettingDtlDetails?.find( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'decimal' && + setting?.SettingValue === 'Y' + ); const CompId = getSession('CompId'); const AppId = getSession('AppId'); const UserId = getSession('UserId'); @@ -298,39 +302,42 @@ const RetailBookingClosing = (props) => { title={'Booking Close'} handleCancel={props.PaymentClose} footer={false} - width={700} + width={750} children={
-
- {' '} - Received Amount ={' '} +
+

Received Amount

+
=
{safeRound(PaymentClosingData?.ReceivedAmount)}
-
- Cash Amount ={' '} +
+

Cash Amount

+
=
{safeRound(PaymentClosingData?.OverAllCashAmount)}
-
- Card Amount ={' '} +
+

Card Amount

+
=
{safeRound(PaymentClosingData?.OverAllCardAmount)}
-
- UPI Amount ={' '} +
+

UPI Amount

+
=
{safeRound(PaymentClosingData?.OverAllUpiAmount)}
- -
- Total Cash In Hand ={' '} +
+

Total Cash In Hand

+
=
{safeRound(TotalCashInHand)} diff --git a/src/Pages/BookingScreen/Template/RetailBookingClosing.scss b/src/Pages/BookingScreen/Template/RetailBookingClosing.scss index a62166b..896e539 100644 --- a/src/Pages/BookingScreen/Template/RetailBookingClosing.scss +++ b/src/Pages/BookingScreen/Template/RetailBookingClosing.scss @@ -68,10 +68,19 @@ font-size: 14px; font-weight: 500; font-family: "Poppins"; - width: 250px; - div { - display: flex; - align-items: center; - justify-content: space-between; + width: 300px; + margin-top: 10px; +} + +.ClosepayBTN { + display: flex; + align-items: center; + justify-content: space-between; + p { + width: 150px; + } + span { + width: 50px; + text-align: right; } } diff --git a/src/Pages/PurchaseQuotation/PurchaseQuotationForm.jsx b/src/Pages/PurchaseQuotation/PurchaseQuotationForm.jsx index 6f807cd..82fb84e 100644 --- a/src/Pages/PurchaseQuotation/PurchaseQuotationForm.jsx +++ b/src/Pages/PurchaseQuotation/PurchaseQuotationForm.jsx @@ -1,10 +1,18 @@ import React, { useState, useEffect, useRef, useCallback } from 'react'; import { useNavigate } from 'react-router-dom'; import { useDispatch } from 'react-redux'; -import { ImWarning } from "react-icons/im"; -import { Form, Table, Input, Select, AutoComplete, Button, Tooltip } from 'antd'; -import { BsUpcScan } from "react-icons/bs"; -import { FaLink } from "react-icons/fa"; +import { ImWarning } from 'react-icons/im'; +import { + Form, + Table, + Input, + Select, + AutoComplete, + Button, + Tooltip, +} from 'antd'; +import { BsUpcScan } from 'react-icons/bs'; +import { FaLink } from 'react-icons/fa'; import { DeleteFilled, ArrowRightOutlined, @@ -13,7 +21,12 @@ import { import { Messages } from '../../Components/Notifications/Messages.jsx'; import { InputField } from '../../Components/Forms/InputField.jsx'; import Buttons from '../../Components/Forms/Buttons.jsx'; -import { getSession, pdfDiv, printDiv, validateSafeInput } from '../../Services/Others'; +import { + getSession, + pdfDiv, + printDiv, + validateSafeInput, +} from '../../Services/Others'; import FormHeader from '../PageComponents/FormHeader.jsx'; import { DropDowns } from '../../Components/Forms/DropDown.jsx'; import { CiBarcode } from 'react-icons/ci'; @@ -32,14 +45,17 @@ import { getEmpAccess, } from '../../Features/AppPage/CenterPage.js'; import { useAuth } from '../../AuthContext.jsx'; -import { getAllCustomer, getPreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js'; +import { + getAllCustomer, + getPreferenceData, +} from '../../Features/BookingScreen/BookingData/BookingData.js'; const subDirectory = import.meta.env.BASE_URL; import TooltipWrapper from '../../Components/Tooltip/Tooltip'; import { FaEye, FaPrint } from 'react-icons/fa'; import { MdOutlineMail } from 'react-icons/md'; import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx'; import FloatLabel from '../../Components/Forms/FloatLabel/index.jsx'; -import { debounce } from "lodash"; +import { debounce } from 'lodash'; import { getPrintSelectionComponentData } from '../../Features/ThemeChange/ThemeChange.js'; import { PrintStyleFunction } from '../paymentpdfPage/PrintStyleFunction.js'; import { isMobile } from 'react-device-detect'; @@ -71,7 +87,7 @@ const SalesQuotationForm = () => { const [SelProduct, setSelProduct] = useState(null); const [selectedProductName, setSelectedProductName] = useState(null); - const [productSearchText, setProductSearchText] = useState(""); + const [productSearchText, setProductSearchText] = useState(''); const [scanner, setScanner] = useState(false); console.log(SelTaxTypeName, 'SelTaxTypeName'); @@ -95,24 +111,22 @@ const SalesQuotationForm = () => { const [addnewAccess, setaddnewAccess] = useState(true); const [isbarcode, setisbarcode] = useState(false); const [isSubmitted, setIsSubmitted] = useState(false); - const [usrMailDataModel, setusrMailDataModel] = useState(false) + const [usrMailDataModel, setusrMailDataModel] = useState(false); const [EnteredMailId, setEnteredMailId] = useState(null); const [PrintTempData, setPrintTempData] = useState([]); console.log(TableData, 'TableData'); - const items = [ - { - name: 'Home', - link: `${subDirectory}app-page/home`, - }, - - { - name: 'Sales Quotation', - link: `${subDirectory}setting/sales-quotation`, - }, - ]; - - - + const items = [ + { + name: 'Home', + link: `${subDirectory}app-page/home`, + }, + + { + name: 'Sales Quotation', + link: `${subDirectory}setting/sales-quotation`, + }, + ]; + // const QuotationStylepdf = ``; @@ -559,15 +572,15 @@ const SalesQuotationForm = () => { ); if (matchedProduct) { let productName = {}; - productName.label = `${matchedProduct?.ProdName} (${matchedProduct.Size} ${matchedProduct.UomName})${matchedProduct?.BrandName ? ` - ${matchedProduct?.BrandName}` : ''}` + productName.label = `${matchedProduct?.ProdName} (${matchedProduct.Size} ${matchedProduct.UomName})${matchedProduct?.BrandName ? ` - ${matchedProduct?.BrandName}` : ''}`; ProductDropDownChange(matchedProduct.ProdId, productName); if (matchedProduct?.ProdVariantPriceDetails?.length < 2) { - setSelectedProductName(""); - setSelProduct(null) + setSelectedProductName(''); + setSelProduct(null); } } else { - setMessageType("error"); - setMessageData("The Scanned Product not Available in Product List") + setMessageType('error'); + setMessageData('The Scanned Product not Available in Product List'); } }, 300), [ProductData] @@ -575,12 +588,16 @@ const SalesQuotationForm = () => { const getPreference = async () => { const data = { AppId: AppId, CompId: CompId, BranchId: BranchId }; - const { data: res } = await dispatch(getPreferenceData(data)).unwrap() - const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y'); + const { data: res } = await dispatch(getPreferenceData(data)).unwrap(); + const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'decimal' && + setting?.SettingValue === 'Y' + ); if (decimalSetting) { - setAllowDecimal(true) + setAllowDecimal(true); } - } + }; const changebarcode = useCallback(() => { setisbarcode((prev) => !prev); }, []); @@ -621,7 +638,6 @@ const SalesQuotationForm = () => { // Print(); // }, [PrintData]); - useEffect(() => { let total = TableData?.reduce((accumulator, currentValue) => { return accumulator + currentValue.NetAmt; @@ -647,7 +663,7 @@ const SalesQuotationForm = () => { }, 0); setTotalBillAmount(billtotal); }, [TableData]); - + const getProduct = async () => { let Product = await dispatch( getPurProductData({ @@ -659,7 +675,9 @@ const SalesQuotationForm = () => { ).unwrap(); if (Product?.data?.statusCode === 1) { let Productonlydata = Product?.data?.data?.filter( - (item) => item?.ProdTypeName === 'Product' && (item?.StockAvailable === "Y" ? item?.BalanceQty > 0 : true) + (item) => + item?.ProdTypeName === 'Product' && + (item?.StockAvailable === 'Y' ? item?.BalanceQty > 0 : true) ); setProductData(Productonlydata); @@ -684,13 +702,14 @@ const SalesQuotationForm = () => { const Data = { AppId, CompId, BranchId }; - const printtemp = await dispatch(getPrintSelectionComponentData(Data)).unwrap(); + const printtemp = await dispatch( + getPrintSelectionComponentData(Data) + ).unwrap(); const printTypeName = printtemp?.data?.data - ?.flatMap(template => template.ComponentDetails || []) + ?.flatMap((template) => template.ComponentDetails || []) ?.find( - comp => - comp.SetasDefault === "Y" && - comp.PrintTypeName === "Sales Quotation" + (comp) => + comp.SetasDefault === 'Y' && comp.PrintTypeName === 'Sales Quotation' ); setPrintTempData(printTypeName); }; @@ -730,7 +749,7 @@ const SalesQuotationForm = () => { TaxAmt: taxname?.ConfigName?.toLowerCase() === 'withtax' ? (item?.NetAmt * parseInt(item?.TaxPercentage)) / - (100 + parseInt(item?.TaxPercentage))?.toFixed(2) + (100 + parseInt(item?.TaxPercentage))?.toFixed(2) : 0, }; }); @@ -739,33 +758,33 @@ const SalesQuotationForm = () => { }; const handleScanSearch = () => { if (scanner === false) { - setMessageType("success"); - setMessageData("Search by QrCode/BarCode Enabled") + setMessageType('success'); + setMessageData('Search by QrCode/BarCode Enabled'); } else { - setMessageType("success"); - setMessageData("Search by QrCode/BarCode Disabled") + setMessageType('success'); + setMessageData('Search by QrCode/BarCode Disabled'); } - setScanner(prev => !prev) + setScanner((prev) => !prev); setSelectedProductName(null); setselectedProductVariantData(null); - setVariants(null) + setVariants(null); formRef?.current?.setFieldsValue({ ProdId: null, - VarProdId: null + VarProdId: null, }); - } + }; const handleProductSearch = (value) => { if (scanner) { debouncedScannerSearch(value); } - setProductSearchText(value) + setProductSearchText(value); setSelectedProductName(value); setselectedProductVariantData([]); - setVariants([]) + setVariants([]); }; const ProductDropDownChange = async (ProdId, option) => { - setProductSearchText("") - setSelectedProductName(option?.label ? option?.label : '') + setProductSearchText(''); + setSelectedProductName(option?.label ? option?.label : ''); formRef?.current?.resetFields(['VarProdId']); console.log(ProductData, 'ProdIdProdId'); @@ -866,9 +885,7 @@ const SalesQuotationForm = () => { )?.[0]?.ProdVariantName; const ProdName1 = TableData?.some( - (e) => - e.ProdId == SelProduct && - e.ProdVariantName === ProdName2 + (e) => e.ProdId == SelProduct && e.ProdVariantName === ProdName2 ); if (ProdName1) { setMessageType('error'); @@ -886,9 +903,7 @@ const SalesQuotationForm = () => { // let x = VariantData1?.filter((e) => e.InwardDtlId == value); // let u = ProductData?.find((e) => e.ProdId == selectedProductData); // console.log(first) - let ProductData1 = ProductData?.find( - (e) => e.ProdId == SelProduct - ); + let ProductData1 = ProductData?.find((e) => e.ProdId == SelProduct); console.log(ProductData1, 'ProductData1ProductData1'); let mrp; let sellprice; @@ -988,7 +1003,7 @@ const SalesQuotationForm = () => { title: 'Product Name', dataIndex: 'ProdName', key: 'ProdName', - width: "230px", + width: '230px', align: 'right', render: (text, record, index) => ( @@ -1350,10 +1365,11 @@ const SalesQuotationForm = () => { ? sellprice * parseInt(qty) : 0; - const taxamt = SelTaxTypeName?.toLowerCase() === 'withtax' - ? (Amount * parseInt(record?.TaxPercentage)) / - (100 + parseInt(record?.TaxPercentage)) - : 0; + const taxamt = + SelTaxTypeName?.toLowerCase() === 'withtax' + ? (Amount * parseInt(record?.TaxPercentage)) / + (100 + parseInt(record?.TaxPercentage)) + : 0; const newData = TableData.map((item, index1) => { if (index1 === index) { return { @@ -1373,22 +1389,12 @@ const SalesQuotationForm = () => { [`Qty${index}`]: qty, [`NetAmt${index}`]: Amount, - // [`ReceivedQty${index}`]: qty, - // [`AcceptedQty${index}`]: acceptedQty, - // [`RejectedQty${index}`]: qty - acceptedQty, - // ReceivedQty: qty, - // AcceptedQty: acceptedQty, - // RejectedQty: qty - acceptedQty, + [`PurcDisc${index}`]: 0, [`DiscType${index}`]: 'P', }); }; const handleDiscountTypeChange = (value, record, index) => { - // console.log(value,"valuevalue") - // const newData1 = [...TableData]; - // const item = newData1[index]; - // item.DiscountType = value; - // setTableData(newData1); const tempamt = record.Qty * record.Price; const DisType = value; const amount = @@ -1398,7 +1404,7 @@ const SalesQuotationForm = () => { const taxamt = SelTaxTypeName?.toLowerCase() === 'withtax' ? (amount * parseInt(record?.TaxPercentage)) / - (100 + parseInt(record?.TaxPercentage))?.toFixed(2) + (100 + parseInt(record?.TaxPercentage))?.toFixed(2) : 0; // You can calculate acceptedQty based on your requirement const newData = TableData.map((item, index1) => { @@ -1441,7 +1447,7 @@ const SalesQuotationForm = () => { const taxamt = SelTaxTypeName?.toLowerCase() === 'withtax' ? (amount * parseInt(record?.TaxPercentage)) / - (100 + parseInt(record?.TaxPercentage))?.toFixed(2) + (100 + parseInt(record?.TaxPercentage))?.toFixed(2) : 0; // You can calculate acceptedQty based on your requirement const newData = TableData.map((item, index1) => { @@ -1475,7 +1481,7 @@ const SalesQuotationForm = () => { const taxamount = SelTaxTypeName?.toLowerCase() === 'withtax' ? (amount * parseInt(record?.TaxPercentage)) / - (100 + parseInt(record?.TaxPercentage))?.toFixed(2) + (100 + parseInt(record?.TaxPercentage))?.toFixed(2) : 0; form.setFields([{ name: [`PurcDisc${index}`], errors: [] }]); @@ -1530,23 +1536,16 @@ const SalesQuotationForm = () => { PostData['TaxAmount'] = parseFloat( (TotalCgst + TotalSgst + TotalIgst)?.toFixed(2) ); - (PostData['CompId'] = CompId), + ((PostData['CompId'] = CompId), (PostData['BranchId'] = BranchId), - (PostData['AppId'] = AppId); + (PostData['AppId'] = AppId)); let res = await dispatch(postPurcQuotation(PostData)).unwrap(); if (res?.data?.statusCode === 1) { setMessageType('success'); setMessageData(res?.data?.response); const custId = formRef.current?.getFieldValue('CustId'); - const customer = AllCustomer?.find(c => c.UserId === custId); - console.log(customer, "customertrt"); - - // const printDataWithCustomer = { - // ...res?.data?.data, - // customerName: customer?.CustName || '', - // customerAddress: customer?.CustAddress || '', - // customerMobile: customer?.CustMobile || '', - // }; + const customer = AllCustomer?.find((c) => c.UserId === custId); + console.log(customer, 'customertrt'); setPrintData(res?.data?.data); setIsSubmitted(true); @@ -1597,33 +1596,6 @@ const SalesQuotationForm = () => { } }; - // const handleSearch = (input) => { - // // Only proceed if input is not empty and isbarcode is true - // if (!input || !isbarcode) { - // return; - // } - - // if (debounceRef.current) { - // clearTimeout(debounceRef.current); - // } - - // debounceRef.current = setTimeout(async () => { - // const product = ProductData.find( - // (p) => p.QRCode?.toLowerCase() === input.toLowerCase() - // ); - // console.log(input, 'inputinput', product); - // if (product) { - // setEditingKey(''); - - // await ProductDropDownChange(product.ProdId); - // setTimeout(() => { - // setSelProduct(null); - // formRef.current?.setFieldsValue({ ProdId: null }); - // }, 100); - // } - // }, 300); - // }; - const onChangeprodFunction = (e) => { console.log(e, 'yyyyyyyyyyyyyy'); @@ -1651,20 +1623,11 @@ const SalesQuotationForm = () => { } }; - // Add these functions inside your component, before the return statement: - // const handleEmailClick = () => { - // const subject = encodeURIComponent('Sales Quotation'); - // const body = encodeURIComponent('Please find attached the purchase quotation.'); - // window.open(`mailto:?subject=${subject}&body=${body}`); - // }; - - // const handlePrint = () => { - // printDiv('Pur-Quot-Print', QuotationStyle); - // }; - // ...existing code... const handlePrint = async () => { const style = await PrintStyleFunction( - PrintTempData?.StyleName == undefined ? 'Style 13' : PrintTempData?.StyleName, + PrintTempData?.StyleName == undefined + ? 'Style 13' + : PrintTempData?.StyleName, 'Quotation' ); @@ -1690,25 +1653,25 @@ const SalesQuotationForm = () => { const selectedStyle = stylesMap[ - PrintTempData?.StyleName == undefined ? 'Style 13' : PrintTempData?.StyleName + PrintTempData?.StyleName == undefined + ? 'Style 13' + : PrintTempData?.StyleName ]; - - if (isMobile) { - PurchaseQtMobilePrint({ - PrintTempData: PrintTempData, - PrintOrderDetails: PrintData, - UserId: UserId, - dispatch, - }); - } - else if (selectedStyle) { - await printDiv(`${selectedStyle}`, style); + + if (isMobile) { + PurchaseQtMobilePrint({ + PrintTempData: PrintTempData, + PrintOrderDetails: PrintData, + UserId: UserId, + dispatch, + }); + } else if (selectedStyle) { + await printDiv(`${selectedStyle}`, style); } }; - const handleEmailClick = async (mail, data) => { - let record = mail == "mail" ? data : PrintData?.[0] + let record = mail == 'mail' ? data : PrintData?.[0]; if (record?.Email) { setTimeout(async () => { @@ -1726,46 +1689,45 @@ const SalesQuotationForm = () => { if (res?.data?.status === 1) { setMessageData(res?.data?.response); setMessageType('success'); - } - else { + } else { setMessageData(res?.data?.response); setMessageType('error'); } - // setMessageData("Email sent successfully"); // setMessageType('success'); } catch (error) { console.error('❌ Email send failed:', error); // alert('❌ Email failed to send'); - setMessageData("Email failed to send"); + setMessageData('Email failed to send'); setMessageType('error'); } }, 300); + } else { + setusrMailDataModel(true); } - else { - setusrMailDataModel(true) - } - }; const handleUserMailmodalCancel = () => { - setusrMailDataModel(false) - setEnteredMailId(null) + setusrMailDataModel(false); + setEnteredMailId(null); emailform.resetFields(); // setQuotationProductdata([]) - } + }; const emailSubmit = (values) => { - let data = { ...PrintData?.[0], ...{ CustMail: values.email }, ...{ Email: values.email } }; - handleEmailClick("mail", data); + let data = { + ...PrintData?.[0], + ...{ CustMail: values.email }, + ...{ Email: values.email }, + }; + handleEmailClick('mail', data); setEnteredMailId(null); emailform.resetFields(); emailform.setFieldsValue({ email: '' }); setusrMailDataModel(false); }; - return (
@@ -1775,11 +1737,14 @@ const SalesQuotationForm = () => { messageData={messageData} onComplete={onComplete} /> -
+
{ cursor: 'pointer', fontFamily: 'Poppins', fontWeight: '400', - whiteSpace: "nowrap", - fontSize: "15px" + whiteSpace: 'nowrap', + fontSize: '15px', }} - onClick={() => navigate(`${subDirectory}setting/sales-quotation/list`)} + onClick={() => + navigate(`${subDirectory}setting/sales-quotation/list`) + } > View Quotation
@@ -1857,129 +1824,67 @@ const SalesQuotationForm = () => { />
- +
- + { - const product = ProductData.find(p => p.ProdId === option.value); - const nameMatch = option.label?.toLowerCase()?.includes(productSearchText?.toLowerCase()); - const qrMatch = product?.QRCode?.toLowerCase() == productSearchText?.toLowerCase(); + const product = ProductData.find( + (p) => p.ProdId === option.value + ); + const nameMatch = option.label + ?.toLowerCase() + ?.includes(productSearchText?.toLowerCase()); + const qrMatch = + product?.QRCode?.toLowerCase() == + productSearchText?.toLowerCase(); return nameMatch || qrMatch; }} - options={!scanner ? ProductData?.map - ((option) => ({ - value: option.ProdId, - label: `${option.ProdName} (${option.Size} ${option.UomName})${option?.BrandName ? ` - ${option?.BrandName}` : ''}` - })) : []} + options={ + !scanner + ? ProductData?.map((option) => ({ + value: option.ProdId, + label: `${option.ProdName} (${option.Size} ${option.UomName})${option?.BrandName ? ` - ${option?.BrandName}` : ''}`, + })) + : [] + } onSelect={ProductDropDownChange} onChange={handleProductSearch} onKeyDown={(e) => { - if (scanner && e.key === "Enter") { + if (scanner && e.key === 'Enter') { e.preventDefault(); } }} disabled={ProductData?.length === 0} - > - + > - - + +
+ +
- {ProductData?.length === 0 &&

All Products have no Stock

} + {ProductData?.length === 0 && ( +

+ All Products have no Stock +

+ )}
- {/* - ({ - value: - option.ProdName + - ' ' + - '(' + - option.Size + - option.UomName + - ')', - label: - option.ProdName + - ' ' + - '(' + - option.Size + - option.UomName + - ')', - qrCode: option.QRCode, - }))} - style={{ width: '250px', height: '48px' }} - onSelect={(value, option) => { - if (isbarcode && option.qrCode) { - const productByQR = ProductData.find( - (p) => p.QRCode === option.qrCode - ); - if (productByQR) { - ProductDropDownChange({ - value: - productByQR.ProdName + - ' ' + - '(' + - productByQR.Size + - productByQR.UomName + - ')', - }); - } - } else { - ProductDropDownChange(option); - } - }} - filterOption={(input, option) => { - if (isbarcode) { - return ( - option.qrCode && - option.qrCode - .toLowerCase() - .includes(input.toLowerCase()) - ); - } else { - return option.label - .toLowerCase() - .includes(input.toLowerCase()); - } - }} - value={SelProduct} - > - - onChangeprodFunction(e?.target?.value) - } - onPressEnter={(e) => - onChangeprodFunction(e?.target?.value) - } - isOnChange={SelProduct ? true : false} - suffix={ - - - - - } - /> - - */}
@@ -2025,7 +1930,10 @@ const SalesQuotationForm = () => {
-
+
{
)} -
{TableData?.length > 0 && (
-
Gross Total: {allowDecimal ? TotalBillAmount?.toFixed(2) : TotalBillAmount}
-
Total GST: {allowDecimal ? (TotalCgst + TotalSgst + TotalIgst)?.toFixed(2) : (TotalCgst + TotalSgst + TotalIgst)}
+
+ {' '} + Gross Total:{' '} + {allowDecimal ? TotalBillAmount?.toFixed(2) : TotalBillAmount} +
+
+ {' '} + Total GST:{' '} + {allowDecimal + ? (TotalCgst + TotalSgst + TotalIgst)?.toFixed(2) + : TotalCgst + TotalSgst + TotalIgst} +
{/*
Total SGST: {TotalSgst?.toFixed(2)}
Total IGST: {TotalIgst?.toFixed(2)}
*/} -
Total Amount: {allowDecimal ? Math.round(TotalAmount)?.toFixed(2) : Math.round(TotalAmount)}
- {/*
- - - - - - - - - - - - - - - - - - - - -
Gross Total: - -
Total CGST: - {TotalCgst?.toFixed(2)} -
Total SGST: - {TotalSgst?.toFixed(2)} -
Total IGST: - {TotalIgst?.toFixed(2)} -
- Total Amount(Round Off): - - {Math.round(TotalAmount)?.toFixed(2)} -
*/} +
+ {' '} + Total Amount:{' '} + {allowDecimal + ? Math.round(TotalAmount)?.toFixed(2) + : Math.round(TotalAmount)} +
)}
@@ -2109,20 +1998,17 @@ const SalesQuotationForm = () => { handleCancel={handleUserMailmodalCancel} footer={false} children={ -
- +
); }; -export default SalesQuotationForm; \ No newline at end of file +export default SalesQuotationForm; diff --git a/src/Styles/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.scss b/src/Styles/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.scss index 3e89f33..092a276 100644 --- a/src/Styles/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.scss +++ b/src/Styles/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.scss @@ -44,7 +44,7 @@ .BSBilling4-tablediv-mobile { display: block; height: 40vh; - overflow-y: scroll; + overflow-y: auto; } .BSBilling4-tablediv-mobile::-webkit-scrollbar { @@ -316,6 +316,7 @@ display: flex; justify-content: space-between; flex-direction: column; + gap: 4px; } @media (min-width: 280px) and (max-width: 499px) { @@ -340,11 +341,6 @@ row-gap: 0rem; } - .Table4-price-btn-master { - flex-direction: row; - align-items: center; - } - .Table4-cash { width: 60px !important; } @@ -726,8 +722,10 @@ .BSBilling4-price-content { display: flex; flex-direction: row; - width: 100vw; + @media (max-width: 768px) { + width: 100% !important; + } } .Table4-price-icon-container { @@ -789,3 +787,38 @@ font-weight: bold; padding: 2px; } +.BS7hold-sum { + display: flex; + justify-content: center; + align-items: center; + flex-direction: row; + column-gap: 1rem; + color: var(--DEFAULT_SELECTED_COLOR); +} +.RowforResposiveBill7 { + display: flex; + flex-direction: column; + width: 100%; +} + +.RowResposiveBill7 { + display: flex; + align-items: flex-start; + gap: 4px; + width: 100%; +} +.bsbilltable7 { + padding: 10px; +} + +@media (max-width: 768px) { + .BSTable3_payroll { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + } + .bsbilltable7 { + padding: 0; + } +} diff --git a/src/Styles/BookingScreen/Components/BSBillingTables/BSBillingTables3/BSBillingTable3.scss b/src/Styles/BookingScreen/Components/BSBillingTables/BSBillingTables3/BSBillingTable3.scss index ad64d5c..618187c 100644 --- a/src/Styles/BookingScreen/Components/BSBillingTables/BSBillingTables3/BSBillingTable3.scss +++ b/src/Styles/BookingScreen/Components/BSBillingTables/BSBillingTables3/BSBillingTable3.scss @@ -109,7 +109,8 @@ .Btn-payment-mode { background-color: var(--SELECTED_COLOR); color: #ffffff; - outline: none;border: none; + outline: none; + border: none; font-size: 12px; display: flex; flex-direction: row; @@ -318,9 +319,9 @@ flex-direction: column; justify-content: space-between; overflow: auto; + scrollbar-width: none; width: inherit; height: 85vh; - scrollbar-width: none; border-radius: 10px; @media (max-width: 768px) { width: 100% !important; @@ -333,9 +334,9 @@ .BSTable3 { overflow-y: auto; + scrollbar-width: none; height: 100vh; background-color: #fff; - scrollbar-width: none; } .Cust-tag { diff --git a/src/Styles/BookingScreen/Components/BSItemCards/BSItemCard.scss b/src/Styles/BookingScreen/Components/BSItemCards/BSItemCard.scss index ae636fc..8dd610f 100644 --- a/src/Styles/BookingScreen/Components/BSItemCards/BSItemCard.scss +++ b/src/Styles/BookingScreen/Components/BSItemCards/BSItemCard.scss @@ -95,9 +95,10 @@ font-size: 12px; font-weight: 500; max-width: 130px; - white-space: nowrap; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; overflow: hidden; - text-overflow: ellipsis; } .BSItemCard-itemPrice { diff --git a/src/Styles/BookingScreen/Components/OtherConponents/Reprint/CreditCustomerReprint.scss b/src/Styles/BookingScreen/Components/OtherConponents/Reprint/CreditCustomerReprint.scss index 63c501a..7d266fc 100644 --- a/src/Styles/BookingScreen/Components/OtherConponents/Reprint/CreditCustomerReprint.scss +++ b/src/Styles/BookingScreen/Components/OtherConponents/Reprint/CreditCustomerReprint.scss @@ -9,7 +9,7 @@ .receipt-reprint-header { display: flex; align-items: center; - // justify-content: space-between; + flex-wrap: wrap; gap: 10px; margin-bottom: 16px; } diff --git a/src/Styles/BookingScreen/Template/BSLayout2/BSLayout2.scss b/src/Styles/BookingScreen/Template/BSLayout2/BSLayout2.scss index b42562b..500933f 100644 --- a/src/Styles/BookingScreen/Template/BSLayout2/BSLayout2.scss +++ b/src/Styles/BookingScreen/Template/BSLayout2/BSLayout2.scss @@ -113,7 +113,8 @@ body { @media (max-width: 768px) { width: 100%; - margin: 0.5rem; + margin: 0; + padding: 0.5rem; min-height: 200px; } @@ -195,7 +196,7 @@ body { } } - .BSLayout2-Master .BSBTOverall1-Default { +.BSLayout2-Master .BSBTOverall1-Default { height: 81vh; } @@ -229,7 +230,6 @@ body { width: 100%; } - .NewLayoutBillContainer { display: flex; align-items: center; @@ -439,7 +439,7 @@ body { font-weight: 600; align-items: center; gap: 2px; - padding: 0 6px; + padding: 0 6px; @media (max-width: 500px) { font-size: 10px; diff --git a/src/Styles/PrinterSetting/PrinterSetting.scss b/src/Styles/PrinterSetting/PrinterSetting.scss index b30d06c..ef4ed79 100644 --- a/src/Styles/PrinterSetting/PrinterSetting.scss +++ b/src/Styles/PrinterSetting/PrinterSetting.scss @@ -46,6 +46,12 @@ overflow: auto; height: 75vh; padding-bottom: 3rem; + white-space: nowrap; + width: 100%; + + .printer-button { + width: 120px !important; + } .modal-header { text-align: center; @@ -75,13 +81,15 @@ .setting-card { width: 30%; + @media (max-width: 768px) { + width: unset; + } button { background: #fff; border-radius: 8px; display: flex; align-items: center; - // flex-direction: column; padding: 10px 20px; text-align: center; cursor: pointer; @@ -166,11 +174,10 @@ // Responsive design @media (max-width: 600px) { .printer-settings-content { - padding: 20px; + padding: 10px; .settings-grid { - grid-template-columns: 1fr; - gap: 15px; + gap: 10px; } .modal-actions { diff --git a/src/Styles/PurchaseQuotation/PurchaseQuotation.scss b/src/Styles/PurchaseQuotation/PurchaseQuotation.scss index 01730e1..663818c 100644 --- a/src/Styles/PurchaseQuotation/PurchaseQuotation.scss +++ b/src/Styles/PurchaseQuotation/PurchaseQuotation.scss @@ -68,10 +68,10 @@ column-gap: 3rem; padding-top: 1rem; height: 78vh; - overflow: scroll; + overflow: auto; + scrollbar-width: thin; row-gap: 1.5rem; padding-bottom: 4rem; - scrollbar-width: thin; @media (max-width: 768px) { padding-bottom: 4rem; @@ -131,6 +131,7 @@ } .sales-quotation { + position: relative; .ant-select { width: 250px !important; height: 48px !important; @@ -139,4 +140,9 @@ input { padding: 6px 25px 6px 12px !important; } + .BsUpcScanSQ { + position: absolute; + right: 10px; + top: 15px; + } } diff --git a/src/Styles/Reports/LedgerReport/LedgerReport.scss b/src/Styles/Reports/LedgerReport/LedgerReport.scss index 541c29b..d85b78c 100644 --- a/src/Styles/Reports/LedgerReport/LedgerReport.scss +++ b/src/Styles/Reports/LedgerReport/LedgerReport.scss @@ -4,7 +4,6 @@ } .MasterLedger-Report { - // width: 100vw; padding: 0rem 0; overflow: hidden; background-color: #fff; @@ -16,13 +15,16 @@ width: max-content !important; } } + .custom-table th { + white-space: nowrap; + } } .LedgerTable { height: 73vh; - scrollbar-width: thin; width: 100%; overflow: auto; + scrollbar-width: thin; tr:nth-child(even) { background-color: #e9e8e8 !important; @@ -49,7 +51,6 @@ .Dropdown-DatePicker { display: flex; align-items: center; - // padding: 0.2rem 0px; flex-direction: row; column-gap: 2rem; flex-wrap: wrap; @@ -80,12 +81,10 @@ .LedgerDropDate { display: flex; - // align-items: center; justify-content: space-between; width: 100%; gap: 2rem; flex-wrap: wrap; - // overflow-x: scroll; } .ItemWiseReport-printerIcon-disabled { @@ -118,7 +117,6 @@ display: flex; padding-left: 10px; border-style: groove; - // align-items: center; } .LR-DatePicker { @@ -142,8 +140,8 @@ width: 72px; } -.LedgerTable .ant-table-wrapper .ant-table-thead>tr>th, -.ant-table-wrapper .ant-table-thead>tr>td { +.LedgerTable .ant-table-wrapper .ant-table-thead > tr > th, +.ant-table-wrapper .ant-table-thead > tr > td { color: #000000; font-size: 12px; font-weight: 600; @@ -174,7 +172,7 @@ } .MasterLedger-Report .ant-table-wrapper .ant-table-cell, -.MasterLedger-Report .ant-table-wrapper .ant-table-thead>tr>th { +.MasterLedger-Report .ant-table-wrapper .ant-table-thead > tr > th { padding: 1px 13px; width: 100px; } @@ -207,17 +205,15 @@ width: 200px !important; } - .LedgerTable { height: 50vh; } .LedgerDropDate { - overflow-y: scroll; + overflow-y: auto; } .Ledger-datePicker { - .ant-picker { width: 100px !important; height: 50px !important; @@ -239,7 +235,7 @@ .AllRadioButton { width: 37vh; - overflow-x: scroll; + overflow-x: auto; } } @@ -265,7 +261,7 @@ border: 1px solid #909090; font-family: "Poppins", sans-serif; - >thead { + > thead { position: sticky; top: -1px; } @@ -281,7 +277,6 @@ font-size: 12px; font-weight: 500; font-family: VAR(--HEADING_FONT_FAMILY); - // text-transform: uppercase; text-transform: capitalize; letter-spacing: 0.2px; } @@ -290,7 +285,8 @@ display: flex; flex-direction: column; gap: 4px; - overflow: scroll; + overflow: auto; + scrollbar-width: thin; padding-bottom: 2rem; } @@ -336,7 +332,7 @@ justify-content: flex-end; gap: 1rem; - >div { + > div { border-radius: 6px; padding: 5px 10px; color: #fff; @@ -344,21 +340,20 @@ cursor: pointer; } - >div:nth-child(1) { + > div:nth-child(1) { background-color: #28aa3a; } - >div:nth-child(2) { + > div:nth-child(2) { background-color: #ff0000; } } .custom-table { - Button:disabled, Button[disabled] { width: unset !important; height: unset !important; border-radius: 50px !important; } -} \ No newline at end of file +}