admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
Method VerifyPlanResult (
  ProductInStockingPointInPeriodPlanning pispip
)
{
  Description: 'Verify plan result'
  TextBody:
  [*
    this.Run().AssertEqual( 60000.0, pispip.TotalSupplyUser(), "Verify total new supply is equal to total demand of pispip");
    this.Run().AssertEqual( pispip.InventoryLevelEnd().Round( 0 ), ( pispip.TotalSupplyUser() - pispip.GetDemandQuantity() ).Round( 0 ), "Verify the extra supply is not pushed to downstream processing.")
    
    // Locked color in product planning matrix is determined with the following condition
    this.Run().AssertTrue( pispip.HasUserSupplyLocked(), "Verify user plan is locked." );
    
    macroplan := pispip.ProductInStockingPoint_MP().MacroPlan();
    sanitycheckgroupbalance := select( macroplan, SanityCheckGroup.astype( SanityCheckGroupBalance ), sgbalance, true );
    this.Run().AssertTrue( sanitycheckgroupbalance.NumberOfViolation() = 0, "Verify no balance violation occurred in the whole supply chain." );
    
    sm := this.GetScenarioManagerStream();
    sm->( scenariomanager )
    {
      // There could be more than 1 base scenario from different sales demo
      base := select( scenariomanager, ScenarioMP, scenario, scenario.Name() = this.GetDemoScenario() and scenario.Parent().Name()= this.GetDemoFolder() )
      opt := DatasetFindOptions::Construct( base.DatasetName() );
      mp := MDSMacroPlan::Find( opt );
      mp->( basedataset )
      {
        // Verify that test dataset has higher cost
        this.Run().AssertEqual( basedataset.GetKPIFulfillment(), macroplan.GetKPIFulfillment(), "Fulfillment same for both test and original dataset.");
        this.Run().AssertEqual( basedataset.GetKPIFulfillmentTarget(), macroplan.GetKPIFulfillmentTarget(), 'Fulfillment target same for both test and orignal dataset.');
        this.Run().AssertGreater( this.GetAccountKPI( basedataset, 'Inventory holding cost'), this.GetAccountKPI( macroplan, 'Inventory holding cost'), 'Higher inventory holding cost on test dataset.');
        this.Run().AssertGreater( this.GetAccountKPI( basedataset, 'Cost of sales' ), this.GetAccountKPI( macroplan, 'Cost of sales'), 'Higher cost of sales on test dataset.');
      }                          
                                          
     }
  *]
  InterfaceProperties { Accessibility: 'Module' }
}