Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method GetBaseCostForInventoryHolding ( 
 | 
  output Real cost_o, 
 | 
  output Real costwithinhorizon_o 
 | 
) declarative 
 | 
{ 
 | 
  Description: 'returns inventory holding cost for finished goods and WIP' 
 | 
  TextBody: 
 | 
  [* 
 | 
    wipcostforopt := 0.0;  
 | 
    costperdaytotalforopt := 0.0;  
 | 
    traverse( this, LeafPISP.ProductInStockingPointInPeriodPlanning, pispip ) 
 | 
    { 
 | 
      totalcost := pispip.GetBaseInventoryHoldingCost( this ); 
 | 
     
 | 
      cost_o := cost_o + totalcost; 
 | 
     
 | 
      if( pispip.Period_MP().IsWithinKPIHorizon() ) 
 | 
      { 
 | 
        costwithinhorizon_o := costwithinhorizon_o + totalcost; 
 | 
      } 
 | 
       
 | 
      wipcostforopt := wipcostforopt + pispip.GetBaseWIPCostPerQuantityPerDay( this );  
 | 
      costperdaytotalforopt := costperdaytotalforopt + pispip.GetBaseInventoryHoldingCostPerQuantity(  this ); // different from cost because it ignores the inventory end 
 | 
    } 
 | 
    this.SetBaseCostForOptimizer( wipcostforopt, costperdaytotalforopt ); 
 | 
  *] 
 | 
} 
 |