after fixed conflicts
This commit is contained in:
parent
15bb895eeb
commit
2cbd73f985
|
|
@ -2100,6 +2100,40 @@ const BSItemCard = (props) => {
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
return;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue