yypsybs
2023-10-10 550ebcf02217f8a0c6fe9001fcfa8e42e9cd6b83
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
Quintiq file version 2.0
#parent: #root
Method Initialize () id:Method_DialogEditDefaultInventoryHoldingCost_Initialize
{
  #keys: '[145730.1.476582867]'
  Body:
  [*
    // Initialize dialog
    // Get allowed account, set to dataholder
    allowedAccounts := construct( Account_MPs );
    allowedCostDrivers := construct( Strings );
    MacroPlan.GetAccounts( Form.GetCostType(), &allowedAccounts, &allowedCostDrivers );
    DataHolderAccounts.Data( &allowedAccounts );
    
    // Set BoundValue according to current gp value
    // Boundvalue is text, thus use AsQuill to convert boolean to text
    gp := MacroPlan.GlobalParameters_MP();
    RadioButtonGroupSelection.BoundValue( gp.HasAbsoluteValueForInventoryHolding().AsQUILL() );
    
    // Pre-select default account based on default account
    account := select( MacroPlan, Account_MP, acc, acc.IsDefaultInventoryHoldingAccount() );
    if( not isnull(  account ) )
    {
      DropDownListAccount.Data( account )
    }
    
    ApplicationMacroPlanner.ShowFormModal( this );
  *]
}