IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PLANTA_CALC_EV]') 
	AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[PLANTA_CALC_EV]
GO
CREATE FUNCTION PLANTA_CALC_EV(@COSTS_TOTAL float, @COSTS_ACT float, @BL_COSTS_CUMULATIVE float) 
RETURNS float
BEGIN
	DECLARE @returnvalue float;
    SET @returnvalue = dbo.PLANTA_CALC_PRORESS(@COSTS_TOTAL,@COSTS_ACT) * @BL_COSTS_CUMULATIVE
    RETURN COALESCE(@returnvalue,0);
END
GO
