| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 | | Quintiq file version 2.0 |  | #parent: #root |  | Method VerifyCampaignPlannedValue ( |  |   Unit unit, |  |   String campaigntype, |  |   RealVector expectedfulfilledqty, |  |   RealVector expectedptcquantity, |  |   RealVector expectedutilizationpercentage, |  |   String operator, |  |   Number nrofcampaigns |  | ) |  | { |  |   Description: 'Verify FulfilledQuantity for Campaign PeriodTaskInCampaign, PeriodTaskInTransition, utilization percentage for campaign' |  |   TextBody: |  |   [* |  |     campaigns := selectsortedset( unit, Campaign_MP, cam, cam.CampaignTypeName() = campaigntype, cam.Start() ); |  |     index :=0  |  |      |  |     traverse( campaigns, Elements, campaign, index < nrofcampaigns ) |  |     { |  |       ptcs := selectsortedset( campaign, OperationInCampaign.PeriodTaskInCampaign, ptc, true, ptc.PeriodTaskOperation().Start() ); |  |       ptc := ptcs.Element( 0 ); |  |        |  |       if ( operator = '=' ) |  |       { |  |         this.Run().AssertEqual( expectedfulfilledqty.Get( index ), campaign.FulfilledQuantity().Round( 0 ), 'Verify Campaign.FufilledQuantity for CampaignType ['+ campaigntype+'].' ); |  |         this.Run().AssertEqual( expectedptcquantity.Get( index ), ptc.Quantity().Round( 0 ), 'Verify PeriodInCampaign.Quantity for CampaignType ['+ campaigntype+ '].'); |  |         this.Run().AssertEqual( expectedutilizationpercentage.Get( index ), ( campaign.Utilization() * 100 ).Round( 0 ), 'Verify Campaign.Utilization for Campaign type ['+ campaigntype +'.' ); |  |       } |  |       else |  |       { |  |          this.Run().AssertGreaterOrEqual( expectedfulfilledqty.Get( index ), campaign.FulfilledQuantity().Round( 0 ), 'Verify Campaign.FufilledQuantity for CampaignType ['+ campaigntype+'].' ); |  |          this.Run().AssertGreaterOrEqual( expectedptcquantity.Get( index ), ptc.Quantity().Round( 0 ), 'Verify PeriodInCampaign.Quantity for CampaignType ['+ campaigntype+ '].'); |  |          this.Run().AssertGreaterOrEqual( expectedutilizationpercentage.Get( index ), ( campaign.Utilization() * 100 ).Round( 0 ), 'Verify Campaign.Utilization for Campaign type ['+ campaigntype +'.' ); |  |       } |  |       index++; |  |     } |  |   *] |  |   InterfaceProperties { Accessibility: 'Module' } |  | } | 
 |