kisok quantity constrain
This commit is contained in:
parent
70444d3028
commit
608aa917b3
|
|
@ -41,6 +41,7 @@ import {
|
||||||
import { validateOffers } from '../../BSItemCards/ValidateOffer.jsx';
|
import { validateOffers } from '../../BSItemCards/ValidateOffer.jsx';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import WeightCalculatePrice from './WeightCalculatePrice.jsx';
|
import WeightCalculatePrice from './WeightCalculatePrice.jsx';
|
||||||
|
import { calculateOverAllQtyLimit } from '../../../../../utils/calculations.js';
|
||||||
|
|
||||||
const BSBillingEditQuantity = (props) => {
|
const BSBillingEditQuantity = (props) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -49,7 +50,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
const priceChangeInputRef = useRef(null);
|
const priceChangeInputRef = useRef(null);
|
||||||
const reductionInputRef = useRef(null);
|
const reductionInputRef = useRef(null);
|
||||||
|
|
||||||
const { setIndex = () => {} } = props;
|
const { setIndex = () => { } } = props;
|
||||||
|
|
||||||
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
||||||
const SessionData = useSelector(StoredSessionData);
|
const SessionData = useSelector(StoredSessionData);
|
||||||
|
|
@ -64,6 +65,14 @@ const BSBillingEditQuantity = (props) => {
|
||||||
(state) => state?.BookingOFferNew?.OverAllProductBasedProducts,
|
(state) => state?.BookingOFferNew?.OverAllProductBasedProducts,
|
||||||
shallowEqual
|
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 preferenceOffer =
|
const preferenceOffer =
|
||||||
preferenceDatas?.[0]?.['SettingDtlDetails']?.find(
|
preferenceDatas?.[0]?.['SettingDtlDetails']?.find(
|
||||||
(item) => item.SettingIdName === 'Offer'
|
(item) => item.SettingIdName === 'Offer'
|
||||||
|
|
@ -107,8 +116,8 @@ const BSBillingEditQuantity = (props) => {
|
||||||
quantity: 'qty',
|
quantity: 'qty',
|
||||||
Parcel: 'Parcel',
|
Parcel: 'Parcel',
|
||||||
weightAmount: 'weightAmount'
|
weightAmount: 'weightAmount'
|
||||||
};
|
};
|
||||||
const [RadioBtnSelection, setRadioBtnSelection] = useState(() => {
|
const [RadioBtnSelection, setRadioBtnSelection] = useState(() => {
|
||||||
if (props?.shortKeyMethod && SHORTKEY_TO_RADIO[props.shortKeyMethod]) {
|
if (props?.shortKeyMethod && SHORTKEY_TO_RADIO[props.shortKeyMethod]) {
|
||||||
return SHORTKEY_TO_RADIO[props.shortKeyMethod];
|
return SHORTKEY_TO_RADIO[props.shortKeyMethod];
|
||||||
}
|
}
|
||||||
|
|
@ -119,7 +128,7 @@ const [RadioBtnSelection, setRadioBtnSelection] = useState(() => {
|
||||||
return 'Price';
|
return 'Price';
|
||||||
}
|
}
|
||||||
return 'Parcel';
|
return 'Parcel';
|
||||||
});
|
});
|
||||||
// const [RadioBtnSelection, setRadioBtnSelection] = useState(
|
// const [RadioBtnSelection, setRadioBtnSelection] = useState(
|
||||||
// props?.shortKeyMethod == 'price'
|
// props?.shortKeyMethod == 'price'
|
||||||
// ? 'Price'
|
// ? 'Price'
|
||||||
|
|
@ -334,6 +343,7 @@ const [RadioBtnSelection, setRadioBtnSelection] = useState(() => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const calculateOverAllQty = (item, filterItems) => {
|
const calculateOverAllQty = (item, filterItems) => {
|
||||||
|
|
||||||
if (!item) return 0;
|
if (!item) return 0;
|
||||||
|
|
||||||
const totalUsedQty =
|
const totalUsedQty =
|
||||||
|
|
@ -435,6 +445,18 @@ const [RadioBtnSelection, setRadioBtnSelection] = useState(() => {
|
||||||
(e) => e?.localId == localId
|
(e) => e?.localId == localId
|
||||||
);
|
);
|
||||||
const editedProduct = CartOrderDetails[editedProductIndex];
|
const editedProduct = CartOrderDetails[editedProductIndex];
|
||||||
|
|
||||||
|
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}`);
|
||||||
|
setMessageType('warning');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const productBookingType = editedProduct?.BookingTypeName;
|
const productBookingType = editedProduct?.BookingTypeName;
|
||||||
const isItemInCart = CartOrderDetails?.find(
|
const isItemInCart = CartOrderDetails?.find(
|
||||||
(cartItem) =>
|
(cartItem) =>
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import {
|
||||||
import { validateOffers } from '../../BSItemCards/ValidateOffer.jsx';
|
import { validateOffers } from '../../BSItemCards/ValidateOffer.jsx';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import './ComboBillTableEdit.scss';
|
import './ComboBillTableEdit.scss';
|
||||||
|
import { calculateOverAllQtyLimit } from '../../../../../utils/calculations.js';
|
||||||
|
|
||||||
const ComboEditQtyAndRate = (props) => {
|
const ComboEditQtyAndRate = (props) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -37,9 +38,9 @@ const ComboEditQtyAndRate = (props) => {
|
||||||
const quantityInputRef = useRef(null);
|
const quantityInputRef = useRef(null);
|
||||||
const priceChangeInputRef = useRef(null);
|
const priceChangeInputRef = useRef(null);
|
||||||
const {
|
const {
|
||||||
setIndex = () => {},
|
setIndex = () => { },
|
||||||
setEditQtyCombo = () => {},
|
setEditQtyCombo = () => { },
|
||||||
setEditRateCombo = () => {},
|
setEditRateCombo = () => { },
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
||||||
|
|
@ -51,10 +52,19 @@ const ComboEditQtyAndRate = (props) => {
|
||||||
const applyOffer = useApplyOfferto_CardDetail();
|
const applyOffer = useApplyOfferto_CardDetail();
|
||||||
const preferenceDatas = useSelector(PreferenceData);
|
const preferenceDatas = useSelector(PreferenceData);
|
||||||
const EmpAccessDetail = useSelector(GlobalEmpAccessDetail);
|
const EmpAccessDetail = useSelector(GlobalEmpAccessDetail);
|
||||||
|
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 OverAllproductBasedOfferDatas = useSelector(
|
const OverAllproductBasedOfferDatas = useSelector(
|
||||||
(state) => state?.BookingOFferNew?.OverAllProductBasedProducts,
|
(state) => state?.BookingOFferNew?.OverAllProductBasedProducts,
|
||||||
shallowEqual
|
shallowEqual
|
||||||
);
|
);
|
||||||
|
console.log(overAllLimitPreferenece, "itemWiseLimitPreferenece")
|
||||||
const preferenceOffer =
|
const preferenceOffer =
|
||||||
preferenceDatas?.[0]?.['SettingDtlDetails']?.find(
|
preferenceDatas?.[0]?.['SettingDtlDetails']?.find(
|
||||||
(item) => item.SettingIdName === 'Offer'
|
(item) => item.SettingIdName === 'Offer'
|
||||||
|
|
@ -251,7 +261,16 @@ const ComboEditQtyAndRate = (props) => {
|
||||||
item?.SinglePc === 'Y' ? item?.OverAllPcs : item?.BalanceQty;
|
item?.SinglePc === 'Y' ? item?.OverAllPcs : item?.BalanceQty;
|
||||||
return availableQty - totalUsedQty;
|
return availableQty - totalUsedQty;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const quantityValidation = async (val) => {
|
||||||
|
|
||||||
|
setQuantity(val)
|
||||||
|
|
||||||
|
}
|
||||||
const AddProductQuantity = async () => {
|
const AddProductQuantity = async () => {
|
||||||
|
// debugger
|
||||||
|
|
||||||
|
|
||||||
let newPrice = editedPrice > 0 ? editedPrice : props.Productdata.OrderRate;
|
let newPrice = editedPrice > 0 ? editedPrice : props.Productdata.OrderRate;
|
||||||
await dispatch(changeHoldOrderDtl(false));
|
await dispatch(changeHoldOrderDtl(false));
|
||||||
await dispatch(changePreviousOrderLength(CartOrderDetails?.length));
|
await dispatch(changePreviousOrderLength(CartOrderDetails?.length));
|
||||||
|
|
@ -312,6 +331,20 @@ const ComboEditQtyAndRate = (props) => {
|
||||||
let editedProductIndex = CartOrderDetails?.findIndex(
|
let editedProductIndex = CartOrderDetails?.findIndex(
|
||||||
(e) => e?.localId == localId
|
(e) => e?.localId == localId
|
||||||
);
|
);
|
||||||
|
if ((overAllLimitPreferenece || itemWiseLimitPreferenece) && maxQtyLimit) {
|
||||||
|
if (overAllLimitPreferenece) {
|
||||||
|
let removeProds1 = CartOrderDetails?.find((_, index) => index == editedProductIndex)
|
||||||
|
let removeProds = CartOrderDetails?.filter((_, index) => index !== editedProductIndex)
|
||||||
|
|
||||||
|
const calculatedOverAllQty = calculateOverAllQtyLimit(removeProds);
|
||||||
|
if ((calculatedOverAllQty + editedQty) > maxQtyLimit) {
|
||||||
|
setMessageData(`Overall Quantity Limit Exceeds than ${maxQtyLimit}`);
|
||||||
|
setMessageType('warning');
|
||||||
|
setQuantity(removeProds1?.OrderQty || 1)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
const editedProduct = CartOrderDetails[editedProductIndex];
|
const editedProduct = CartOrderDetails[editedProductIndex];
|
||||||
const productBookingType = editedProduct?.BookingTypeName;
|
const productBookingType = editedProduct?.BookingTypeName;
|
||||||
const isItemInCart = CartOrderDetails?.find(
|
const isItemInCart = CartOrderDetails?.find(
|
||||||
|
|
@ -3227,7 +3260,7 @@ const ComboEditQtyAndRate = (props) => {
|
||||||
type="number"
|
type="number"
|
||||||
value={Quantity}
|
value={Quantity}
|
||||||
min="0"
|
min="0"
|
||||||
onChange={(e) => setQuantity(e.target.value)}
|
onChange={(e) => quantityValidation(e.target.value)}
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
if (Quantity && Quantity.trim() !== '') {
|
if (Quantity && Quantity.trim() !== '') {
|
||||||
AddProductQuantity();
|
AddProductQuantity();
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ import { MdOutlineAddShoppingCart } from 'react-icons/md';
|
||||||
import { bulkpostdata } from '../../../../Features/ProductPage/ProductPage.js';
|
import { bulkpostdata } from '../../../../Features/ProductPage/ProductPage.js';
|
||||||
import ProductPriceChange from '../UtillComponents/ProductPriceChange.jsx';
|
import ProductPriceChange from '../UtillComponents/ProductPriceChange.jsx';
|
||||||
import ExpireConfirmModal from '../BookingFunctionality/ExpireConfirmModal.jsx';
|
import ExpireConfirmModal from '../BookingFunctionality/ExpireConfirmModal.jsx';
|
||||||
|
import { calculateOverAllQtyLimit } from '../../../../utils/calculations.js';
|
||||||
|
|
||||||
export function SortableCard({ id, children, item }) {
|
export function SortableCard({ id, children, item }) {
|
||||||
const {
|
const {
|
||||||
|
|
@ -164,6 +165,13 @@ const BSItemCard = (props) => {
|
||||||
// const applyOffer = useApplyOfferto_CardDetail();
|
// const applyOffer = useApplyOfferto_CardDetail();
|
||||||
const preferenceDatas = useSelector(PreferenceData, shallowEqual);
|
const preferenceDatas = useSelector(PreferenceData, shallowEqual);
|
||||||
const { selectedDate } = useDateStore();
|
const { selectedDate } = useDateStore();
|
||||||
|
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 =
|
const preferenceOffer =
|
||||||
preferenceDatas?.[0]?.['SettingDtlDetails']?.find(
|
preferenceDatas?.[0]?.['SettingDtlDetails']?.find(
|
||||||
(item) => item.SettingIdName === 'Offer'
|
(item) => item.SettingIdName === 'Offer'
|
||||||
|
|
@ -180,7 +188,6 @@ const BSItemCard = (props) => {
|
||||||
// GlobalAddCustomerDetails,
|
// GlobalAddCustomerDetails,
|
||||||
// shallowEqual
|
// shallowEqual
|
||||||
// );
|
// );
|
||||||
|
|
||||||
const offerAppliedProducts = useSelector(
|
const offerAppliedProducts = useSelector(
|
||||||
GlobalOfferAppliedProducts,
|
GlobalOfferAppliedProducts,
|
||||||
shallowEqual
|
shallowEqual
|
||||||
|
|
@ -2073,6 +2080,18 @@ const BSItemCard = (props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const AddOrderDetails = async (item) => {
|
const AddOrderDetails = async (item) => {
|
||||||
|
|
||||||
|
if ((overAllLimitPreferenece || itemWiseLimitPreferenece) && maxQtyLimit) {
|
||||||
|
if (overAllLimitPreferenece) {
|
||||||
|
const calculatedOverAllQty = calculateOverAllQtyLimit(CartOrderDetails);
|
||||||
|
if ((calculatedOverAllQty + 1) > maxQtyLimit) {
|
||||||
|
setMessageData(`Overall Quantity Limit Exceeds than ${maxQtyLimit}`);
|
||||||
|
setMessageType('warning');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (preOrder) {
|
if (preOrder) {
|
||||||
await handlePreOrder(item);
|
await handlePreOrder(item);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -3663,7 +3682,7 @@ const BSItemCard = (props) => {
|
||||||
parseInt(totalSelectedProductQty || 0) +
|
parseInt(totalSelectedProductQty || 0) +
|
||||||
parseInt(reorderComboConsumed || 0);
|
parseInt(reorderComboConsumed || 0);
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
let getCurrentProdDtl = orderDetails?.filter(
|
let getCurrentProdDtl = orderDetails?.filter(
|
||||||
(a) => a?.ProdName === ProdName
|
(a) => a?.ProdName === ProdName
|
||||||
);
|
);
|
||||||
|
|
@ -3864,7 +3883,7 @@ const BSItemCard = (props) => {
|
||||||
parseInt(totalSelectedProductQty || 0) +
|
parseInt(totalSelectedProductQty || 0) +
|
||||||
parseInt(reorderComboConsumed || 0);
|
parseInt(reorderComboConsumed || 0);
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
|
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
|
||||||
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
|
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -3900,7 +3919,7 @@ const BSItemCard = (props) => {
|
||||||
}, 0);
|
}, 0);
|
||||||
totalOrderQty =
|
totalOrderQty =
|
||||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||||
if (
|
if (
|
||||||
parseInt(ItemQuantity) >
|
parseInt(ItemQuantity) >
|
||||||
|
|
@ -3986,7 +4005,7 @@ const BSItemCard = (props) => {
|
||||||
parseInt(totalSelectedProductQty || 0) +
|
parseInt(totalSelectedProductQty || 0) +
|
||||||
parseInt(reorderComboConsumed || 0);
|
parseInt(reorderComboConsumed || 0);
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
|
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
|
||||||
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
|
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -4025,7 +4044,7 @@ const BSItemCard = (props) => {
|
||||||
}, 0);
|
}, 0);
|
||||||
totalOrderQty =
|
totalOrderQty =
|
||||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||||
if (
|
if (
|
||||||
parseInt(ItemQuantity) >
|
parseInt(ItemQuantity) >
|
||||||
|
|
@ -4117,7 +4136,7 @@ const BSItemCard = (props) => {
|
||||||
parseInt(totalSelectedProductQty || 0) +
|
parseInt(totalSelectedProductQty || 0) +
|
||||||
parseInt(reorderComboConsumed || 0);
|
parseInt(reorderComboConsumed || 0);
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
let getCurrentProdDtl = orderDetails?.filter(
|
let getCurrentProdDtl = orderDetails?.filter(
|
||||||
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
|
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
|
||||||
);
|
);
|
||||||
|
|
@ -4160,7 +4179,7 @@ const BSItemCard = (props) => {
|
||||||
}, 0);
|
}, 0);
|
||||||
totalOrderQty =
|
totalOrderQty =
|
||||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
|
|
||||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||||
if (
|
if (
|
||||||
|
|
@ -4244,7 +4263,7 @@ const BSItemCard = (props) => {
|
||||||
parseInt(totalSelectedProductQty || 0) +
|
parseInt(totalSelectedProductQty || 0) +
|
||||||
parseInt(reorderComboConsumed || 0);
|
parseInt(reorderComboConsumed || 0);
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
let getCurrentProdDtl = orderDetails?.filter(
|
let getCurrentProdDtl = orderDetails?.filter(
|
||||||
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
|
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
|
||||||
);
|
);
|
||||||
|
|
@ -4291,7 +4310,7 @@ const BSItemCard = (props) => {
|
||||||
}, 0);
|
}, 0);
|
||||||
totalOrderQty =
|
totalOrderQty =
|
||||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
|
|
||||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
export const calculateOverAllQtyLimit = (orders) => {
|
||||||
|
return orders?.reduce((acc, cartItem) => {
|
||||||
|
return acc + (cartItem?.OrderQty || 0);
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue