Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method AddSPIPs ( 
 | 
  output StockingPointInPeriods spips_o, 
 | 
  Period_MP firstperiod, 
 | 
  Period_MP lastperiod, 
 | 
  StockingPoint_MP sp 
 | 
) as owning StockingPointInPeriods 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    addedsp := construct( StockingPointInPeriods );  
 | 
    firstspip := StockingPointInPeriod::FindStockingPointInPeriodTypeIndex( sp.ID(), firstperiod.Start(), firstperiod.End() );  
 | 
     
 | 
    currentspip := firstspip;  
 | 
    lastperiodstart := lastperiod.Start();  
 | 
    while(  guard( currentspip.Start() <= lastperiodstart, false ) )  
 | 
    { 
 | 
      if ( currentspip.Period_MP().IsInRectangleMetaOptimizer() )  
 | 
      { 
 | 
        spips_o.Add( currentspip );  
 | 
        addedsp.Add( currentspip );  
 | 
      } 
 | 
      currentspip := currentspip.Next();  
 | 
    } 
 | 
    return &addedsp; 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |