I have a very simple problem which I can't get it. First, I have an ingredient which has an approved quantity. And that ingredient has several expiration dates. However, I want to check if my expiration dates which has the "quantity to transfer" is not more than the approved quantity.
How should I check this? I already finished some parts BUT this one I couldn't compare since it has to check several rows of "quantity to transfer" against the one approved quantity. Here's the code link below:
FORKED LINK HERE
customValidator(group: any) {
if ((group.controls.transfer_qty.value > group.parent.parent.controls.approved_qty.value)) {
return { out1: true }
}
if ((group.controls.transfer_qty.value > group.controls.available_qty.value)) {
return { out2: true }
}
return null;
}