hongji.li
2023-11-07 1a1ba3ad5ed9e4380185aa1ccad20204a0e5f115
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
Quintiq file version 2.0
#parent: #root
Method SetAttributesAfterOnApplyData () id:Method_DialogCreateEditOperation_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( CheckBoxHasUserLotSize.Checked() )
    {
      data.UserMinimumQuantity( data.MinimumQuantity() );
      data.HasUserMaximumQuantity( data.HasMaximumQuantity() );
      data.UserMaximumQuantity( data.MaximumQuantity() );
      data.UserLotSize( data.LotSize() );
    }
    /*
    // Delete generated costs which belongs to different unit
    traverse( data, OperationCost, rc,
              isnull( rc.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( rc.UnitAccount().Unit() <> data.Unit(), true ) )
    {
      rc.Delete();
    }
    */
  *]
}