Project

General

Profile

Bug #1327 » PRPTCMBONUSHEAD_20220713.sql

Tri Rizqiaty, 07/20/2022 09:43 AM

 
1
??USE [MinovaES_BankKalteng_Dev]
2

3
GO
4

5
/****** Object:  StoredProcedure [dbo].[PRPTCMBONUSHEAD]    Script Date: 13/07/2022 10.19.32 ******/
6

7
SET ANSI_NULLS ON
8

9
GO
10

11
SET QUOTED_IDENTIFIER ON
12

13
GO
14

15
ALTER PROCEDURE [dbo].[PRPTCMBONUSHEAD]
16

17
(
18

19
  @CompanyID varchar(8),
20

21
  @Year varchar(8),
22

23
  @CostCenter varchar(8),
24

25
  @Organization varchar(8),
26

27
  @EmployeeIDFrom varchar(8),
28

29
  @EmployeeIDTo varchar(8),
30

31
  @MenuID varchar(8),
32

33
  @UserID varchar(8)
34

35
)
36

37
AS
38

39

40

41
--DECLARE @CompanyID varchar(8)
42

43
--DECLARE @Scenario varchar(250)
44

45
--DECLARE @Year varchar(8)
46

47
--DECLARE @CostCenter varchar(8)
48

49
--DECLARE @Organization varchar(8)
50

51
--DECLARE @EmployeeIDFrom varchar(8)
52

53
--DECLARE @EmployeeIDTo varchar(8)
54

55
--DECLARE @MenuID varchar(8) = 'CMR01'
56

57
--DECLARE @UserID varchar(8) = 'tri'
58

59
--SET @CompanyID = '1000'
60

61
--SET @Scenario = ''
62

63
--SET @Year = '2022'
64

65
--SET @CostCenter = ''
66

67
--SET @Organization = ''
68

69
--SET @EmployeeIDFrom = ''
70

71
--SET @EmployeeIDTo = ''
72

73

74

75
SELECT TOP(1) COM.* ,
76

77
        ISNULL(CAT.FileData, 0) AS Value
78

79
		,@year AS period
80

81
FROM    dbo.PCMEPCOMPID COM
82

83
LEFT JOIN dbo.SFILECATALOG CAT ON COM.Logo = CAT.FileName
84

85
WHERE (com.CompanyID = @CompanyID OR @CompanyID = '')
(14-14/17)