yanweiyuan3
2023-08-09 fd693f0faf305ec98d7ea03e09fe6787817e71d7
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
Quintiq file version 2.0
#parent: #root
Method UIEnableDisableComponent (
  Boolean isInit
) id:Method_DialogCreateEditProduct_UIEnableDisableComponent
{
  #keys: '[135040.0.219561692]'
  Body:
  [*
    // Enable/Disable components
    
    // Enable / disable shelf life
    batchShelfLifeActive := not CheckBoxBatchEditShelfLife.Visible() 
                            or CheckBoxBatchEditShelfLife.Checked();
    
    hasShelfLifeScrValue  := CheckBoxHasShelfLife.Checked();
    hasShelfLifeDataValue := guard( DataHolderDialogData.Data().HasShelfLife(), false );
    hasShelfLifeValue     := ifexpr( isInit
                                    ,hasShelfLifeDataValue
                                    ,hasShelfLifeScrValue );
    EditFieldShelfLife.Enabled( hasShelfLifeValue
                                and batchShelfLifeActive, "" );
    
    
    // Enable / disable maturation
    batchMaturationActive := not CheckBoxBatchEditMaturation.Visible() 
                            or CheckBoxBatchEditMaturation.Checked();
    
    hasMaturationScrValue  := CheckBoxHasMaturation.Checked();
    hasMaturationDataValue := guard( DataHolderDialogData.Data().HasMaturation(), false );
    hasMaturationValue     := ifexpr( isInit
                                    ,hasMaturationDataValue
                                    ,hasMaturationScrValue );
    EditFieldMaturation.Enabled( hasMaturationValue
                                and batchMaturationActive, "" );
    
    
    // Enable / disable Post processing
    batchExcludeOptiActive := not CheckBoxBatchEditExcludeFromOptimizer.Visible() 
                              or CheckBoxBatchEditExcludeFromOptimizer.Checked();
    
    hasExcludeScrValue  := CheckBoxExcludeFromOptimizer.Checked();
    hasExcludeDataValue := guard( DataHolderDialogData.Data().IsExcludedFromOptimization(), false );
    hasExcludeValue     := ifexpr( isInit
                                  ,hasExcludeDataValue
                                  ,hasExcludeScrValue );
    
    CheckBoxIsPlannedAfterOptimization.Enabled( hasExcludeValue
                                               and batchExcludeOptiActive, "" );
    
    // Enable / disable ExcludeFromOpti
    hasPlannedAfterScrValue   := CheckBoxIsPlannedAfterOptimization.Checked()
    hasPlannedAfterDataValue  := guard( DataHolderDialogData.Data().IsPlannedAfterOptimization(), false );
    hasPlannedAfterValue      := ifexpr( isInit
                                         ,hasPlannedAfterDataValue
                                         ,hasPlannedAfterScrValue );
    CheckBoxExcludeFromOptimizer.Enabled( not hasPlannedAfterValue
                                          and batchExcludeOptiActive, "" );
    
    
    // Enable / disable IsExcludedFromFulfillmentKPI
    if( not isnull( DataHolderDialogData.Data().Parent() ) and DataHolderDialogData.Data().Parent().IsDerivedExcludeFromFulfillmentKPI() )
    {
      CheckboxIsExcludedFromFulfillmentKPI.Enabled( not DataHolderDialogData.Data().Parent().IsDerivedExcludeFromFulfillmentKPI(),
                                                    Translations::MP_Designer_DialogProduct_DisableCheckBoxIsExcludedFromFulfillmentKPI() );
    }
  *]
}