lazhen
2025-01-07 b3987122cbbc46c5c59d3173f37fca3170b6dc5a
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
Quintiq file version 2.0
#parent: #root
Method OnOK () id:Method_DialogCreateEditPISPSpecification_OnOK
{
  #keys: '[135040.0.219519607]'
  Body:
  [*
    // Create / update PISP specification
    pisps := DataHolderDialogDatas.Data();
    isbatchedit := pisps.Size() > 1;
    pisp := pisps.Element( 0 );
    
    inputlotsize := ApplicationMacroPlanner.FormatStringToReal( EditFieldInputLotSizeUOM.Text(), 0.0 );
    
    if( not isbatchedit )
    {     
      PISPSpecification::CreateUpdate( pisp.Product_MP(), 
                                       pisp.StockingPoint_MP(), 
                                       CheckboxIsOverrideUOMForProduct.Checked(), 
                                       guard( DropDownListUOM.Data().Name(), '' ), 
                                       CheckboxIsNegativeInventoryAllowed.Checked(), // IsNegativeInventoryAllowed 
                                       CheckboxIsExcluded.Checked(), // IsExcluded
                                       CheckboxIsExcludedFromBalancing.Checked(), // IsExcludedFromBalancing
                                       CheckboxIsSafetyStockKept.Checked(), // IsSafetyStockKept 
                                       inputlotsize, // InputLotSize
                                       CheckBoxIsExcludeShelfLife.Checked(), //IsExcludeShelfLifeAndMaturation
                                       false /* IsFromDB */ ); 
    }
    else
    {
      PISPSpecification::Update( pisps,
                                 CheckboxBatchIsOverrideUOMForProduct.Checked(),
                                 CheckboxIsOverrideUOMForProduct.Checked(),
                                 guard( DropDownListUOM.Data().Name(), '' ),                   
                                 CheckboxBatchIsNegativeInventoryAllowed.Checked(),
                                 CheckboxIsNegativeInventoryAllowed.Checked(), // IsNegativeInventoryAllowed
                                 CheckboxBatchIsExcluded.Checked(),
                                 CheckboxIsExcluded.Checked(), // IsExcluded
                                 CheckboxBatchIsExcludedFromBalancing.Checked(),
                                 CheckboxIsExcludedFromBalancing.Checked(),
                                 CheckboxBatchIsSafetyStockKept.Checked(),
                                 CheckboxIsSafetyStockKept.Checked(), // IsSafetyStockKept 
                                 CheckboxBatchLotSize.Checked(),
                                 inputlotsize, // InputLotSize
                                 CheckBoxIsBatchEditIsExcludeShelfLife.Checked(), // batchedit shelflife
                                 CheckBoxIsExcludeShelfLife.Checked(), // excludeshelflife
                                 false );
    }
    
    this.Close();
  *]
}