haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
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
Quintiq file version 2.0
#parent: #root
Method EnableDisableComponent (
  Boolean isbatchedit
) id:Method_DialogCreateEditSalesDemand_EnableDisableComponent
{
  #keys: '[107528.0.165695004]'
  Body:
  [*
    // Enable disable components
    
    SelectionSalesSegment.Enabled( not isbatchedit or CheckBoxBatchEditSalesSegment.Checked() );
    LabelSalesSegment.Enabled( not isbatchedit or CheckBoxBatchEditSalesSegment.Checked() );
    
    SelectionStockingPoint.Enabled( not isbatchedit or CheckBoxBatchEditStockingPoint.Checked() );
    LabelStockingPoint.Enabled( not isbatchedit or CheckBoxBatchEditStockingPoint.Checked() );
    
    SelectionUnitOfMeasure.Enabled( not isbatchedit or CheckBoxBatchEditUnitOfMeasure.Checked() );
    LabelUnitOfMeasure.Enabled( not isbatchedit or CheckBoxBatchEditUnitOfMeasure.Checked() );
    
    SelectionProduct.Enabled( not isbatchedit or CheckBoxBatchEditProduct.Checked() );
    LabelProduct.Enabled( not isbatchedit or CheckBoxBatchEditProduct.Checked() );
    
    GUIDateTimeSelectorStart.Enabled( not isbatchedit or CheckBoxBatchEditStart.Checked() );
    LabelStart.Enabled( not isbatchedit or CheckBoxBatchEditStart.Checked() );
    
    GUIDateTimeSelectorEnd.Enabled( not isbatchedit or CheckBoxBatchEditEnd.Checked() );
    LabelEnd.Enabled( not isbatchedit or CheckBoxBatchEditEnd.Checked() );
    
    SelectionCurrency.Enabled( not isbatchedit or CheckBoxBatchEditCurrency.Checked() );
    LabelCurrency.Enabled( not isbatchedit or CheckBoxBatchEditCurrency.Checked() );
    
    EditorQuantity.Enabled( not isbatchedit or CheckBoxBatchEditQuantity.Checked() );
    LabelQuantity.Enabled( not isbatchedit or CheckBoxBatchEditQuantity.Checked() );
    
    EditorPrice.Enabled( not isbatchedit or CheckBoxBatchEditPrice.Checked() );
    LabelPrice.Enabled( not isbatchedit or CheckBoxBatchEditPrice.Checked() );
    
    CheckBoxIsExcludedFromFulfillmentKPI.Enabled( not isbatchedit or CheckBoxBatchEditIsExcludedFromFulfillmentKPI.Checked() );
    
    isenabledpriority := false;
    isenableduncertaintypct := false;
    if( CheckBoxIsExcludedFromFulfillmentKPI.Checked() )
    {
      SelectionPriority.Data( null( Priority ));
      EditorDemandUncertaintyPercentage.Text( ApplicationLibMacroPlanner.FormatRealToString( 0.0 ) );
    }
    else
    {
      isenabledpriority := not isbatchedit or CheckBoxBatchEditPriority.Checked();
      isenableduncertaintypct := not isbatchedit or CheckBoxBatchEditDemandUncertaintyPercentage.Checked();
      
      if( isnull( SelectionPriority.Data() ) )
      {
        SelectionPriority.Data( SalesDemandBase::GetDefaultPriority( MacroPlan ) );
      }
    }
    SelectionPriority.Enabled( isenabledpriority );
    LabelPriority.Enabled( isenabledpriority );
    
    EditorDemandUncertaintyPercentage.Enabled( isenableduncertaintypct );
    LabelDemandUncertaintyPercentage.Enabled( isenableduncertaintypct );
  *]
}