Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod AddPISPIPFromFirstToLast ( 
 | 
  output ProductInStockingPointInPeriodPlanningLeafs candidates_o, 
 | 
  ProductInStockingPoint_MP pisp, 
 | 
  ProductInStockingPointInPeriodPlanningLeaf firstpispip, 
 | 
  DateTime last, 
 | 
  Boolean includefirst, 
 | 
  Boolean includelast 
 | 
) as ProductInStockingPointInPeriodPlanningLeaf 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    pispip := pisp.FirstPISPIPRectangleMeta(); 
 | 
    lastadded := null(  ProductInStockingPointInPeriodPlanningLeaf );  
 | 
    if ( not includefirst and not isnull( pispip ) )  
 | 
    { 
 | 
      pispip := pispip.NextPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf );  
 | 
    }  
 | 
    last := last - ifexpr(  includelast, Duration::Zero(), Duration::Minutes( 1 ) );  
 | 
    while(  not isnull( pispip ) 
 | 
                        and pispip.Start() <= last )  
 | 
    { 
 | 
      candidates_o.Add( pispip );  
 | 
      lastadded := pispip;  
 | 
      pispip := pispip.NextPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf );  
 | 
    } 
 | 
    return lastadded; 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |