| | |
| | | //interface.CustomerDemandIDS( relflush ); |
| | | //interface.CustomerDemandIDSSearch( relflush ); |
| | | info( '-------------------------Start---------------------'); |
| | | allunit := CustomerDemandIDS::GetDefaultAllUnit(); |
| | | search := interface.CustomerDemandIDSSearch( relnew, Product := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate(), Unit := allunit ); |
| | | allunit := CustomerDemandIDS::GetDefaultAllUnit();//search := |
| | | interface.CustomerDemandIDSSearch( relnew, Product := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate(), Unit := allunit ); |
| | | name := '客户需求'; |
| | | idstable := selectobject( interface, CustomerDemandIDS, idstable, idstable.ID() = name ); |
| | | if( isnull( idstable ) ){ |
| | | idstable := interface.CustomerDemandIDS( relnew, ID := name, Name := name ); |
| | | } |
| | | showtable := selectobject( interface, CustomerDemandIDS, version, version.IsShow() ); |
| | | if( isnull( showtable ) ){ |
| | | showtable := interface.CustomerDemandIDS( relnew, ID := name + 'Show', Name := name, IsShow := true ); |
| | | } |
| | | //showtable := selectobject( interface, CustomerDemandIDS, version, version.IsShow() ); |
| | | //if( isnull( showtable ) ){ |
| | | // showtable := interface.CustomerDemandIDS( relnew, ID := name + 'Show', Name := name, IsShow := true ); |
| | | //} |
| | | binaryValue := TemplateManager::GetIDSFullTable( archive, Date::ActualDate().Year() ); |
| | | source := GeneralExcelImportAndExportDataSource::Upload( recycle, binaryValue, OS::TempPath() + "template.xlsx" ); |
| | | source.ReadStructure(); |
| | |
| | | traverse( row, GeneralExcelImportAndExportDataCell, cell, cell.GeneralExcelImportAndExportDataColumn().ColumnIndex() > 2 ){ |
| | | period := cnv2.Convert( cell.GeneralExcelImportAndExportDataColumn().Name() ); |
| | | daycolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Day(), period ); |
| | | weekcolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), period ); |
| | | monthcolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), period ); |
| | | // weekcolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), period ); |
| | | // monthcolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), period ); |
| | | |
| | | idsrow.SetCellValue( daycolumn, [Number]cell.Value() ); |
| | | idsrow.SetCellValue( weekcolumn, [Number]cell.Value() ); |
| | | idsrow.SetCellValue( monthcolumn, [Number]cell.Value() ); |
| | | // idsrow.SetCellValue( weekcolumn, [Number]cell.Value() ); |
| | | // idsrow.SetCellValue( monthcolumn, [Number]cell.Value() ); |
| | | } |
| | | } |
| | | } |
| | |
| | | traverse( forecast, PlanningSalesDemandInPeriod, sdip ){ |
| | | idsrow := idstable.GetRowByUnit( forecast.ProductID(), unitname ); |
| | | daycolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Day(), sdip.StartDate() ); |
| | | weekcolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), sdip.StartDate() ); |
| | | monthcolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), sdip.StartDate() ); |
| | | info( '-----------------', isnull( idsrow ), isnull( daycolumn ), isnull( weekcolumn ), isnull( monthcolumn ), sdip.StartDate() ); |
| | | // weekcolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), sdip.StartDate() ); |
| | | // monthcolumn := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), sdip.StartDate() ); |
| | | // info( '-----------------', isnull( idsrow ), isnull( daycolumn ), isnull( weekcolumn ), isnull( monthcolumn ), sdip.StartDate() ); |
| | | idsrow.SetCellValue( daycolumn, [Number]sdip.Quantity() ); |
| | | idsrow.SetCellValue( weekcolumn, [Number]sdip.Quantity() ); |
| | | idsrow.SetCellValue( monthcolumn, [Number]sdip.Quantity() ); |
| | | // idsrow.SetCellValue( weekcolumn, [Number]sdip.Quantity() ); |
| | | // idsrow.SetCellValue( monthcolumn, [Number]sdip.Quantity() ); |
| | | } |
| | | } |
| | | |
| | | source.Delete(); |
| | | info( '-------------------------End---------------------'); |
| | | productids := selectuniquevalues( idstable, Row, row, row.Name() ); |
| | | showtable.Generate( search, productids ); |
| | | //productids := selectuniquevalues( idstable, Row, row, row.Name() ); |
| | | //showtable.Generate( search, productids ); |
| | | *] |
| | | } |