Gross >= Net + MR
Users can make individual adjustments to Gross, Net, and Makeready as long as the primary business rule is maintained.
Currently, the adjustments are made one at a time and always in the same order (Gross first, then Net, finally MR). This causes issues in certain situations
- Gross: 500
- Net + MR: 250 + 100 (350)
- -200 Gross, -200 Net
- +50 Gross, +200 Net
- -50 Gross, +100 Net
- +50 Gross, -100 Net
How can I determine the order by which adjustments should be made?
/* The logic below assumes we've already checked that the final adjusted Gross, Net, MR values will comply with the Rule */
if(GrossAdjustment > 0 && (NetAdjustment + MRAdjustment) > 0)
{
//Gross adjustment first
}
else if(GrossAdjustment < 0 && (NetAdjustment + MRAdjustment) > 0)
{
//Gross adjustment first
}
else if(GrossAdjustment > 0 && (NetAdjustment + MRAdjustment) < 0)
{
//Gross adjustment first
}
else
{
//NetAdjustment & MRAdjustment first
}