lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
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
Quintiq file version 2.0
#parent: #root
Method EnableDisableBatch () id:Method_DialogCreateEditTransportationCost_EnableDisableBatch
{
  #keys: '[145730.1.944936499]'
  Body:
  [*
    // Enable/disable fields during batch create/edit
    isBatchCreate := DataHolderFormLaneLeg.Data().Size() > 1;
    isBatch := DataHolderDialogDatas.Data().Size() > 1;
    
    tooltip := Translations::MP_Batch_Disabled_Create_Edit();
    
    // Non-editable fields during batch create/edit
    DropDownListLane.Enabled( not (isBatchCreate or isBatch), tooltip );
    DropDownListOrigin.Enabled( not (isBatchCreate or isBatch), tooltip );
    DropDownListDestination.Enabled( not (isBatchCreate or isBatch), tooltip );
    
    // Non-visible fields during batch edit
    CheckboxBatchEditTimeUnit.Visible( isBatch );
    CheckboxBatchEditLengthOfTime.Visible( isBatch );
    CheckboxBatchEditCost.Visible( isBatch );
    
    tooltip := Translations::MP_Batch_Disabled_Edit();
    
    // Non-editable fields during batch edit
    EditFieldCost.Enabled( not isBatch, ''  );
    DropDownListAccount.Enabled( not isBatch, tooltip );
    DateSelectorCostStart.Enabled( not isBatch, tooltip );
    DropDownStringListCostDriver.Enabled( not isBatch, tooltip )
  *]
}