yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
Quintiq file version 2.0
#parent: #root
Method VerifyResultAfterNettedQuantity (
  MacroPlan macroplan,
  NamedValueTree nvt_forecasts,
  NamedValueTree nvt_customerorders,
  Boolean checkkpifulfillment,
  Real expectedkpifulfilment
)
{
  Description: 'Verify Forecast.NettedQuantity, CustomerOrder.Quantity, and expected FulfillmentQuantity'
  TextBody:
  [*
    dto_forecasts := DTO_Structured::Construct( nvt_forecasts );
    dto_customerorders := DTO_Structured::Construct( nvt_customerorders );
    
    traverse( dto_forecasts.GetChildren(), Elements.astype( DTO_Forecast ), dto_forecast )
    {
      UI_Forecast::ValidateEquals( this.Run(), macroplan, true, dto_forecast.ID(), dto_forecast.ToNVT() );
    }
    
    traverse( dto_customerorders.GetChildren(), Elements.astype( DTO_CustomerOrder ), dto_customerorder )
    {
      UI_CustomerOrder::ValidateEquals( this.Run(), macroplan, true, dto_customerorder.ID(), dto_customerorder.ToNVT() );
    }
    
    if ( checkkpifulfillment )
    {
      this.VerifyKPIFulfillment( macroplan, expectedkpifulfilment, 0.0, 0.0 );
    }
  *]
  InterfaceProperties { Accessibility: 'Module' }
}