Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Function CalcIsPruningCandidate 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    eis := this.MacroPlan().OptimizerMetaEIS();  
 | 
    value := false;  
 | 
    if ( guard( eis.IsNeedEstimatedImprovementScores(), false ) // only compute when meta optimizer is active 
 | 
         and not this.ProductInStockingPoint_MP().HasPostponableSalesDemand() ) // don't prune if possible some sales demand can be postponed, making arriving trips relevant 
 | 
    { 
 | 
      has_salesdemand := this.SalesDemandQuantity() > 0;  
 | 
      has_targetinventory := this.GetHasTargetInventory(); 
 | 
      has_mininventory := this.GetHasMinLevel();   
 | 
       
 | 
      hasnolocaldemand := not has_salesdemand and not has_targetinventory and not has_mininventory;  
 | 
      value :=   hasnolocaldemand  
 | 
                 and guard( this.NextPlanningPISPIP().IsPruningCandidate(), true ) // don't prune if future as some local demand 
 | 
                 and guard( this.ParentOfProductDimension().astype( ProductInStockingPointInPeriodPlanning ).IsPruningCandidate(), true ); // don't prube if there is higher level sales demand 
 | 
    } 
 | 
     
 | 
    this.IsPruningCandidate( value ); 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |