hongji.li
2023-11-03 aefafd2142478d4fb07d6b8b45c3047e247389e0
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 SetDefaultValue () id:Method_DialogCreateEditPISPSpecification_SetDefaultValue
{
  #keys: '[124808.2.555252516]'
  Body:
  [*
    // Set default values
    
    pisp := DataHolderPISP.Data();
    
    pispspec := pisp.PISPSpecification();
    
    hasuom := guard( pispspec.HasUnitOfMeasure(), false );
    uomname := ifexpr( hasuom, 
                       pisp.UnitOfMeasureName(),
                       pisp.Product_MP().UnitOfMeasureName() );
                     
    CheckBoxIsOverrideUnitOfMeasurementForProduct.Checked( hasuom ); 
    SelectionUnitOfMeasurement.BoundValue( uomname );
    
    CheckBoxIsNegativeInventoryAllowed.Checked( pisp.IsNegativeInventoryAllowed() );
    CheckBoxIsExcluded.Checked( pisp.IsExcluded() );
    CheckBoxIsExcludedFromBalancing.Checked( guard( pisp.PISPSpecification().IsExcludedFromBalancing(), false ) );
    CheckBoxIsSafetyStockKept.Checked( pisp.IsSafetyStockKept() );
    
    inputLotSize := ApplicationLibMacroPlanner.FormatRealToString( guard( pispspec.InputLotSize(), 0.0 ) ); 
    Dialog.SetLabelInputLotSize();
    EditorInputLotSize.Text( inputLotSize );
    
    LabelCurrency.Text( guard( pisp.StockingPoint_MP().Currency_MP().Name(), "" ) );
    
    CheckBoxIsExcludeShelfLife.Checked( guard( pisp.PISPSpecification().IsExcludeShelfLifeAndMaturation(), false ) );
  *]
}