From e8488df615e656b32da0a970b35fa5eddb1fb9ad Mon Sep 17 00:00:00 2001 From: Srinath Date: Mon, 16 Feb 2026 18:30:58 +0530 Subject: [PATCH 1/4] Added Hold data edit funtionalies --- .../ComboSalesBillTable.jsx | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx index f25d3f5..9d79e2a 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx @@ -125,7 +125,6 @@ const ComboSalesBillTable = () => { const [PreviousdataLength, setPreviousdataLength] = useState(); const BookingTypeBoth = useSelector(GlobalBookingTypeBoth); const OrderType = useSelector(GlobalOrderType); - console.log(PreviousOrderLength, 'PreviousOrderLength'); const GlobEstBooking = useSelector(GlobalEstimateBooking); const GlobalExtraCharge = useSelector(globalExtraTotalAmount); const OfferFreeProduct = useSelector(GlobalFreeProdList, shallowEqual); @@ -216,6 +215,48 @@ const ComboSalesBillTable = () => { } } }, [tableOptions]); + + // Merge same items in hold order + useEffect(() => { + if (OrderType === 'Hold' && tableData?.length > 0) { + const mergedData = []; + const processedIds = new Set(); + + tableData.forEach((item) => { + const key = `${item.InwardDtlId}-${item.BookingTypeName}-${item.OrderRate}`; + + if (processedIds.has(key)) return; + + // Find all items with same InwardDtlId, BookingTypeName, and OrderRate + const sameItems = tableData.filter( + (i) => + i.InwardDtlId === item.InwardDtlId && + i.BookingTypeName === item.BookingTypeName && + i.OrderRate === item.OrderRate + ); + + if (sameItems.length > 1) { + // Merge quantities + const totalQty = sameItems.reduce((sum, i) => sum + i.OrderQty, 0); + const mergedItem = { + ...sameItems[0], + OrderQty: totalQty, + TotalAmt: totalQty * item.OrderRate, + TaxAmt: ((totalQty * item.OrderRate * item.TaxPercentage) / (100 + item.TaxPercentage)), + }; + mergedData.push(mergedItem); + } else { + mergedData.push(item); + } + + processedIds.add(key); + }); + if (mergedData.length !== tableData.length) { + dispatch(changeOrderCardDetails(mergedData)); + } + } + }, [tableData?.length, OrderType]); + useEffect(() => { if (SelectedFont) { WebFont.load({ @@ -328,7 +369,7 @@ const ComboSalesBillTable = () => { if (OtherServicesglobal && value.Type == 'OS' && value.ServiceType == 'I') { setEditQuantity(false); } else { - if (value?.SalesId) { + if (value?.SalesId && OrderType !== 'Hold') { setEditQuantity(false); } else { setEditQuantity(true); @@ -341,7 +382,7 @@ const ComboSalesBillTable = () => { if (OtherServicesglobal && value.Type == 'OS' && value.ServiceType == 'I') { setEditQtyCombo(false); } else { - if (value?.SalesId) { + if (value?.SalesId && OrderType !== 'Hold') { setEditQtyCombo(false); } else { setEditQtyCombo(true); @@ -355,7 +396,7 @@ const ComboSalesBillTable = () => { if (OtherServicesglobal && value.Type == 'OS' && value.ServiceType == 'I') { setEditRateCombo(false); } else { - if (value?.SalesId) { + if (value?.SalesId && OrderType !== 'Hold') { setEditRateCombo(false); } else { setEditRateCombo(true); @@ -2172,7 +2213,6 @@ const ComboSalesBillTable = () => { tableOptions, ]); - console.log(combinedTableData, 'combinedTableData', tableData); const displayTableData = BillOrderPre === 'N' ? [...combinedTableData].reverse() : combinedTableData; @@ -2379,7 +2419,7 @@ const ComboSalesBillTable = () => { ? 'wheat' : 'inherit' : 'none', - background: row?.SalesId + background: row?.SalesId && OrderType !== 'Hold' ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && GlobProdwisedata?.includes( From a2bdb67940c50b35a5e0fc94d2122646f5d38094 Mon Sep 17 00:00:00 2001 From: Srinath Date: Mon, 16 Feb 2026 18:33:49 +0530 Subject: [PATCH 2/4] Added search clear funtionalies --- src/Pages/BookingScreen/Components/BSCombo/BSC1Search.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Pages/BookingScreen/Components/BSCombo/BSC1Search.jsx b/src/Pages/BookingScreen/Components/BSCombo/BSC1Search.jsx index 76097ab..8362f5c 100644 --- a/src/Pages/BookingScreen/Components/BSCombo/BSC1Search.jsx +++ b/src/Pages/BookingScreen/Components/BSCombo/BSC1Search.jsx @@ -1204,6 +1204,7 @@ export default function BSC1Search(props) { let ProdNamedata = ProductList?.find((item) => item.ProdName === data); const removedDefault = removeDefaultVariantStock(ProdNamedata); setSelectedProduct(removedDefault); + formRef.current.resetFields(['ItemName']); }; const ProductSelected = (item) => { if (item.OverAllExpStatus == 'Y') { From 167b3196dbd00db3d605363e8ead570a5a501083 Mon Sep 17 00:00:00 2001 From: Srinath Date: Mon, 16 Feb 2026 18:35:38 +0530 Subject: [PATCH 3/4] Added qty edit click funtions --- .../ComboEditQtyAndRate.jsx | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/ComboBillTableEdit/ComboEditQtyAndRate.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/ComboBillTableEdit/ComboEditQtyAndRate.jsx index 243f7f4..532e812 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/ComboBillTableEdit/ComboEditQtyAndRate.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/ComboBillTableEdit/ComboEditQtyAndRate.jsx @@ -36,8 +36,10 @@ const ComboEditQtyAndRate = (props) => { const formRef = useRef(null); const quantityInputRef = useRef(null); const priceChangeInputRef = useRef(null); + const modalRef = useRef(null); const { setIndex = () => {}, setEditQtyCombo = () => {}, setEditRateCombo = () => {} } = props; + const [disableSubmitButton, setDisableSubmitButton] = useState(false); const SessionData = useSelector(StoredSessionData); // const AppId = SessionData?.AppId; @@ -139,14 +141,21 @@ const ComboEditQtyAndRate = (props) => { }, [RadioBtnSelection, props.BSBillingEditQuantity, props.BSBillingEditRate]); useEffect(() => { - const handleKeyDown = (event) => { - if (preferenceshortcutkey && event.shiftKey && event.key === 'E') { - event.preventDefault(); - if (PriceChangeaccess && props.Productdata?.Offer <= 0) { - onRadioBtnChange('Price'); - } - } - }; +const handleKeyDown = (event) => { + const navigationKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; + if (event.key === 'Escape' || navigationKeys.includes(event.key)) { + event.preventDefault(); + if (props.BSBillingEditQuantity) { + props.handleEditQuantityCancel?.(); + setEditQtyCombo(false); + } + if (props.BSBillingEditRate) { + props.handleEditRateComboCancel?.(); + setEditRateCombo(false); + } + return; + } +}; if (EditOpen) { document.addEventListener('keydown', handleKeyDown); @@ -160,8 +169,12 @@ const ComboEditQtyAndRate = (props) => { preferenceshortcutkey, PriceChangeaccess, props.Productdata?.Offer, + props.BSBillingEditQuantity, + props.BSBillingEditRate, ]); + + useEffect(() => { const BillOrder = SettingDataSelector?.[0]?.SettingDtlDetails?.find( (item) => item.SettingIdName === 'BillItemsOrder' @@ -3203,6 +3216,7 @@ const ComboEditQtyAndRate = (props) => { ref={quantityInputRef} type="number" value={Quantity} + min="0" onChange={(e) => setQuantity(e.target.value)} onBlur={() => { if (Quantity && Quantity.trim() !== '') { From bb32f8fce2725dc6c3843ee8fd9849fbad218095 Mon Sep 17 00:00:00 2001 From: Srinath Date: Mon, 16 Feb 2026 18:39:48 +0530 Subject: [PATCH 4/4] Added email payload HeaderType:SelfBooking --- src/Pages/Reports/PublicQrCodeShare/PublicQrCodeShare.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Pages/Reports/PublicQrCodeShare/PublicQrCodeShare.jsx b/src/Pages/Reports/PublicQrCodeShare/PublicQrCodeShare.jsx index e49ae0c..f34056b 100644 --- a/src/Pages/Reports/PublicQrCodeShare/PublicQrCodeShare.jsx +++ b/src/Pages/Reports/PublicQrCodeShare/PublicQrCodeShare.jsx @@ -58,6 +58,7 @@ const PublicQrCodeShare = (qrCodeUrl) => { toEmail: toEmail, type: 'M', fileUrl: qrCodeUrl.qrCodeUrl, + HeaderType:"SelfBooking" }; try {