| Quintiq file version 2.0 | 
| #parent: #root | 
| Method PISPGapFill ( | 
|   LibOpt_Scope scope, | 
|   RunContextForCapacityPlanning runcontext | 
| ) | 
| { | 
|   TextBody: | 
|   [* | 
|     this.ProductInStockingPointInPeriodPlanningHelper( relflush );  | 
|     this.ProductInStockingPoint_MPHelper( relflush );  | 
|     traverse( scope.GetPISPIPInOptimizerRun(), Elements, pispip )  | 
|     { | 
|       pispip.SelectorMetaHelper( relset, this );  | 
|       pispip.ProductInStockingPoint_MP().SelectorMetaHelper( relset, this );  | 
|     } | 
|      | 
|     traverse( this, ProductInStockingPoint_MPHelper, pisp )  | 
|     { | 
|       pisp.EarliestPISPIPInScope( relflush ); | 
|       pisp.LatestPISPIPInScope( relflush );  | 
|     } | 
|      | 
|     traverse( this, ProductInStockingPointInPeriodPlanningHelper, pispip )  | 
|     { | 
|       pisp := pispip.ProductInStockingPoint_MP();  | 
|        | 
|       if ( guard( pispip.Start() > pisp.LatestPISPIPInScope().Start(), true ) ) | 
|       { | 
|         pisp.LatestPISPIPInScope( relset, pispip );  | 
|       } | 
|       if ( guard( pispip.Start() < pisp.EarliestPISPIPInScope().Start(), true ) ) | 
|       { | 
|         pisp.EarliestPISPIPInScope( relset, pispip );  | 
|       } | 
|     } | 
|      | 
|     traverse( this, ProductInStockingPoint_MPHelper, pisp, pisp.IsLeaf() ) | 
|     { | 
|       firstpispip := pisp.EarliestPISPIPInScope();  | 
|       lastpispip := pisp.LatestPISPIPInScope();  | 
|      | 
|       currentpispip := firstpispip;  | 
|       while( not isnull( currentpispip )  | 
|              and currentpispip.Start() < lastpispip.Start() )  | 
|       { | 
|         if ( not currentpispip.SelectorMetaHelper() = this )  | 
|         { | 
|           scope.Add( currentpispip ); // we want to avoid calling this if the pispip is already in scope for performance | 
|         }  | 
|         currentpispip := currentpispip.NextPlanningPISPIP(); | 
|       } | 
|     } | 
|      | 
|     this.AddClosureForPISPIPInventorySpecificationAsDays( scope, runcontext ); // requires pisp.EarliestPISPIPInScope & ProductInStockingPoint_MPHelper | 
|      | 
|     // clear dont want to spend database access | 
|     this.ProductInStockingPointInPeriodPlanningHelper( relflush );  | 
|     this.ProductInStockingPoint_MPHelper( relflush ); | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |