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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  | Quintiq file version 2.0 
 |  #parent: #root 
 |  Method GenerateBenchmarksRemoveHistoryScript 
 |  { 
 |    TextBody: 
 |    [* 
 |      traverse( this, Product_MP.ProductInStockingPoint_MP, pisp )  
 |      { 
 |        latestactual := maxselect(  pisp, ActualProductInStockingPointInPeriod, a, true, a.Date() );  
 |         
 |        if ( not isnull( latestactual ) )  
 |        { 
 |          qty := latestactual.ActualInventoryLevelEnd();  
 |          pispips := selectset(  pisp, ProductInStockingPointInPeriodPlanning, p, true, p.Start().Date() = Date::Construct( 2018, 12, 1 ) );   
 |          traverse( pisp, ActualProductInStockingPointInPeriod, a )  
 |          { 
 |            a.Delete();  
 |          } 
 |          ActualProductInStockingPointInPeriod::Create( this, pispips, qty );  
 |        } 
 |      } 
 |       
 |      traverse( this, PeriodSpecification_MP, p )  
 |      { 
 |        if ( not p.IsUsedForPlanning() )  
 |        { 
 |          p.Delete();  
 |        } 
 |        else 
 |        { 
 |          p.Update(  p.ID(),  
 |                     p.TimeUnit(),  
 |                     p.NrOfTimeUnit(),  
 |                     p.PeriodAlignment(),  
 |                     1, // 1 historical 
 |                     p.NrOfFuturePeriod(),  
 |                     true, // sync 
 |                     false, // isfrom db 
 |                     p.IsUsedForPlanning(),  
 |                     false ); // clean actuals 
 |        } 
 |      } 
 |    *] 
 |    InterfaceProperties { Accessibility: 'Module' } 
 |  } 
 |  
  |