SELECT papf.employee_number
,prrv.result_value
FROM pay_run_results prr
,pay_element_types_f petf
,pay_run_result_values prrv
,pay_input_values_f piv
,pay_assignment_actions paa
,pay_payroll_actions ppa
,per_all_assignments_f paaf
,per_all_people_f papf
WHERE prr.element_type_id = petf.element_type_id
AND prr.run_result_id = prrv.run_result_id
AND prrv.input_value_id = piv.input_value_id
AND prr.assignment_action_id = paa.assignment_action_id
AND paaf.assignment_id = paa.assignment_id
AND paaf.business_group_id = fnd_profile.value('PER_BUSINESS_GROUP_ID')
and paaf.person_id= papf.person_id
AND papf.business_group_id = fnd_profile.value('PER_BUSINESS_GROUP_ID')
AND upper(petf.element_name) = 'ADVANCE SALARY'
AND piv.name = 'Pay Value'
AND SYSDATE BETWEEN piv.effective_start_date AND piv.effective_end_date
AND SYSDATE BETWEEN petf.effective_start_date AND petf.effective_end_date
AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
AND ppa.payroll_action_id = paa.payroll_action_id
AND ppa.action_type IN ('Q', 'R')
AND ppa.effective_date = '31-JUL-2022'
AND prrv.result_value > '0'
No comments:
Post a Comment