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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Quintiq file version 2.0
#parent: #root
Method UIShowHideComponentForBatchEdit (
  Boolean isInit,
  Boolean isBatchEdit
) id:Method_DialogCreateEditProduct_UIShowHideComponentForBatchEdit
{
  #keys: '[135040.0.219771730]'
  Body:
  [*
    // Handles the toggling of the batch related component
    if(  isInit )
    {
      //for initialize, control batch checkboxes visibility
      
      CheckBoxBatchEditParent.Visible( isBatchEdit );  
      CheckBoxBatchEditUOM.Visible( isBatchEdit );  
        
      CheckBoxBatchEditShelfLife.Visible( isBatchEdit );  
      CheckBoxBatchEditMaturation.Visible( isBatchEdit );
      CheckBoxBatchEditByProduct.Visible( isBatchEdit );  
      CheckBoxBatchEditExcludeFromOptimizer.Visible( isBatchEdit );  
      CheckboxBatchEditExcludeFromFulfillmentKPI.Visible( isBatchEdit );
      
      CheckBoxBatchEditNote.Visible( isBatchEdit );  
      
      LabelBatchEditSpacerName.Visible( isBatchEdit );  
      LabelBatchEditSpacerID.Visible( isBatchEdit );  
      
      //disable all other component  
      if( isBatchEdit )
      {
        disableText := Translations::MP_Product_DialogCreateEdit_DisableForBatchEdit();
        disableFlag := false;
        
        selParentProduct.Enabled( disableFlag, disableText );
        EditFieldID.Enabled( disableFlag, disableText );
        EditFieldName.Enabled( disableFlag, disableText );
      }
    }
    
    //batch parent
    batchParentActive := ifexpr( isInit
                                 ,not isBatchEdit //when isBatchEdit,default=disable all
                                 ,CheckBoxBatchEditParent.Checked() 
                                ); 
    selParentProduct.Enabled( batchParentActive, "" );
    
    //batch UOM
    batchUOMActive := ifexpr(  isInit
                              ,not isBatchEdit //when isBatchEdit,default=disable all
                              ,CheckBoxBatchEditUOM.Checked() 
                             ); 
    DropDownListUOM.Enabled( batchUOMActive, "" );
    
    //batch shelf life
    batchShelfLifeActive := ifexpr( isInit
                                   ,not isBatchEdit //when isBatchEdit,default=disable all
                                   ,CheckBoxBatchEditShelfLife.Checked() 
                                  );
    CheckBoxHasShelfLife.Enabled( batchShelfLifeActive, "" );
    EditFieldShelfLife.Enabled( batchShelfLifeActive
                                and CheckBoxHasShelfLife.Checked()
                                , "" );
    //batch maturation
    batchMaturationActive := ifexpr( isInit
                                   ,not isBatchEdit //when isBatchEdit,default=disable all
                                   ,CheckBoxBatchEditMaturation.Checked() 
                                  );
    CheckBoxHasMaturation.Enabled( batchMaturationActive, "" );
    EditFieldMaturation.Enabled( batchMaturationActive
                                and CheckBoxHasMaturation.Checked()
                                , "" );
    
    //batch by-product
    batchByProductActive := ifexpr( isInit
                                   ,not isBatchEdit //when isBatchEdit,default=disable all
                                   ,CheckBoxBatchEditByProduct.Checked() 
                                  );
    CheckBoxIsByProduct.Enabled( batchByProductActive, "" );
    
    
    //batch exclude optimizer
    batchExcludeOptiActive := ifexpr( isInit
                                     ,not isBatchEdit //when isBatchEdit,default=disable all
                                     ,CheckBoxBatchEditExcludeFromOptimizer.Checked() 
                                    );
    CheckBoxExcludeFromOptimizer.Enabled( batchExcludeOptiActive
                                          and not CheckBoxIsPlannedAfterOptimization.Checked()
                                          , "" );
    CheckBoxIsPlannedAfterOptimization.Enabled( batchExcludeOptiActive
                                                and CheckBoxExcludeFromOptimizer.Checked()
                                                , "" );
    
    //batch isexcludedfromfulfillmentkpi
    batchByIsExcludedFulfillmentKPIActive := ifexpr( isInit
                                                     ,not isBatchEdit //when isBatchEdit,default=disable all
                                                     ,CheckboxBatchEditExcludeFromFulfillmentKPI.Checked() 
                                                    );
    CheckboxIsExcludedFromFulfillmentKPI.Enabled( batchByIsExcludedFulfillmentKPIActive, "" );
    
    //batch Note
    batchNoteActive:= ifexpr( isInit
                              ,not isBatchEdit //when sBatchEdit,default=disable all
                              ,CheckBoxBatchEditNote.Checked() 
                            ); 
    EditFieldNotes.Enabled( batchNoteActive, "" );
  *]
}