yanweiyuan3
2023-08-09 98db93a55d7079e89c706c18b15eeaecd0ec539a
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
Quintiq file version 2.0
#parent: #root
Method Edit (
  internal[GUIComponent] parent,
  structured[SafetyStock] selection
) id:Method_DialogCreateEditSafetyStock_Edit
{
  #keys: '[136682.2.182627981]'
  Body:
  [*
    // Edit inventory specifications
    data := shadow( selection.Element(0) );
    Dialog.Data( data );
    
    isbatchedit := selection.Size() > 1;
    Dialog.ShowHideComponent( isbatchedit );
    Dialog.EnableBatchEditComponents( isbatchedit );
    
    if ( Dialog.DoModal( parent ) > 0 )
    {
      istargetinday := [Boolean]RadioButtonGroupTarget.BoundValue()
      targetindays := ifexpr( istargetinday, ApplicationLibMacroPlanner.FormatStringToReal( EditorTargetInDays.Text(),0.0), 0.0 );
      targetinqty := ifexpr( not istargetinday, ApplicationLibMacroPlanner.FormatStringToReal( EditorTargetInQuantity.Text(),0.0 ), 0.0 );
      
      SafetyStock::Update( selection,
                           SelectionProduct.Data(),
                           SelectionStockingPoint.Data(),
                           GUIStartDateTimeSelector.DateTime().Date(),
                           istargetinday, targetindays, targetinqty,            // Does not have a target in days, the initial targets are 0
                           false, CheckBoxHasUserTarget.Checked(), false );     
    }
  *]
}