Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method UpdateSalesDemoDataYear 
 | 
{ 
 | 
  Description: 'Update sales demo data to start of planning to current year' 
 | 
  TextBody: 
 | 
  [* 
 | 
    increasestartofplanning := CommandLine::Instance().SimpleArgument( 'user.increasestartofplanning' ); 
 | 
     
 | 
    if ( increasestartofplanning ) 
 | 
    { 
 | 
      date := Date::Today(); 
 | 
      year := date.Year(); 
 | 
      periodparameter := select( this, IOPeriodParameter_MP, parameter, true ); 
 | 
       
 | 
      if ( not isnull( periodparameter ) and periodparameter.StartOfPlanning().Year() < year ) 
 | 
      { 
 | 
       // Exclude IOUnitCapacity due to IOUnitCapacity Start date is part of the typeindex, need to update the the Date desc 
 | 
        traverse( this, IOBase, io, not io.istype( IOUnitCapacity ) ) 
 | 
        { 
 | 
          io.IncreaseYear();   
 | 
        } 
 | 
         
 | 
        iounitcapacities := selectsortedset( this, IOBase.astype( IOUnitCapacity ), io, -io.Start().DaysAsReal() ); 
 | 
        traverse( iounitcapacities, Elements, e ) 
 | 
        { 
 | 
          e.IncreaseYear(); 
 | 
        } 
 | 
      }   
 | 
    } 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |