---------------------------Sayed 2020-12-24-----------------------------
alter procedure [dbo].[Inv_StoreBalance]

(@storeCode int =null)
as
SELECT        Inv.StoreTransactionDetail.ItemCode, Inv.ItemUnit.Name AS UnitName, Inv.ItemUnit.Arabic_Name AS UnitAraName, Inv.Store.Name AS StoreName, Inv.Store.Arabic_Name AS StoreAraName, Inv.Store.StoreCode, 
                         Inv.ItemCard.ItemCardSerial, Inv.ItemCard.Name AS ItemName, Inv.ItemCard.Arabic_Name AS ItemAraName, SUM(Inv.StoreTransactionDetail.Quantity * Inv.StoreTransactionDetail.Indicator) AS Qty, 
                         Inv.StoreTransactionDetail.UnitPrice, Inv.StoreTransactionMaster.TransactionDate
FROM            Inv.StoreTransactionDetail INNER JOIN
                         Inv.StoreTransactionMaster ON Inv.StoreTransactionDetail.StoreTransactionMasterCode = Inv.StoreTransactionMaster.StoreTransactionMasterCode INNER JOIN
                         Inv.Store ON Inv.StoreTransactionDetail.StoreCode = Inv.Store.StoreCode INNER JOIN
                        Inv.ItemUnit ON Inv.StoreTransactionDetail.UnitCode = Inv.ItemUnit.ItemUnitCode INNER JOIN
                         Inv.ItemCard ON Inv.StoreTransactionDetail.ItemCode = Inv.ItemCard.ItemCardCode
                       
					    where (@storeCode IS NULL OR Inv.Store.StoreCode = @storeCode)

GROUP BY Inv.StoreTransactionDetail.ItemCode, Inv.ItemUnit.Name, Inv.ItemUnit.Arabic_Name, Inv.Store.Name, Inv.Store.Arabic_Name, Inv.Store.StoreCode, Inv.ItemCard.ItemCardSerial, Inv.ItemCard.Name, 
                         Inv.ItemCard.Arabic_Name, Inv.StoreTransactionDetail.UnitPrice, Inv.StoreTransactionMaster.TransactionDate
Go					
---------------------------2020-12-24-----------------------------------------
---------------------------Ali 2020-12-24-----------------------------------------

   ALTER TABLE [dbo].[Rec_RecruitJobQuestion] 
  ADD  IsMandatoryQuestion bit not null
  DEFAULT ((0))
  GO
--------------------------- End 2020-12-24-----------------------------------------
------------------------------- A.Khaled 2020-12-24 -------------------------- 
CREATE TABLE [dbo].[Rec_JobOfferParameterGroup](
	[JobOfferParameterGroupCode] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Arabic_Name] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_Rec_JobOfferParameterGroup] PRIMARY KEY CLUSTERED 
(
	[JobOfferParameterGroupCode] 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].[Rec_JobOfferParameter] ADD [JobOfferParameterGroupCode] INT NULL

ALTER TABLE [dbo].[Rec_JobOfferParameter]  WITH CHECK ADD  CONSTRAINT [FK_Rec_JobOfferParameter_JobOfferParameterGroup] FOREIGN KEY([JobOfferParameterGroupCode])
REFERENCES [dbo].[Rec_JobOfferParameterGroup] ([JobOfferParameterGroupCode])
GO

ALTER TABLE [dbo].[Rec_JobOfferParameter] CHECK CONSTRAINT [FK_Rec_JobOfferParameter_JobOfferParameterGroup]
GO

INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(405,N'Job Offer Parameter Group',N'مجموعة عناصر العرض الوظيفي',48,N'/Recruitment/JobOfferParameterGroup',N'Index','fa fa-sitemap',N'GET',14,1,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(405,4)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(5122,N'مجموعة عناصر العرض الوظيفي',N'Job Offer Parameter Group',405,1)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(5123,N'عرض مجموعة عناصر العرض الوظيفي',N'View Job Offer Parameter Group',405,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(5124,N'إضافة مجموعة عناصر العرض الوظيفي',N'Add Job Offer Parameter Group',405,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(5125,N'تعديل مجموعة عناصر العرض الوظيفي',N'Edit Job Offer Parameter Group',405,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(5126,N'حذف مجموعة عناصر العرض الوظيفي',N'Delete Job Offer Parameter Group',405,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(5127,N'حفظ مجموعة عناصر العرض الوظيفي',N'Save Job Offer Parameter Group',405,2)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES (295, N'Recruitment', N'JobOfferParameterGroup', N'Index', 0, N'get', 5122)
GO
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES (296, N'Recruitment', N'JobOfferParameterGroup', N'JobOfferParameterGroup_Read', 0, N'post', 5123)
GO
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES (297, N'Recruitment', N'JobOfferParameterGroup', N'Save', 1, N'get', 5124)
GO
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES (298, N'Recruitment', N'JobOfferParameterGroup', N'Save', 2, N'get', 5125)
GO
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES (299, N'Recruitment', N'JobOfferParameterGroup', N'Save', 0, N'post', 5126)
GO
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES (300, N'Recruitment', N'JobOfferParameterGroup', N'Delete', 0, N'post', 5127)
GO


Go
------------------------------- End 2020-12-24 --------------------------
-------------------------------Sayed 2020-12-27--------------------------
alter table Divisions
add DirectorOfHumanResourcesCode int null
Go
INSERT [dbo].[UserType] ([UserTypeCode], [Name], [Arabic_Name], [HaveEmployee], [OrganizationCategoryCode]) VALUES (29, N'Director Of Human Resources', N'مدير ادارة الموارد البشرية', 1, NULL)
Go
------------------------------End 2020-12-27----------------------------