lazhen
2025-01-07 b3987122cbbc46c5c59d3173f37fca3170b6dc5a
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
Quintiq file version 2.0
#parent: #root
Method InitializeComponents (
  Boolean isbatchedit
) id:Method_DialogCreateEditInventoryTarget_InitializeComponents
{
  #keys: '[139394.1.922897751]'
  Body:
  [*
    // Initialize dialog data
    
    // Disable/Hide UIs for batch edit
    ddlProduct.Enabled( not isbatchedit,  Translations::MP_Designer_DisableSelectorForBatchEdit( 'product' ) );
    ddlStockingPoint.Enabled( not isbatchedit, Translations::MP_Designer_DisableSelectorForBatchEdit( 'stocking point' ) );
    dsStart.Enabled( not isbatchedit, Translations::MP_Designer_DisableSelectorForBatchEdit( 'start' ) )
    
    cbBatchEditMinInventory.Visible( isbatchedit );
    cbBatchEditMaxInventory.Visible( isbatchedit );
    
    // Set edit fields value according to the data
    data := DataHolderDialogData.Data();
    
    mininventory := ifexpr( data.HasMinLevelInDays(), data.MinLevelInDays(), data.MinLevelInQuantity() );
    maxinventory := ifexpr( data.HasMaxLevelInDays(), data.MaxLevelInDays(), data.MaxLevelInQuantity() );
    efMinInventoryLevel.Text( ApplicationMacroPlanner.FormatRealToString( mininventory ) );
    efMaxInventoryLevel.Text( ApplicationMacroPlanner.FormatRealToString( maxinventory ) );
    
    rbgMinLevel.Enabled( not isbatchedit, '' );
    efMinInventoryLevel.Enabled( not isbatchedit, '' );
    cbHasMaxInventory.Enabled( not isbatchedit, '' );
    rbgMaxLevel.Enabled( not isbatchedit and data.HasMaxLevel(), '' )
    efMaxInventoryLevel.Enabled( not isbatchedit and data.HasMaxLevel(), '' );
    
    this.SetLabels( data.HasMinLevelInDays(), data.HasMaxLevelInDays(),
                    guard( data.ProductInStockingPoint_MP().UnitOfMeasureName(), data.Product_MP().UnitOfMeasureName() ) );
  *]
}