From 7e8ced53c6593912b23d716d837d029b39a80475 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 25 Feb 2026 16:26:02 +0530 Subject: [PATCH] fixed bugs --- .../ComboEditQtyAndRate.jsx | 4 +- .../UtillComponents/BSNavBarDragItems.jsx | 121 +++++++++--------- .../Template/SalesCountForStandard.jsx | 18 +-- .../Payment/PaymentOptions/PaymentOptions.jsx | 99 +++++++------- src/Pages/StockTransfer/StockReceived.jsx | 2 +- .../Components/BSItemCards/BSItemCard.scss | 70 +++++----- src/utils/calculations.js | 7 +- 7 files changed, 166 insertions(+), 155 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/ComboBillTableEdit/ComboEditQtyAndRate.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/ComboBillTableEdit/ComboEditQtyAndRate.jsx index 6f699c1..6ce1ca8 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/ComboBillTableEdit/ComboEditQtyAndRate.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/ComboBillTableEdit/ComboEditQtyAndRate.jsx @@ -263,7 +263,7 @@ const ComboEditQtyAndRate = (props) => { }; const quantityValidation = async (val) => { - + setQuantity(val) } @@ -3262,7 +3262,7 @@ const ComboEditQtyAndRate = (props) => { min="0" onChange={(e) => quantityValidation(e.target.value)} onBlur={() => { - if (Quantity && Quantity.trim() !== '') { + if (Quantity && String(Quantity || '').trim() !== '') { AddProductQuantity(); } }} diff --git a/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarDragItems.jsx b/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarDragItems.jsx index 96f86dc..b83092c 100644 --- a/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarDragItems.jsx +++ b/src/Pages/BookingScreen/Components/UtillComponents/BSNavBarDragItems.jsx @@ -33,11 +33,12 @@ import { DropDowns } from '../../../../Components/Forms/DropDown.jsx'; import { Messages } from '../../../../Components/Notifications/Messages.jsx'; import '../../../../Styles/BookingScreen/Components/UtillComponents/BSNavBarDragItems.scss'; import { getTemplateData } from '../../../../Features/ThemeChange/ThemeChange.js'; +import { capitalizeFirstLetter } from '../../../../utils/calculations.js'; const BSNavBarDragItems = ({ type, drawerOpen = false, - setDrawerOpen = () => {}, + setDrawerOpen = () => { }, }) => { const draggingComponent = useSelector(GlobaldraggingComponent); const GlobalisFavClickedCheck = useSelector(GlobalisFavClicked); @@ -72,27 +73,27 @@ const BSNavBarDragItems = ({ BranchId: BranchId, ...(draggingComponent == 'sub-category' ? { - ProdCat: MapData?.[0]?.ProdCat, - ProductSubCatDtl: MapData.map((item, index) => ({ - ProdSubCat: item?.ProdSubCat, - DisplayProdSubCatNo: index + 1, - })), - } + ProdCat: MapData?.[0]?.ProdCat, + ProductSubCatDtl: MapData.map((item, index) => ({ + ProdSubCat: item?.ProdSubCat, + DisplayProdSubCatNo: index + 1, + })), + } : draggingComponent == 'category' ? { - ProductCatDtl: MapData.map((item, index) => ({ - ProdCat: item?.ProdCat, - DisplayProdCatNo: index + 1, - })), - } + ProductCatDtl: MapData.map((item, index) => ({ + ProdCat: item?.ProdCat, + DisplayProdCatNo: index + 1, + })), + } : { - ProdCat: MapData?.[0]?.ProdCat || null, - ProdSubCat: MapData?.[0]?.ProdSubCat || null, - ProductDtl: MapData.map((item, index) => ({ - ProdId: item?.ProdId, - DisplayProductNo: index + 1, - })), - }), + ProdCat: MapData?.[0]?.ProdCat || null, + ProdSubCat: MapData?.[0]?.ProdSubCat || null, + ProductDtl: MapData.map((item, index) => ({ + ProdId: item?.ProdId, + DisplayProductNo: index + 1, + })), + }), UpdatedBy: UserId, }; @@ -199,7 +200,7 @@ const BSNavBarDragItems = ({ draggingComponent === item.name ? 'selected' : '' } > - {item.name} + {capitalizeFirstLetter(item.name)} ))} @@ -279,47 +280,47 @@ const BSNavBarDragItems = ({ (!GlobalisFavClickedCheck && draggingComponent !== 'card' && draggingComponent !== 'sub-category'))) || - (!GlobalisFavClickedCheck && - draggingComponent !== 'card' && - draggingComponent == 'sub-category') || - (!GlobalisFavClickedCheck && - draggingComponent == 'card' && - draggingComponent !== 'sub-category') + (!GlobalisFavClickedCheck && + draggingComponent !== 'card' && + draggingComponent == 'sub-category') || + (!GlobalisFavClickedCheck && + draggingComponent == 'card' && + draggingComponent !== 'sub-category') ? MapData?.map((item, index) => ( - - {(provided, snapshot) => ( -
-

- {draggingComponent == 'category' - ? item?.ProdCatName - : draggingComponent == 'sub-category' - ? item?.ProdSubCatName - : item?.ProdName} -

-
- )} -
- )) - : 'NO data Found'} + + {(provided, snapshot) => ( +
+

+ {draggingComponent == 'category' + ? item?.ProdCatName + : draggingComponent == 'sub-category' + ? item?.ProdSubCatName + : item?.ProdName} +

+
+ )} +
+ )) + : 'No Data Found'} {provided.placeholder} )} diff --git a/src/Pages/BookingScreen/Template/SalesCountForStandard.jsx b/src/Pages/BookingScreen/Template/SalesCountForStandard.jsx index 6a69864..63e91b5 100644 --- a/src/Pages/BookingScreen/Template/SalesCountForStandard.jsx +++ b/src/Pages/BookingScreen/Template/SalesCountForStandard.jsx @@ -491,10 +491,10 @@ const SalesCountForStandard = React.memo(() => { return ( DineInAccess?.SettingValue === 'Y' && DineInOrderCount + - TakeAwayOrderCount + - SelfTakeAwayOrderCount + - SelfDineInOrderCount > - 0 && + TakeAwayOrderCount + + SelfTakeAwayOrderCount + + SelfDineInOrderCount > + 0 && (takeAwayPreference || dinePreference) ); }, [DineInAccess, sales, dinePreference, takeAwayPreference]); @@ -652,7 +652,7 @@ const SalesCountForStandard = React.memo(() => { {DineInAccess?.SettingValue === 'Y' && takeAwayPreference && (TakeAwayOrderCount || SelfTakeAwayOrderCount || PreOrderAmount) > - 0 && ( + 0 && ( { (e.currentTarget.style.backgroundColor = '#d6e4ff') } onMouseLeave={(e) => - (e.currentTarget.style.backgroundColor = - index % 2 === 0 ? '#f7faff' : '#e9f1ff') + (e.currentTarget.style.backgroundColor = + index % 2 === 0 ? '#f7faff' : '#e9f1ff') } > @@ -1162,8 +1162,8 @@ const SalesCountForStandard = React.memo(() => { (e.currentTarget.style.backgroundColor = '#e6f2ff') } onMouseLeave={(e) => - (e.currentTarget.style.backgroundColor = - index % 2 === 0 ? '#f7faff' : '#ffffff') + (e.currentTarget.style.backgroundColor = + index % 2 === 0 ? '#f7faff' : '#ffffff') } > details.FlowId === sectionId ) ? prevState[key]?.map((details) => { - if (details.FlowId === sectionId) { - return { - ...details, - optionDetails: details?.optionDetails?.some( - (opt) => opt.optionId === optionId + if (details.FlowId === sectionId) { + return { + ...details, + optionDetails: details?.optionDetails?.some( + (opt) => opt.optionId === optionId + ) + ? details?.optionDetails?.filter( + (opt) => opt.optionId !== optionId ) - ? details?.optionDetails?.filter( - (opt) => opt.optionId !== optionId - ) - : [ - ...details.optionDetails, - { optionId, optionName: option }, - ], - }; - } - return details; - }) + : [ + ...details.optionDetails, + { optionId, optionName: option }, + ], + }; + } + return details; + }) : [ - ...prevState[key], - { - FlowId: sectionId, - FlowName: section, - optionDetails: [{ optionId, optionName: option }], - }, - ]; + ...prevState[key], + { + FlowId: sectionId, + FlowName: section, + optionDetails: [{ optionId, optionName: option }], + }, + ]; return { ...prevState, [key]: updatedDetails }; }); @@ -864,8 +864,7 @@ function PaymentOptions({ setModalOpen }) { {configDetails?.some((detail) => detail?.optionDetails?.some((opt) => opt.optionName === configName) ) && - modeOptions.length > 0 && - (configName === 'Business Upi' && section === 'kioskSales' ? ( + modeOptions.length > 0 ? (configName === 'Business Upi' && section === 'kioskSales' ? ( { @@ -951,7 +950,7 @@ function PaymentOptions({ setModalOpen }) { ); }) - ))} + )) :
No payment methods available
} ); }; @@ -1043,27 +1042,27 @@ function PaymentOptions({ setModalOpen }) { // Update newOptionDetails based on whether we are adding or removing let newOptionDetails = isAdding ? [ - ...currentDetails.OptionDetails, - { - OptionName: configName, - ModeDetails: [ - { - ModeId: optionId, - ModeName: - option.ConfigName || - option.MethodName || - option.MerchantNameIdName || - option.BusinessName, - }, - ], - }, - ] + ...currentDetails.OptionDetails, + { + OptionName: configName, + ModeDetails: [ + { + ModeId: optionId, + ModeName: + option.ConfigName || + option.MethodName || + option.MerchantNameIdName || + option.BusinessName, + }, + ], + }, + ] : currentDetails.OptionDetails.map((details) => ({ - ...details, - ModeDetails: details.ModeDetails.filter( - (mode) => mode.ModeId !== optionId - ), - })).filter((details) => details.ModeDetails.length > 0); + ...details, + ModeDetails: details.ModeDetails.filter( + (mode) => mode.ModeId !== optionId + ), + })).filter((details) => details.ModeDetails.length > 0); let updatedOptions = prevCheckedOptions.filter( (opt) => !(opt.FlowName === section && opt.Option === configName) @@ -1374,8 +1373,8 @@ function PaymentOptions({ setModalOpen }) { postData['PaymentDetails'] = consolidatedData; postData['KioskDefaultOption'] = checkedOptions?.length > 0 && - (checkForCardDefaultOption(checkedOptions) || - checkForUpiDefaultOption(checkedOptions)) + (checkForCardDefaultOption(checkedOptions) || + checkForUpiDefaultOption(checkedOptions)) ? defaultStatus : null; if (consolidatedData?.length > 0) { @@ -1486,7 +1485,7 @@ function PaymentOptions({ setModalOpen }) { )} {option.optionName === 'Pay at the counter' && getPayAtCounterSalesDropdownOptions().length > - 0 && ( + 0 && (