Kevin Kok Khah Whey
2023-11-07 5ae534ab606e6f2ba5ea60914224d665b0447d5a
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
Quintiq file version 2.0
#parent: #root
Method OnUserUpdateUI (
  Product_MP product,
  StockingPoint_MP stockingpoint
) id:Method_DialogCreateEditInventoryTarget_OnUserUpdateUI
{
  #keys: '[139394.1.931027168]'
  Body:
  [*
    // Enable disable components when user toggles ui
    isbatchedit := DataHolderDialogDatas.Data().Size() > 1;
    
    pisp := product.FindProductInStockingPoint( stockingpoint.ID() );
    
    // When user selects radio buttons etc in the UI
    this.SetLabels( [Boolean]rbgMinLevel.BoundValue(), 
                    [Boolean]rbgMaxLevel.BoundValue(),
                    guard( pisp.UnitOfMeasureName(), product.UnitOfMeasureName() ) );
    
    rbgMinLevel.Enabled( not isbatchedit or cbBatchEditMinInventory.Checked(), '' );
    efMinInventoryLevel.Enabled( not isbatchedit or cbBatchEditMinInventory.Checked(), '' );
    cbHasMaxInventory.Enabled( not isbatchedit or cbBatchEditMaxInventory.Checked(), '' );
    rbgMaxLevel.Enabled( cbHasMaxInventory.Checked()
                         and ( not isbatchedit or cbBatchEditMaxInventory.Checked() ), '' );
    efMaxInventoryLevel.Enabled( cbHasMaxInventory.Checked()
                                 and ( not isbatchedit or cbBatchEditMaxInventory.Checked() ), '' );
    
    // Set dropdownlist (sp & product) to disabled during batch edit
    ddlProduct.Enabled( not isbatchedit, Translations::MP_Designer_DisableSelectorForBatchEdit( 'product' ) );
    ddlStockingPoint.Enabled( not isbatchedit, Translations::MP_Designer_DisableSelectorForBatchEdit( 'stocking point' ) );
  *]
}