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 ) );
  *]
}
