﻿
---------------------Ali 2022-05-17---------

 INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(620,N'My Employees Salary Details',N'عرض تفاصيل المرتب لموظفينى',613,N'',N'','fa fa-thumb-tack',N'',7,0,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(620,6)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(1330,N'عرض تفاصيل المرتب لموظفينى',N'My Employees Salary Details',620,1)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1331, N'عرض تفاصيل المرتب', N'View Salary Details', 620, 2)
Go
---------------------End 2022-05-17---------
---------------------End 2022-05-17---------
---------------------Mostafa 2022-05-18---------
 INSERT[dbo].[ConfigParameter]  ([ConfigKey], [Name], [Arabic_Name], [ConfigValue], [ConfigCategoryCode], [OrderNo], [ConfigType], [IsVisible], [ModifiedBy], [ModificationDate], [RequestTypeId])
VALUES(N'PossibilityApplyingMoreThanTheMaximumDegree',N'Possibility to Apply More Than The Maximum Degree',N'امكانية التقديم اكثر من الدرجة القصوي',N'False',10,20,1,1,Null,Null,Null)
Go
---------------------End 2022-05-18---------
---------------------Hammad 2022-05-18---------
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES 
(1338, N'يسمح بتخطى المسار الاساسى فى طلب الجزاء', N'Allow Skip Main Track In Penalty Request', 199, 2)
GO
---------------------End 2022-05-18---------
---------------------Ali 2022-05-18---------

INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(621,N'My Employees promotions',N'ترقيات موظفينى',613,N'',N'','fa fa-thumb-tack',N'',8,0,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(621,6)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(1332,N'ترقيات موظفينى',N'My Employees promotions',621,1)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(1333,N'عرض ترقيات موظفينى',N'View My Employees promotions',621,2)
Go


INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(622,N'My Employees Qualifications',N'مؤهلات موظفينى',613,N'',N'','fa fa-thumb-tack',N'',9,0,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(622,6)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(1334,N'مؤهلات موظفينى',N'My Employees Qualifications',622,1)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(1335,N'عرض مؤهلات موظفينى',N'View My Employees Qualifications',622,2)
Go

INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(623,N'My Employees Contract Information',N'بيانات تعاقد موظفينى',613,N'',N'','fa fa-thumb-tack',N'',10,0,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(623,6)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(1336,N'بيانات تعاقد موظفينى',N'My Employees Contract Information',623,1)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(1337,N'عرض بيانات تعاقد موظفينى',N'View My Employees Contract Information',623,2)
Go


ALTER TABLE [dbo].[Basis] DROP CONSTRAINT [DF_Basis_Effect]
GO

ALTER TABLE dbo.Basis
	DROP COLUMN Effect
GO

 ALTER TABLE dbo.WF_Track ADD
	AllowSkipMainTrack bit NOT NULL CONSTRAINT DF_WF_Track_AllowSkipMainTrack DEFAULT ((0))
  GO
---------------------End 2022-05-18---------
---------------------Hammad 2022-05-18---------


Alter TABLE [dbo].[Levels] Add
	[LevelNotApplicableToTransportationAllowance] [bit] NULL,
	[Closed] [bit] NULL,
	[MDT] [datetime] NULL,
	[CentralCode] [int] NULL
Go
ALTER TABLE [dbo].[Levels] ADD  CONSTRAINT [DF_Levels_LevelNotApplicableToTransportationAllowance]  DEFAULT ((0)) FOR [LevelNotApplicableToTransportationAllowance]
GO
ALTER TABLE [dbo].[Levels] ADD  CONSTRAINT [DF_Levels_Closed]  DEFAULT ((0)) FOR [Closed]
GO

CREATE TABLE [dbo].[SubContractGroups](
	[SubContractGroupCode] [int] NOT NULL,
	[Name] [nvarchar](150) NULL,
	[Arabic_Name] [nvarchar](150) NULL,
	[Closed] [bit] NULL,
	[MDT] [datetime] NULL,
 CONSTRAINT [PK_SubContractGroups_SubContractGroupCode] PRIMARY KEY CLUSTERED 
(
	[SubContractGroupCode] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[SubContractGroups] ADD  CONSTRAINT [DF_SubContractGroups_Closed]  DEFAULT ((0)) FOR [Closed]
GO

---------------------End 2022-05-18---------
----------------------------AK 2022-05-18----------------
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON; SET ARITHABORT ON; SET NUMERIC_ROUNDABORT OFF; SET CONCAT_NULL_YIELDS_NULL ON; SET ANSI_NULLS ON; SET ANSI_PADDING ON; SET ANSI_WARNINGS ON;
COMMIT
BEGIN TRANSACTION
INSERT INTO [dbo].[SecurityGroupDetail] (SecurityGroupID,PrivilegeID)
SELECT SecurityGroupID, CASE WHEN PrivilegeID=1036 THEN 1318 WHEN PrivilegeID=1037 THEN 1319 WHEN PrivilegeID=1297 THEN 1320 WHEN PrivilegeID=1249 THEN 1321 WHEN PrivilegeID=1228 THEN 1322 WHEN PrivilegeID=1034 THEN 1331 WHEN PrivilegeID=3991 THEN 1333 WHEN PrivilegeID=3990 THEN 1335 WHEN PrivilegeID=1033 THEN 1337 ELSE 0 END AS PrivilegeID 
FROM [dbo].[SecurityGroupDetail] WHERE PrivilegeID in (1036,1037,1297,1249,1228,1034,3991,3990,1033)

INSERT INTO [dbo].[SecurityGroupDetail] (SecurityGroupID,PrivilegeID)
SELECT DISTINCT SecurityGroupID, 1317 AS PrivilegeID FROM [dbo].[SecurityGroupDetail] WHERE PrivilegeID in (1036,1037,1297,1249,1228,1034,3991,3990,1033)

INSERT INTO [dbo].[SecurityUserDetail] (SecurityUserID,PrivilegeID)
SELECT SecurityUserID, CASE WHEN PrivilegeID=1036 THEN 1318 WHEN PrivilegeID=1037 THEN 1319 WHEN PrivilegeID=1297 THEN 1320 WHEN PrivilegeID=1249 THEN 1321 WHEN PrivilegeID=1228 THEN 1322 WHEN PrivilegeID=1034 THEN 1331 WHEN PrivilegeID=3991 THEN 1333 WHEN PrivilegeID=3990 THEN 1335 WHEN PrivilegeID=1033 THEN 1337 ELSE 0 END AS PrivilegeID 
FROM [dbo].[SecurityUserDetail] WHERE PrivilegeID in (1036,1037,1297,1249,1228,1034,3991,3990,1033)

INSERT INTO [dbo].[SecurityUserDetail] (SecurityUserID,PrivilegeID)
SELECT DISTINCT SecurityUserID, 1317 AS PrivilegeID FROM [dbo].[SecurityUserDetail] WHERE PrivilegeID in (1036,1037,1297,1249,1228,1034,3991,3990,1033)
COMMIT
----------------------------End 2022-05-18----------------
----------------------------Hammad 2022-05-19----------------
CREATE TABLE [dbo].[EmployeesSubContracts](
	[Serial] [int] NOT NULL,
	[EmployeeCode] [int] NOT NULL,
	[SubContractCode] [tinyint] NULL,
	[SubContractDate] [datetime] NULL,
	[SubContractDateHijri] [nvarchar](10) NULL,
	[SubContractExpireDate] [datetime] NULL,
	[SubContractExpireDateHijri] [nvarchar](10) NULL,
	[BandCode] [int] NOT NULL,
	[CurrencyCode] [tinyint] NULL,
	[SalaryPayWayCode] [tinyint] NULL,
	[Amount] [float] NULL,
	[LocalAmount] [float] NULL,
	[SectionCode] [nvarchar](30) NULL,
	[CostCenter] [nvarchar](150) NULL,
	[Closed] [bit] NULL,
	[RecordAddBy] [nvarchar](20) NULL,
	[RecordAddDate] [datetime] NULL,
	[RecordLastChangeBy] [nvarchar](20) NULL,
	[RecordChangeDate] [datetime] NULL,
	[MDT] [datetime] NULL,
	[ManagerCode] [int] NULL,
	[SubContractPositionCode] [nvarchar](30) NULL,
	[SubContractGroupCode] [int] NULL,
 CONSTRAINT [PK_EmployeesSubContracts_Serial] PRIMARY KEY CLUSTERED 
(
	[Serial] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[EmployeesSubContracts] ADD  CONSTRAINT [DF_EmployeesSubContracts_Closed]  DEFAULT ((0)) FOR [Closed]
GO
----------------------------End 2022-05-19----------------
----------------------------AK 2022-05-19----------------
UPDATE [dbo].[SecurityPrivilegeActions] SET HTTPMethod='POST' WHERE ID=538
GO
----------------------------End 2022-05-19----------------