
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
ALTER FUNCTION [dbo].[getProcentProwizjiDyrektora] 
(
	-- Add the parameters for the function here
	@podstawa decimal(9,4),
	@planbiura decimal(9,4),
	@planOgolny decimal(9,4)
)
RETURNS decimal(9,4)
AS
BEGIN
DECLARE @prowizja DECIMAL(9,4)


IF @planbiura >= 1
SET @prowizja = @podstawa + 0.005
ELSE
SET @prowizja = @podstawa - 0.005

IF @planOgolny >=1
SET @prowizja = @prowizja + 0.005

RETURN @prowizja

END
GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

