after fixed conflict

This commit is contained in:
unknown 2026-03-03 19:46:21 +05:30
parent a95f8082ac
commit 13dd50a1ea
1 changed files with 538 additions and 504 deletions

View File

@ -2100,6 +2100,40 @@ const BSItemCard = (props) => {
setMessageType('warning');
return;
}
} else if (itemWiseLimitPreferenece) {
const inwardQtyMap = CartOrderDetails.reduce((acc, curr) => {
const inwardId = curr?.InwardDtlId;
const qty = Number(curr?.OrderQty) || 0;
if (acc[inwardId]) {
acc[inwardId] += qty;
} else {
acc[inwardId] = qty;
}
return acc;
}, {});
const currentInwardId = item?.InwardDtlId;
const addQty = Qty || 1;
if (inwardQtyMap[currentInwardId]) {
inwardQtyMap[currentInwardId] += addQty;
} else {
inwardQtyMap[currentInwardId] = addQty;
}
console.log("Final InwardDtlId Qty Map:", inwardQtyMap);
const isExceeded = Object.values(inwardQtyMap).some(
(qty) => qty > maxQtyLimit
);
if (isExceeded) {
setMessageData(`Item Quantity Limit Exceeds than ${maxQtyLimit}`);
setMessageType('warning');
return;
}
}
}
@ -3693,7 +3727,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0);
}
} catch (_) {}
} catch (_) { }
let getCurrentProdDtl = orderDetails?.filter(
(a) => a?.ProdName === ProdName
);
@ -3894,7 +3928,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0);
}
} catch (_) {}
} catch (_) { }
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
return (
@ -3930,7 +3964,7 @@ const BSItemCard = (props) => {
}, 0);
totalOrderQty =
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
} catch (_) {}
} catch (_) { }
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
if (
parseInt(ItemQuantity) >
@ -4016,7 +4050,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0);
}
} catch (_) {}
} catch (_) { }
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
return (
@ -4055,7 +4089,7 @@ const BSItemCard = (props) => {
}, 0);
totalOrderQty =
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
} catch (_) {}
} catch (_) { }
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
if (
parseInt(ItemQuantity) >
@ -4147,7 +4181,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0);
}
} catch (_) {}
} catch (_) { }
let getCurrentProdDtl = orderDetails?.filter(
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
);
@ -4190,7 +4224,7 @@ const BSItemCard = (props) => {
}, 0);
totalOrderQty =
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
} catch (_) {}
} catch (_) { }
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
if (
@ -4274,7 +4308,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0);
}
} catch (_) {}
} catch (_) { }
let getCurrentProdDtl = orderDetails?.filter(
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
);
@ -4321,7 +4355,7 @@ const BSItemCard = (props) => {
}, 0);
totalOrderQty =
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
} catch (_) {}
} catch (_) { }
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
if (