hongji.li
2023-11-03 aefafd2142478d4fb07d6b8b45c3047e247389e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Quintiq file version 2.0
#parent: #root
Method ExportExcels (
  LibSOPImpExp_UserInputs userInput_i,
  ScenarioManager scenarioManager_i,
  MPSync mpsync_i,
  ExportExcel exportExcel_i
)
{
  Description: 'Export to Excels, used by web app.'
  TextBody:
  [*
    // Store the export result (binary value = excel content, broker name to be used to create the excel filename in client side)
    result_excel_binaryvalues := construct( BinaryValues );
    result_excel_brokernames := construct( Strings );
    
    // Translations are retrieved from method ImportObjectGroup.GetDisplayName()
    this.Export( LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_SupplyChainParameters() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_GlobalParameters() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Periods() ),
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MP_Functionality_InventorySpecifications() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MP_Functionality_InventorySupplies() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Products() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Recipes() ),
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Forecasts() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_ServiceLevels() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Campaigns() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Entities() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Costs() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Lanes() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Routings() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Capacities() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MP_Functionality_SupplySpecifications() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MP_Designer_Actuals() ), 
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MP_GlobalParameters_KPIFeedbackName() ),
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_OptimizerPuzzles() ),
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_PostponementSpecAndFulfillmentRestriction() ),
                 LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_CustomerOrder() ),
                 true /* isBinaryExport */,
                 false /* is3DDrive */, null( FileItem ), 
                 result_excel_binaryvalues, result_excel_brokernames );
    
    scenarioManager_i.Export( LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Strategies() ), 
                              LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Accounts() ), 
                              LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_Bookmarks() ), 
                              LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_KPISetting() ),  
                              true /* isBinaryExport */, 
                              false /* is3DDrive */, null( FileItem ),  
                              result_excel_binaryvalues, result_excel_brokernames );
    
    mpsync_i.Export( LibSOPImpExp_ExportExcel::IsDataSourceIncluded( userInput_i, Translations::MPSync_ObjectGroup_ImportProfiles() ),
                     false /* is3DDrive */, null( FileItem ),
                     result_excel_binaryvalues, result_excel_brokernames );
    
    exportExcel_i.CreateExportExcelFiles( result_excel_binaryvalues, result_excel_brokernames );
  *]
}