USE [HRIS]
GO


SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [dbo].[view_etlcacm_rekap_cuti] AS 

	SELECT 
		rc.NIP,
		--rc.JNS_CUTI,
		jc.NM_CUTI,
		rc.TANGGAL_BERLAKU,
		CASE 
			WHEN rc.ATURAN_HAK_CUTI = '2' THEN rc.HAK_CUTI * 22
			ELSE rc.HAK_CUTI
		END AS HAK_CUTI,
		rc.SISA_CUTI
	FROM 
		dbo.SPG_REKAP_CUTI AS rc INNER JOIN
		dbo.SPG_JNS_CUTI AS jc ON rc.JNS_CUTI = jc.JNS_CUTI
	WHERE
		jc.TAMPILKAN_SISA_CUTI = 1



GO
