Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod UpdateNonFinancialKPIValueInPeriod ( 
 | 
  KPIValues kpivalues, 
 | 
  Period_MP period, 
 | 
  DateTime start, 
 | 
  DateTime end, 
 | 
  Scenario scenario 
 | 
) 
 | 
{ 
 | 
  Description: 'Update kpi value in period other than account kpis' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Non financial kpis 
 | 
    traverse( kpivalues, Elements, kpivalue ) 
 | 
    { 
 | 
      kpiname := kpivalue.KPI().Name(); 
 | 
     
 | 
      // Only create for TargetInventoryLevel, Fulfillment, Volume and PostponedPenalty 
 | 
      if( kpiname = Translations::MP_GlobalParameters_KPISafetyStock() ) 
 | 
      { 
 | 
        value := guard( period.TargetInventoryLevelFulfillment() / period.TargetInventoryLevel() * 100, 0 ); 
 | 
        KPIValueInPeriod::Create( kpivalue, start, end, value, kpiname ); 
 | 
      } 
 | 
     
 | 
      else if( kpiname = Translations::MP_GlobalParameters_KPIFulfillmentName() ) 
 | 
      { 
 | 
        value := guard( period.SalesDemandFulfillmentWithExclusion() / period.SalesDemandQuantityWithExclusion() * 100, 0 ); 
 | 
        KPIValueInPeriod::Create( kpivalue, start, end, value, kpiname ); 
 | 
      } 
 | 
     
 | 
      else if( kpiname = Translations::MP_GlobalParameters_KPIVolumeName() ) 
 | 
      { 
 | 
        value := period.SalesDemandFulfillmentWithExclusion(); 
 | 
        KPIValueInPeriod::Create( kpivalue, start, end, value, kpiname ); 
 | 
      } 
 | 
     
 | 
      else if( kpiname = Translations::MP_GlobalParameters_KPIPostponementPenaltyName() ) 
 | 
      { 
 | 
        value := period.PostponedSalesDemandPenalty(); 
 | 
        KPIValueInPeriod::Create( kpivalue, start, end, value, kpiname ); 
 | 
      } 
 | 
       
 | 
      // Total expired quantity KPI 
 | 
      else if( kpiname = Translations::MP_GlobalParameters_KPITotalExpiredQuantity() ) 
 | 
      { 
 | 
        value := period.TotalExpiredQuantity(); 
 | 
        KPIValueInPeriod::Create( kpivalue, start, end, value, kpiname ); 
 | 
      } 
 | 
      // Number of shelf-life violation KPI 
 | 
      else if( kpiname = Translations::MP_GlobalParameters_KPINumberOfShelfLifeViolation() ) 
 | 
      { 
 | 
        value := [Real] period.NumberOfShelfLifeViolations(); 
 | 
        KPIValueInPeriod::Create( kpivalue, start, end, value, kpiname ); 
 | 
      } 
 | 
    } 
 | 
  *] 
 | 
} 
 |