• Post category:Payroll
  • Post comments:0 Comments
  • Post last modified:October 11, 2021
  • Reading time:2 mins read
You are currently viewing Do you know how to query the payroll flow tables to get the payslips generated count?
Do you know how to query the payroll flow tables to get the payslips generated count?
- Do you know how to query the payroll flow tables to get the payslips generated count?
Total Visits: 2

In this article, we will look into a query to identify the number of employees for whom the payslip has been generated as part of the payroll flow.

We have to run the “Generate Payslips” process to generate the payslips for employees. We can also run the consolidated payroll flows like “Quick Pay” or “Simplified Payroll Flow”.

Either way, the payslips process will be run to generate the payslips for the employees.

If there is a need to quickly validate the number of employees for whom the payslip is generated, this query will be handy.

SELECT pf.base_flow_name,
  fi.instance_name,
  ppa.payroll_action_id,
  COUNT(pra.payroll_rel_action_id) AS payslip_count
FROM pay_flow_instances fi,
  pay_flow_task_instances pfti,
  pay_flow_tasks_vl pft,
  pay_tasks pt,
  pay_flows pf,
  pay_requests pr,
  pay_payroll_actions ppa,
  pay_payroll_rel_actions pra
WHERE fi.creation_date        >= sysdate - 300
AND fi.flow_instance_id        = pfti.flow_instance_id
AND pfti.base_flow_task_id     = pft.base_flow_task_id
AND pft.base_task_id           = pt.base_task_id
AND pt.base_task_name          = 'PAYSLIP'
and fi.base_flow_id = pf.base_flow_id
AND pfti.flow_task_instance_id = pr.flow_task_instance_id
AND pr.pay_request_id          = ppa.pay_request_id
AND ppa.action_type            ='XWr'
AND ppa.PAYROLL_ACTION_ID      = pra.PAYROLL_ACTION_ID(+)
GROUP BY pf.base_flow_name, 
  fi.instance_name,
  ppa.payroll_action_id
ORDER BY ppa.payroll_action_id
If you like the content, please follow us on LinkedInFacebook, and Twitter to get updated with the latest content.