Quintiq file version 2.0
|
#parent: #root
|
Method GetHasConformInputLotSizingRequirement () declarative remote as Boolean
|
{
|
Description: 'Returns true if the (Operation only) DependentDemand quantity is an integer multiple of input lot size'
|
TextBody:
|
[*
|
isvalid := true;
|
process := this.PeriodTask_MP().Process_MP();
|
pisp := guard( this.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP(), null( ProductInStockingPoint_MP ) );
|
period := guard( this.PeriodTask_MP().UnitPeriod().Period_MP(), null( Period_MP ) );
|
|
if( guard( process.HasInputLotSize()
|
and pisp.HasInputLotSize() // To prevent division by zero
|
and period.IsWithinLotSizeHorizon(), // Only check within the lotsize horizon
|
false )
|
)
|
{
|
gp := this.PeriodTask_MP().MacroPlan().GlobalParameters_MP();
|
inputlotsize := pisp.PISPSpecification().InputLotSize();
|
remainder := GlobalParameters_MP::GetRemainder( this.Quantity(), inputlotsize );
|
|
isvalid := gp.GetIsLotSizeWithinTolerance( inputlotsize, remainder + inputlotsize )
|
or gp.GetIsLotSizeWithinTolerance( inputlotsize, remainder )
|
or gp.GetIsBalanceWithinTolerance( remainder, 0.0 );
|
}
|
|
return isvalid
|
*]
|
}
|