This option is used to get the required fields of employee details to display in the organization chart.
Below is the example for understanding the option.
1. Initially, when we open the organization chart a blank screen will be displayed on clicking the employee information option similar to the below screen.
2. To get more information for individual employees, run the below stored procedure from server database.
GO
/****** Object: StoredProcedure [dbo].[pPay_Employee360] Script Date: 13-11-2018 18:59:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create Procedure [dbo].[pPay_Employee360] (
@iEmployeeId INT
,@iStartDate INT
)
AS
BEGIN
select 2 as 'Type', '' as 'EmployeeGeneral Information', mPay_Designation.sName as 'designation' ,mPay_Position.sName as 'Position'
, CONVERT(varchar,CONVERT(date,dbo.IntToDate(muPay_Employee.dDateofJoining))) as 'joining Date'
from mPay_Employee
inner join muPay_Employee on mPay_Employee.iMasterId=muPay_Employee.iMasterId
inner join mPay_Designation on mPay_Designation.iMasterId=muPay_Employee.iDesignation
inner join mPay_Position on mPay_Position.iMasterId=muPay_Employee.iPosition
where mPay_Employee.iMasterId=@iEmployeeId
select 2 as 'Type','' as 'Personal Information',CONVERT(varchar,CONVERT(date,dbo.IntToDate(p.dDateofBirth))) as 'date of birth'
,n.sName as 'nationality'
from mPay_Employee
inner join muPay_Employee on mPay_Employee.iMasterId=muPay_Employee.iMasterId
inner join muPay_Employee_PersonalInformation p on mPay_Employee.iMasterId=p.iMasterId
INNER JOIN vPay_Employee vp ON vp.iMasterId = p.iMasterId
inner join mPay_Nationality n on p.iNationality=n.iMasterId where mPay_Employee.iMasterId=@iEmployeeId
select 3 as 'Type','' as 'Attendance Information', (DATENAME(month,dbo.IntToDate(dStartDate))) as 'Month',MAX(p.fWorkingDaysHours) as 'Working Days',SUM(a.fworkedDays) as 'Worked Days'
FROM tPay_Payroll p
INNER JOIN tuPay_Payroll_Details pd ON p.iTransId = pd.iPayrollId
AND pd.iPayrollRefType = 0
AND pd.iBodyId NOT IN (
SELECT isnull(iBodyId, 0)
FROM tuPay_PayrollApprovals_Details
WHERE iStatus = 6
)
INNER JOIN tuPay_PayrollAttendance_Details a ON pd.iBodyId = a.iPayrollDetailsId
AND a.iRevisionId = (
SELECT max(iRevisionId)
FROM tuPay_PayrollAttendance_Details tpd
WHERE tpd.iEmpId = a.iEmpId
AND a.iPayrollDetailsId = tpd.iPayrollDetailsId
)
INNER JOIN vPay_Employee ON vPay_Employee.iMasterId = a.iEmpId and a.iEmpId=@iEmployeeId
GROUP BY a.iEmpId,dStartDate
declare @p1 xml
declare @xmlData nvarchar(max) =N'<Params><SelectedIds>'+ CAST(@iEmployeeId as nvarchar(max))+ '</SelectedIds><StartDate>'+ CAST(@iStartDate as nvarchar(max))+ '</StartDate><EndDate>'+ CAST(@iStartDate as nvarchar(max))+ '</EndDate><LoginEmpId>0</LoginEmpId></Params>'
set @p1=convert(xml,@xmlData)
SET NOCOUNT OFF;
END
3. Now go to organization hierarchy to give the query details.
Settings>>Approval>>Organization Hierarchy
Enter the stored procedure name (pPay_Employee360) in the field provided “Dashboard stored procedure name”. Refer below screenshot.
On saving the details, the organization chart will be refreshed with more information which are added in the query. Refer below screenshot after executing the stored procedure.
If you refer the query, below details are included:
EmployeeGeneral Information – designation
Position
joining Date
Personal Information - date of birth
nationality
Attendance Information – Month
working Days
Worked Days
All the information added in the query is displayed in the organization chart.
Note: If User wants to get few more details to be displayed in the organization chart, they can modify or add the required details in the query and execute it.
Refer below video link for better understanding:
https://drive.google.com/file/d/1X3QOmnyAFo_9R-r1Zi0eFMhWG4_ZS_-k/view?usp=sharing
Comments
Post a Comment