yypsybs
2023-09-09 3cb5a54def670d97301f07170fcaad213bfc54f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Quintiq file version 2.0
#parent: #root
Method GetHasConformLotSizingRequirement () declarative remote as Boolean
{
  Description: 'Returns true if the PeriodTaskOperation quantity is an integer multiple of lot size.'
  TextBody:
  [*
    // Adhi Aug-18-2015 (created)
    isvalid := true;
    
    if( this.Operation().HasLotSize()                                 // To prevent division by zero
        and this.UnitPeriod().Period_MP().IsWithinLotSizeHorizon() )  // Only check within the lotsize horizon
    {
      gp := this.MacroPlan().GlobalParameters_MP();
      remainder := GlobalParameters_MP::GetRemainder( this.QuantityToProcess(), this.Operation().LotSize() );
    
      isvalid := gp.GetIsLotSizeWithinTolerance( this.Operation().LotSize(), remainder + this.Operation().LotSize() )
                 or gp.GetIsLotSizeWithinTolerance( this.Operation().LotSize(), remainder )
                 or gp.GetIsBalanceWithinTolerance( remainder, 0.0 );
    
    
    }
    
    return isvalid
  *]
}