927: /* that had a different tax district at that date */
928: ( select /*+ ORDERED INDEX (NASS PER_ASSIGNMENTS_F_PK,
929: PASS PER_ASSIGNMENTS_F_PK,
930: ROLL PAY_PAYROLLS_F_PK,
931: FLEX HR_SOFT_CODING_KEYFLEX_PK,
932: PROLL PAY_PAYROLLS_F_PK,
933: PFLEX HR_SOFT_CODING_KEYFLEX_PK)
934: USE_NL(NASS,PASS,ROLL,FLEX,PROLL,PFLEX) +*/
935: nvl(max(NASS.effective_start_date), to_date('01-01-0001','DD-MM-YYYY'))
929: PASS PER_ASSIGNMENTS_F_PK,
930: ROLL PAY_PAYROLLS_F_PK,
931: FLEX HR_SOFT_CODING_KEYFLEX_PK,
932: PROLL PAY_PAYROLLS_F_PK,
933: PFLEX HR_SOFT_CODING_KEYFLEX_PK)
934: USE_NL(NASS,PASS,ROLL,FLEX,PROLL,PFLEX) +*/
935: nvl(max(NASS.effective_start_date), to_date('01-01-0001','DD-MM-YYYY'))
936: from per_all_assignments_f NASS
937: ,per_all_assignments_f PASS
935: nvl(max(NASS.effective_start_date), to_date('01-01-0001','DD-MM-YYYY'))
936: from per_all_assignments_f NASS
937: ,per_all_assignments_f PASS
938: ,pay_all_payrolls_f ROLL
939: ,hr_soft_coding_keyflex FLEX
940: ,pay_all_payrolls_f PROLL
941: ,hr_soft_coding_keyflex PFLEX
942: where NASS.assignment_id = ASS.assignment_id
943: and ROLL.payroll_id = NASS.payroll_id
937: ,per_all_assignments_f PASS
938: ,pay_all_payrolls_f ROLL
939: ,hr_soft_coding_keyflex FLEX
940: ,pay_all_payrolls_f PROLL
941: ,hr_soft_coding_keyflex PFLEX
942: where NASS.assignment_id = ASS.assignment_id
943: and ROLL.payroll_id = NASS.payroll_id
944: and NASS.effective_start_date between
945: ROLL.effective_start_date and ROLL.effective_end_date
956: )
957: and exists ( select null from
958: /* check that the current assignment tax districts match */
959: pay_all_payrolls_f BROLL
960: ,hr_soft_coding_keyflex BFLEX
961: ,pay_all_payrolls_f PROLL
962: ,hr_soft_coding_keyflex PFLEX
963: where BACT.payroll_id = BROLL.payroll_id
964: and PACT.payroll_id = PROLL.payroll_id
958: /* check that the current assignment tax districts match */
959: pay_all_payrolls_f BROLL
960: ,hr_soft_coding_keyflex BFLEX
961: ,pay_all_payrolls_f PROLL
962: ,hr_soft_coding_keyflex PFLEX
963: where BACT.payroll_id = BROLL.payroll_id
964: and PACT.payroll_id = PROLL.payroll_id
965: and BFLEX.soft_coding_keyflex_id = BROLL.soft_coding_keyflex_id
966: and PFLEX.soft_coding_keyflex_id = PROLL.soft_coding_keyflex_id
1514: select FLEX.segment1,a.person_id
1515: into l_tax_reference, l_person_id
1516: from pay_payrolls_f p,
1517: per_assignments_f a,
1518: hr_soft_coding_keyflex FLEX
1519: where a.assignment_id = p_assignment_id
1520: and a.payroll_id = p.payroll_id
1521: and l_effective_date
1522: between a.effective_start_date and a.effective_end_date
1532: begin
1533: select count(distinct ptpt.NUMBER_PER_FISCAL_YEAR) into l_count
1534: from pay_payrolls_f p,
1535: per_assignments_f a,
1536: hr_soft_coding_keyflex FLEX,
1537: per_time_period_types ptpt
1538: where a.person_id = l_person_id
1539: and a.assignment_type = 'E'
1540: and a.payroll_id = p.payroll_id
1592: ordered
1593: use_nl(a p flex)
1594: index(a per_assignments_f_pk)
1595: index(p pay_payrolls_f_pk)
1596: index(flex hr_soft_coding_keyflex_pk)
1597: */
1598: FLEX.segment1,a.person_id into l_tax_reference, l_person_id
1599: from per_all_assignments_f a,
1600: pay_all_payrolls_f p,
1597: */
1598: FLEX.segment1,a.person_id into l_tax_reference, l_person_id
1599: from per_all_assignments_f a,
1600: pay_all_payrolls_f p,
1601: hr_soft_coding_keyflex FLEX
1602: where a.assignment_id = l_assignment_id
1603: and a.payroll_id = p.payroll_id
1604: and l_effective_date between a.effective_start_date and a.effective_end_date
1605: and l_effective_date between p.effective_start_date and p.effective_end_date
1617: ordered
1618: use_nl(a p flex ptpt)
1619: index(a per_assignments_f_n12)
1620: index(p pay_payrolls_f_pk)
1621: index(flex hr_soft_coding_keyflex_pk)
1622: index(ptpt per_time_period_types_pk)
1623: */
1624: min(ptpt.NUMBER_PER_FISCAL_YEAR) into l_freq
1625: from per_all_assignments_f a,
1623: */
1624: min(ptpt.NUMBER_PER_FISCAL_YEAR) into l_freq
1625: from per_all_assignments_f a,
1626: pay_all_payrolls_f p,
1627: hr_soft_coding_keyflex FLEX,
1628: per_time_period_types ptpt
1629: where a.person_id = l_person_id
1630: and a.payroll_id = p.payroll_id
1631: and nvl(hr_gbnidir.element_entry_value(a.assignment_id,
1996: /* that had a different tax district at that date */
1997: ( select /*+ ORDERED INDEX (NASS PER_ASSIGNMENTS_F_PK,
1998: PASS PER_ASSIGNMENTS_F_PK,
1999: ROLL PAY_PAYROLLS_F_PK,
2000: FLEX HR_SOFT_CODING_KEYFLEX_PK,
2001: PROLL PAY_PAYROLLS_F_PK,
2002: PFLEX HR_SOFT_CODING_KEYFLEX_PK)
2003: USE_NL(NASS,PASS,ROLL,FLEX,PROLL,PFLEX) +*/
2004: nvl(max(NASS.effective_start_date), to_date('01-01-0001','DD-MM-YYYY'))
1998: PASS PER_ASSIGNMENTS_F_PK,
1999: ROLL PAY_PAYROLLS_F_PK,
2000: FLEX HR_SOFT_CODING_KEYFLEX_PK,
2001: PROLL PAY_PAYROLLS_F_PK,
2002: PFLEX HR_SOFT_CODING_KEYFLEX_PK)
2003: USE_NL(NASS,PASS,ROLL,FLEX,PROLL,PFLEX) +*/
2004: nvl(max(NASS.effective_start_date), to_date('01-01-0001','DD-MM-YYYY'))
2005: from per_all_assignments_f NASS
2006: ,per_all_assignments_f PASS
2004: nvl(max(NASS.effective_start_date), to_date('01-01-0001','DD-MM-YYYY'))
2005: from per_all_assignments_f NASS
2006: ,per_all_assignments_f PASS
2007: ,pay_all_payrolls_f ROLL
2008: ,hr_soft_coding_keyflex FLEX
2009: ,pay_all_payrolls_f PROLL
2010: ,hr_soft_coding_keyflex PFLEX
2011: where NASS.assignment_id = ASS.assignment_id
2012: and ROLL.payroll_id = NASS.payroll_id
2006: ,per_all_assignments_f PASS
2007: ,pay_all_payrolls_f ROLL
2008: ,hr_soft_coding_keyflex FLEX
2009: ,pay_all_payrolls_f PROLL
2010: ,hr_soft_coding_keyflex PFLEX
2011: where NASS.assignment_id = ASS.assignment_id
2012: and ROLL.payroll_id = NASS.payroll_id
2013: and NASS.effective_start_date between
2014: ROLL.effective_start_date and ROLL.effective_end_date
2025: )
2026: and exists ( select null from
2027: /* check that the current assignment tax districts match */
2028: pay_all_payrolls_f BROLL
2029: ,hr_soft_coding_keyflex BFLEX
2030: ,pay_all_payrolls_f PROLL
2031: ,hr_soft_coding_keyflex PFLEX
2032: where BACT.payroll_id = BROLL.payroll_id
2033: and PACT.payroll_id = PROLL.payroll_id
2027: /* check that the current assignment tax districts match */
2028: pay_all_payrolls_f BROLL
2029: ,hr_soft_coding_keyflex BFLEX
2030: ,pay_all_payrolls_f PROLL
2031: ,hr_soft_coding_keyflex PFLEX
2032: where BACT.payroll_id = BROLL.payroll_id
2033: and PACT.payroll_id = PROLL.payroll_id
2034: and BFLEX.soft_coding_keyflex_id = BROLL.soft_coding_keyflex_id
2035: and PFLEX.soft_coding_keyflex_id = PROLL.soft_coding_keyflex_id