陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
27
28
29
30
Quintiq file version 2.0
#parent: #root
StaticMethod GetIsValidPeriodTask (
  const Operation operation,
  const Period_MP period
) const declarative remote as Boolean
{
  Description: 'Check if the period task has incomplete DD (the dd is out of planning horizon) or if the operation is not valid in this period'
  TextBody:
  [*
    unit := operation.Unit();
    endoffrozen := unit.EndOfFrozen(); 
    
    startdd := period.Start(); 
    isvalid := period.IsPlanning() 
    // The dependent demand is not outside the horizon
    
    if( operation.GetHasLeadTime() )
    {
      gp := operation.Unit().MacroPlan().GlobalParameters_MP();
      startdd := Process_MP::GetDependentDemandEarliestStart( period, operation.LeadTime(), gp, operation );
      isvalid := isvalid and startdd >= period.MacroPlan().Start(); // Return false if the dd falls outside planning horizon.
    }
    
    isvalid := isvalid and period.IsInPeriod( operation.ValidFrom(), operation.ValidTill() );
    isvalid := isvalid and startdd >= endoffrozen; 
    
    return isvalid;
  *]
}