limj
2023-10-24 93652435728de839582440eefd5122c281181d35
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
Quintiq file version 2.0
#parent: #root
Method EnableDisableComponent () derived id:Method_DialogCreateEditCustomerOrder_EnableDisableComponent
{
  #keys: '[136682.1.803278990]'
  BaseType => //DialogCreateEditSalesDemand/Method_DialogCreateEditSalesDemand_EnableDisableComponent
  Body:
  [*
    // Enable disable components
    
    DropDownListSalesSegment.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListSalesSegment ), "" );
    DropDownListStockingPoint.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListStockingPoint ), "" );
    DropDownListUnitOfMeasurement.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListUnitOfMeasurement ), "" );
    DropDownListProduct.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListProduct ), "" );
    DateSelectorStart.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DateSelectorStart ), "" );
    DateSelectorEnd.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DateSelectorEnd ), "" );
    DropDownListCurrency.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListCurrency ), "" );
    EditFieldQuantityUom.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldQuantityUom ), "" );
    EditFieldPrice.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldPrice ), "" );
    
    isexcludedfrmfulfillmentkpifrmproduct := guard( productselection.IsDerivedExcludeFromFulfillmentKPI(), false );
    
    EditFieldCustomerID.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldCustomerID ), "" );
    EditFieldCustomerName.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldCustomerName ), "" );
    EditFieldOrderID.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldOrderID ), "" );
    EditFieldOrderLineID.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldOrderLineID ), "" );
    CheckboxIsFirmed.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( CheckboxIsFirmed ), "" );
    CheckboxIsForNetting.Enabled( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( CheckboxIsForNetting ), "" );
    
    CheckBoxIsExcludedFromFulfillmentKPI.Enabled( ( not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( CheckBoxIsExcludedFromFulfillmentKPI ) )
                                                    and not isexcludedfrmfulfillmentkpifrmproduct,
                                                    ifexpr(  isexcludedfrmfulfillmentkpifrmproduct, 
                                                             Translations::MP_Designer_DialogSalesDemand_DisableCheckBoxIsExcludedFromFulfillmentKPI(), 
                                                             "" ) );
    
    isenabledpriority := false;
    isenableduncertaintypct := false;
    if( Form.CheckBoxIsExcludedFromFulfillmentKPI().Checked() )
    {
      Form.DropDownListPriority().Data( null( Priority ) );
      Form.EditFieldDemandUncertaintyPercentage().Text( ApplicationMacroPlanner.FormatRealToString( 0.0 ) );
    }
    else
    {
      isenabledpriority := not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListPriority );
      isenableduncertaintypct := not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldDemandUncertaintyPercentage );
      
      if( isenabledpriority and isnull( DropDownListPriority.Data() ) )
      {
        Form.DropDownListPriority().Data( SalesDemandBase::GetDefaultPriority( MacroPlan ) );
      }
    }
    Form.DropDownListPriority().Enabled( isenabledpriority, "" );
    Form.EditFieldDemandUncertaintyPercentage().Enabled( isenableduncertaintypct, "" );
  *]
}