﻿  ----------------------------------------- AK 2025-11-02 -----------------------
INSERT INTO [SystemMenu](SystemMenuCode,Name,Arabic_Name,ParentID,ControllerName,ActionName,ImageURL,HTTPMethod,Sequence,IsVisible,ShowInPrivilegePage) VALUES (1208,N'Sales invoices returns',N'مردودات فواتير المبيعات',1201,N'/SAL/SalesInvoiceReturn',N'Index',N'fas fa-file-invoice',N'Get',3,1,1)
GO
INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1208,21)
GO
INSERT INTO [SecurityPrivilege](ID,DescriptionAR,DescriptionEN,SystemMenuCode,PrivilegeType) VALUES (22105,N'مردودات فواتير المبيعات',N'Sales invoices returns',1208,1)
GO
INSERT INTO [SecurityPrivilege](ID,DescriptionAR,DescriptionEN,SystemMenuCode,PrivilegeType) VALUES (22106,N'عرض مردودات فواتير المبيعات',N'View Sales invoices returns',1208,2)
GO
INSERT INTO [SecurityPrivilege](ID,DescriptionAR,DescriptionEN,SystemMenuCode,PrivilegeType) VALUES (22107,N'إضافة مردودات فواتير المبيعات',N'Add Sales invoices returns',1208,2)
GO
INSERT INTO [SecurityPrivilege](ID,DescriptionAR,DescriptionEN,SystemMenuCode,PrivilegeType) VALUES (22108,N'تعديل مردودات فواتير المبيعات',N'Edit Sales invoices returns',1208,2)
GO
INSERT INTO [SecurityPrivilege](ID,DescriptionAR,DescriptionEN,SystemMenuCode,PrivilegeType) VALUES (22109,N'حذف مردودات فواتير المبيعات',N'Delete Sales invoices returns',1208,2)
GO
INSERT INTO [SecurityPrivilege](ID,DescriptionAR,DescriptionEN,SystemMenuCode,PrivilegeType) VALUES (22110,N'حفظ مردودات فواتير المبيعات',N'Save Sales invoices returns',1208,2)
GO
 -----------------------------------------END AK 2025-11-02 --------------------
 -----------------------------------------Hammad  2025-11-03 -----------------

 INSERT [dbo].[LookupTables] ( [TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr])
