SELECT distinct papf.employee_number empno,
substr(papf.full_name,1,35) employee_name,
(SELECT distinct pppm.ORG_PAYMENT_METHOD_ID
FROM pay_personal_payment_methods_f pppm,
pay_external_accounts pea
WHERE pppm.external_account_id = pea.external_account_id
AND ptp.end_date BETWEEN pppm.effective_start_date AND pppm.effective_end_date
AND pppm.assignment_id = paaf.assignment_id)ORG_PAYMENT_METHOD_ID,
(SELECT distinct NVL(PEA.SEGMENT3,'N/A')
FROM PAY_PERSONAL_PAYMENT_METHODS_F PPPM ,
PAY_EXTERNAL_ACCOUNTS PEA
WHERE PPPM.EXTERNAL_ACCOUNT_ID = PEA.EXTERNAL_ACCOUNT_ID
AND PTP.END_DATE BETWEEN PPPM.EFFECTIVE_START_DATE AND PPPM.EFFECTIVE_END_DATE
AND PPPM.ASSIGNMENT_ID = PAAF.ASSIGNMENT_ID)IBAN,
substr(haou.NAME,1,105) ORG_NAME
papf.person_id,paaf.assignment_id
FROM per_all_people_f papf,
per_all_assignments_f paaf,
pay_assignment_actions paa,
pay_payroll_actions ppa,
per_time_periods ptp,
hr_all_organization_units haou
WHERE papf.person_id = paaf.person_id(+)
AND (ppa.payroll_action_id = :p_paid OR :p_paid IS NULL)
AND haou.organization_id = paaf.organization_id
AND ptp.end_date BETWEEN papf.effective_start_date AND papf.effective_end_date
AND ptp.end_date BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND paaf.assignment_id = paa.assignment_id
AND paaf.primary_flag = 'Y'
-- AND papf.current_employee_flag = 'Y'
AND ppa.action_type = 'R'
AND paa.payroll_action_id = ppa.payroll_action_id
AND ppa.payroll_id = paaf.payroll_id
AND ppa.payroll_id = :p_payroll_id
AND ppa.payroll_id = ptp.payroll_id
AND ptp.time_period_id = ppa.time_period_id
AND ptp.time_period_id = :p_time_period_id
and(SELECT distinct pppm.ORG_PAYMENT_METHOD_ID
FROM pay_personal_payment_methods_f pppm,
pay_external_accounts pea
WHERE pppm.external_account_id = pea.external_account_id
AND ptp.end_date BETWEEN pppm.effective_start_date AND pppm.effective_end_date
AND pppm.assignment_id = paaf.assignment_id) = 63 --BANK
-- AND papf.employee_number = '9700'
ORDER BY 1
substr(papf.full_name,1,35) employee_name,
(SELECT distinct pppm.ORG_PAYMENT_METHOD_ID
FROM pay_personal_payment_methods_f pppm,
pay_external_accounts pea
WHERE pppm.external_account_id = pea.external_account_id
AND ptp.end_date BETWEEN pppm.effective_start_date AND pppm.effective_end_date
AND pppm.assignment_id = paaf.assignment_id)ORG_PAYMENT_METHOD_ID,
(SELECT distinct NVL(PEA.SEGMENT3,'N/A')
FROM PAY_PERSONAL_PAYMENT_METHODS_F PPPM ,
PAY_EXTERNAL_ACCOUNTS PEA
WHERE PPPM.EXTERNAL_ACCOUNT_ID = PEA.EXTERNAL_ACCOUNT_ID
AND PTP.END_DATE BETWEEN PPPM.EFFECTIVE_START_DATE AND PPPM.EFFECTIVE_END_DATE
AND PPPM.ASSIGNMENT_ID = PAAF.ASSIGNMENT_ID)IBAN,
substr(haou.NAME,1,105) ORG_NAME
papf.person_id,paaf.assignment_id
FROM per_all_people_f papf,
per_all_assignments_f paaf,
pay_assignment_actions paa,
pay_payroll_actions ppa,
per_time_periods ptp,
hr_all_organization_units haou
WHERE papf.person_id = paaf.person_id(+)
AND (ppa.payroll_action_id = :p_paid OR :p_paid IS NULL)
AND haou.organization_id = paaf.organization_id
AND ptp.end_date BETWEEN papf.effective_start_date AND papf.effective_end_date
AND ptp.end_date BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND paaf.assignment_id = paa.assignment_id
AND paaf.primary_flag = 'Y'
-- AND papf.current_employee_flag = 'Y'
AND ppa.action_type = 'R'
AND paa.payroll_action_id = ppa.payroll_action_id
AND ppa.payroll_id = paaf.payroll_id
AND ppa.payroll_id = :p_payroll_id
AND ppa.payroll_id = ptp.payroll_id
AND ptp.time_period_id = ppa.time_period_id
AND ptp.time_period_id = :p_time_period_id
and(SELECT distinct pppm.ORG_PAYMENT_METHOD_ID
FROM pay_personal_payment_methods_f pppm,
pay_external_accounts pea
WHERE pppm.external_account_id = pea.external_account_id
AND ptp.end_date BETWEEN pppm.effective_start_date AND pppm.effective_end_date
AND pppm.assignment_id = paaf.assignment_id) = 63 --BANK
-- AND papf.employee_number = '9700'
ORDER BY 1
No comments:
Post a Comment