Quintiq file version 2.0
|
#parent: #root
|
Method InitializeNonEntitiesDataAfterImport (
|
Boolean importsalesdemands,
|
Boolean importcustomerorder,
|
Boolean importproducts,
|
Boolean importentities,
|
Boolean importroutings,
|
Boolean importperiods
|
)
|
{
|
Description: 'Create data after import from external'
|
TextBody:
|
[*
|
// cye1 Apr-26-2016 (created)
|
// Create product in stockingpoint
|
this.InitializeProductInStockingPoint();
|
|
haschangesonrouting := importroutings or importproducts or importentities;
|
|
if( haschangesonrouting )
|
{
|
// Rouitng needs to be snchornized when user import unit/product/stockingpoint/routing
|
// So instead of acalling them in seperate method and cause a multi synchronize call, we will just call it once here
|
// Synchronize operation links within a routing
|
// Propagate the relation Operation to Routing Step and the Systems relations
|
Transaction::Transaction().Propagate();
|
traverse( this, Routing, r )
|
{
|
r.SynchronizeAfterImport();
|
}
|
}
|
|
// Relation is empty after execute import broker, need to propagate
|
Transaction::Transaction().Propagate( relation( MacroPlan, SalesDemand ) );
|
if ( importcustomerorder )
|
{
|
traverse( this, SalesDemand.astype( CustomerOrder ), co )
|
{
|
// Customer order don't had an end date, set it to start date
|
co.EndDate( co.StartDate() );
|
}
|
}
|
|
this.CreateProductInStockingPointInPeriod( true /*iscreateall*/ );
|
|
if( importsalesdemands or importperiods or importcustomerorder )
|
{
|
this.InitializeSalesDemandsAfterImport();
|
}
|
*]
|
}
|