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
Quintiq file version 2.0
#parent: #root
Method SetAttributesAfterOnApplyData () id:Method_DialogCreateEditLaneLeg_SetAttributesAfterOnApplyData
{
  #keys: '[109478.0.549768960]'
  Body:
  [*
    // Set user attributes based on declarative value binded with the components after on apply data
    
    data := Dialog.Data();
    
    // If the components are disabled, the date time is not updated by the data binding.
    data.Start( GUIDateTimeSelectorStart.DateTime().Date() );
    data.End( GUIDateTimeSelectorEnd.DateTime().Date() );
    
    if( CheckBoxHasUserPreprocessingTime.Checked() )
    {
      data.UserLeadTime( data.LeadTime() );
    }
    
    data.StandardDeviationLeadTimeLaneLeg( GUIDurationSelectorStandardDeviationLeadTimeLaneLeg.Duration() );
    /*
    if( CheckBoxHasStandardDeviationLeadTimeLaneLeg.Checked() )
    {
      data.StandardDeviationLeadTimeLaneLeg( data.StandardDeviationLeadTime() );
    }
    
    // Delete generated costs which belongs to different unit
    traverse( data, LaneLegCost, llc,
              isnull( llc.WrappedInstance() )
              /* There is two sitiuation
                 1) User created an account assignment, we will remove the cost generated for others unit.
                 2) User removed account assignment, we will remove the shadow cost.
                 Guard as:
                 AccountCost.AccountAssignment will be null if the account assignment is being removed,
                 true so the orphan cost will be removed
              and guard( llc.UnitAccount().Unit() <> data.Lane().Unit(), true ) )
    {
      llc.Delete();
    }
    */
  *]
}