Quintiq file version 2.0
#parent: #root
Method CreateShadowAcountAssignmentInPeriodForUnitAccount (
  structured[UnitAccount] uas,
  structured[Period_MP] activeperiods
) id:Method_FormCostsForScenarioComparison_CreateShadowAcountAssignmentInPeriodForUnitAccount
{
  #keys: '[127710.1.755579561]'
  Body:
  [*
    // Generate AAiP for Unit accounts
    
    traverse( uas, Elements, ua )
    {
      traverse( ua, Unit.UnitPeriod, up, up.Period_MP().IsInPeriods( activeperiods ) )
      {
        costinperiod := up.GetUnitCost( ua );
        basecost := ua.GetBaseCost( costinperiod, up );
    
        FormCostsForScenarioComparison.CreateAccountAssignmentInPeriod( up.Period_MP(), ua, guard( costinperiod.Cost(), 0.0 ), basecost );
      }
    }
  *]
}
