﻿-------------------------------------------------------- Hammad  18-01-2024 --------------------------------------------------------------------



IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ParameterReports]') AND type in (N'U'))
DROP TABLE [dbo].[ParameterReports]
GO
CREATE TABLE [dbo].[ParameterReports](
[ParameterReportCode] [int] IDENTITY(1,1) NOT NULL,
[ParameterCode] [int] NOT NULL,
[ReportCode] [int] NOT NULL,
[IsRequired] [bit] NOT NULL,
[DefaultValueFrom] [nvarchar](100) NULL,
[DefaultValueTo] [nvarchar](100) NULL,
[SelectionTable] [int] NULL,
[DisplayMultiSelect] [bit] NOT NULL,
CONSTRAINT [PK_ParameterReports] PRIMARY KEY CLUSTERED 
(
[ParameterReportCode] 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].[ParameterReports] ADD  CONSTRAINT [DF_ParameterReports_IsRequired]  DEFAULT ((0)) FOR [IsRequired]
GO

ALTER TABLE [dbo].[ParameterReports] ADD  CONSTRAINT [DF_ParameterReports_DisplayMultiSelect]  DEFAULT ((0)) FOR [DisplayMultiSelect]
GO

ALTER TABLE [dbo].[ParameterReports]  WITH CHECK ADD  CONSTRAINT [FK_ParameterReports_Parameters] FOREIGN KEY([ParameterCode])
REFERENCES [dbo].[Parameters] ([ParameterCode])
GO

ALTER TABLE [dbo].[ParameterReports] CHECK CONSTRAINT [FK_ParameterReports_Parameters]
GO

ALTER TABLE [dbo].[ParameterReports]  WITH CHECK ADD  CONSTRAINT [FK_ParameterReports_Reports] FOREIGN KEY([ReportCode])
REFERENCES [dbo].[Reports] ([ReportCode])
GO

ALTER TABLE [dbo].[ParameterReports] CHECK CONSTRAINT [FK_ParameterReports_Reports]
GO

SET IDENTITY_INSERT [dbo].[LookupTableGroup] ON 
GO
INSERT [dbo].[LookupTableGroup] ([LookupTableGroupCode], [ColumnName], [Name], [Arabic_Name]) VALUES (4, N'LocationCode', N'Location Code', N'كود الفرع')
GO
INSERT [dbo].[LookupTableGroup] ([LookupTableGroupCode], [ColumnName], [Name], [Arabic_Name]) VALUES (5, N'DivisionCode', N'Division Code', N'كود القطاع')
GO
INSERT [dbo].[LookupTableGroup] ([LookupTableGroupCode], [ColumnName], [Name], [Arabic_Name]) VALUES (6, N'DepartmentCode', N'Department Code', N'كود الادارة')
GO
INSERT [dbo].[LookupTableGroup] ([LookupTableGroupCode], [ColumnName], [Name], [Arabic_Name]) VALUES (7, N'SectionCode', N'Section Code', N'كود القسم')
GO
INSERT [dbo].[LookupTableGroup] ([LookupTableGroupCode], [ColumnName], [Name], [Arabic_Name]) VALUES (8, N'EmployeeCode', N'Employee Code', N'كود الموظف')
GO
INSERT [dbo].[LookupTableGroup] ([LookupTableGroupCode], [ColumnName], [Name], [Arabic_Name]) VALUES (9, N'PositionCode', N'Position Code', N'كود الوظيفة')
GO
INSERT [dbo].[LookupTableGroup] ([LookupTableGroupCode], [ColumnName], [Name], [Arabic_Name]) VALUES (10, N'LevelCode', N'Level Code', N'كود المستوى')
GO
INSERT [dbo].[LookupTableGroup] ([LookupTableGroupCode], [ColumnName], [Name], [Arabic_Name]) VALUES (11, N'GeneralTypeCode', N'General Type Code', N'كود النوع العام')
GO
SET IDENTITY_INSERT [dbo].[LookupTableGroup] OFF
GO
SET IDENTITY_INSERT [dbo].[LookupTables] ON 
GO
INSERT [dbo].[LookupTables] ([LookupTableId], [TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr]) VALUES (1, N'Employees', N'Personal/Employee', N'GetEmployeesBySecEmp', N'EmployeeCode', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[LookupTables] ([LookupTableId], [TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr]) VALUES (2, N'Locations', N'BasicData/Location', N'GetLocationsAccess', N'LocationCode', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[LookupTables] ([LookupTableId], [TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr]) VALUES (3, N'Divisions', N'BasicData/Division', N'GetUserDivisions', N'DivisionCode', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[LookupTables] ([LookupTableId], [TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr]) VALUES (4, N'Departments', N'BasicData/Department', N'GetUserDepartments', N'DepartmentCode', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[LookupTables] ([LookupTableId], [TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr]) VALUES (5, N'Sections', N'BasicData/Section', N'GetUserSections', N'SectionCode', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[LookupTables] ([LookupTableId], [TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr]) VALUES (6, N'Positions', N'Personal/Position', N'GetAllPositionsWithCodes', N'PositionCode', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[LookupTables] ([LookupTableId], [TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr]) VALUES (7, N'Levels', N'/Common', N'GetLevelsWithCodes', N'LevelCode', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[LookupTables] ([LookupTableId], [TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr]) VALUES (8, N'GeneralTypes', N'/Common', N'GetGeneralTypes', N'GeneralTypeCode', N'Name', N'Arabic_Name')
GO
SET IDENTITY_INSERT [dbo].[LookupTables] OFF
GO



ALTER TABLE dbo.Parameters
	DROP COLUMN DataSourceArea, DataSourceController, DataSourceAction
GO

ALTER TABLE dbo.Parameters ADD
	LookupTableId int NULL
GO

INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (1, N'الفرع', N'Location ', N'LocationCode', 2, 6, 0)
GO
INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (2, N'كود الموظف', N'Employee code', N'EmployeeCode', 1, 6, 0)
GO
INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (3, N'تاريخ الميلاد', N'BirthDate', N'BirthDate', 1, 5, 0)
GO
INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (4, N'ذكور', N'Male Only', N'sex', 1, 1, 0)
GO
INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (5, N'القطاع', N'Division', N'DivisionCode', 3, 6, 1)
GO
INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (6, N'الادارة', N'Department', N'DepartmentCode', 4, 6, 1)
GO
INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (7, N'القسم', N'Section', N'SectionCode', 5, 6, 1)
GO
INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (8, N'الوظيفة', N'Position', N'PositionCode', 6, 6, 1)
GO
INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (9, N'النوع العام', N'GeneralType', N'GeneralTypeCode', 8, 6, 0)
GO
INSERT [dbo].[Parameters] ([ParameterCode], [DescriptionAr], [DescriptionEn], [ParameterName], [LookupTableId], [DataType], [IsString]) VALUES (10, N'Level Code', N'Level Code', N'LevelCode', 7, 6, 0)
GO

ALTER TABLE dbo.Reports ADD
	ShowMonthAndYear bit NOT NULL CONSTRAINT DF_Reports_ShowMonthAndYear DEFAULT 0
GO

ALTER TABLE dbo.Reports ADD
	CanReadPayRoll bit NOT NULL CONSTRAINT DF_Reports_CanReadPayRoll DEFAULT 0
GO

-------------------------------------------------------- End  18-01-2024 -----------------------------------------------------------------------
------------------------------------------------------- Negm 18-01-2024 ---------------------------------------------------------------------
INSERT [dbo].[ConfigParameter] ([ConfigKey], [Name], [Arabic_Name], [ConfigValue], [ConfigCategoryCode], [OrderNo], [ConfigType], [IsVisible], [ModifiedBy], [ModificationDate], [RequestTypeId], [ConfigDescription]) 
VALUES (N'Wf_CloseEditingNewContractType', N'Close Editing New Contract Type', N'إغلاق تعديل نوع العقد الجديد ', N'false', 2, 1, 1, 1, NULL, NULL, 60, N'تعديل نوع العقد الجديد مغلق ')
Go

----------------------------------------------------------End 18-01-2024  -----------------------------------------------------------------
------------------------------------------------------- Negm 18-01-2024 ---------------------------------------------------------------------
	INSERT INTO SecurityPrivilege (ID , DescriptionAR, DescriptionEN , SystemMenuCode , PrivilegeType )
	VALUES (15452, N'تعديل بيانات طلب تجديد العقد أثناءالإعتماد' , N'Editing Renew Request During accreditation', 1012, 2 )
	Go

	INSERT INTO SecurityUserDetail ( SecurityUserID,PrivilegeID, CreationDate, CreatedBy)
    SELECT sec.SecurityUserID,15452, GETDATE(), 1
    FROM SecurityUserDetail sec 
	WHERE  sec.PrivilegeID in
    (15372);
    Go


  INSERT INTO SecurityGroupDetail( SecurityGroupID,PrivilegeID, CreationDate, CreatedBy)
    SELECT gr.SecurityGroupID,15452, GETDATE(), 1
    FROM SecurityGroupDetail gr 
	WHERE  gr.PrivilegeID in
    (15372);
    Go
----------------------------------------------------------End 18-01-2024  -----------------------------------------------------------------
----------------------------------------------------------Hammad 18-01-2024  --------------------------------------------------------------
INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES (707, N'Reports', N'التقارير', 345, NULL, NULL, N'fa fa-thumb-tack', NULL, 12, 1, 1)
GO
INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES (708, N'Reports Consolidated ', N'التقارير المجمعة', 707, N'/Attendance/ReportsConsolidated', N'Index', N'fa fa-thumb-tack', N'get', 1, 1, 1)
GO

INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13131, N'التقارير   ', N'Reports', 707, 1)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13132, N'التقارير المجمعة   ', N'Reports Consolidated', 708, 1)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13133, N'عرض التقارير المجمعة ', N'View Reports Consolidated', 708, 2)

INSERT [dbo].[SystemMenuModule] ([SystemMenuCode], [AppModuleCode]) VALUES (707, 11)
GO
INSERT [dbo].[SystemMenuModule] ([SystemMenuCode], [AppModuleCode]) VALUES (708, 11)
GO
----------------------------------------------------------Hammad 18-01-2024  --------------------------------------------------------------
----------------------------------------------------------Ali 18-01-2024  --------------------------------------------------------------
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) 
VALUES (15451, N'امكانية نسخ المسار', N'Can Copy Track', 31, 2)
GO

----------------------------------------------------------End 18-01-2024  --------------------------------------------------------------
----------------------------------------------------------Ali 21-01-2024  --------------------------------------------------------------

ALTER TABLE dbo.WF_Track ADD
	IsClosed bit NOT NULL CONSTRAINT DF_WF_Track_IsClosed DEFAULT ((0))
GO
----------------------------------------------------------End 21-01-2024  --------------------------------------------------------------

----------------------------------------------------------Negm 21-01-2024  --------------------------------------------------------------

ALTER TABLE dbo.WF_RequestType ADD
	EmployeeFilter nvarchar(Max) NULL 
GO
----------------------------------------------------------End 21-01-2024  --------------------------------------------------------------

----------------------------------------------------------Ali 21-01-2024  --------------------------------------------------------------

  ALTER TABLE dbo.WF_LoanTypeDetials ADD
	RepeatLoan smallint NULL,
	RepeatNumber int NULL
GO
----------------------------------------------------------End 21-01-2024  --------------------------------------------------------------
  --------------------------------------- AK 2024-01-22 ---------
CREATE TABLE [dbo].[DashboardCategories](
	[DashboardCategoryCode] [int] NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Arabic_Name] [nvarchar](100) NOT NULL,
	[IsVisable] [bit] NOT NULL,
 CONSTRAINT [PK_DashboardCategories] PRIMARY KEY CLUSTERED 
(
	[DashboardCategoryCode] 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

CREATE TABLE [dbo].[DashboardCategoriesLabels](
	[DashboardCategoryLabelCode] [int] NOT NULL,
	[DashboardCategoryCode] [int] NOT NULL,
	[LabelEn] [nvarchar](100) NOT NULL,
	[LabelAr] [nvarchar](100) NOT NULL,
	[Sequence] [int] NOT NULL,
	[AreaName] [nvarchar](100) NULL,
	[ControllerName] [nvarchar](100) NOT NULL,
	[ActionName] [nvarchar](100) NOT NULL,
	[SecurityPrivilegeID] [int] NOT NULL,
	[IsVisable] [bit] NOT NULL,
 CONSTRAINT [PK_DashboardCategoriesLabels] PRIMARY KEY CLUSTERED 
(
	[DashboardCategoryLabelCode] 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

CREATE TABLE [dbo].[DashboardCharts](
	[DashboardChartCode] [int] NOT NULL,
	[ChartType] [nvarchar](50) NOT NULL,
	[DashboardCategoryCode] [int] NOT NULL,
	[ChartTitleEn] [nvarchar](100) NOT NULL,
	[ChartTitleAr] [nvarchar](100) NOT NULL,
	[Sequence] [int] NOT NULL,
	[IsMain] [bit] NOT NULL,
	[AreaName] [nvarchar](100) NULL,
	[ControllerName] [nvarchar](100) NOT NULL,
	[ActionName] [nvarchar](100) NOT NULL,
	[Options] [nvarchar](2000) NOT NULL,
	[ResourceKeys] [varchar](200) NOT NULL,
	[SecurityPrivilegeID] [int] NOT NULL,
	[IsVisable] [bit] NOT NULL,
 CONSTRAINT [PK_DashboardCharts] PRIMARY KEY CLUSTERED 
(
	[DashboardChartCode] 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
INSERT [dbo].[DashboardCategories] ([DashboardCategoryCode], [Name], [Arabic_Name], [IsVisable]) VALUES (1, N'Operations', N'التشغيل', 1)
GO
INSERT [dbo].[DashboardCategories] ([DashboardCategoryCode], [Name], [Arabic_Name], [IsVisable]) VALUES (2, N'Payroll', N'المرتبات', 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable]) VALUES (1, 1, N'Headcount', N'عدد العاملين', 1, NULL, N'GeneralDashboard', N'GetHeadcount', 1380, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable]) VALUES (2, 1, N'Turnover', N'معدل دوران العاملين', 2, NULL, N'GeneralDashboard', N'GetTurnover', 1380, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable]) VALUES (3, 1, N'New Hire', N'تعيين جديد', 3, NULL, N'GeneralDashboard', N'GetNewHire', 1380, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable]) VALUES (4, 1, N'Resignation', N'استقالة', 4, NULL, N'GeneralDashboard', N'GetResignation', 1380, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable]) VALUES (5, 2, N'Total Gross Salary', N'اجمالي المرتبات', 2, NULL, N'GeneralDashboard', N'GetGrossSalaries', 1380, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable]) VALUES (6, 2, N'Total Net Salary', N'صافي المرتبات', 2, NULL, N'GeneralDashboard', N'GetNetSalaries', 1380, 1)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable]) VALUES (1, N'corechart', 1, N'Headcount Per Company', N'عدد العاملين بالشركة', 1, 1, NULL, N'GeneralDashboard', N'GetEmployeesCountByLocation', N'{{title:''{0}'',pieSliceText:''percentage'',chartArea:{{left:''2%'',right:''2%'',top:''10%'',bottom:''2%'',}},is3D:true,}}', N'GoogleDashboardRes.HeadcountPerCompany', 1380, 1)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable]) VALUES (2, N'corechart', 1, N'Headcount Per Division', N'عدد العاملين بالقطاع', 2, 1, NULL, N'GeneralDashboard', N'GetEmployeesCountByDivision', N'{{title:''{0}'',pieSliceText:''percentage'',chartArea:{{left:''2%'',right:''2%'',top:''10%'',bottom:''2%'',height:''100%'',width:''100%''}},is3D:true,}}', N'GoogleDashboardRes.HeadcountPerDivision', 1380, 1)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable]) VALUES (3, N'bar', 2, N'Salaries Per Company', N'المرتبات بالشركة', 1, 1, NULL, N'GeneralDashboard', N'GetLocationsSalaries', N'{{title:''{0}'',bars:''horizontal'',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bar: {{ groupWidth: ''50%'' }} }}', N'GoogleDashboardRes.SalariesPerCompany', 1380, 1)
GO
ALTER TABLE [dbo].[DashboardCategories] ADD  CONSTRAINT [DF_DashboardCategories_IsVisable]  DEFAULT ((1)) FOR [IsVisable]
GO
ALTER TABLE [dbo].[DashboardCharts] ADD  CONSTRAINT [DF_DashboardCharts_IsMain]  DEFAULT ((0)) FOR [IsMain]
GO
ALTER TABLE [dbo].[DashboardCharts] ADD  CONSTRAINT [DF_DashboardCharts_IsVisable]  DEFAULT ((1)) FOR [IsVisable]
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels]  WITH CHECK ADD  CONSTRAINT [FK_DashboardCategoriesLabels_DashboardCategories] FOREIGN KEY([DashboardCategoryCode])
REFERENCES [dbo].[DashboardCategories] ([DashboardCategoryCode])
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels] CHECK CONSTRAINT [FK_DashboardCategoriesLabels_DashboardCategories]
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels]  WITH CHECK ADD  CONSTRAINT [FK_DashboardCategoriesLabels_SecurityPrivilege] FOREIGN KEY([SecurityPrivilegeID])
REFERENCES [dbo].[SecurityPrivilege] ([ID])
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels] CHECK CONSTRAINT [FK_DashboardCategoriesLabels_SecurityPrivilege]
GO
ALTER TABLE [dbo].[DashboardCharts]  WITH CHECK ADD  CONSTRAINT [FK_DashboardCharts_SecurityPrivilege] FOREIGN KEY([SecurityPrivilegeID])
REFERENCES [dbo].[SecurityPrivilege] ([ID])
GO
ALTER TABLE [dbo].[DashboardCharts] CHECK CONSTRAINT [FK_DashboardCharts_SecurityPrivilege]
GO

INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES (1032, N'General dashboard', N'لوحة القياس العامة', 115, '/GeneralDashboard', 'Index', N'fa fa-thumb-tack', 'get', 12, 1, 1)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1388, N'عدد العاملين بالشركة', N'Headcount Per Company', 1032, 1)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1389, N'عدد العاملين بالقطاع', N'Headcount Per Division', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1390, N'المرتبات بالشركة', N'Salaries Per Company', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1391, N'عدد العاملين', N'Headcount', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1392, N'معدل دوران العاملين', N'Turnover', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1393, N'تعيين جديد', N'New Hire', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1394, N'استقالة', N'Resignation', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1395, N'اجمالي المرتبات', N'Total Gross Salary', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1396, N'صافي المرتبات', N'Total Net Salary', 1032, 2)
GO

INSERT [dbo].[SystemMenuModule] ([SystemMenuCode], [AppModuleCode]) VALUES (1032, 6)
GO
--------------------------------------- End AK 2024-01-22 ------------
---------------------------------------Hammad 2024-01-22 ------------
INSERT [dbo].[LabelsName] ([LabelKey], [Name], [Arabic_Name]) VALUES (N'VacationRefuse', N'Refuse', N'رفض')
GO
--------------------------------------- End  2024-01-22 -------------
--------------------------------------- Ali  2024-01-23 -------------
update [SystemMenu] set [ControllerName]=N'/Attendance/FingerAreaProjects' where [SystemMenuCode]=1036
update [SystemMenu] set [ControllerName]=N'/Attendance/FingerAreaUnit' where [SystemMenuCode]=1040
Go
--------------------------------------- End  2024-01-23 -------------
