﻿
-------------------------------Ali 2022-04-10---

INSERT[dbo].[ConfigParameter]  ([ConfigKey], [Name], [Arabic_Name], [ConfigValue], [ConfigCategoryCode], [OrderNo], [ConfigType], [IsVisible], [ModifiedBy], [ModificationDate], [RequestTypeId])
VALUES(N'ACC_VendorsMainAccountsChartCode',N'Vendors Main Account',N'حساب الموردين الرئيسى',N'0',18,6,2,1,Null,Null,Null)
Go
 INSERT[dbo].[ConfigParameter]  ([ConfigKey], [Name], [Arabic_Name], [ConfigValue], [ConfigCategoryCode], [OrderNo], [ConfigType], [IsVisible], [ModifiedBy], [ModificationDate], [RequestTypeId])
VALUES(N'ACC_CustomersMainAccountsChartCode',N'Customers Main Account',N'حساب العملاء الرئيسى',N'0',18,7,2,1,Null,Null,Null)
Go

 INSERT[dbo].[ConfigParameter]  ([ConfigKey], [Name], [Arabic_Name], [ConfigValue], [ConfigCategoryCode], [OrderNo], [ConfigType], [IsVisible], [ModifiedBy], [ModificationDate], [RequestTypeId])
VALUES(N'ACC_AutoPosting',N'Auto Posting',N'الترحيل التلقائى',N'false',18,8,1,1,Null,Null,Null)
Go
-------------------------------End 2022-04-10---
-------------------------------MOstafa 2022-04-11---
 INSERT[dbo].[ConfigParameter]  ([ConfigKey], [Name], [Arabic_Name], [ConfigValue], [ConfigCategoryCode], [OrderNo], [ConfigType], [IsVisible], [ModifiedBy], [ModificationDate], [RequestTypeId])
VALUES(N'WFShowAnnualBalance',N' Show Annual Balance',N'عرض الرصيد السنوي ',N'false',2,43,1,1,Null,Null,11)
Go


 INSERT[dbo].[ConfigParameter]  ([ConfigKey], [Name], [Arabic_Name], [ConfigValue], [ConfigCategoryCode], [OrderNo], [ConfigType], [IsVisible], [ModifiedBy], [ModificationDate], [RequestTypeId])
VALUES(N'WFShowDayoffBalance',N' Show Dayoff Balance',N'عرض الرصيد الاسبوعي ',N'false',2,44,1,1,Null,Null,11)
Go


 INSERT[dbo].[ConfigParameter]  ([ConfigKey], [Name], [Arabic_Name], [ConfigValue], [ConfigCategoryCode], [OrderNo], [ConfigType], [IsVisible], [ModifiedBy], [ModificationDate], [RequestTypeId])
VALUES(N'WFShowHolidayBalance',N' Show Holiday Balance',N'عرض رصيد الاعياد ',N'false',2,45,1,1,Null,Null,11)
Go


Update [dbo].[ConfigParameter] Set Name=N'Show Compensation Balance',Arabic_Name=N'عرض الرصيد التعويض',ConfigValue=N'true',ConfigCategoryCode=2,OrderNo=18,ConfigType=1,IsVisible=1,ModifiedBy=Null,ModificationDate=Null,RequestTypeId=11 Where  ConfigKey= N'WFVacShowOtherBalance'
Go

 update ConfigParameter set IsVisible=0 where ConfigKey='VacBalanceSource'
 GO
-------------------------------End 2022-04-11---
-------------------------------Mostafa 2022-04-12---
UPDATE ConfigParameter  
SET ConfigValue = 
( CASE  
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '1') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '2') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '5') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '6') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '88') THEN 'true' 
ELSE  ('false')
END )
where ConfigKey='WFShowAnnualBalance'

GO
UPDATE ConfigParameter  
SET ConfigValue = 
( CASE  
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '1') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '3') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '5') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '7') THEN 'true' 
ELSE  ('false')
END )
where ConfigKey='WFShowDayoffBalance'

GO

UPDATE ConfigParameter  
SET ConfigValue = 
( CASE  
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '1') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '4') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '6') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '7') THEN 'true' 
ELSE  ('false')
END )
where ConfigKey='WFShowHolidayBalance'

GO

UPDATE ConfigParameter  
SET ConfigValue = 
( CASE  
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '1') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '78') THEN 'true' 
WHEN ((select ConfigValue from ConfigParameter where ConfigKey='VacBalanceSource') = '88') THEN 'true' 

ELSE  ('false')
END )
where ConfigKey='WFVacShowOtherBalance'
GO
-------------------------------End 2022-04-12---
-------------------------------Hammad 2022-04-13---
update ConfigParameter set Arabic_Name=N'رقم إذن المامورية' where ConfigKey='WFPermissionMissionNo'
Go
-------------------------------End 2022-04-13---
-------------------------------MOstafa 2022-04-13---
IF EXISTS (select * from __EFMigrationsHistory where MigrationId='20210523093844_AddReimbursementRequest') 
BEGIN
   SELECT 1 
END
ELSE
BEGIN
DROP TABLE [WF_ReimbursementDocument];
DROP TABLE [WF_ReimbursementRequest];
END
GO
-------------------------------End 2022-04-13---
-------------------------------Hammad 2022-04-14---
Alter table LookupTableGroup ADD
	Name nvarchar(150) not NULL,
	Arabic_Name nvarchar(150) not NULL
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 Parameters ADD
	IsString bit not NULL default(0)
Go
-------------------------------End 2022-04-14---
-------------------------------Ali 2022-04-17---


INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(607,N'Entries',N'القيود',583,N'',N'','fa fa-thumb-tack',N'',5,1,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(607,18)
Go

 
  update [SystemMenu] set ParentID= 607 , Sequence=1
  where SystemMenuCode=604 
  Go

INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(606,N'Cash Transactions',N'الحركات الماليه',583,N'/GenerlLedger/CashTransaction',N'Index','fa fa-money',N'get',4,1,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(606,18)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(23058,N'الحركات الماليه',N'Cash Transactions',606,1)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(23059,N'عرض الحركات الماليه',N'View Cash Transactions',606,2)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(23060,N'إضافة الحركات الماليه',N'Add Cash Transactions',606,2)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(23061,N'تعديل الحركات الماليه',N'Edit Cash Transactions',606,2)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(23062,N'حذف الحركات الماليه',N'Delete Cash Transactions',606,2)
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(23063,N'حفظ الحركات الماليه',N'Save Cash Transactions',606,2)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1020,N'GenerlLedger',N'CashTransaction',N'Index',0,N'get',23058)
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1021,N'GenerlLedger',N'CashTransaction',N'CashTransaction_Read',0,N'post',23059)
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1022,N'GenerlLedger',N'CashTransaction',N'Save',1,N'get',23060)
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1023,N'GenerlLedger',N'CashTransaction',N'Save',2,N'get',23061)
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1024,N'GenerlLedger',N'CashTransaction',N'Delete',0,N'post',23062)
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1025,N'GenerlLedger',N'CashTransaction',N'Save',0,N'post',23063)
Go
-------------------------------End 2022-04-17---
