From 85cd9cd141e763f70660153d0e81ee95a00b5e4a Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 4 Mar 2026 12:19:03 +0530 Subject: [PATCH] Focus Clear In edit QTY and Serial Number --- .../BSBillingEditQuantity.jsx | 307 ++++++++++-------- .../BSImeiDetails/BSImeiDetails.jsx | 121 +++---- .../Components/BSNavbar/BSNavbar1.scss | 1 + 3 files changed, 239 insertions(+), 190 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx index 9e5df58..6a86902 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx @@ -12,6 +12,9 @@ import { GlobalReorderProductDetails, PreferenceData, getConfigType, + changefocusStatusCust, + changeCombofocus, + GlobalfocusStatusCust, } from '../../../../../Features/BookingScreen/BookingData/BookingData'; import { ArrowRightOutlined } from '@ant-design/icons'; import { Messages } from '../../../../../Components/Notifications/Messages'; @@ -50,7 +53,7 @@ const BSBillingEditQuantity = (props) => { const priceChangeInputRef = useRef(null); const reductionInputRef = useRef(null); - const { setIndex = () => { } } = props; + const { setIndex = () => {} } = props; const [disableSubmitButton, setDisableSubmitButton] = useState(false); const SessionData = useSelector(StoredSessionData); @@ -66,13 +69,24 @@ const BSBillingEditQuantity = (props) => { shallowEqual ); - const overAllLimitPreferenece = - preferenceDatas?.[0]?.['SettingDtlDetails']?.find( - (item) => (item.SettingIdName?.toLowerCase() === 'overalllimit') && item?.SettingValue === 'Y'); - const itemWiseLimitPreferenece = - preferenceDatas?.[0]?.['SettingDtlDetails']?.find( - (item) => item.SettingIdName?.toLowerCase() === 'itemwiselimit' && item?.SettingValue === 'Y'); - const maxQtyLimit = itemWiseLimitPreferenece?.SettingCount || overAllLimitPreferenece?.SettingCount || null; + const overAllLimitPreferenece = preferenceDatas?.[0]?.[ + 'SettingDtlDetails' + ]?.find( + (item) => + item.SettingIdName?.toLowerCase() === 'overalllimit' && + item?.SettingValue === 'Y' + ); + const itemWiseLimitPreferenece = preferenceDatas?.[0]?.[ + 'SettingDtlDetails' + ]?.find( + (item) => + item.SettingIdName?.toLowerCase() === 'itemwiselimit' && + item?.SettingValue === 'Y' + ); + const maxQtyLimit = + itemWiseLimitPreferenece?.SettingCount || + overAllLimitPreferenece?.SettingCount || + null; const preferenceOffer = preferenceDatas?.[0]?.['SettingDtlDetails']?.find( (item) => item.SettingIdName === 'Offer' @@ -86,7 +100,7 @@ const BSBillingEditQuantity = (props) => { ); console.log(preferenceshortcutkey, 'preferenceshortcutkey'); const [PriceChangeaccess, setPriceChangeaccess] = useState(true); - + const selectStatuscust = useSelector(GlobalfocusStatusCust); const [ConfigDataList, setConfigDataList] = useState([]); const [messageType, setMessageType] = useState(null); const [messageData, setMessageData] = useState(null); @@ -115,7 +129,7 @@ const BSBillingEditQuantity = (props) => { price: 'Price', quantity: 'qty', Parcel: 'Parcel', - weightAmount: 'weightAmount' + weightAmount: 'weightAmount', }; const [RadioBtnSelection, setRadioBtnSelection] = useState(() => { if (props?.shortKeyMethod && SHORTKEY_TO_RADIO[props.shortKeyMethod]) { @@ -343,7 +357,6 @@ const BSBillingEditQuantity = (props) => { }; const calculateOverAllQty = (item, filterItems) => { - if (!item) return 0; const totalUsedQty = @@ -446,11 +459,18 @@ const BSBillingEditQuantity = (props) => { ); const editedProduct = CartOrderDetails[editedProductIndex]; - if ((overAllLimitPreferenece || itemWiseLimitPreferenece) && maxQtyLimit) { + if ( + (overAllLimitPreferenece || itemWiseLimitPreferenece) && + maxQtyLimit + ) { if (overAllLimitPreferenece) { - const calculatedOverAllQty = calculateOverAllQtyLimit(CartOrderDetails?.filter((_, index) => index !== editedProductIndex)); - if ((calculatedOverAllQty + editedQty) > maxQtyLimit) { - setMessageData(`Overall Quantity Limit Exceeds than ${maxQtyLimit}`); + const calculatedOverAllQty = calculateOverAllQtyLimit( + CartOrderDetails?.filter((_, index) => index !== editedProductIndex) + ); + if (calculatedOverAllQty + editedQty > maxQtyLimit) { + setMessageData( + `Overall Quantity Limit Exceeds than ${maxQtyLimit}` + ); setMessageType('warning'); return; } @@ -722,11 +742,12 @@ const BSBillingEditQuantity = (props) => { newPrice, overrideQty = null ) => { - const editedQty = overrideQty !== null - ? overrideQty - : props?.Productdata?.ScaleType !== 'weight' - ? parseInt(Quantity) - : props.Productdata.OrderQty; + const editedQty = + overrideQty !== null + ? overrideQty + : props?.Productdata?.ScaleType !== 'weight' + ? parseInt(Quantity) + : props.Productdata.OrderQty; const addFirst = BillOrderPre === 'Y'; const isExistsInFreeProdList = FreeProdList?.find( (product) => @@ -750,7 +771,7 @@ const BSBillingEditQuantity = (props) => { return ( cartItem?.InwardDtlId === editedProduct?.InwardDtlId && cartItem?.OfferMessage?.[0]?.OfferId === - editedProduct?.OfferMessage?.[0]?.OfferId && + editedProduct?.OfferMessage?.[0]?.OfferId && cartItem?.OfferMode === editedProduct?.OfferMode && cartItem?.BookingTypeName !== editedProduct?.BookingTypeName ); @@ -884,7 +905,7 @@ const BSBillingEditQuantity = (props) => { cartItem?.InwardDtlId === editedProduct?.InwardDtlId && cartItem?.OrderRate === editedProduct?.OrderRate && cartItem?.BookingTypeName !== - editedProduct?.BookingTypeName && + editedProduct?.BookingTypeName && !cartItem?.OfferMode && cartItem?.Offer === 0 ); @@ -898,7 +919,7 @@ const BSBillingEditQuantity = (props) => { cartItem?.InwardDtlId === editedProduct?.InwardDtlId && cartItem?.OrderRate === editedProduct?.OrderRate && cartItem?.BookingTypeName !== - editedProduct?.BookingTypeName && + editedProduct?.BookingTypeName && cartItem?.OfferMode === editedProduct?.OfferMode && cartItem?.Offer > 0 ); @@ -1031,7 +1052,7 @@ const BSBillingEditQuantity = (props) => { ) ) && product?.OfferId === - editedProduct?.OfferMessage?.[0]?.OfferId && + editedProduct?.OfferMessage?.[0]?.OfferId && product?.OfferMode === editedProduct?.OfferMode ) { const freeQty = @@ -1064,7 +1085,7 @@ const BSBillingEditQuantity = (props) => { // Also check main offer conditions const isMatchingOffer = offerProduct?.OfferId === - editedProduct?.OfferMessage?.[0]?.OfferId && + editedProduct?.OfferMessage?.[0]?.OfferId && offerProduct?.OfferMode === editedProduct?.OfferMode; if (hasMatchingFreeProduct && isMatchingOffer) { @@ -1147,7 +1168,7 @@ const BSBillingEditQuantity = (props) => { ) ) && product?.OfferId === - editedProduct?.OfferMessage?.[0]?.OfferId && + editedProduct?.OfferMessage?.[0]?.OfferId && product?.OfferMode === editedProduct?.OfferMode ) { return { @@ -1177,7 +1198,7 @@ const BSBillingEditQuantity = (props) => { // Also check main offer conditions const isMatchingOffer = offerProduct?.OfferId === - editedProduct?.OfferMessage?.[0]?.OfferId && + editedProduct?.OfferMessage?.[0]?.OfferId && offerProduct?.OfferMode === editedProduct?.OfferMode; if (hasMatchingFreeProduct && isMatchingOffer) { @@ -1364,7 +1385,7 @@ const BSBillingEditQuantity = (props) => { // Also check main offer conditions const isMatchingOffer = offerProduct?.OfferId === - editedProduct?.OfferMessage?.[0]?.OfferId && + editedProduct?.OfferMessage?.[0]?.OfferId && offerProduct?.OfferMode === editedProduct?.OfferMode; if (hasMatchingFreeProduct && isMatchingOffer) { @@ -1466,7 +1487,7 @@ const BSBillingEditQuantity = (props) => { // Also check main offer conditions const isMatchingOffer = offerProduct?.OfferId === - editedProduct?.OfferMessage?.[0]?.OfferId && + editedProduct?.OfferMessage?.[0]?.OfferId && offerProduct?.OfferMode === editedProduct?.OfferMode; if (hasMatchingFreeProduct && isMatchingOffer) { @@ -1620,7 +1641,7 @@ const BSBillingEditQuantity = (props) => { ) && cartItem?.Offer && isFreeProductApplicable?.OfferId === - cartItem?.OfferMessage?.[0]?.OfferId + cartItem?.OfferMessage?.[0]?.OfferId ); } ); @@ -1909,11 +1930,11 @@ const BSBillingEditQuantity = (props) => { product?.ProdId === editedProduct?.ProdId && product?.InwardDtlId === editedProduct?.InwardDtlId && product?.OfferId === - (sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId || - otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) && + (sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId || + otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) && product?.OfferMode === - (sameBookingTypeProduct?.OfferMode || - otherBookingTypeProduct?.OfferMode) + (sameBookingTypeProduct?.OfferMode || + otherBookingTypeProduct?.OfferMode) ) { return { ...product, @@ -1947,11 +1968,11 @@ const BSBillingEditQuantity = (props) => { // Also check main offer conditions const isMatchingOffer = offerProduct?.OfferId === - (sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId || - otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) && + (sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId || + otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) && offerProduct?.OfferMode === - (sameBookingTypeProduct?.OfferMode || - otherBookingTypeProduct?.OfferMode); + (sameBookingTypeProduct?.OfferMode || + otherBookingTypeProduct?.OfferMode); if (hasMatchingFreeProduct && isMatchingOffer) { // Get loyalty points from the matching free product @@ -2092,7 +2113,7 @@ const BSBillingEditQuantity = (props) => { cartItem?.Offer > 0 && isFreeProductApplicable?.OfferMode === cartItem?.OfferMode && isFreeProductApplicable?.OfferId === - cartItem?.OfferMessage?.[0]?.OfferId + cartItem?.OfferMessage?.[0]?.OfferId ); } ); @@ -2195,11 +2216,11 @@ const BSBillingEditQuantity = (props) => { if ( cartItem.ProdId === otherBookingTypeProduct.ProdId && cartItem.InwardDtlId === - otherBookingTypeProduct.InwardDtlId && + otherBookingTypeProduct.InwardDtlId && cartItem.BookingTypeName === - otherBookingTypeProduct.BookingTypeName && + otherBookingTypeProduct.BookingTypeName && cartItem.OrderRate === - otherBookingTypeProduct.OrderRate && + otherBookingTypeProduct.OrderRate && cartItem.OfferMode && cartItem.Offer > 0 ) { @@ -2270,12 +2291,12 @@ const BSBillingEditQuantity = (props) => { product?.ProdId === editedProduct?.ProdId && product?.InwardDtlId === editedProduct?.InwardDtlId && product?.OfferId === - (sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId || - otherBookingTypeFreeProduct?.OfferMessage?.[0] - ?.OfferId) && + (sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId || + otherBookingTypeFreeProduct?.OfferMessage?.[0] + ?.OfferId) && product?.OfferMode === - (sameBookingTypeFreeProduct?.OfferMode || - otherBookingTypeFreeProduct?.OfferMode) + (sameBookingTypeFreeProduct?.OfferMode || + otherBookingTypeFreeProduct?.OfferMode) ) { return { ...product, @@ -2309,13 +2330,13 @@ const BSBillingEditQuantity = (props) => { // Also check main offer conditions const isMatchingOffer = offerProduct?.OfferId === - (sameBookingTypeFreeProduct?.OfferMessage?.[0] - ?.OfferId || - otherBookingTypeFreeProduct?.OfferMessage?.[0] - ?.OfferId) && + (sameBookingTypeFreeProduct?.OfferMessage?.[0] + ?.OfferId || + otherBookingTypeFreeProduct?.OfferMessage?.[0] + ?.OfferId) && offerProduct?.OfferMode === - (sameBookingTypeFreeProduct?.OfferMode || - otherBookingTypeFreeProduct?.OfferMode); + (sameBookingTypeFreeProduct?.OfferMode || + otherBookingTypeFreeProduct?.OfferMode); if (hasMatchingFreeProduct && isMatchingOffer) { // Get loyalty points from the matching free product @@ -2397,11 +2418,11 @@ const BSBillingEditQuantity = (props) => { if ( cartItem.ProdId === sameBookingTypeProduct.ProdId && cartItem.InwardDtlId === - sameBookingTypeProduct.InwardDtlId && + sameBookingTypeProduct.InwardDtlId && cartItem.BookingTypeName === - sameBookingTypeProduct.BookingTypeName && + sameBookingTypeProduct.BookingTypeName && cartItem.OrderRate === - sameBookingTypeProduct.OrderRate && + sameBookingTypeProduct.OrderRate && cartItem.OfferMode && cartItem.Offer > 0 ) { @@ -2454,11 +2475,11 @@ const BSBillingEditQuantity = (props) => { if ( cartItem.ProdId === sameBookingTypeProduct.ProdId && cartItem.InwardDtlId === - sameBookingTypeProduct.InwardDtlId && + sameBookingTypeProduct.InwardDtlId && cartItem.BookingTypeName === - sameBookingTypeProduct.BookingTypeName && + sameBookingTypeProduct.BookingTypeName && cartItem.OrderRate === - sameBookingTypeProduct.OrderRate && + sameBookingTypeProduct.OrderRate && cartItem.OfferMode && cartItem.Offer > 0 ) { @@ -2547,11 +2568,11 @@ const BSBillingEditQuantity = (props) => { if ( cartItem.ProdId === otherBookingTypeProduct.ProdId && cartItem?.InwardDtlId === - otherBookingTypeProduct.InwardDtlId && + otherBookingTypeProduct.InwardDtlId && cartItem?.BookingTypeName === - otherBookingTypeProduct.BookingTypeName && + otherBookingTypeProduct.BookingTypeName && cartItem?.OrderRate === - otherBookingTypeProduct.OrderRate && + otherBookingTypeProduct.OrderRate && cartItem?.OfferMode && cartItem?.Offer > 0 ) { @@ -2580,11 +2601,11 @@ const BSBillingEditQuantity = (props) => { if ( cartItem.ProdId === otherBookingTypeProduct.ProdId && cartItem.InwardDtlId === - otherBookingTypeProduct.InwardDtlId && + otherBookingTypeProduct.InwardDtlId && cartItem.BookingTypeName === - otherBookingTypeProduct.BookingTypeName && + otherBookingTypeProduct.BookingTypeName && cartItem.OrderRate === - otherBookingTypeProduct.OrderRate && + otherBookingTypeProduct.OrderRate && cartItem.OfferMode && cartItem.Offer > 0 ) { @@ -2614,11 +2635,11 @@ const BSBillingEditQuantity = (props) => { if ( cartItem.ProdId === otherBookingTypeProduct.ProdId && cartItem.InwardDtlId === - otherBookingTypeProduct.InwardDtlId && + otherBookingTypeProduct.InwardDtlId && cartItem.BookingTypeName === - otherBookingTypeProduct.BookingTypeName && + otherBookingTypeProduct.BookingTypeName && cartItem.OrderRate === - otherBookingTypeProduct.OrderRate && + otherBookingTypeProduct.OrderRate && cartItem.OfferMode && cartItem.Offer > 0 ) { @@ -2717,12 +2738,12 @@ const BSBillingEditQuantity = (props) => { product?.ProdId === editedProduct?.ProdId && product?.InwardDtlId === editedProduct?.InwardDtlId && product?.OfferId === - (sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId || - otherBookingTypeFreeProduct?.OfferMessage?.[0] - ?.OfferId) && + (sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId || + otherBookingTypeFreeProduct?.OfferMessage?.[0] + ?.OfferId) && product?.OfferMode === - (sameBookingTypeFreeProduct?.OfferMode || - otherBookingTypeFreeProduct?.OfferMode) + (sameBookingTypeFreeProduct?.OfferMode || + otherBookingTypeFreeProduct?.OfferMode) ) { return { ...product, @@ -2756,12 +2777,12 @@ const BSBillingEditQuantity = (props) => { // Also check main offer conditions const isMatchingOffer = offerProduct?.OfferId === - (sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId || - otherBookingTypeProduct?.OfferMessage?.[0] - ?.OfferId) && + (sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId || + otherBookingTypeProduct?.OfferMessage?.[0] + ?.OfferId) && offerProduct?.OfferMode === - (sameBookingTypeProduct?.OfferMode || - otherBookingTypeProduct?.OfferMode); + (sameBookingTypeProduct?.OfferMode || + otherBookingTypeProduct?.OfferMode); if (hasMatchingFreeProduct && isMatchingOffer) { // Get loyalty points from the matching free product @@ -2840,11 +2861,11 @@ const BSBillingEditQuantity = (props) => { if ( cartItem.ProdId === sameBookingTypeProduct.ProdId && cartItem.InwardDtlId === - sameBookingTypeProduct.InwardDtlId && + sameBookingTypeProduct.InwardDtlId && cartItem.BookingTypeName === - sameBookingTypeProduct.BookingTypeName && + sameBookingTypeProduct.BookingTypeName && cartItem.OrderRate === - sameBookingTypeProduct.OrderRate && + sameBookingTypeProduct.OrderRate && cartItem.OfferMode && cartItem.Offer > 0 ) { @@ -2903,11 +2924,11 @@ const BSBillingEditQuantity = (props) => { if ( cartItem.ProdId === otherBookingTypeProduct.ProdId && cartItem.InwardDtlId === - otherBookingTypeProduct.InwardDtlId && + otherBookingTypeProduct.InwardDtlId && cartItem.BookingTypeName === - otherBookingTypeProduct.BookingTypeName && + otherBookingTypeProduct.BookingTypeName && cartItem.OrderRate === - otherBookingTypeProduct.OrderRate && + otherBookingTypeProduct.OrderRate && cartItem.OfferMode && cartItem.Offer > 0 ) { @@ -2979,12 +3000,12 @@ const BSBillingEditQuantity = (props) => { product?.ProdId === editedProduct?.ProdId && product?.InwardDtlId === editedProduct?.InwardDtlId && product?.OfferId === - (sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId || - otherBookingTypeFreeProduct?.OfferMessage?.[0] - ?.OfferId) && + (sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId || + otherBookingTypeFreeProduct?.OfferMessage?.[0] + ?.OfferId) && product?.OfferMode === - (sameBookingTypeFreeProduct?.OfferMode || - otherBookingTypeFreeProduct?.OfferMode) + (sameBookingTypeFreeProduct?.OfferMode || + otherBookingTypeFreeProduct?.OfferMode) ) { return { ...product, @@ -3018,12 +3039,12 @@ const BSBillingEditQuantity = (props) => { // Also check main offer conditions const isMatchingOffer = offerProduct?.OfferId === - (sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId || - otherBookingTypeProduct?.OfferMessage?.[0] - ?.OfferId) && + (sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId || + otherBookingTypeProduct?.OfferMessage?.[0] + ?.OfferId) && offerProduct?.OfferMode === - (sameBookingTypeProduct?.OfferMode || - otherBookingTypeProduct?.OfferMode); + (sameBookingTypeProduct?.OfferMode || + otherBookingTypeProduct?.OfferMode); if (hasMatchingFreeProduct && isMatchingOffer) { // Get loyalty points from the matching free product @@ -3178,17 +3199,17 @@ const BSBillingEditQuantity = (props) => { changeOrderCardDetails( CartOrderDetails?.map((i) => i?.InwardDtlId == updatedProduct?.InwardDtlId && - i?.BookingTypeName == updatedProduct?.BookingTypeName && - i?.localId === updatedProduct?.localId + i?.BookingTypeName == updatedProduct?.BookingTypeName && + i?.localId === updatedProduct?.localId ? { - ...updatedProduct, - Offer: 0, - OfferType: - updatedProduct?.Type === 'C' - ? updatedProduct?.OfferType - : null, - OfferMessage: null, - } + ...updatedProduct, + Offer: 0, + OfferType: + updatedProduct?.Type === 'C' + ? updatedProduct?.OfferType + : null, + OfferMessage: null, + } : i ) ) @@ -3224,10 +3245,10 @@ const BSBillingEditQuantity = (props) => { ((c?.OfferModeType && c?.OfferMode === 'B' ? true : c?.OfferMode !== 'B') && - c?.OfferMode !== 'P' && - c?.OfferMode !== 'C' && - c?.OfferMode !== 'O' && - c?.OfferMode !== 'L' + c?.OfferMode !== 'P' && + c?.OfferMode !== 'C' && + c?.OfferMode !== 'O' && + c?.OfferMode !== 'L' ? true : c?.Offer === 0); @@ -3481,16 +3502,21 @@ const BSBillingEditQuantity = (props) => { ); const editedProduct = { ...CartOrderDetails[editedProductIndex], - OrderQty: qty + OrderQty: qty, }; - await handleEditQuantity(editedProduct, editedProductIndex, editedProduct.OrderRate, qty); + await handleEditQuantity( + editedProduct, + editedProductIndex, + editedProduct.OrderRate, + qty + ); props.handleEditQuantityCancel(); setClearQuantity(false); }; const isKg = props?.Productdata?.Size == 1 && - ["KG", "KGS"].includes(props?.Productdata?.UomName?.toUpperCase()); + ['KG', 'KGS'].includes(props?.Productdata?.UomName?.toUpperCase()); return (
@@ -3589,23 +3615,30 @@ const BSBillingEditQuantity = (props) => { Packing - {isKg && ()} - + {isKg && ( + + )}
{RadioBtnSelection == 'Quantity' && ( <> -
+
{ + dispatch(changefocusStatusCust(!selectStatuscust)); + dispatch(changeCombofocus(false)); + }} + > @@ -3614,6 +3647,10 @@ const BSBillingEditQuantity = (props) => { type="number" value={Quantity} onChange={(e) => setQuantity(e.target.value)} + onBlur={() => { + dispatch(changefocusStatusCust(!selectStatuscust)); + dispatch(changeCombofocus(false)); + }} className="EditQuantity-Quantitybox" />
diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx index e2d9943..b9d4a12 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx @@ -11,17 +11,21 @@ import { InputField } from '../../../../../Components/Forms/InputField'; import { GlobalOrderCardDetails, changeOrderCardDetails, + changefocusStatusCust, + changeCombofocus, + GlobalfocusStatusCust, } from '../../../../../Features/BookingScreen/BookingData/BookingData'; import { useDispatch, useSelector } from 'react-redux'; import { validateSafeInput } from '../../../../../Services/Others'; import { TextAreaInput } from '../../../../../../ownLib/my-ui-lib'; -import "../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.scss" +import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.scss'; const BSImeiDetails = (props) => { const formRef = useRef(null); const dispatch = useDispatch(); const [messageType, setMessageType] = useState(null); const [messageData, setMessageData] = useState(null); const CartOrderDetails = useSelector(GlobalOrderCardDetails); + const selectStatuscust = useSelector(GlobalfocusStatusCust); const [DeviceDetailOpen, setDeviceDetailOpen] = useState(props.DeviceDetails); const [ProductDetail, setProductDetail] = useState(props.ProductDetail); const [RadioBtnSelection, setRadioBtnSelection] = useState('Serial'); @@ -51,8 +55,8 @@ const BSImeiDetails = (props) => { ); formRef?.current?.setFieldsValue({ - description: productidentifier?.[0]?.Description || "", - }) + description: productidentifier?.[0]?.Description || '', + }); }, []); const CloseDeviceDetailModal = () => { props.handleDeviceDetailClose(); @@ -72,8 +76,7 @@ const BSImeiDetails = (props) => { } else { setSerialNumberList([...SerialNumberList, e]); } - } - else { + } else { setMessageType('error'); setMessageData('Already Selected '); } @@ -94,7 +97,6 @@ const BSImeiDetails = (props) => { setMessageData('you cant enter more than Order Qty'); } formRef.current?.resetFields(['SerialNumbertext', 'IMEINumbertext']); - }; const IMEINumberOnchange = (e) => { @@ -139,8 +141,10 @@ const BSImeiDetails = (props) => { setMessageType(null); }, []); const AddDeviceDetails = () => { - - console.log(formRef?.current?.getFieldsValue, "formRef?.current?.getFieldsValue") + console.log( + formRef?.current?.getFieldsValue, + 'formRef?.current?.getFieldsValue' + ); const maxLength = Math.max(SerialNumberList.length, IMEINumberList.length); // Create the new object array const IdentifyDetails = Array.from({ length: maxLength }, (_, index) => { @@ -165,17 +169,16 @@ const BSImeiDetails = (props) => { cartItem // if the item is already in the cart, increase the quantity of the item ) => cartItem.ProdId === ProductDetail.ProdId && - cartItem.InwardDtlId === ProductDetail.InwardDtlId && - cartItem?.OrderRate === ProductDetail?.OrderRate && - cartItem?.BookingTypeName === ProductDetail?.BookingTypeName + cartItem.InwardDtlId === ProductDetail.InwardDtlId && + cartItem?.OrderRate === ProductDetail?.OrderRate && + cartItem?.BookingTypeName === ProductDetail?.BookingTypeName ? { ...cartItem, ProductIdentifierDtls: IdentifyDetails } : cartItem // otherwise, return the cart item ) ) ); - formRef?.current?.resetFields() + formRef?.current?.resetFields(); CloseDeviceDetailModal(); - }; console.log(ProductDetail, 'ProductDetaildevice'); return ( @@ -239,7 +242,7 @@ const BSImeiDetails = (props) => { {RadioBtnSelection == 'Serial' && (
- {ProductDetail?.FullProductIdentifierDtls?.length > 0 && + {ProductDetail?.FullProductIdentifierDtls?.length > 0 && ( { onChangeFunction={(e) => SerialNumberOnchange(e)} /> - - } + )} { - await validateSafeInput(value); return Promise.resolve(); }, }, ]} > - { - // if (['e', 'E', '+', '-', '.'].includes(e.key)) { - // e.preventDefault(); - // } - // }} - /> +
{ + dispatch(changefocusStatusCust(!selectStatuscust)); + dispatch(changeCombofocus(false)); + }} + > + { + dispatch(changefocusStatusCust(!selectStatuscust)); + dispatch(changeCombofocus(false)); + }} + /> +
{
)} - {RadioBtnSelection == 'IMEI' && (
- {ProductDetail?.FullProductIdentifierDtls?.length > 0 && + {ProductDetail?.FullProductIdentifierDtls?.length > 0 && ( { className="field-DropDown" onChangeFunction={(e) => IMEINumberOnchange(e)} /> - } + + )} { - await validateSafeInput(value); return Promise.resolve(); }, }, ]} > - { - // if (['e', 'E', '+', '-', '.'].includes(e.key)) { - // e.preventDefault(); - // } - // }} - /> +
{ + dispatch(changefocusStatusCust(!selectStatuscust)); + dispatch(changeCombofocus(false)); + }} + > + { + dispatch(changefocusStatusCust(!selectStatuscust)); + dispatch(changeCombofocus(false)); + }} + /> +
{
)} -
+
Description..} @@ -411,7 +423,6 @@ const BSImeiDetails = (props) => {
-
{ icon={} >
-
+
} handleCancel={CloseDeviceDetailModal} /> -
+
); }; export default BSImeiDetails; diff --git a/src/Styles/BookingScreen/Components/BSNavbar/BSNavbar1.scss b/src/Styles/BookingScreen/Components/BSNavbar/BSNavbar1.scss index e33efd8..db0b57b 100644 --- a/src/Styles/BookingScreen/Components/BSNavbar/BSNavbar1.scss +++ b/src/Styles/BookingScreen/Components/BSNavbar/BSNavbar1.scss @@ -514,6 +514,7 @@ position: absolute; z-index: 10; left: 6px; + background-color: unset !important; } .custom-input { padding: 10px 30px 10px 30px;