Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod ArchivedData ( 
 | 
  InterfaceDataset interfaceDataset, 
 | 
  MacroPlan macroPlan 
 | 
) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    traverse ( macroPlan, SalesDemand.astype( Forecast ), forecast, not isnull( forecast.Product_MP() ) ){ 
 | 
    //  factory := f.Origin().Tokenize( "-" ).Element( 0 ); 
 | 
      product := forecast.Product_MP(); 
 | 
      traverse( forecast, PlanningSalesDemandInPeriod, sdip ){ 
 | 
        itrcf := selectobject( interfaceDataset, InterfaceForecast, tempITRCF, tempITRCF.PartNumber() = forecast.ProductID() and tempITRCF.Date() = sdip.StartDate() ); 
 | 
     
 | 
        if ( not isnull( itrcf ) ) { 
 | 
          itrcf.Delete(); 
 | 
        } 
 | 
       
 | 
        interfaceDataset.InterfaceForecast( relnew,  
 | 
                                             Date       := sdip.StartDate(), 
 | 
                                             Factory    := forecast.SalesSegmentName(), 
 | 
                                             PartNumber := forecast.ProductID(), 
 | 
                                             Quantity   := sdip.Quantity(), 
 | 
                                             Generation := product.Generation(), 
 | 
                                             MLBMQB     := product.MQBMLB(), 
 | 
                                             Power      := product.Power(), 
 | 
                                             Origin     := forecast.Origin() 
 | 
                                            ); 
 | 
      } 
 | 
    } 
 | 
  *] 
 | 
} 
 |