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
34
35
36
37
38
39
40
41
Quintiq file version 2.0
#parent: #root
Method UIShowHideComponentForBatchEdit (
  Boolean isInit,
  Boolean isBatchEdit
) id:Method_DialogCreateEditPostponementSpecification_UIShowHideComponentForBatchEdit
{
  #keys: '[135040.0.189841449]'
  Body:
  [*
    // Handles the toggling of the batch related component
    if(  isInit )
    {
      //for initialize, control batch checkboxes visibility
      CheckBoxBatchEditHorizon.Visible( isBatchEdit );
      CheckBoxBatchEditMaximum.Visible( isBatchEdit );
      
      //disable all other component  
      if( isBatchEdit )
      {
        selSalesSegment.Enabled( false,  Translations::MP_PostponementSpecification_DialogCreateEdit_DisableSalesSegment() );
      }
    }
    
    //batch horizon
    batchValidHorizon := ifexpr( isInit
                                ,not isBatchEdit //when isBatchEdit,default=disable all
                                ,CheckBoxBatchEditHorizon.Checked() 
                                );
    StringListHorizonTimeUnit.Enabled( batchValidHorizon, "" );
    NumberPickerNrOfTimeUnit.Enabled( batchValidHorizon, "" );
    
    //batch max
    batchValidMax     := ifexpr( isInit
                                ,not isBatchEdit //when isBatchEdit,default=disable all
                                ,CheckBoxBatchEditMaximum.Checked() 
                                );
    StringListMaxTimeUnit.Enabled( batchValidMax, "" );
    NumberPickerMaxNrOfTimeUnit.Enabled( batchValidMax, "" );
  *]
}