Quintiq file version 2.0
|
#parent: #root
|
Method CreateTestData (
|
MacroPlan macroplan
|
)
|
{
|
Description: 'Create postponement spec and sale demand'
|
TextBody:
|
[*
|
// Setup for sales demand
|
strawberry := UI_Product::FindSingle( this.Run(), macroplan, true, 'Strawberry');
|
priority := 'Normal';
|
uom := 'MT';
|
dewarehouseraw := UI_StockingPoint::FindSingle( this.Run(), macroplan, true, 'DE Warehouse Raw Material' );
|
carrefourAustria := macroplan.FindSalesSegment( 'Carrefour Austria' );
|
currency := macroplan.BaseCurrency();
|
sop := macroplan.StartOfPlanning();
|
sopyear := sop.Year();
|
janSop := Date::Construct( sopyear, 1, 1 );
|
marSop := Date::Construct( sopyear, 3, 1 );
|
F1_ID := "F1_" + strawberry.Name();
|
|
// Create a sales demand for Lowfat in DC-Austria for Carrefour Austria in Jan-sop year with quantity 1000 MT
|
dto_forecast := DTO_Forecast::Construct().CurrencyID( currency.ID() )
|
.StockingPointID( dewarehouseraw.ID() )
|
.SalesSegmentName( carrefourAustria.Name() )
|
.UnitOfMeasureName( uom )
|
.Price( 1000.0 ).PriorityName( priority)
|
.StartDate( janSop )
|
.EndDate( janSop );
|
UI_Forecast::MenuNew( this.Run(), macroplan, dto_forecast.ID( F1_ID ).ProductID( strawberry.ID() ).Quantity ( 1000.0 ).ToNVT() )
|
|
// Create a postponement specifications for Carrefour Austria: Horizon = 6 Month, Max postponement = 3 months
|
PostponementSpecification::Create( carrefourAustria, 'Month', 6, 'Month', 3, false );
|
|
// only make it possible to get strawberry from March onwards, so in order to fulfill the above demand we must postpone
|
// however, with smart plan one should only do this postponement if the Jan psipip is actually explicitly selected. We'll test for both situations
|
dto_routing := DTO_Routing::Construct().ID( 'DE Purchase Strawberry' ).Start( marSop );
|
UI_Routing::MenuEdit( this.Run(), macroplan, dto_routing.ID(), dto_routing.ToNVT() );
|
*]
|
InterfaceProperties { Accessibility: 'Module' }
|
}
|