| | |
| | | #parent: #root |
| | | StaticMethod GenerateData ( |
| | | const MacroPlan macroplan, |
| | | const Archive archive, |
| | | InterfaceDataset interfaceDataset, |
| | | String executor, |
| | | Boolean versionflag |
| | |
| | | , ReturnMsg := 'Success' |
| | | , Success := true |
| | | ); |
| | | traverse( macroplan, SalesDemand.astype( Forecast ), forecast, forecast.Origin() = 'PPA' ){ |
| | | cd :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product := forecast.ProductID() |
| | | , DemandDate := forecast.StartDate() |
| | | , DemandQty := [Number]forecast.Quantity() |
| | | , VersionName := macroplan.ScenarioName() |
| | | , InterfaceTime := nowdate |
| | | , VersionFlag := versionflag |
| | | ); |
| | | loginfo.CustomerDemandPPAIDS( relinsert, cd ); |
| | | } |
| | | binaryValue := TemplateManager::GetIDSFullTable( archive, Date::ActualDate().Year() ); |
| | | CustomerDemandIDS::ReadStructure( binaryValue, interfaceDataset ); |
| | | productcolumn := select( interfaceDataset, CustomerDemandIDS.Column, column, column.Index() = 1 ); |
| | | cnv2 := StringToDate::StandardConverter(); |
| | | cnv2.SetCustomConversion(); |
| | | cnv2.CustomFormatString( "dd/MM/yyyy" ); |
| | | traverse( interfaceDataset, CustomerDemandIDS.Row, row ){ |
| | | product := selectobject( row, Cell, cell, cell.Column() = productcolumn ); |
| | | traverse( row, Cell, cell, cell.Column().Index() > 3 ){ |
| | | period := cnv2.Convert( cell.Column().Name() ); |
| | | cd :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product := product.Value() |
| | | , DemandDate := period |
| | | traverse( macroplan, CustomerDemandIDS.Row, row ){ |
| | | traverse( row, Cell, cell ){ |
| | | cd :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product := row.Name() |
| | | , DemandDate := cell.Column().StartDate() |
| | | , DemandQty := [Number]cell.Value() |
| | | , VersionName := macroplan.ScenarioName() |
| | | , InterfaceTime := nowdate |