99: nvl(min(decode(inv.name, 'Tax Previous', eev.screen_entry_value, null)),0)||
100: nvl(min(decode(inv.name, 'Authority', substr(HR_GENERAL.DECODE_LOOKUP('GB_AUTHORITY',eev.screen_entry_value),1,80),null)),0)||
101: nvl(ele.entry_information1,0)||
102: nvl(ele.entry_information2,0) VALUE,
103: pay_gb_eoy_archive.get_agg_active_start(paa.assignment_id, p_tax_district, greatest(paa.effective_start_date,ppf.effective_start_date)) cpe_start_date,
104: paa.assignment_id assignment_id,
105: eev.effective_start_date effective_start_date,
106: eev.effective_end_date effective_end_date
107: from
158: and papf.effective_end_date >= p_start_date
159: and papf.payroll_id = paaf.payroll_id
160: and papf.soft_coding_keyflex_id=hsck.soft_coding_keyflex_id
161: and hsck.segment1 = scl.segment1
162: and pay_gb_eoy_archive.get_agg_active_end(paa.assignment_id, p_tax_district, greatest(paa.effective_start_date,ppf.effective_start_date))
163: = pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, p_tax_district, greatest(paaf.effective_start_date,papf.effective_start_date))
164: and pay_gb_eoy_archive.get_agg_active_start(paa.assignment_id, p_tax_district, greatest(paa.effective_start_date,ppf.effective_start_date))
165: = pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, p_tax_district, greatest(paaf.effective_start_date,papf.effective_start_date))
166: and paaf.assignment_status_type_id = past.assignment_status_type_id
159: and papf.payroll_id = paaf.payroll_id
160: and papf.soft_coding_keyflex_id=hsck.soft_coding_keyflex_id
161: and hsck.segment1 = scl.segment1
162: and pay_gb_eoy_archive.get_agg_active_end(paa.assignment_id, p_tax_district, greatest(paa.effective_start_date,ppf.effective_start_date))
163: = pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, p_tax_district, greatest(paaf.effective_start_date,papf.effective_start_date))
164: and pay_gb_eoy_archive.get_agg_active_start(paa.assignment_id, p_tax_district, greatest(paa.effective_start_date,ppf.effective_start_date))
165: = pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, p_tax_district, greatest(paaf.effective_start_date,papf.effective_start_date))
166: and paaf.assignment_status_type_id = past.assignment_status_type_id
167: and past.per_system_status in ('ACTIVE_ASSIGN','SUSP_ASSIGN')
160: and papf.soft_coding_keyflex_id=hsck.soft_coding_keyflex_id
161: and hsck.segment1 = scl.segment1
162: and pay_gb_eoy_archive.get_agg_active_end(paa.assignment_id, p_tax_district, greatest(paa.effective_start_date,ppf.effective_start_date))
163: = pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, p_tax_district, greatest(paaf.effective_start_date,papf.effective_start_date))
164: and pay_gb_eoy_archive.get_agg_active_start(paa.assignment_id, p_tax_district, greatest(paa.effective_start_date,ppf.effective_start_date))
165: = pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, p_tax_district, greatest(paaf.effective_start_date,papf.effective_start_date))
166: and paaf.assignment_status_type_id = past.assignment_status_type_id
167: and past.per_system_status in ('ACTIVE_ASSIGN','SUSP_ASSIGN')
168: )
161: and hsck.segment1 = scl.segment1
162: and pay_gb_eoy_archive.get_agg_active_end(paa.assignment_id, p_tax_district, greatest(paa.effective_start_date,ppf.effective_start_date))
163: = pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, p_tax_district, greatest(paaf.effective_start_date,papf.effective_start_date))
164: and pay_gb_eoy_archive.get_agg_active_start(paa.assignment_id, p_tax_district, greatest(paa.effective_start_date,ppf.effective_start_date))
165: = pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, p_tax_district, greatest(paaf.effective_start_date,papf.effective_start_date))
166: and paaf.assignment_status_type_id = past.assignment_status_type_id
167: and past.per_system_status in ('ACTIVE_ASSIGN','SUSP_ASSIGN')
168: )
169: group by ele.rowid, scl.segment1,
584: and apf.payroll_id =aaf.payroll_id
585: and c_end_date between apf.effective_start_date and apf.effective_end_date
586: and apf.soft_coding_keyflex_id = sck.soft_coding_keyflex_id
587: and sck.segment1 = hsck.segment1
588: AND pay_gb_eoy_archive.get_agg_active_end(aaf.assignment_id, hsck.segment1, c_end_date)
589: = pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, hsck.segment1, c_end_date)
590: AND pay_gb_eoy_archive.get_agg_active_start(aaf.assignment_id, hsck.segment1, c_end_date)
591: = pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, hsck.segment1, c_end_date));
592: --
585: and c_end_date between apf.effective_start_date and apf.effective_end_date
586: and apf.soft_coding_keyflex_id = sck.soft_coding_keyflex_id
587: and sck.segment1 = hsck.segment1
588: AND pay_gb_eoy_archive.get_agg_active_end(aaf.assignment_id, hsck.segment1, c_end_date)
589: = pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, hsck.segment1, c_end_date)
590: AND pay_gb_eoy_archive.get_agg_active_start(aaf.assignment_id, hsck.segment1, c_end_date)
591: = pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, hsck.segment1, c_end_date));
592: --
593: -- cursor to fetch earliest and latest payroll actions tax year for this assignment
586: and apf.soft_coding_keyflex_id = sck.soft_coding_keyflex_id
587: and sck.segment1 = hsck.segment1
588: AND pay_gb_eoy_archive.get_agg_active_end(aaf.assignment_id, hsck.segment1, c_end_date)
589: = pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, hsck.segment1, c_end_date)
590: AND pay_gb_eoy_archive.get_agg_active_start(aaf.assignment_id, hsck.segment1, c_end_date)
591: = pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, hsck.segment1, c_end_date));
592: --
593: -- cursor to fetch earliest and latest payroll actions tax year for this assignment
594: --
587: and sck.segment1 = hsck.segment1
588: AND pay_gb_eoy_archive.get_agg_active_end(aaf.assignment_id, hsck.segment1, c_end_date)
589: = pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, hsck.segment1, c_end_date)
590: AND pay_gb_eoy_archive.get_agg_active_start(aaf.assignment_id, hsck.segment1, c_end_date)
591: = pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, hsck.segment1, c_end_date));
592: --
593: -- cursor to fetch earliest and latest payroll actions tax year for this assignment
594: --
595:
1046: AND elt.legislation_code = 'GB'
1047: AND c_effective_date between elt.effective_start_date and elt.effective_end_date
1048: -- AND pay_p45_pkg.PAYE_SYNC_P45_ISSUED_FLAG(paaf.assignment_id,c_effective_date) = 'N'
1049: AND paaf.assignment_id <> c_assignment_id
1050: AND pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, c_tax_ref,c_effective_date) =
1051: pay_gb_eoy_archive.get_agg_active_start(c_assignment_id, c_tax_ref,c_effective_date)
1052: AND pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, c_tax_ref,c_effective_date) =
1053: pay_gb_eoy_archive.get_agg_active_end(c_assignment_id, c_tax_ref,c_effective_date)
1054: ) ppev
1047: AND c_effective_date between elt.effective_start_date and elt.effective_end_date
1048: -- AND pay_p45_pkg.PAYE_SYNC_P45_ISSUED_FLAG(paaf.assignment_id,c_effective_date) = 'N'
1049: AND paaf.assignment_id <> c_assignment_id
1050: AND pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, c_tax_ref,c_effective_date) =
1051: pay_gb_eoy_archive.get_agg_active_start(c_assignment_id, c_tax_ref,c_effective_date)
1052: AND pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, c_tax_ref,c_effective_date) =
1053: pay_gb_eoy_archive.get_agg_active_end(c_assignment_id, c_tax_ref,c_effective_date)
1054: ) ppev
1055: where ppev.TAX_CODE is not null
1048: -- AND pay_p45_pkg.PAYE_SYNC_P45_ISSUED_FLAG(paaf.assignment_id,c_effective_date) = 'N'
1049: AND paaf.assignment_id <> c_assignment_id
1050: AND pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, c_tax_ref,c_effective_date) =
1051: pay_gb_eoy_archive.get_agg_active_start(c_assignment_id, c_tax_ref,c_effective_date)
1052: AND pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, c_tax_ref,c_effective_date) =
1053: pay_gb_eoy_archive.get_agg_active_end(c_assignment_id, c_tax_ref,c_effective_date)
1054: ) ppev
1055: where ppev.TAX_CODE is not null
1056: and ppev.Tax_Basis is not null
1049: AND paaf.assignment_id <> c_assignment_id
1050: AND pay_gb_eoy_archive.get_agg_active_start(paaf.assignment_id, c_tax_ref,c_effective_date) =
1051: pay_gb_eoy_archive.get_agg_active_start(c_assignment_id, c_tax_ref,c_effective_date)
1052: AND pay_gb_eoy_archive.get_agg_active_end(paaf.assignment_id, c_tax_ref,c_effective_date) =
1053: pay_gb_eoy_archive.get_agg_active_end(c_assignment_id, c_tax_ref,c_effective_date)
1054: ) ppev
1055: where ppev.TAX_CODE is not null
1056: and ppev.Tax_Basis is not null
1057: and ppev.Refundable is not null;