Kevin Kok Khah Whey
2023-09-25 34d29be6a3eb0c025da50b77f2107c4ad259c6c0
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
Quintiq file version 2.0
#parent: #root
Method SynchronizePISPSpecification (
  structured[ProductInStockingPoint_MP] pisps
) id:Method_DialogCreateEditPISPSpecification_SynchronizePISPSpecification
{
  #keys: '[124808.2.555255257]'
  Body:
  [*
    // Create / update PISP specification
    isbatchedit := pisps.Size() > 1;
    pisp := pisps.Element( 0 );
    inputlotsize := ApplicationLibMacroPlanner.FormatStringToReal( EditorInputLotSize.Text(), 0.0 );
    
    if( not isbatchedit )
    {     
      PISPSpecification::CreateUpdate( pisp.Product_MP(), 
                                       pisp.StockingPoint_MP(), 
                                       CheckBoxIsOverrideUnitOfMeasurementForProduct.Checked(), 
                                       guard( SelectionUnitOfMeasurement.Data().Name(), '' ), 
                                       CheckBoxIsNegativeInventoryAllowed.Checked(), // IsNegativeInventoryAllowed 
                                       CheckBoxIsExcluded.Checked(), // IsExcluded
                                       CheckBoxIsExcludedFromBalancing.Checked(), // IsExcludedFromBalancing
                                       CheckBoxIsSafetyStockKept.Checked(), // IsSafetyStockKept 
                                       inputlotsize, // InputLotSize
                                       CheckBoxIsExcludeShelfLife.Checked(),//IsExcludeShelflife
                                       false /* IsFromDB */ ); 
    }
    else
    {
      PISPSpecification::Update( pisps,
                                 CheckBoxIsBatchEditUOM.Checked(),
                                 CheckBoxIsOverrideUnitOfMeasurementForProduct.Checked(),
                                 guard( SelectionUnitOfMeasurement.Data().Name(), '' ),                   
                                 CheckBoxIsBatchEditIsNegativeInventoryAllowed.Checked(),
                                 CheckBoxIsNegativeInventoryAllowed.Checked(), // IsNegativeInventoryAllowed
                                 CheckBoxIsBatchEditIsExcluded.Checked(),
                                 CheckBoxIsExcluded.Checked(), // IsExcluded
                                 CheckBoxIsBatchEditIsExcludedFromBalancing.Checked(),
                                 CheckBoxIsExcludedFromBalancing.Checked(),
                                 CheckBoxIsBatchEditIsSafetyStockKept.Checked(),
                                 CheckBoxIsSafetyStockKept.Checked(), // IsSafetyStockKept 
                                 CheckBoxIsBatchEditInputLotSize.Checked(),
                                 inputlotsize, // InputLotSize   
                                 CheckBoxIsBatchEditIsExcludeShelfLife.Checked(),
                                 CheckBoxIsExcludeShelfLife.Checked(),
                                 false );
    }
  *]
}