yypsybs
2023-09-09 3cb5a54def670d97301f07170fcaad213bfc54f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 );
      }
    }
  *]
}