DBA Data[Home] [Help]

APPS.SSP_SMP_PKG dependencies on HR_UTILITY

Line 244: hr_utility.trace (l_proc||' p_effective_date = '

240: --
241: procedure check_parameters is
242: begin
243: --
244: hr_utility.trace (l_proc||' p_effective_date = '
245: ||to_char (p_effective_date));
246: --
247: hr_api.mandatory_arg_error (
248: p_api_name => l_proc,

Line 255: hr_utility.set_location (l_proc,1);

251: end check_parameters;
252: --
253: begin
254: --
255: hr_utility.set_location (l_proc,1);
256: --
257: check_parameters;
258: --
259: open csr_SMP_element_details (p_effective_date,c_SMP_Corr_element_name);

Line 262: --hr_utility.trace('g_SMP_Correction_element'||g_SMP_Correction_element);

258: --
259: open csr_SMP_element_details (p_effective_date,c_SMP_Corr_element_name);
260: fetch csr_SMP_element_details into g_SMP_Correction_element;
261:
262: --hr_utility.trace('g_SMP_Correction_element'||g_SMP_Correction_element);
263:
264: close csr_SMP_element_details;
265: --
266: hr_utility.set_location (l_proc,100);

Line 266: hr_utility.set_location (l_proc,100);

262: --hr_utility.trace('g_SMP_Correction_element'||g_SMP_Correction_element);
263:
264: close csr_SMP_element_details;
265: --
266: hr_utility.set_location (l_proc,100);
267: --
268: end get_SMP_correction_element;
269: --
270: --------------------------------------------------------------------------------

Line 278: hr_utility.trace (l_proc||' p_effective_date = '

274: --
275: procedure check_parameters is
276: begin
277: --
278: hr_utility.trace (l_proc||' p_effective_date = '
279: ||to_char (p_effective_date));
280: --
281: hr_api.mandatory_arg_error (
282: p_api_name => l_proc,

Line 289: hr_utility.set_location (l_proc,1);

285: end check_parameters;
286: --
287: begin
288: --
289: hr_utility.set_location (l_proc,1);
290: --
291: check_parameters;
292: --
293: open csr_SMP_element_details (p_effective_date,c_SMP_element_name);

Line 297: hr_utility.set_location (l_proc,100);

293: open csr_SMP_element_details (p_effective_date,c_SMP_element_name);
294: fetch csr_SMP_element_details into g_SMP_element;
295: close csr_SMP_element_details;
296: --
297: hr_utility.set_location (l_proc,100);
298: --
299: end get_SMP_element;
300: --
301: --------------------------------------------------------------------------------

Line 322: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',1);

318:
319:
320: begin
321: --
322: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',1);
323:
324: l_EWC := (next_day (p_due_date,l_sunday) -7);
325:
326: hr_utility.trace('l_EWC: '||l_EWC);

Line 326: hr_utility.trace('l_EWC: '||l_EWC);

322: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',1);
323:
324: l_EWC := (next_day (p_due_date,l_sunday) -7);
325:
326: hr_utility.trace('l_EWC: '||l_EWC);
327:
328: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',99);
329:
330: return l_EWC;

Line 328: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',99);

324: l_EWC := (next_day (p_due_date,l_sunday) -7);
325:
326: hr_utility.trace('l_EWC: '||l_EWC);
327:
328: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',99);
329:
330: return l_EWC;
331: --
332: end expected_week_of_confinement;

Line 400: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',1);

396:
397: --
398: begin
399: --
400: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',1);
401:
402: open csr_SMP_element_details (p_due_date,c_SMP_element_name);
403: fetch csr_SMP_element_details into l_SMP_element;
404: close csr_SMP_element_details;

Line 406: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',2);

402: open csr_SMP_element_details (p_due_date,c_SMP_element_name);
403: fetch csr_SMP_element_details into l_SMP_element;
404: close csr_SMP_element_details;
405:
406: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',2);
407: --
408:
409: l_Continuously_employed_since :=
410: next_day(next_day(Qualifying_Week (p_due_date),l_saturday)

Line 413: hr_utility.trace('l_Continuously_employed_since: '||l_Continuously_employed_since);

409: l_Continuously_employed_since :=
410: next_day(next_day(Qualifying_Week (p_due_date),l_saturday)
411: - (l_SMP_element.continuous_employment_period),l_saturday);
412:
413: hr_utility.trace('l_Continuously_employed_since: '||l_Continuously_employed_since);
414:
415: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',99);
416: --
417: return l_Continuously_employed_since;

Line 415: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',99);

411: - (l_SMP_element.continuous_employment_period),l_saturday);
412:
413: hr_utility.trace('l_Continuously_employed_since: '||l_Continuously_employed_since);
414:
415: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',99);
416: --
417: return l_Continuously_employed_since;
418: --
419: end continuous_employment_date;

Line 463: hr_utility.set_location ('Entering '||l_proc,1);

459: and effective_date = l_effective_date;
460: --
461: begin
462: --
463: hr_utility.set_location ('Entering '||l_proc,1);
464: --
465: if woman.actual_birth_date is not null then
466: l_effective_date := least (greatest(woman.QW, woman.date_start), ssp_smp_support_pkg.start_of_week
467: (woman.actual_birth_date));

Line 488: hr_utility.set_location ('Leaving '||l_proc,10);

484: end if;
485: --
486: close csr_average_earnings;
487: --
488: hr_utility.set_location ('Leaving '||l_proc,10);
489: --
490: return l_average_earnings;
491: --
492: end average_earnings;

Line 573: hr_utility.trace (l_proc||' p_reason = '||p_reason);

569: procedure check_parameters is
570: --
571: begin
572: --
573: hr_utility.trace (l_proc||' p_reason = '||p_reason);
574: hr_utility.trace (l_proc||' withhold from '
575: ||to_char (p_withhold_from));
576: hr_utility.trace (l_proc||' withhold to '
577: ||to_char (p_withhold_to));

Line 574: hr_utility.trace (l_proc||' withhold from '

570: --
571: begin
572: --
573: hr_utility.trace (l_proc||' p_reason = '||p_reason);
574: hr_utility.trace (l_proc||' withhold from '
575: ||to_char (p_withhold_from));
576: hr_utility.trace (l_proc||' withhold to '
577: ||to_char (p_withhold_to));
578: --

Line 576: hr_utility.trace (l_proc||' withhold to '

572: --
573: hr_utility.trace (l_proc||' p_reason = '||p_reason);
574: hr_utility.trace (l_proc||' withhold from '
575: ||to_char (p_withhold_from));
576: hr_utility.trace (l_proc||' withhold to '
577: ||to_char (p_withhold_to));
578: --
579: hr_api.mandatory_arg_error (
580: p_api_name => l_proc,

Line 593: hr_utility.set_location (l_proc,1);

589: end check_parameters;
590: --
591: begin
592: --
593: hr_utility.set_location (l_proc,1);
594: --
595: check_parameters;
596: --
597: l_reason_id := ssp_smp_support_pkg.withholding_reason_id (

Line 618: hr_utility.trace (l_proc||' Stoppage is overridden');

614: p_maternity_id => p_maternity_id,
615: p_user_entered => 'N',
616: p_reason_id => l_reason_id);
617: else
618: hr_utility.trace (l_proc||' Stoppage is overridden');
619: end if;
620: --
621: hr_utility.set_location (l_proc,100);
622: --

Line 621: hr_utility.set_location (l_proc,100);

617: else
618: hr_utility.trace (l_proc||' Stoppage is overridden');
619: end if;
620: --
621: hr_utility.set_location (l_proc,100);
622: --
623: end create_stoppage;
624: --
625: procedure remove_stoppages is

Line 641: hr_utility.set_location (l_proc,1);

637: l_proc varchar2 (72) := g_package||'remove_stoppages';
638: --
639: begin
640: --
641: hr_utility.set_location (l_proc,1);
642: --
643: for each_stoppage in csr_stoppages LOOP
644: ssp_stp_del.del (p_stoppage_id => each_stoppage.stoppage_id,
645: p_object_version_number => l_dummy);

Line 648: hr_utility.set_location (l_proc,100);

644: ssp_stp_del.del (p_stoppage_id => each_stoppage.stoppage_id,
645: p_object_version_number => l_dummy);
646: end loop;
647: --
648: hr_utility.set_location (l_proc,100);
649: --
650: end remove_stoppages;
651: --
652: procedure check_continuity_rule is

Line 679: hr_utility.set_location (l_proc,1);

675: l_proc varchar2 (72) := g_package||'check_continuity_rule';
676: --
677: begin
678: --
679: hr_utility.set_location (l_proc,1);
680: --
681: open period_of_service;
682: fetch period_of_service into l_dummy;
683: --

Line 695: hr_utility.set_location (l_proc,100);

691: end if;
692: --
693: close period_of_service;
694: --
695: hr_utility.set_location (l_proc,100);
696: --
697: end check_continuity_rule;
698: --
699: --

Line 738: hr_utility.set_location('Entering : '||l_proc,1);

734: return nvl(l_leaving_reason,'-1');
735: end get_leaving_reason;
736: --
737: begin
738: hr_utility.set_location('Entering : '||l_proc,1);
739: --
740: open csr_period_of_service_qw;
741: fetch csr_period_of_service_qw into l_termination_date
742: ,l_leaving_reason ;

Line 748: hr_utility.set_location(l_proc,2);

744: --
745:
746: l_leaving_reason := get_leaving_reason(l_leaving_reason);
747: --
748: hr_utility.set_location(l_proc,2);
749: --
750: --
751: -- Bug 2663735
752: -- For current regulations (due date less than 06-APR-2003)

Line 759: hr_utility.set_location(l_proc,3);

755: -- But the employee gets complete SMP according to the
756: -- new regulations (due date after 06-APR-2003)
757: --
758: if woman.due_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
759: hr_utility.set_location(l_proc,3);
760: if l_termination_date < woman.qw then
761: hr_utility.set_location(l_proc,4);
762: create_stoppage(p_withhold_from => l_termination_date + 1
763: ,p_reason => 'Not employed in QW' );

Line 761: hr_utility.set_location(l_proc,4);

757: --
758: if woman.due_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
759: hr_utility.set_location(l_proc,3);
760: if l_termination_date < woman.qw then
761: hr_utility.set_location(l_proc,4);
762: create_stoppage(p_withhold_from => l_termination_date + 1
763: ,p_reason => 'Not employed in QW' );
764: end if;
765: else

Line 766: hr_utility.set_location(l_proc,5);

762: create_stoppage(p_withhold_from => l_termination_date + 1
763: ,p_reason => 'Not employed in QW' );
764: end if;
765: else
766: hr_utility.set_location(l_proc,5);
767: if (l_termination_date
768: between woman.qw
769: and nvl(woman.MPP_start_date
770: ,ssp_smp_pkg.earliest_mpp_start_date(woman.due_date)) )

Line 774: hr_utility.set_location(l_proc,6);

770: ,ssp_smp_pkg.earliest_mpp_start_date(woman.due_date)) )
771: and
772: (l_leaving_reason <> 'MATERNITY')
773: then
774: hr_utility.set_location(l_proc,6);
775: create_stoppage(p_withhold_from => l_termination_date + 1
776: ,p_reason => 'Insufficient employment' );
777: elsif l_termination_date < woman.qw then
778: hr_utility.set_location(l_proc,7);

Line 778: hr_utility.set_location(l_proc,7);

774: hr_utility.set_location(l_proc,6);
775: create_stoppage(p_withhold_from => l_termination_date + 1
776: ,p_reason => 'Insufficient employment' );
777: elsif l_termination_date < woman.qw then
778: hr_utility.set_location(l_proc,7);
779: create_stoppage(p_withhold_from => l_termination_date + 1
780: ,p_reason => 'Not employed in QW' );
781: end if;
782: hr_utility.set_location(l_proc,8);

Line 782: hr_utility.set_location(l_proc,8);

778: hr_utility.set_location(l_proc,7);
779: create_stoppage(p_withhold_from => l_termination_date + 1
780: ,p_reason => 'Not employed in QW' );
781: end if;
782: hr_utility.set_location(l_proc,8);
783: end if;
784: --
785: hr_utility.set_location('Leaving : '||l_proc,9);
786: --

Line 785: hr_utility.set_location('Leaving : '||l_proc,9);

781: end if;
782: hr_utility.set_location(l_proc,8);
783: end if;
784: --
785: hr_utility.set_location('Leaving : '||l_proc,9);
786: --
787: end check_employment_qw;
788: --
789: procedure check_stillbirth is

Line 797: hr_utility.set_location (l_proc,1);

793: l_proc varchar2 (72) := g_package||'check_stillbirth';
794: --
795: begin
796: --
797: hr_utility.set_location (l_proc,1);
798: --
799: -- Woman must be still pregnant, have had a live birth, or have had a
800: -- stillbirth after the threshhold week to be eligible for SMP
801: --

Line 815: hr_utility.set_location (l_proc,100);

811: create_stoppage (p_withhold_from => woman.MPP_start_date,
812: p_reason => 'Stillbirth');
813: end if;
814: --
815: hr_utility.set_location (l_proc,100);
816: --
817: end check_stillbirth;
818: --
819: procedure check_new_employer is

Line 828: hr_utility.set_location (l_proc,1);

824: l_proc varchar2 (72) := g_package||'check_new_employer';
825: --
826: begin
827: --
828: hr_utility.set_location (l_proc,1);
829: --
830: if woman.start_date_with_new_employer >= woman.actual_birth_date then
831: --
832: -- Stop SMP payment from the start of the week in which the woman

Line 840: hr_utility.set_location (l_proc,100);

836: (woman.start_date_with_new_employer),
837: p_reason => 'Worked for another employer');
838: end if;
839: --
840: hr_utility.set_location (l_proc,100);
841: --
842: end check_new_employer;
843: --
844: procedure check_maternity_allowance is

Line 852: hr_utility.set_location (l_proc,1);

848: l_proc varchar2 (72) := g_package||'check_maternity_allowance';
849: --
850: begin
851: --
852: hr_utility.set_location (l_proc,1);
853: --
854: if woman.start_date_maternity_allowance is not null then
855: --
856: -- Stop SMP payment from the start of the week in which SMA was first

Line 864: hr_utility.set_location (l_proc,100);

860: (woman.start_date_maternity_allowance),
861: p_reason => 'Employee is receiving SMA');
862: end if;
863: --
864: hr_utility.set_location (l_proc,100);
865: --
866: end check_maternity_allowance;
867: --
868: procedure check_death is

Line 893: hr_utility.set_location (l_proc,1);

889: l_day_of_the_week varchar2(20);
890: --
891: begin
892: --
893: hr_utility.set_location (l_proc,1);
894: --
895: if woman.date_of_death is not null then
896: --
897: -- SMP ceases on the Saturday following death

Line 927: hr_utility.set_location (l_proc,100);

923: end if;
924: -- Bug 2663899 end
925: end if;
926: --
927: hr_utility.set_location (l_proc,100);
928: --
929: end check_death;
930: --
931: procedure check_average_earnings is

Line 942: hr_utility.set_location (l_proc,1);

938: earnings_not_derived exception;
939: --
940: begin
941: --
942: hr_utility.set_location (l_proc,1);
943: --
944: if l_average_earnings = 0
945: then
946: --

Line 973: hr_utility.set_location (l_proc,100);

969: create_stoppage (p_withhold_from => woman.MPP_start_date,
970: p_reason => 'Earnings too low');
971: end if;
972: --
973: hr_utility.set_location (l_proc,100);
974: --
975: exception
976: --
977: when earnings_not_derived then

Line 981: hr_utility.trace (l_proc||' Earnings not derived');

977: when earnings_not_derived then
978: --
979: -- Exit silently from this procedure
980: --
981: hr_utility.trace (l_proc||' Earnings not derived');
982: null;
983: --
984: end check_average_earnings;
985: --

Line 1001: hr_utility.set_location (l_proc,1);

997: l_medical medical%rowtype;
998: --
999: begin
1000: --
1001: hr_utility.set_location (l_proc,1);
1002: --
1003: open medical;
1004: fetch medical into l_medical;
1005: --

Line 1041: hr_utility.set_location (l_proc,100);

1037: end if;
1038: --
1039: close medical;
1040: --
1041: hr_utility.set_location (l_proc,100);
1042: --
1043: end check_medical_evidence;
1044: --
1045: procedure check_birth_confirmation is

Line 1053: hr_utility.set_location (l_proc,1);

1049: l_proc varchar2 (72) := g_package||'check_birth_confirmation';
1050: --
1051: begin
1052: --
1053: hr_utility.set_location (l_proc,1);
1054: --
1055: --
1056: -- This should not create a stoppage. A quick fix for bug 1021179
1057: -- is to comment out the stoppage process.

Line 1074: hr_utility.set_location (l_proc,100);

1070: -- create_stoppage (p_withhold_from => woman.MPP_start_date,
1071: -- p_reason => 'Late notification of birth');
1072: -- end if;
1073: --
1074: hr_utility.set_location (l_proc,100);
1075: --
1076: end check_birth_confirmation;
1077: --
1078: procedure check_parameters is

Line 1082: hr_utility.trace (l_proc||' p_maternity_id = '

1078: procedure check_parameters is
1079: --
1080: begin
1081: --
1082: hr_utility.trace (l_proc||' p_maternity_id = '
1083: ||to_char (p_maternity_id));
1084: --
1085: hr_api.mandatory_arg_error (
1086: p_api_name => l_proc,

Line 1094: hr_utility.set_location (l_proc,1);

1090: end check_parameters;
1091: --
1092: begin
1093: --
1094: hr_utility.set_location (l_proc,1);
1095: --
1096: check_parameters;
1097: --
1098: -- Get the details of the woman and her maternity.

Line 1110: hr_utility.trace (l_proc||' Woman has no maternity record - exiting');

1106: -- If no maternity record exists then there can be no entitlement to SMP
1107: --
1108: close csr_personal_details;
1109: --
1110: hr_utility.trace (l_proc||' Woman has no maternity record - exiting');
1111: --
1112: raise no_prima_facia_entitlement;
1113: end if;
1114: --

Line 1121: hr_utility.trace (l_proc||' Woman has no MPP start date - exiting');

1117: if woman.MPP_start_date is null then
1118: --
1119: -- If the MPP has not started then there is no entitlement to SMP.
1120: --
1121: hr_utility.trace (l_proc||' Woman has no MPP start date - exiting');
1122: --
1123: raise no_prima_facia_entitlement;
1124: end if;
1125: --

Line 1142: hr_utility.trace (l_proc||' Woman has not stopped work - exiting');

1138: fetch csr_check_if_existing_entries into l_existing_entries;
1139: --
1140: if csr_check_if_existing_entries%NOTFOUND
1141: then
1142: hr_utility.trace (l_proc||' Woman has not stopped work - exiting');
1143: raise no_prima_facia_entitlement;
1144: end if;
1145: --
1146: -- if entries are found then the absence has been deleted and entries remain

Line 1160: hr_utility.set_location ('ssp_smp_pkg.entitled_to_SMP',2);

1156: --
1157: -- Having established a prima facia entitlement to SMP, perform checks which
1158: -- may lead to creation of stoppages for particular periods.
1159: --
1160: hr_utility.set_location ('ssp_smp_pkg.entitled_to_SMP',2);
1161: --
1162: -- Get the SMP legislative parameters.
1163: --
1164: get_SMP_element (woman.due_date);

Line 1212: hr_utility.set_location ('ssp_smp_pkg.entitled_to_SMP',3);

1208: p_withhold_from => woman.MPP_start_date,
1209: p_reason => 'Late absence notification');
1210: end if;
1211: --
1212: hr_utility.set_location ('ssp_smp_pkg.entitled_to_SMP',3);
1213: --
1214: -- Check for any work done during the MPP.
1215: --
1216: if

Line 1260: hr_utility.trace (l_proc||' ERROR: Invalid null absence end date');

1256: else
1257: --
1258: -- This is not the last absence in the maternity but it has no end date.
1259: --
1260: hr_utility.trace (l_proc||' ERROR: Invalid null absence end date');
1261: --
1262: raise invalid_absence_date;
1263: end if;
1264: end if;

Line 1524: hr_utility.set_location (l_proc,1);

1520: l_proc varchar2 (72) := g_package||'.remove_stoppages';
1521: --
1522: begin
1523: --
1524: hr_utility.set_location (l_proc,1);
1525: --
1526: for each_stoppage in csr_stoppages LOOP
1527: ssp_stp_del.del (p_stoppage_id => each_stoppage.stoppage_id,
1528: p_object_version_number => l_dummy);

Line 1531: hr_utility.set_location (l_proc,100);

1527: ssp_stp_del.del (p_stoppage_id => each_stoppage.stoppage_id,
1528: p_object_version_number => l_dummy);
1529: end loop;
1530: --
1531: hr_utility.set_location (l_proc,100);
1532: --
1533: end remove_stoppages;
1534: --
1535: begin

Line 1537: --hr_utility.trace_on(null,'ssp');

1533: end remove_stoppages;
1534: --
1535: begin
1536: --
1537: --hr_utility.trace_on(null,'ssp');
1538: hr_utility.set_location('Entering: '||l_proc,10);
1539:
1540: hr_utility.trace('woman.due_date='||woman.due_date);
1541: --

Line 1538: hr_utility.set_location('Entering: '||l_proc,10);

1534: --
1535: begin
1536: --
1537: --hr_utility.trace_on(null,'ssp');
1538: hr_utility.set_location('Entering: '||l_proc,10);
1539:
1540: hr_utility.trace('woman.due_date='||woman.due_date);
1541: --
1542: get_SMP_correction_element (woman.due_date);

Line 1540: hr_utility.trace('woman.due_date='||woman.due_date);

1536: --
1537: --hr_utility.trace_on(null,'ssp');
1538: hr_utility.set_location('Entering: '||l_proc,10);
1539:
1540: hr_utility.trace('woman.due_date='||woman.due_date);
1541: --
1542: get_SMP_correction_element (woman.due_date);
1543: --
1544: -- Check each existing SMP entry in turn against all the potential new ones.

Line 1548: hr_utility.trace('Old entries');

1544: -- Check each existing SMP entry in turn against all the potential new ones.
1545: --
1546: <>
1547:
1548: hr_utility.trace('Old entries');
1549:
1550:
1551: for old_entry in csr_existing_entries
1552: LOOP

Line 1559: hr_utility.trace('Entered csr_existing_entries');

1555: --a stoppage. If there isn't one, invalidate the old entry.
1556: --Assume we don't need to correct the entry until we discover otherwise:
1557: --
1558:
1559: hr_utility.trace('Entered csr_existing_entries');
1560:
1561: l_ins_corr_ele := FALSE;
1562: begin
1563: hr_utility.trace('Entering begin');

Line 1563: hr_utility.trace('Entering begin');

1559: hr_utility.trace('Entered csr_existing_entries');
1560:
1561: l_ins_corr_ele := FALSE;
1562: begin
1563: hr_utility.trace('Entering begin');
1564: entry_number := 0;
1565: if p_deleting then
1566: hr_utility.trace('Raising error');
1567: raise no_data_found; -- enter exception handler

Line 1566: hr_utility.trace('Raising error');

1562: begin
1563: hr_utility.trace('Entering begin');
1564: entry_number := 0;
1565: if p_deleting then
1566: hr_utility.trace('Raising error');
1567: raise no_data_found; -- enter exception handler
1568: end if;
1569: LOOP
1570:

Line 1571: hr_utility.trace('First loop');

1567: raise no_data_found; -- enter exception handler
1568: end if;
1569: LOOP
1570:
1571: hr_utility.trace('First loop');
1572: entry_number := entry_number +1;
1573:
1574: -- Exit the loop when we find a hypothetical entry covering the
1575: -- same week as the old entry, which is not subject to a stoppage.

Line 1592: hr_utility.trace('Exiting');

1588: = hypothetical_entry.week_commencing (entry_number)
1589: and not hypothetical_entry.stopped (entry_number) = 'TRUE'
1590: and g_smp_update = 'Y'));
1591:
1592: hr_utility.trace('Exiting');
1593: end loop;
1594:
1595: hr_utility.trace (l_proc||' Old entry / Hypo entry time Match with values:');
1596: hr_utility.trace (l_proc||' Rate: '

Line 1595: hr_utility.trace (l_proc||' Old entry / Hypo entry time Match with values:');

1591:
1592: hr_utility.trace('Exiting');
1593: end loop;
1594:
1595: hr_utility.trace (l_proc||' Old entry / Hypo entry time Match with values:');
1596: hr_utility.trace (l_proc||' Rate: '
1597: ||old_entry.rate||' / '
1598: ||hypothetical_entry.rate (Entry_number));
1599: hr_utility.trace (l_proc||' Amount: '

Line 1596: hr_utility.trace (l_proc||' Rate: '

1592: hr_utility.trace('Exiting');
1593: end loop;
1594:
1595: hr_utility.trace (l_proc||' Old entry / Hypo entry time Match with values:');
1596: hr_utility.trace (l_proc||' Rate: '
1597: ||old_entry.rate||' / '
1598: ||hypothetical_entry.rate (Entry_number));
1599: hr_utility.trace (l_proc||' Amount: '
1600: ||old_entry.amount||' / '

Line 1599: hr_utility.trace (l_proc||' Amount: '

1595: hr_utility.trace (l_proc||' Old entry / Hypo entry time Match with values:');
1596: hr_utility.trace (l_proc||' Rate: '
1597: ||old_entry.rate||' / '
1598: ||hypothetical_entry.rate (Entry_number));
1599: hr_utility.trace (l_proc||' Amount: '
1600: ||old_entry.amount||' / '
1601: ||hypothetical_entry.amount (entry_number));
1602: hr_utility.trace (l_proc||' Recoverable: '
1603: ||old_entry.recoverable_amount||' / '

Line 1602: hr_utility.trace (l_proc||' Recoverable: '

1598: ||hypothetical_entry.rate (Entry_number));
1599: hr_utility.trace (l_proc||' Amount: '
1600: ||old_entry.amount||' / '
1601: ||hypothetical_entry.amount (entry_number));
1602: hr_utility.trace (l_proc||' Recoverable: '
1603: ||old_entry.recoverable_amount||' / '
1604: ||hypothetical_entry.recoverable_amount (entry_number));
1605: hr_utility.trace (l_proc||' Week Comm: '
1606: ||hypothetical_entry.week_commencing (entry_number) );

Line 1605: hr_utility.trace (l_proc||' Week Comm: '

1601: ||hypothetical_entry.amount (entry_number));
1602: hr_utility.trace (l_proc||' Recoverable: '
1603: ||old_entry.recoverable_amount||' / '
1604: ||hypothetical_entry.recoverable_amount (entry_number));
1605: hr_utility.trace (l_proc||' Week Comm: '
1606: ||hypothetical_entry.week_commencing (entry_number) );
1607: --A hypo entry covers the same week as the old one
1608: if old_entry.rate = hypothetical_entry.rate (entry_number)
1609: and old_entry.amount = hypothetical_entry.amount(entry_number)

Line 1617: hr_utility.trace (l_proc||' leave unchanged');

1613: -- the hypo entry has the same values as the old one
1614: -- don't create a correction element.
1615: -- don't create a new entry
1616: hypothetical_entry.dealt_with (entry_number) := 'TRUE';
1617: hr_utility.trace (l_proc||' leave unchanged');
1618: else
1619: if ssp_smp_support_pkg.entry_already_processed
1620: (old_entry.element_entry_id)
1621: then l_ins_corr_ele := TRUE;

Line 1622: hr_utility.trace (l_proc||' processed - correct it');

1618: else
1619: if ssp_smp_support_pkg.entry_already_processed
1620: (old_entry.element_entry_id)
1621: then l_ins_corr_ele := TRUE;
1622: hr_utility.trace (l_proc||' processed - correct it');
1623: else
1624: -- update old entry
1625: hr_utility.trace (l_proc||' unprocessed - update it');
1626: hr_entry_api.update_element_entry (

Line 1625: hr_utility.trace (l_proc||' unprocessed - update it');

1621: then l_ins_corr_ele := TRUE;
1622: hr_utility.trace (l_proc||' processed - correct it');
1623: else
1624: -- update old entry
1625: hr_utility.trace (l_proc||' unprocessed - update it');
1626: hr_entry_api.update_element_entry (
1627: p_dt_update_mode => 'CORRECTION',
1628: p_session_date => old_entry.effective_start_date,
1629: p_element_entry_id => old_entry.element_entry_id,

Line 1649: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');

1645: when no_data_found then
1646: -- There was no new entry which exactly matched the old entry.
1647: -- or we are deleting.
1648: entry_number := null;
1649: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1650: hr_utility.trace (l_proc||' or p_deleting is true');
1651: hr_utility.trace (l_proc||' Old entry values:');
1652: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1653: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);

Line 1650: hr_utility.trace (l_proc||' or p_deleting is true');

1646: -- There was no new entry which exactly matched the old entry.
1647: -- or we are deleting.
1648: entry_number := null;
1649: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1650: hr_utility.trace (l_proc||' or p_deleting is true');
1651: hr_utility.trace (l_proc||' Old entry values:');
1652: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1653: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1654: hr_utility.trace (l_proc||' Recoverable: '

Line 1651: hr_utility.trace (l_proc||' Old entry values:');

1647: -- or we are deleting.
1648: entry_number := null;
1649: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1650: hr_utility.trace (l_proc||' or p_deleting is true');
1651: hr_utility.trace (l_proc||' Old entry values:');
1652: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1653: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1654: hr_utility.trace (l_proc||' Recoverable: '
1655: ||old_entry.recoverable_amount);

Line 1652: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);

1648: entry_number := null;
1649: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1650: hr_utility.trace (l_proc||' or p_deleting is true');
1651: hr_utility.trace (l_proc||' Old entry values:');
1652: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1653: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1654: hr_utility.trace (l_proc||' Recoverable: '
1655: ||old_entry.recoverable_amount);
1656: if ssp_smp_support_pkg.entry_already_processed

Line 1653: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);

1649: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1650: hr_utility.trace (l_proc||' or p_deleting is true');
1651: hr_utility.trace (l_proc||' Old entry values:');
1652: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1653: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1654: hr_utility.trace (l_proc||' Recoverable: '
1655: ||old_entry.recoverable_amount);
1656: if ssp_smp_support_pkg.entry_already_processed
1657: (old_entry.element_entry_id)

Line 1654: hr_utility.trace (l_proc||' Recoverable: '

1650: hr_utility.trace (l_proc||' or p_deleting is true');
1651: hr_utility.trace (l_proc||' Old entry values:');
1652: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1653: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1654: hr_utility.trace (l_proc||' Recoverable: '
1655: ||old_entry.recoverable_amount);
1656: if ssp_smp_support_pkg.entry_already_processed
1657: (old_entry.element_entry_id)
1658: then l_ins_corr_ele := TRUE;

Line 1659: hr_utility.trace (l_proc||' Old entry already processed');

1655: ||old_entry.recoverable_amount);
1656: if ssp_smp_support_pkg.entry_already_processed
1657: (old_entry.element_entry_id)
1658: then l_ins_corr_ele := TRUE;
1659: hr_utility.trace (l_proc||' Old entry already processed');
1660: else
1661: hr_utility.trace (l_proc||' Old entry NOT already processed');
1662: --Old entry not already processed so delete it
1663: hr_entry_api.delete_element_entry (

Line 1661: hr_utility.trace (l_proc||' Old entry NOT already processed');

1657: (old_entry.element_entry_id)
1658: then l_ins_corr_ele := TRUE;
1659: hr_utility.trace (l_proc||' Old entry already processed');
1660: else
1661: hr_utility.trace (l_proc||' Old entry NOT already processed');
1662: --Old entry not already processed so delete it
1663: hr_entry_api.delete_element_entry (
1664: p_dt_delete_mode => 'ZAP',
1665: p_session_date => old_entry.effective_start_date,

Line 1669: hr_utility.trace('Entered error');

1665: p_session_date => old_entry.effective_start_date,
1666: p_element_entry_id => old_entry.element_entry_id);
1667: end if;
1668: when others then
1669: hr_utility.trace('Entered error');
1670: hr_utility.trace('SQL ERROR:='||SQLERRM);
1671: end;
1672: if l_ins_corr_ele
1673: then

Line 1670: hr_utility.trace('SQL ERROR:='||SQLERRM);

1666: p_element_entry_id => old_entry.element_entry_id);
1667: end if;
1668: when others then
1669: hr_utility.trace('Entered error');
1670: hr_utility.trace('SQL ERROR:='||SQLERRM);
1671: end;
1672: if l_ins_corr_ele
1673: then
1674: -- Create a correction element to reverse the old entry. Then create a

Line 1677: hr_utility.trace (l_proc ||

1673: then
1674: -- Create a correction element to reverse the old entry. Then create a
1675: -- brand new entry with the correct values.
1676: --
1677: hr_utility.trace (l_proc ||
1678: ' Inserting CORRECTION entry for week commencing ' ||
1679: to_char (old_entry.week_commencing));
1680: hr_utility.trace (l_proc||' Old value / New value:');
1681: if entry_number is null then

Line 1680: hr_utility.trace (l_proc||' Old value / New value:');

1676: --
1677: hr_utility.trace (l_proc ||
1678: ' Inserting CORRECTION entry for week commencing ' ||
1679: to_char (old_entry.week_commencing));
1680: hr_utility.trace (l_proc||' Old value / New value:');
1681: if entry_number is null then
1682: hr_utility.trace (l_proc||' Rate: '
1683: ||old_entry.rate||' / NA');
1684: hr_utility.trace (l_proc||' Amount: '

Line 1682: hr_utility.trace (l_proc||' Rate: '

1678: ' Inserting CORRECTION entry for week commencing ' ||
1679: to_char (old_entry.week_commencing));
1680: hr_utility.trace (l_proc||' Old value / New value:');
1681: if entry_number is null then
1682: hr_utility.trace (l_proc||' Rate: '
1683: ||old_entry.rate||' / NA');
1684: hr_utility.trace (l_proc||' Amount: '
1685: ||old_entry.amount||' / NA');
1686: hr_utility.trace (l_proc||' Recoverable: '

Line 1684: hr_utility.trace (l_proc||' Amount: '

1680: hr_utility.trace (l_proc||' Old value / New value:');
1681: if entry_number is null then
1682: hr_utility.trace (l_proc||' Rate: '
1683: ||old_entry.rate||' / NA');
1684: hr_utility.trace (l_proc||' Amount: '
1685: ||old_entry.amount||' / NA');
1686: hr_utility.trace (l_proc||' Recoverable: '
1687: ||old_entry.recoverable_amount||' / NA');
1688: else

Line 1686: hr_utility.trace (l_proc||' Recoverable: '

1682: hr_utility.trace (l_proc||' Rate: '
1683: ||old_entry.rate||' / NA');
1684: hr_utility.trace (l_proc||' Amount: '
1685: ||old_entry.amount||' / NA');
1686: hr_utility.trace (l_proc||' Recoverable: '
1687: ||old_entry.recoverable_amount||' / NA');
1688: else
1689: hr_utility.trace (l_proc||' Rate: '
1690: ||old_entry.rate||' / '

Line 1689: hr_utility.trace (l_proc||' Rate: '

1685: ||old_entry.amount||' / NA');
1686: hr_utility.trace (l_proc||' Recoverable: '
1687: ||old_entry.recoverable_amount||' / NA');
1688: else
1689: hr_utility.trace (l_proc||' Rate: '
1690: ||old_entry.rate||' / '
1691: ||hypothetical_entry.rate (Entry_number));
1692: hr_utility.trace (l_proc||' Amount: '
1693: ||old_entry.amount||' / '

Line 1692: hr_utility.trace (l_proc||' Amount: '

1688: else
1689: hr_utility.trace (l_proc||' Rate: '
1690: ||old_entry.rate||' / '
1691: ||hypothetical_entry.rate (Entry_number));
1692: hr_utility.trace (l_proc||' Amount: '
1693: ||old_entry.amount||' / '
1694: ||hypothetical_entry.amount (entry_number));
1695: hr_utility.trace (l_proc||' Recoverable: '
1696: ||old_entry.recoverable_amount||' /'

Line 1695: hr_utility.trace (l_proc||' Recoverable: '

1691: ||hypothetical_entry.rate (Entry_number));
1692: hr_utility.trace (l_proc||' Amount: '
1693: ||old_entry.amount||' / '
1694: ||hypothetical_entry.amount (entry_number));
1695: hr_utility.trace (l_proc||' Recoverable: '
1696: ||old_entry.recoverable_amount||' /'
1697: ||hypothetical_entry.recoverable_amount (entry_number));
1698: end if;
1699: --

Line 1704: hr_utility.trace('Correction Entry');

1700: -- Determine the next available period in which to place the
1701: -- correction entry
1702: --
1703:
1704: hr_utility.trace('Correction Entry');
1705:
1706: ssp_smp_support_pkg.get_entry_details (
1707: p_date_earned => old_entry.week_commencing,
1708: p_last_process_date => woman.final_process_date,

Line 1723: hr_utility.trace('Insert element entry');

1719: -- api. Later fix 647543 made old_entry (csr_existing_entries) return
1720: -- the meaning, so rate passed directly.
1721: --
1722:
1723: hr_utility.trace('Insert element entry');
1724:
1725: hr_entry_api.insert_element_entry (
1726: p_effective_start_date=> old_entry.effective_start_date,
1727: p_effective_end_date => old_entry.effective_end_date,

Line 1754: hr_utility.set_location (l_proc,20);

1750: -- Having been through all the existing entries, we now check that we
1751: -- have dealt with all the newly derived entries by inserting any which
1752: -- were not flagged as dealt with during the above actions.
1753: --
1754: hr_utility.set_location (l_proc,20);
1755: --
1756: <>
1757: begin
1758: if p_deleting then

Line 1759: hr_utility.trace('Deleting an absence so don''t insert entries');

1755: --
1756: <>
1757: begin
1758: if p_deleting then
1759: hr_utility.trace('Deleting an absence so don''t insert entries');
1760: else
1761: for new_entry in 1..g_SMP_element.maximum_MPP LOOP
1762: if (not hypothetical_entry.dealt_with (new_entry) = 'TRUE')
1763: and (not hypothetical_entry.stopped (new_entry) = 'TRUE')

Line 1809: hr_utility.set_location(' Leaving: '||l_proc,100);

1805: if l_no_of_absence_periods = 0 then
1806: remove_stoppages;
1807: end if;
1808: --
1809: hr_utility.set_location(' Leaving: '||l_proc,100);
1810: --
1811: end save_hypothetical_entries;
1812: --
1813: procedure derive_SMP_week (p_week_number in integer) is

Line 1821: hr_utility.set_location ('Entering: ssp_smp_pkg.derive_SMP_week',1);

1817: -- we are and finding the offset from the start date.
1818: --
1819: begin
1820: --
1821: hr_utility.set_location ('Entering: ssp_smp_pkg.derive_SMP_week',1);
1822: hr_utility.trace ('Entry number = '||to_char (p_week_number));
1823: --
1824: hypothetical_entry.week_commencing (p_week_number)
1825: := (woman.MPP_start_date + ((p_week_number -1) * 7));

Line 1822: hr_utility.trace ('Entry number = '||to_char (p_week_number));

1818: --
1819: begin
1820: --
1821: hr_utility.set_location ('Entering: ssp_smp_pkg.derive_SMP_week',1);
1822: hr_utility.trace ('Entry number = '||to_char (p_week_number));
1823: --
1824: hypothetical_entry.week_commencing (p_week_number)
1825: := (woman.MPP_start_date + ((p_week_number -1) * 7));
1826: --

Line 1832: hr_utility.trace ('week_commencing = '

1828: hypothetical_entry.stopped (p_week_number) := 'FALSE';
1829: hypothetical_entry.element_link_id (p_week_number) := null;
1830: hypothetical_entry.assignment_id (p_week_number) := null;
1831: --
1832: hr_utility.trace ('week_commencing = '
1833: ||to_char (hypothetical_entry.week_commencing (p_week_number)));
1834: --
1835: hr_utility.set_location ('Leaving : ssp_smp_pkg.derive_SMP_week',100);
1836: --

Line 1835: hr_utility.set_location ('Leaving : ssp_smp_pkg.derive_SMP_week',100);

1831: --
1832: hr_utility.trace ('week_commencing = '
1833: ||to_char (hypothetical_entry.week_commencing (p_week_number)));
1834: --
1835: hr_utility.set_location ('Leaving : ssp_smp_pkg.derive_SMP_week',100);
1836: --
1837: end derive_SMP_week;
1838: --
1839: procedure Check_SMP_stoppages (p_week_number in integer) is

Line 1873: hr_utility.set_location ('ssp_smp_pkg.Check_SMP_stoppages',1);

1869: l_dummy integer (1);
1870: --
1871: begin
1872: --
1873: hr_utility.set_location ('ssp_smp_pkg.Check_SMP_stoppages',1);
1874: --
1875: hypothetical_entry.stopped (p_week_number) := 'FALSE';
1876: --
1877: open csr_stoppages (

Line 1892: hr_utility.trace ('Entry is STOPPED');

1888: -- is payable.
1889: --
1890: hypothetical_entry.stopped (p_week_number) := 'TRUE';
1891: --
1892: hr_utility.trace ('Entry is STOPPED');
1893: --
1894: -- Keep a tally of the number of stopped weeks
1895: --
1896: l_stopped_weeks := l_stopped_weeks +1;

Line 1901: hr_utility.set_location ('ssp_smp_pkg.Check_SMP_stoppages',10);

1897: end if;
1898: --
1899: close csr_stoppages;
1900: --
1901: hr_utility.set_location ('ssp_smp_pkg.Check_SMP_stoppages',10);
1902: --
1903: end Check_SMP_stoppages;
1904: --
1905: procedure Calculate_correct_SMP_rate (p_week_number in number) is

Line 1919: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',1);

1915: and lookup_code = p_rate_band;
1916: --
1917: begin
1918: --
1919: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',1);
1920: --
1921: if l_high_rate is null then
1922: --
1923: -- Get the meanings for the rate bands

Line 1941: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',1);

1937: --
1938: if (p_week_number - l_stopped_weeks)
1939: <= g_SMP_element.period_at_higher_rate
1940: then
1941: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',1);
1942: --
1943: -- We have not yet given the employee all their higher rate weeks
1944: --
1945: hypothetical_entry.rate (p_week_number) := l_high_rate;

Line 1950: hr_utility.trace ('SMP Rate = '

1946: else
1947: hypothetical_entry.rate (p_week_number) := l_low_rate;
1948: end if;
1949: --
1950: hr_utility.trace ('SMP Rate = '
1951: ||hypothetical_entry.rate (p_week_number));
1952: --
1953: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',10);
1954: --

Line 1953: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',10);

1949: --
1950: hr_utility.trace ('SMP Rate = '
1951: ||hypothetical_entry.rate (p_week_number));
1952: --
1953: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',10);
1954: --
1955: end Calculate_correct_SMP_rate;
1956: --
1957: procedure Calculate_SMP_amounts (p_week_number in integer, p_MPP_start_date in date) is

Line 1961: hr_utility.set_location('Entering: ssp_smp_pkg.Calculate_SMP_amounts',1);

1957: procedure Calculate_SMP_amounts (p_week_number in integer, p_MPP_start_date in date) is
1958: --
1959: begin
1960: --
1961: hr_utility.set_location('Entering: ssp_smp_pkg.Calculate_SMP_amounts',1);
1962: --
1963: -- Get the SMP element for each week in case the SMP rate has changed
1964: --
1965: get_SMP_element (hypothetical_entry.week_commencing (p_week_number));

Line 1973: hr_utility.trace('Calculate at high rate');

1969: -- The higher rate is the greater of the low SMP flat rate amount and
1970: -- the legislation-specified proportion of average earnings (rounded
1971: -- UP to the nearest penny)
1972: --
1973: hr_utility.trace('Calculate at high rate');
1974: hr_utility.trace('p_MPP_start_date : '||fnd_date.date_to_canonical(p_MPP_start_date));
1975: if p_MPP_start_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
1976: hr_utility.trace('MPP start date after 06-APR-2003, therefore 90 percent of average earnings');
1977: hypothetical_entry.amount (p_week_number)

Line 1974: hr_utility.trace('p_MPP_start_date : '||fnd_date.date_to_canonical(p_MPP_start_date));

1970: -- the legislation-specified proportion of average earnings (rounded
1971: -- UP to the nearest penny)
1972: --
1973: hr_utility.trace('Calculate at high rate');
1974: hr_utility.trace('p_MPP_start_date : '||fnd_date.date_to_canonical(p_MPP_start_date));
1975: if p_MPP_start_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
1976: hr_utility.trace('MPP start date after 06-APR-2003, therefore 90 percent of average earnings');
1977: hypothetical_entry.amount (p_week_number)
1978: := round((average_earnings * g_SMP_element.higher_SMP_rate)

Line 1976: hr_utility.trace('MPP start date after 06-APR-2003, therefore 90 percent of average earnings');

1972: --
1973: hr_utility.trace('Calculate at high rate');
1974: hr_utility.trace('p_MPP_start_date : '||fnd_date.date_to_canonical(p_MPP_start_date));
1975: if p_MPP_start_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
1976: hr_utility.trace('MPP start date after 06-APR-2003, therefore 90 percent of average earnings');
1977: hypothetical_entry.amount (p_week_number)
1978: := round((average_earnings * g_SMP_element.higher_SMP_rate)
1979: + 0.0049,2);
1980: else

Line 1981: hr_utility.trace('Due date before 06-APR-2003, therfore under higher rate with lower rate, else 90 percent of average earnings');

1977: hypothetical_entry.amount (p_week_number)
1978: := round((average_earnings * g_SMP_element.higher_SMP_rate)
1979: + 0.0049,2);
1980: else
1981: hr_utility.trace('Due date before 06-APR-2003, therfore under higher rate with lower rate, else 90 percent of average earnings');
1982: hypothetical_entry.amount (p_week_number)
1983: := greatest (round (
1984: (average_earnings * g_SMP_element.higher_SMP_rate)
1985: + 0.0049,2),

Line 1989: hr_utility.trace('Calculating for lower, therfore we need to find out if week commencing date is before or after 06-APR-2003, week_commencing : '||fnd_date.date_to_canonical(hypothetical_entry.week_commencing(p_week_number)));

1985: + 0.0049,2),
1986: g_SMP_element.lower_SMP_rate);
1987: end if;
1988: else
1989: hr_utility.trace('Calculating for lower, therfore we need to find out if week commencing date is before or after 06-APR-2003, week_commencing : '||fnd_date.date_to_canonical(hypothetical_entry.week_commencing(p_week_number)));
1990: if hypothetical_entry.week_commencing(p_week_number) <
1991: fnd_date.canonical_to_date('2003/04/06 00:00:00') then
1992: hr_utility.trace('Decided week commencing before 06-APR-2003');
1993: -- Any SMP weeks paid before 06-APR-2003 to be paid

Line 1992: hr_utility.trace('Decided week commencing before 06-APR-2003');

1988: else
1989: hr_utility.trace('Calculating for lower, therfore we need to find out if week commencing date is before or after 06-APR-2003, week_commencing : '||fnd_date.date_to_canonical(hypothetical_entry.week_commencing(p_week_number)));
1990: if hypothetical_entry.week_commencing(p_week_number) <
1991: fnd_date.canonical_to_date('2003/04/06 00:00:00') then
1992: hr_utility.trace('Decided week commencing before 06-APR-2003');
1993: -- Any SMP weeks paid before 06-APR-2003 to be paid
1994: -- at floored lower amount
1995: hypothetical_entry.amount (p_week_number)
1996: := g_SMP_element.lower_SMP_rate;

Line 2003: hr_utility.trace('Week commenicng is after 06-APR-2003, but MPP start date is before 06-APR-2003, therfore amount must be underpinned');

1999: p_MPP_start_date < fnd_date.canonical_to_date('2003/04/06 00:00:00')) then
2000: -- For payments after 06-APR-2003 for maternities with MPP start date
2001: -- prior to 06-APR-2003, the payment must be underpinned by SMP
2002: -- lower rate
2003: hr_utility.trace('Week commenicng is after 06-APR-2003, but MPP start date is before 06-APR-2003, therfore amount must be underpinned');
2004: if g_SMP_element.lower_SMP_rate > round(
2005: (average_earnings * g_SMP_element.higher_SMP_rate)
2006: + 0.0049,2) then
2007: -- Payment to be underpinned

Line 2008: hr_utility.trace('Average earnings * 90 percent less than lower rate, therfore underpin');

2004: if g_SMP_element.lower_SMP_rate > round(
2005: (average_earnings * g_SMP_element.higher_SMP_rate)
2006: + 0.0049,2) then
2007: -- Payment to be underpinned
2008: hr_utility.trace('Average earnings * 90 percent less than lower rate, therfore underpin');
2009: hypothetical_entry.amount (p_week_number)
2010: := g_SMP_element.lower_SMP_rate;
2011: else
2012: -- Calculated amount is higher than lower SMP rate, so

Line 2014: hr_utility.trace('average earnings * 90 percent greater than lower rate, no need to underpin');

2010: := g_SMP_element.lower_SMP_rate;
2011: else
2012: -- Calculated amount is higher than lower SMP rate, so
2013: -- assign calculated amount
2014: hr_utility.trace('average earnings * 90 percent greater than lower rate, no need to underpin');
2015: hypothetical_entry.amount (p_week_number)
2016: := least(round(
2017: (average_earnings * g_SMP_element.higher_SMP_rate)
2018: + 0.0049,2), g_SMP_element.standard_SMP_rate);

Line 2021: hr_utility.trace('Due date and week Commencing both after 06-APr-2003, therfore lowest of average earnings and standard rate');

2017: (average_earnings * g_SMP_element.higher_SMP_rate)
2018: + 0.0049,2), g_SMP_element.standard_SMP_rate);
2019: end if;
2020: else
2021: hr_utility.trace('Due date and week Commencing both after 06-APr-2003, therfore lowest of average earnings and standard rate');
2022: hypothetical_entry.amount (p_week_number)
2023: := least(round(
2024: (average_earnings * g_SMP_element.higher_SMP_rate)
2025: + 0.0049,2), g_SMP_element.standard_SMP_rate);

Line 2033: hr_utility.trace ('SMP amount = '

2029: hypothetical_entry.recoverable_amount (p_week_number)
2030: := round (hypothetical_entry.amount (p_week_number)
2031: * g_SMP_element.recovery_rate,2);
2032: --
2033: hr_utility.trace ('SMP amount = '
2034: ||to_char (hypothetical_entry.amount (p_week_number)));
2035: hr_utility.trace ('Recoverable amount = '
2036: ||to_char (hypothetical_entry.recoverable_amount (p_week_number)));
2037: --

Line 2035: hr_utility.trace ('Recoverable amount = '

2031: * g_SMP_element.recovery_rate,2);
2032: --
2033: hr_utility.trace ('SMP amount = '
2034: ||to_char (hypothetical_entry.amount (p_week_number)));
2035: hr_utility.trace ('Recoverable amount = '
2036: ||to_char (hypothetical_entry.recoverable_amount (p_week_number)));
2037: --
2038: hr_utility.set_location('Leaving : ssp_smp_pkg.Calculate_SMP_amounts',100);
2039: --

Line 2038: hr_utility.set_location('Leaving : ssp_smp_pkg.Calculate_SMP_amounts',100);

2034: ||to_char (hypothetical_entry.amount (p_week_number)));
2035: hr_utility.trace ('Recoverable amount = '
2036: ||to_char (hypothetical_entry.recoverable_amount (p_week_number)));
2037: --
2038: hr_utility.set_location('Leaving : ssp_smp_pkg.Calculate_SMP_amounts',100);
2039: --
2040: end calculate_SMP_amounts;
2041: --
2042: procedure check_parameters is

Line 2053: hr_utility.set_location ('ssp_smp_pkg.generate_payments',1);

2049: end check_parameters;
2050: --
2051: begin
2052: --
2053: hr_utility.set_location ('ssp_smp_pkg.generate_payments',1);
2054: --
2055: check_parameters;
2056: --
2057: <>

Line 2147: hr_utility.set_location (l_proc,1);

2143: l_proc varchar2 (72) := g_package||'SMP_control';
2144: --
2145: begin
2146: --
2147: hr_utility.set_location (l_proc,1);
2148: --
2149: open csr_maternity;
2150: fetch csr_maternity into l_dummy;
2151: --

Line 2175: hr_utility.trace (l_proc||' Deleting element entry_id '||

2171: -- The maternity may have been deleted. Remove any element entries associated
2172: -- with it (the absences, stoppages and medicals are handled by constraints).
2173: --
2174: for obsolete in csr_entries LOOP
2175: hr_utility.trace (l_proc||' Deleting element entry_id '||
2176: to_char (obsolete.element_entry_id));
2177: hr_utility.trace (l_proc||'-------------------------------------------');
2178: --
2179: hr_entry_api.delete_element_entry (

Line 2177: hr_utility.trace (l_proc||'-------------------------------------------');

2173: --
2174: for obsolete in csr_entries LOOP
2175: hr_utility.trace (l_proc||' Deleting element entry_id '||
2176: to_char (obsolete.element_entry_id));
2177: hr_utility.trace (l_proc||'-------------------------------------------');
2178: --
2179: hr_entry_api.delete_element_entry (
2180: p_dt_delete_mode => 'ZAP',
2181: p_session_date => obsolete.effective_start_date,

Line 2188: hr_utility.set_location (l_proc,100);

2184: end if;
2185: --
2186: g_smp_update := 'N';
2187: --
2188: hr_utility.set_location (l_proc,100);
2189: --
2190: end SMP_control;
2191: --
2192: --------------------------------------------------------------------------------

Line 2203: hr_utility.set_location('Entering:'||l_proc,1);

2199: l_deleting_ch varchar2(1);
2200: --
2201: begin
2202: --
2203: hr_utility.set_location('Entering:'||l_proc,1);
2204: if p_deleting then
2205: l_deleting_ch := 'Y';
2206: else
2207: l_deleting_ch := 'N';

Line 2211: hr_utility.trace (l_proc||' Saving maternity_id #' || p_maternity_id ||

2207: l_deleting_ch := 'N';
2208: end if;
2209: --
2210: if p_maternity_id is not null then
2211: hr_utility.trace (l_proc||' Saving maternity_id #' || p_maternity_id ||
2212: ' for recalculation (p_del = '||l_deleting_ch||').');
2213: --
2214: insert into ssp_temp_affected_rows (MATERNITY_ID, p_deleting, locked)
2215: select p_maternity_id, l_deleting_ch, userenv('sessionid')

Line 2223: hr_utility.set_location('Leaving :'||l_proc,100);

2219: from ssp_temp_affected_rows t2
2220: where t2.maternity_id = p_maternity_id);
2221: end if;
2222: --
2223: hr_utility.set_location('Leaving :'||l_proc,100);
2224: --
2225: end ins_ssp_temp_affected_rows_mat;
2226: --
2227: --------------------------------------------------------------------------------

Line 2237: hr_utility.set_location (l_proc,1);

2233: l_proc varchar2 (72) := g_package||'absence_control';
2234: --
2235: begin
2236: --
2237: hr_utility.set_location (l_proc,1);
2238: --
2239: g_smp_update := 'N';
2240: --
2241: if p_maternity_id is not null then

Line 2245: hr_utility.set_location (l_proc,100);

2241: if p_maternity_id is not null then
2242: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting);
2243: end if;
2244: --
2245: hr_utility.set_location (l_proc,100);
2246: --
2247: end absence_control;
2248: --------------------------------------------------------------------------------
2249: procedure maternity_control (p_maternity_id in number) is

Line 2255: hr_utility.set_location (l_proc,1);

2251: l_proc varchar2 (72) := g_package||'maternity_control';
2252: --
2253: begin
2254: --
2255: hr_utility.set_location (l_proc,1);
2256: --
2257: g_smp_update := 'Y';
2258: --
2259: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);

Line 2261: hr_utility.set_location (l_proc,100);

2257: g_smp_update := 'Y';
2258: --
2259: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);
2260: --
2261: hr_utility.set_location (l_proc,100);
2262: --
2263: end maternity_control;
2264: --------------------------------------------------------------------------------
2265: procedure medical_control (p_maternity_id in number) is

Line 2271: hr_utility.set_location (l_proc,1);

2267: l_proc varchar2 (72) := g_package||'medical_control';
2268: --
2269: begin
2270: --
2271: hr_utility.set_location (l_proc,1);
2272: --
2273: if p_maternity_id is not null -- the medical is for a maternity
2274: then
2275: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);

Line 2278: hr_utility.set_location (l_proc,100);

2274: then
2275: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);
2276: end if;
2277: --
2278: hr_utility.set_location (l_proc,100);
2279: --
2280: end medical_control;
2281: --
2282: --------------------------------------------------------------------------------

Line 2310: hr_utility.set_location (l_proc,1);

2306: l_proc varchar2(72) := g_package||'earnings_control';
2307: --
2308: begin
2309: --
2310: hr_utility.set_location (l_proc,1);
2311: --
2312: open csr_maternity;
2313: fetch csr_maternity into l_maternity_id;
2314: --

Line 2319: hr_utility.trace(l_proc||' No maternities affected by change in earnings');

2315: if csr_maternity%found
2316: then
2317: ins_ssp_temp_affected_rows_mat(l_maternity_id, p_deleting => FALSE);
2318: else
2319: hr_utility.trace(l_proc||' No maternities affected by change in earnings');
2320: end if;
2321: --
2322: close csr_maternity;
2323: --

Line 2324: hr_utility.set_location (l_proc,100);

2320: end if;
2321: --
2322: close csr_maternity;
2323: --
2324: hr_utility.set_location (l_proc,100);
2325: --
2326: end earnings_control;
2327: --
2328: --------------------------------------------------------------------------------

Line 2359: hr_utility.set_location (l_proc,1);

2355: l_proc varchar2(72) := g_package||'person_control';
2356: --
2357: begin
2358: --
2359: hr_utility.set_location (l_proc,1);
2360: --
2361: open csr_maternity;
2362: fetch csr_maternity into l_maternity_id;
2363: --

Line 2373: hr_utility.set_location (l_proc,100);

2369: close csr_maternity;
2370: --
2371: ssp_smp_support_pkg.recalculate_ssp_and_smp(p_deleting => FALSE);
2372: --
2373: hr_utility.set_location (l_proc,100);
2374: --
2375: end person_control;
2376: --
2377: --------------------------------------------------------------------------------

Line 2389: hr_utility.set_location (l_proc,1);

2385: l_proc varchar2 (72) := g_package||'stoppage_control';
2386: --
2387: begin
2388: --
2389: hr_utility.set_location (l_proc,1);
2390: --
2391: if p_maternity_id is not null
2392: then
2393: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);

Line 2396: hr_utility.set_location (l_proc,100);

2392: then
2393: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);
2394: end if;
2395: --
2396: hr_utility.set_location (l_proc,100);
2397: --
2398: end stoppage_control;
2399: --
2400: --------------------------------------------------------------------------------