yanweiyuan3
2023-10-27 d1d15b61dfcf7fd0f800b32359f082cf580ed556
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
Quintiq file version 2.0
#parent: #root
Method InitializeDialog () id:Method_DialogEditGlobalParameter_InitializeDialog
{
  #keys: '[113694.1.1414699377]'
  Body:
  [*
    // Initialize the dialog, set string selection and labels.
    data := Dialog.Data();
    
    Dialog.EnableDisableComponents();
    Dialog.ShowHideComponents();
    Dialog.HideOptimizerSettings();
    
    // Populate selection with all available time units
    StringSelectionPeriodSpecification.Strings( PeriodSpecification_MP::GetExistingPeriodSpecificationID( MacroPlan ) );
    
    // Populate selection with all available disagggregation factor
    StringSelectionDisaggregationRatio.Strings( GlobalParameters_MP::GetAllDisaggregationRatio() );
    
    // Populate seleciton with all available operation lead time calculation options
    StringSelectionOperationLeadTimeLogic.Strings( GlobalParameters_MP::GetAllOperationLeadTimeLogic() );
    
    // Populate seleciton with all available lane lead time calculation options
    StringSelectionLanesLeadTimeLogic.Strings( GlobalParameters_MP::GetAllLaneLeadTimeLogic() );
    
    // Populate selection with all available forecast netting rule options
    StringSelectionForecastNettingRule.Strings( GlobalParameters_MP::GetAllForecastNettingRule() );
    
    // Populate string for all accounts
    if( not isnull( data.WrappedInstance() ) )
    {
    
      accounts := MacroPlan.GetAllAccounts();
      StringSelectionAccountForInventoryHolding.Strings( accounts );
    
      // Set default value for string selection account xxx if it does not have a value
      if( data.DefaultAccountForInventoryHolding() = '' )
      {
        inventoryholdacc := select( MacroPlan, Account_MP, acc,
                                    acc.IsForAccountAssignment(),
                                    acc.DefaultCostDriver() = Translations::MP_AccountAssignmentCostDriverInventoryHolding() );
    
        data.DefaultAccountForInventoryHolding( guard( inventoryholdacc.Name(), '' ) );
      }
    }
  *]
}