UPDATE TBDD_BASECONFIG SET DB_VERSION = '1.9.0.4'
GO
-- =============================================
-- Author:			DD MS
-- Creation date:	25.06.20200
-- =============================================
CREATE FUNCTION [dbo].[FNDD_GET_DECIMAL_FOR_VARCHAR] (@INPUT VARCHAR(100))
RETURNS DECIMAL(19,2)
AS
BEGIN
	DECLARE @DEC_VALUE DECIMAL(19,2)
	DECLARE @INPUT_SS_15 VARCHAR(5)
	SELECT @INPUT_SS_15 = SUBSTRING(@INPUT,1,5)
	IF @INPUT_SS_15 LIKE ('%.%')
		BEGIN
			DECLARE @REP_SS_15 VARCHAR(5)
			SET @REP_SS_15 = REPLACE(@INPUT_SS_15,'.','')
			SET @INPUT = REPLACE(@INPUT,@INPUT_SS_15,@REP_SS_15)
		END
	SELECT @INPUT = REPLACE(@INPUT,',','.')
	SELECT @DEC_VALUE = convert(DECIMAL(19,2),@INPUT)
	
RETURN @DEC_VALUE
END
