yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Quintiq file version 2.0
#parent: #root
Method PreparePeriodSpecification (
  MacroPlan macroplan
)
{
  Description: 'Remove all period specification except for weekly period specification and set it as for planning.'
  TextBody:
  [*
    traverse( macroplan, PeriodSpecification_MP, ps )
    { 
      if( ps.ID() = PeriodSpecificationUtil::GetPeriodSpecificationID_DemoDataWeekly() )
      {
        ps.Update( ps.ID(), ps.TimeUnit(), ps.NrOfTimeUnit(), ps.PeriodAlignment(), 3, ps.NrOfFuturePeriod(), true, false, true, true );
      }
      else if( not ps.IsDummyPlanningPeriod() )
      {
        ps.Delete();  
      } 
    }
  *]
  InterfaceProperties { Accessibility: 'Module' }
}