1132: where petf.element_type_id = piv.element_type_id
1133: and petf.element_name = 'Statutory Sick Pay'
1134: and piv.name = 'From')
1135: and peev3.screen_entry_value >
1136: fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate))
1137: /* Retrieve only those entries that will be retrieved by main SSP query */
1138: and peev3.element_entry_id in
1139: ( select peef1.element_entry_id
1140: from pay_element_entries_f peef1,
1145: where peef1.assignment_id = paf.assignment_id
1146: and paf.person_id = ppf.person_id
1147: and ppf.person_id = pps.person_id
1148: and ppt.person_type_id = ppf.person_type_id
1149: and peev3.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1150: and fnd_date.date_to_canonical(ppf.effective_end_date)
1151: and peev3.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1152: and fnd_date.date_to_canonical(paf.effective_end_date)
1153: and ppt.system_person_type = 'EMP'
1146: and paf.person_id = ppf.person_id
1147: and ppf.person_id = pps.person_id
1148: and ppt.person_type_id = ppf.person_type_id
1149: and peev3.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1150: and fnd_date.date_to_canonical(ppf.effective_end_date)
1151: and peev3.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1152: and fnd_date.date_to_canonical(paf.effective_end_date)
1153: and ppt.system_person_type = 'EMP'
1154: and nvl(pps.actual_termination_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1147: and ppf.person_id = pps.person_id
1148: and ppt.person_type_id = ppf.person_type_id
1149: and peev3.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1150: and fnd_date.date_to_canonical(ppf.effective_end_date)
1151: and peev3.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1152: and fnd_date.date_to_canonical(paf.effective_end_date)
1153: and ppt.system_person_type = 'EMP'
1154: and nvl(pps.actual_termination_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1155: )
1148: and ppt.person_type_id = ppf.person_type_id
1149: and peev3.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1150: and fnd_date.date_to_canonical(ppf.effective_end_date)
1151: and peev3.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1152: and fnd_date.date_to_canonical(paf.effective_end_date)
1153: and ppt.system_person_type = 'EMP'
1154: and nvl(pps.actual_termination_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1155: )
1156: and rownum = 1);
1260: from pay_input_values_f piv
1261: where petf.element_type_id = piv.element_type_id
1262: and upper(piv.name) = upper('Week commencing')
1263: )
1264: and peev2.screen_entry_value > fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate) - 5)
1265: -- Retrieve only those entries that main SMP query will retrieve
1266: and exists
1267: ( select 1
1268: from per_all_assignments_f paf,
1272: where peef.assignment_id = paf.assignment_id
1273: and paf.person_id = ppf.person_id
1274: and ppf.person_id = pps.person_id
1275: and ppt.person_type_id = ppf.person_type_id
1276: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1277: and fnd_date.date_to_canonical(ppf.effective_end_date)
1278: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1279: and fnd_date.date_to_canonical(paf.effective_end_date)
1280: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1273: and paf.person_id = ppf.person_id
1274: and ppf.person_id = pps.person_id
1275: and ppt.person_type_id = ppf.person_type_id
1276: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1277: and fnd_date.date_to_canonical(ppf.effective_end_date)
1278: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1279: and fnd_date.date_to_canonical(paf.effective_end_date)
1280: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1281: )
1274: and ppf.person_id = pps.person_id
1275: and ppt.person_type_id = ppf.person_type_id
1276: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1277: and fnd_date.date_to_canonical(ppf.effective_end_date)
1278: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1279: and fnd_date.date_to_canonical(paf.effective_end_date)
1280: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1281: )
1282: and peev3.input_value_id =
1275: and ppt.person_type_id = ppf.person_type_id
1276: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1277: and fnd_date.date_to_canonical(ppf.effective_end_date)
1278: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1279: and fnd_date.date_to_canonical(paf.effective_end_date)
1280: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1281: )
1282: and peev3.input_value_id =
1283: (select input_value_id
1389: from pay_input_values_f piv
1390: where petf.element_type_id = piv.element_type_id
1391: and upper(piv.name) = upper('Week commencing')
1392: )
1393: and peev2.screen_entry_value > fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate) - 5)
1394: -- Retrieve only those entries that main sap query will retrieve
1395: and exists
1396: ( select 1
1397: from per_all_assignments_f paf,
1401: where peef.assignment_id = paf.assignment_id
1402: and paf.person_id = ppf.person_id
1403: and ppf.person_id = pps.person_id
1404: and ppt.person_type_id = ppf.person_type_id
1405: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1406: and fnd_date.date_to_canonical(ppf.effective_end_date)
1407: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1408: and fnd_date.date_to_canonical(paf.effective_end_date)
1409: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1402: and paf.person_id = ppf.person_id
1403: and ppf.person_id = pps.person_id
1404: and ppt.person_type_id = ppf.person_type_id
1405: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1406: and fnd_date.date_to_canonical(ppf.effective_end_date)
1407: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1408: and fnd_date.date_to_canonical(paf.effective_end_date)
1409: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1410: )
1403: and ppf.person_id = pps.person_id
1404: and ppt.person_type_id = ppf.person_type_id
1405: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1406: and fnd_date.date_to_canonical(ppf.effective_end_date)
1407: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1408: and fnd_date.date_to_canonical(paf.effective_end_date)
1409: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1410: )
1411: -- Get first row that matches all of the above criteria
1404: and ppt.person_type_id = ppf.person_type_id
1405: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1406: and fnd_date.date_to_canonical(ppf.effective_end_date)
1407: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1408: and fnd_date.date_to_canonical(paf.effective_end_date)
1409: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1410: )
1411: -- Get first row that matches all of the above criteria
1412: and rownum = 1;
1505: from pay_input_values_f piv
1506: where petf.element_type_id = piv.element_type_id
1507: and upper(piv.name) = upper('Week commencing')
1508: )
1509: and peev2.screen_entry_value > fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate) - 5)
1510: -- Retrieve only those entries that main sppa query will retrieve
1511: and exists
1512: ( select 1
1513: from per_all_assignments_f paf,
1517: where peef.assignment_id = paf.assignment_id
1518: and paf.person_id = ppf.person_id
1519: and ppf.person_id = pps.person_id
1520: and ppt.person_type_id = ppf.person_type_id
1521: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1522: and fnd_date.date_to_canonical(ppf.effective_end_date)
1523: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1524: and fnd_date.date_to_canonical(paf.effective_end_date)
1525: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1518: and paf.person_id = ppf.person_id
1519: and ppf.person_id = pps.person_id
1520: and ppt.person_type_id = ppf.person_type_id
1521: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1522: and fnd_date.date_to_canonical(ppf.effective_end_date)
1523: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1524: and fnd_date.date_to_canonical(paf.effective_end_date)
1525: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1526: )
1519: and ppf.person_id = pps.person_id
1520: and ppt.person_type_id = ppf.person_type_id
1521: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1522: and fnd_date.date_to_canonical(ppf.effective_end_date)
1523: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1524: and fnd_date.date_to_canonical(paf.effective_end_date)
1525: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1526: )
1527: -- Get first row that matches all of the above criteria
1520: and ppt.person_type_id = ppf.person_type_id
1521: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1522: and fnd_date.date_to_canonical(ppf.effective_end_date)
1523: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1524: and fnd_date.date_to_canonical(paf.effective_end_date)
1525: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1526: )
1527: -- Get first row that matches all of the above criteria
1528: and rownum = 1;
1620: from pay_input_values_f piv
1621: where petf.element_type_id = piv.element_type_id
1622: and upper(piv.name) = upper('Week commencing')
1623: )
1624: and peev2.screen_entry_value > fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate) - 5)
1625: -- Retrieve only those entries that main SPPB query will retrieve
1626: and exists
1627: ( select 1
1628: from per_all_assignments_f paf,
1632: where peef.assignment_id = paf.assignment_id
1633: and paf.person_id = ppf.person_id
1634: and ppf.person_id = pps.person_id
1635: and ppt.person_type_id = ppf.person_type_id
1636: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1637: and fnd_date.date_to_canonical(ppf.effective_end_date)
1638: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1639: and fnd_date.date_to_canonical(paf.effective_end_date)
1640: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1633: and paf.person_id = ppf.person_id
1634: and ppf.person_id = pps.person_id
1635: and ppt.person_type_id = ppf.person_type_id
1636: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1637: and fnd_date.date_to_canonical(ppf.effective_end_date)
1638: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1639: and fnd_date.date_to_canonical(paf.effective_end_date)
1640: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1641: )
1634: and ppf.person_id = pps.person_id
1635: and ppt.person_type_id = ppf.person_type_id
1636: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1637: and fnd_date.date_to_canonical(ppf.effective_end_date)
1638: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1639: and fnd_date.date_to_canonical(paf.effective_end_date)
1640: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1641: )
1642: -- Get first row that matches all of the above criteria
1635: and ppt.person_type_id = ppf.person_type_id
1636: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
1637: and fnd_date.date_to_canonical(ppf.effective_end_date)
1638: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
1639: and fnd_date.date_to_canonical(paf.effective_end_date)
1640: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
1641: )
1642: -- Get first row that matches all of the above criteria
1643: and rownum = 1;
2433: where petf.element_type_id = piv.element_type_id
2434: and petf.element_name = 'Statutory Sick Pay'
2435: and piv.name = 'From')
2436: and peev3.screen_entry_value >
2437: fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate))
2438: /* Retrieve only those entries that will be retrieved by main SSP query */
2439: and peev3.element_entry_id in
2440: ( select peef1.element_entry_id
2441: from pay_element_entries_f peef1,
2446: where peef1.assignment_id = paf.assignment_id
2447: and paf.person_id = ppf.person_id
2448: and ppf.person_id = pps.person_id
2449: and ppt.person_type_id = ppf.person_type_id
2450: and peev3.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2451: and fnd_date.date_to_canonical(ppf.effective_end_date)
2452: and peev3.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2453: and fnd_date.date_to_canonical(paf.effective_end_date)
2454: and ppt.system_person_type = 'EMP'
2447: and paf.person_id = ppf.person_id
2448: and ppf.person_id = pps.person_id
2449: and ppt.person_type_id = ppf.person_type_id
2450: and peev3.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2451: and fnd_date.date_to_canonical(ppf.effective_end_date)
2452: and peev3.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2453: and fnd_date.date_to_canonical(paf.effective_end_date)
2454: and ppt.system_person_type = 'EMP'
2455: and nvl(pps.actual_termination_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2448: and ppf.person_id = pps.person_id
2449: and ppt.person_type_id = ppf.person_type_id
2450: and peev3.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2451: and fnd_date.date_to_canonical(ppf.effective_end_date)
2452: and peev3.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2453: and fnd_date.date_to_canonical(paf.effective_end_date)
2454: and ppt.system_person_type = 'EMP'
2455: and nvl(pps.actual_termination_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2456: )
2449: and ppt.person_type_id = ppf.person_type_id
2450: and peev3.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2451: and fnd_date.date_to_canonical(ppf.effective_end_date)
2452: and peev3.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2453: and fnd_date.date_to_canonical(paf.effective_end_date)
2454: and ppt.system_person_type = 'EMP'
2455: and nvl(pps.actual_termination_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2456: )
2457: and rownum = 1);
2561: from pay_input_values_f piv
2562: where petf.element_type_id = piv.element_type_id
2563: and upper(piv.name) = upper('Week commencing')
2564: )
2565: and peev2.screen_entry_value > fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate) - 5)
2566: -- Retrieve only those entries that main SMP query will retrieve
2567: and exists
2568: ( select 1
2569: from per_all_assignments_f paf,
2573: where peef.assignment_id = paf.assignment_id
2574: and paf.person_id = ppf.person_id
2575: and ppf.person_id = pps.person_id
2576: and ppt.person_type_id = ppf.person_type_id
2577: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2578: and fnd_date.date_to_canonical(ppf.effective_end_date)
2579: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2580: and fnd_date.date_to_canonical(paf.effective_end_date)
2581: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2574: and paf.person_id = ppf.person_id
2575: and ppf.person_id = pps.person_id
2576: and ppt.person_type_id = ppf.person_type_id
2577: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2578: and fnd_date.date_to_canonical(ppf.effective_end_date)
2579: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2580: and fnd_date.date_to_canonical(paf.effective_end_date)
2581: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2582: )
2575: and ppf.person_id = pps.person_id
2576: and ppt.person_type_id = ppf.person_type_id
2577: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2578: and fnd_date.date_to_canonical(ppf.effective_end_date)
2579: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2580: and fnd_date.date_to_canonical(paf.effective_end_date)
2581: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2582: )
2583: and peev3.input_value_id =
2576: and ppt.person_type_id = ppf.person_type_id
2577: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2578: and fnd_date.date_to_canonical(ppf.effective_end_date)
2579: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2580: and fnd_date.date_to_canonical(paf.effective_end_date)
2581: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2582: )
2583: and peev3.input_value_id =
2584: (select input_value_id
2690: from pay_input_values_f piv
2691: where petf.element_type_id = piv.element_type_id
2692: and upper(piv.name) = upper('Week commencing')
2693: )
2694: and peev2.screen_entry_value > fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate) - 5)
2695: -- Retrieve only those entries that main sap query will retrieve
2696: and exists
2697: ( select 1
2698: from per_all_assignments_f paf,
2702: where peef.assignment_id = paf.assignment_id
2703: and paf.person_id = ppf.person_id
2704: and ppf.person_id = pps.person_id
2705: and ppt.person_type_id = ppf.person_type_id
2706: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2707: and fnd_date.date_to_canonical(ppf.effective_end_date)
2708: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2709: and fnd_date.date_to_canonical(paf.effective_end_date)
2710: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2703: and paf.person_id = ppf.person_id
2704: and ppf.person_id = pps.person_id
2705: and ppt.person_type_id = ppf.person_type_id
2706: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2707: and fnd_date.date_to_canonical(ppf.effective_end_date)
2708: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2709: and fnd_date.date_to_canonical(paf.effective_end_date)
2710: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2711: )
2704: and ppf.person_id = pps.person_id
2705: and ppt.person_type_id = ppf.person_type_id
2706: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2707: and fnd_date.date_to_canonical(ppf.effective_end_date)
2708: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2709: and fnd_date.date_to_canonical(paf.effective_end_date)
2710: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2711: )
2712: -- Get first row that matches all of the above criteria
2705: and ppt.person_type_id = ppf.person_type_id
2706: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2707: and fnd_date.date_to_canonical(ppf.effective_end_date)
2708: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2709: and fnd_date.date_to_canonical(paf.effective_end_date)
2710: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2711: )
2712: -- Get first row that matches all of the above criteria
2713: and rownum = 1;
2806: from pay_input_values_f piv
2807: where petf.element_type_id = piv.element_type_id
2808: and upper(piv.name) = upper('Week commencing')
2809: )
2810: and peev2.screen_entry_value > fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate) - 5)
2811: -- Retrieve only those entries that main sppa query will retrieve
2812: and exists
2813: ( select 1
2814: from per_all_assignments_f paf,
2818: where peef.assignment_id = paf.assignment_id
2819: and paf.person_id = ppf.person_id
2820: and ppf.person_id = pps.person_id
2821: and ppt.person_type_id = ppf.person_type_id
2822: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2823: and fnd_date.date_to_canonical(ppf.effective_end_date)
2824: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2825: and fnd_date.date_to_canonical(paf.effective_end_date)
2826: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2819: and paf.person_id = ppf.person_id
2820: and ppf.person_id = pps.person_id
2821: and ppt.person_type_id = ppf.person_type_id
2822: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2823: and fnd_date.date_to_canonical(ppf.effective_end_date)
2824: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2825: and fnd_date.date_to_canonical(paf.effective_end_date)
2826: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2827: )
2820: and ppf.person_id = pps.person_id
2821: and ppt.person_type_id = ppf.person_type_id
2822: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2823: and fnd_date.date_to_canonical(ppf.effective_end_date)
2824: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2825: and fnd_date.date_to_canonical(paf.effective_end_date)
2826: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2827: )
2828: -- Get first row that matches all of the above criteria
2821: and ppt.person_type_id = ppf.person_type_id
2822: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2823: and fnd_date.date_to_canonical(ppf.effective_end_date)
2824: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2825: and fnd_date.date_to_canonical(paf.effective_end_date)
2826: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2827: )
2828: -- Get first row that matches all of the above criteria
2829: and rownum = 1;
2921: from pay_input_values_f piv
2922: where petf.element_type_id = piv.element_type_id
2923: and upper(piv.name) = upper('Week commencing')
2924: )
2925: and peev2.screen_entry_value > fnd_date.date_to_canonical(hr_gbnicar.uk_tax_yr_end(sysdate) - 5)
2926: -- Retrieve only those entries that main SPPB query will retrieve
2927: and exists
2928: ( select 1
2929: from per_all_assignments_f paf,
2933: where peef.assignment_id = paf.assignment_id
2934: and paf.person_id = ppf.person_id
2935: and ppf.person_id = pps.person_id
2936: and ppt.person_type_id = ppf.person_type_id
2937: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2938: and fnd_date.date_to_canonical(ppf.effective_end_date)
2939: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2940: and fnd_date.date_to_canonical(paf.effective_end_date)
2941: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2934: and paf.person_id = ppf.person_id
2935: and ppf.person_id = pps.person_id
2936: and ppt.person_type_id = ppf.person_type_id
2937: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2938: and fnd_date.date_to_canonical(ppf.effective_end_date)
2939: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2940: and fnd_date.date_to_canonical(paf.effective_end_date)
2941: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2942: )
2935: and ppf.person_id = pps.person_id
2936: and ppt.person_type_id = ppf.person_type_id
2937: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2938: and fnd_date.date_to_canonical(ppf.effective_end_date)
2939: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2940: and fnd_date.date_to_canonical(paf.effective_end_date)
2941: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2942: )
2943: -- Get first row that matches all of the above criteria
2936: and ppt.person_type_id = ppf.person_type_id
2937: and peev2.screen_entry_value between fnd_date.date_to_canonical(ppf.effective_start_date)
2938: and fnd_date.date_to_canonical(ppf.effective_end_date)
2939: and peev2.screen_entry_value between fnd_date.date_to_canonical(paf.effective_start_date)
2940: and fnd_date.date_to_canonical(paf.effective_end_date)
2941: and nvl(pps.final_process_date,to_date('31/12/4712','DD/MM/YYYY')) >= sysdate
2942: )
2943: -- Get first row that matches all of the above criteria
2944: and rownum = 1;