VALUES ( N'CostCenter', N'/Common', N'GetCostCenterWithCode', N'LookUpCodeStr', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[LookupTables] ([TableName], [ControllerName], [ActionName], [DataValueField], [DataTextFieldEn], [DataTextFieldAr])
VALUES (N'FingerAreaProjects', N'Attendance/FingerAreaProjects', N'GetFingerAreaProjects', N'FingerAreaProjectsCode', N'Name', N'ArabicName')
GO
 -----------------------------------------END 2025-11-03 --------------------
Go
 ----------------------------------------End  2025-10-30 --------------------
  ----------------------------------------Ali  2025-11-03 --------------------
INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(1174,N'Competency Approval Signature',N'اعتماد تقييم الكفاءة',1135,N'/PMS/CompetencyApprovalSignature',N'index','fa fa-thumb-tack',N'Get',3,1,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1174,8)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(26133,N'اعتماد تقييم الكفاءة',N'Competency Approval Signature',1174,1)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(26134,N'عرض اعتماد تقييم الكفاءة',N'View Competency Approval Signature',1174,2)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(26135,N'حفظ اعتماد تقييم الكفاءة',N'Save Competency Approval Signature',1174,2)
Go

 ----------------------------------------End  2025-11-03 --------------------
 
 ----------------------------------------Ali  2025-11-04 --------------------

 SET IDENTITY_INSERT[dbo].[EmailTemplateType] ON
INSERT[dbo].[EmailTemplateType]([EmailTemplateTypeCode], [Name],[Arabic_Name], [IsEditable],[AppModuleCode],[RequestTypeCode],[HaveUserAccount])
VALUES(486,N'Send Goals Setting Department',N'اعتماد اهداف تقييم الادارات',0,8,Null , 1 )
SET IDENTITY_INSERT[dbo].[EmailTemplateType] OFF
Go

INSERT[dbo].[EmailTemplate]( [Name], [Arabic_Name], [EmailTemplateTypeCode], [Subject], [Body], [IsDefault], [SubjectAppendCode])
VALUES(N'Send Goals Setting Department',N' ارسال اعتماد اهداف تقييم الادارات',486,N'ارسال اعتماد اهداف تقييم الادارات',N'ارسال اعتماد اهداف تقييم الادارات',1,NULL)

Go



  SET IDENTITY_INSERT[dbo].[EmailTemplateType] ON
INSERT[dbo].[EmailTemplateType]([EmailTemplateTypeCode], [Name],[Arabic_Name], [IsEditable],[AppModuleCode],[RequestTypeCode],[HaveUserAccount])
VALUES(488,N'Approved department goals',N'تمت الموافقة على اهداف الادارة',0,8,Null , 1 )
SET IDENTITY_INSERT[dbo].[EmailTemplateType] OFF
Go

INSERT[dbo].[EmailTemplate]( [Name], [Arabic_Name], [EmailTemplateTypeCode], [Subject], [Body], [IsDefault], [SubjectAppendCode])
VALUES(N'Approved department goals',N'تمت الموافقة على اهداف الادارة',488,N'تمت الموافقة على اهداف الادارة',N'برجاء تسكين الموظفين على مؤشرات الاداء',1,NULL)

Go


SET IDENTITY_INSERT[dbo].[EmailTemplateType] ON
INSERT[dbo].[EmailTemplateType]([EmailTemplateTypeCode], [Name],[Arabic_Name], [IsEditable],[AppModuleCode],[RequestTypeCode],[HaveUserAccount])
VALUES(487,N'Return department goals',N'ارجاع اهداف الادارة',0,8,Null , 1 )
SET IDENTITY_INSERT[dbo].[EmailTemplateType] OFF
Go

INSERT[dbo].[EmailTemplate]( [Name], [Arabic_Name], [EmailTemplateTypeCode], [Subject], [Body], [IsDefault], [SubjectAppendCode])
VALUES(N'Return department goals',N'ارجاع اهداف الادارة من المدير العام',487,N'ارجاع اهداف الادارة من المدير العام',N'تم ارجاع اهداف الادارة من المدير العام',1,NULL)

Go

 ----------------------------------------End  2025-11-04 --------------------

 ----------------------------------------Mostafa  2025-11-05 --------------------
 delete EmailTemplate where EmailTemplateCode in (1266,1267,1268,1270,1271,1272,2266,2267,2268)
 GO
 ----------------------------------------End  2025-11-05 --------------------

 ----------------------------------------Hammad  2025-11-05 -----------------
 

delete FingerAreaLogTasks where FingerAreaLogId not in (select FingerAreaLogId from FingerAreaLogs )
Go

delete FROM FingerAreaLogs where FingerAreaUnitCode not in (select FingerAreaUnitCode from FingerAreaUnits)
Go

ALTER TABLE [dbo].[FingerAreaUnits]  WITH CHECK ADD  CONSTRAINT [FK_FingerAreaUnits_FingerAreaProjects] FOREIGN KEY([FingerAreaProjectCode])
REFERENCES [dbo].[FingerAreaProjects] ([FingerAreaProjectsCode])
GO

ALTER TABLE [dbo].[FingerAreaUnits] CHECK CONSTRAINT [FK_FingerAreaUnits_FingerAreaProjects]
GO

CREATE TABLE [dbo].[FingerAreaLogUnits](
	[FingerAreaLogUnitCode] [int] IDENTITY(1,1) NOT NULL,
	[FingerAreaLogId] [int] NOT NULL,
	[FingerAreaUnitCode] [int] NOT NULL,
 CONSTRAINT [PK_FingerAreaLogUnits] PRIMARY KEY CLUSTERED 
(
	[FingerAreaLogUnitCode] 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].[FingerAreaLogUnits]  WITH CHECK ADD  CONSTRAINT [FK_FingerAreaLogUnits_FingerAreaLogs] FOREIGN KEY([FingerAreaLogId])
REFERENCES [dbo].[FingerAreaLogs] ([FingerAreaLogId])
GO

ALTER TABLE [dbo].[FingerAreaLogUnits] CHECK CONSTRAINT [FK_FingerAreaLogUnits_FingerAreaLogs]
GO

ALTER TABLE [dbo].[FingerAreaLogUnits]  WITH CHECK ADD  CONSTRAINT [FK_FingerAreaLogUnits_FingerAreaUnits] FOREIGN KEY([FingerAreaUnitCode])
REFERENCES [dbo].[FingerAreaUnits] ([FingerAreaUnitCode])
GO

ALTER TABLE [dbo].[FingerAreaLogUnits] CHECK CONSTRAINT [FK_FingerAreaLogUnits_FingerAreaUnits]
GO


ALTER TABLE [dbo].[FingerAreaLogTasks]  WITH CHECK ADD  CONSTRAINT [FK_FingerAreaLogTasks_FingerAreaLogs] FOREIGN KEY([FingerAreaLogId])
REFERENCES [dbo].[FingerAreaLogs] ([FingerAreaLogId])
GO

ALTER TABLE [dbo].[FingerAreaLogTasks] CHECK CONSTRAINT [FK_FingerAreaLogTasks_FingerAreaLogs]
GO

ALTER TABLE [dbo].[FingerAreaLogTasks]  WITH CHECK ADD  CONSTRAINT [FK_FingerAreaLogTasks_PositionTasks] FOREIGN KEY([PositionTasksCode])
REFERENCES [dbo].[PositionTasks] ([PositionTasksCode])
GO

ALTER TABLE [dbo].[FingerAreaLogTasks] CHECK CONSTRAINT [FK_FingerAreaLogTasks_PositionTasks]
GO


INSERT INTO FingerAreaLogUnits (FingerAreaLogId, FingerAreaUnitCode)
SELECT FingerAreaLogId, FingerAreaUnitCode 
FROM FingerAreaLogs
where FingerAreaUnitCode is Not NULL
Go


ALTER TABLE dbo.FingerAreaLogs
	DROP COLUMN FingerAreaUnitCode
GO

 ----------------------------------------End  2025-11-05 -----------------


