Quintiq file version 2.0 
 | 
#parent: #root 
 | 
MethodOverride GetActualCosts ( 
 | 
  Period_MP period 
 | 
) remote as Real 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    totalCost := 0.0; 
 | 
     
 | 
    if( period.IsPlanning() ) //planning period, derive calculation 
 | 
    { 
 | 
      totalCost := sum( this, InventorySupply.ProductInStockingPoint_MP.InventorySupply, is, 
 | 
                        is.ProductInStockingPointInPeriodPlanning().Period_MP() = period, 
 | 
                        is.GetTotalBaseCost( this.AccountAssignment() ) ); 
 | 
    } 
 | 
    else if( period.IsBase() ) //base period, disaggregate from planning period 
 | 
    { 
 | 
      totalCost := this.GetActualCosts( period.PlanningPeriod() ) * period.PlanningSystemRatio(); 
 | 
    } 
 | 
    else  //non base non planning, sum from planning 
 | 
    { 
 | 
      traverse( this, InventorySupply.ProductInStockingPoint_MP.InventorySupply, is, is.ProductInStockingPointInPeriodPlanning().Period_MP() = period ) 
 | 
      { 
 | 
        traverse( is.ProductInStockingPointInPeriodPlanning().GetChildrenOfPeriodDimension(), Elements, childspip ) 
 | 
        { 
 | 
          totalCost := totalCost + this.GetActualCosts( childspip.Period_MP() ); 
 | 
        } 
 | 
      }             
 | 
    } 
 | 
     
 | 
    return totalCost; 
 | 
  *] 
 | 
} 
 |