CREATE PROCEDURE DBO.GetVatvalueFromVATValueNumber @VATValueNumber tinyint, @VATValue float OUTPUT  AS
SET NOCOUNT ON
-- Sidst rettet af Klaus Stenå d. 1/2-2002

Declare @VatValueWareText varchar(8)

if (@VATValueNumber=0)
  Select @VatValueWareText = KeyValue from HotelSetUp WITH (NOLOCK) Where SearchKey='VATValue0' 
else
if (@VATValueNumber=1)
  Select @VatValueWareText = KeyValue from HotelSetUp WITH (NOLOCK) Where SearchKey='VATValue1' 
else
if (@VATValueNumber=2)
  Select @VatValueWareText = KeyValue from HotelSetUp WITH (NOLOCK) Where SearchKey='VATValue2' 
else
if (@VATValueNumber=3)
  Select @VatValueWareText = KeyValue from HotelSetUp WITH (NOLOCK) Where SearchKey='VATValue3' 
else
if (@VATValueNumber=4)
  Select @VatValueWareText = KeyValue from HotelSetUp WITH (NOLOCK) Where SearchKey='VATValue4' 
else
if (@VATValueNumber=5)
  Select @VatValueWareText = KeyValue from HotelSetUp WITH (NOLOCK) Where SearchKey='VATValue5' 

if (charindex(',',@VatValueWareText)>0)
  SET @VatValueWareText = STUFF(@VatValueWareText, charindex(',',@VatValueWareText) ,1, '.')
      
SET @VatValue = CONVERT(FLOAT, @VatValueWareText)

