Quintiq file version 2.0
|
#parent: #root
|
StaticMethod Initialize (
|
MacroPlan owner
|
)
|
{
|
Description: '初始化'
|
TextBody:
|
[*
|
// 甄兰鸽 Jun-24-2024 (created)
|
owner.InventorySummarySource( relflush );
|
products := construct( Product_MPs );
|
allunit := InventorySummaryReport::GetDefaultAllUnit();
|
ccunit := InventorySummaryReport::GetDefaultCCUnit();
|
dlunit := InventorySummaryReport::GetDefaultDLUnit();
|
|
source := owner.InventorySummarySource( relnew, ID := InventorySummaryReport::GetDefaultName(), Name := InventorySummaryReport::GetDefaultName() );
|
table := source.InventorySummaryReport( relnew, ID := source.Name(), Name := source.Name() );
|
showtable := source.InventorySummaryReport( relnew, ID := source.Name() + 'Show', Name := source.Name(), IsShow := true );
|
startofplanning := owner.StartOfPlanning();
|
startofyear := startofplanning.StartOfYear();
|
startofnextyear := startofplanning.StartOfNextYear();
|
|
search := source.InventorySummarySearch( relnew, Unit := allunit, Generation := allunit, MqbMlb := allunit, Power := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );
|
|
table.GenerateColumn( owner );
|
|
//从Product planning查找库存点为长春装配线边库的所有MQB产品,取Total Demand字段按月汇总需求数量
|
traverse( owner, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsLeaf() and not pisp.IsSystem() and ( pisp.StockingPoint_MP().UnitID() = ccunit or pisp.StockingPoint_MP().UnitID() = dlunit ) ){
|
unit := pisp.StockingPoint_MP().UnitID();
|
product := pisp.Product_MP();
|
traverse( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start() >= startofplanning
|
and pispip.Start() < startofnextyear and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Month() ){
|
periodtime := pispip.Start().StartOfMonth().Date();
|
periodname := periodtime.Format( "M2/D2/Y" );
|
column := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname and column.Period() = periodtime );
|
ccrow := table.GetRow( ccunit, product.ID(), startofyear, startofnextyear );
|
ccrow.Initialize( column, pispip );//取Total Demand字段按月汇总需求数量
|
|
allrow := table.GetRow( allunit, product.ID(), startofyear, startofnextyear );
|
allrow.Initialize( column, pispip );
|
}
|
}
|
|
rows := selectsortedset( table, InventroySummaryRow, row, row.Name() );
|
i := 0;
|
traverse( rows, Elements, e ){
|
e.RowNr( i );
|
i := i + 1;
|
}
|
showtable.Generate( search, products );
|
*]
|
}
|