DBA Data[Home] [Help]

APPS.SSP_SMP_PKG dependencies on HR_UTILITY

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

247: --
248: procedure check_parameters is
249: begin
250: --
251: hr_utility.trace (l_proc||' p_effective_date = '
252: ||to_char (p_effective_date));
253: --
254: hr_api.mandatory_arg_error (
255: p_api_name => l_proc,

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

258: end check_parameters;
259: --
260: begin
261: --
262: hr_utility.set_location (l_proc,1);
263: --
264: check_parameters;
265: --
266: open csr_SMP_element_details (p_effective_date,c_SMP_Corr_element_name);

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

265: --
266: open csr_SMP_element_details (p_effective_date,c_SMP_Corr_element_name);
267: fetch csr_SMP_element_details into g_SMP_Correction_element;
268:
269: --hr_utility.trace('g_SMP_Correction_element'||g_SMP_Correction_element);
270:
271: close csr_SMP_element_details;
272: --
273: hr_utility.set_location (l_proc,100);

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

269: --hr_utility.trace('g_SMP_Correction_element'||g_SMP_Correction_element);
270:
271: close csr_SMP_element_details;
272: --
273: hr_utility.set_location (l_proc,100);
274: --
275: end get_SMP_correction_element;
276: --
277: --------------------------------------------------------------------------------

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

281: --
282: procedure check_parameters is
283: begin
284: --
285: hr_utility.trace (l_proc||' p_effective_date = '
286: ||to_char (p_effective_date));
287: --
288: hr_api.mandatory_arg_error (
289: p_api_name => l_proc,

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

292: end check_parameters;
293: --
294: begin
295: --
296: hr_utility.set_location (l_proc,1);
297: --
298: check_parameters;
299: --
300: open csr_SMP_element_details (p_effective_date,c_SMP_element_name);

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

300: open csr_SMP_element_details (p_effective_date,c_SMP_element_name);
301: fetch csr_SMP_element_details into g_SMP_element;
302: close csr_SMP_element_details;
303: --
304: hr_utility.set_location (l_proc,100);
305: --
306: end get_SMP_element;
307: --
308: --------------------------------------------------------------------------------

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

325:
326:
327: begin
328: --
329: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',1);
330:
331: l_EWC := (next_day (p_due_date,l_sunday) -7);
332:
333: hr_utility.trace('l_EWC: '||l_EWC);

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

329: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',1);
330:
331: l_EWC := (next_day (p_due_date,l_sunday) -7);
332:
333: hr_utility.trace('l_EWC: '||l_EWC);
334:
335: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',99);
336:
337: return l_EWC;

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

331: l_EWC := (next_day (p_due_date,l_sunday) -7);
332:
333: hr_utility.trace('l_EWC: '||l_EWC);
334:
335: hr_utility.set_location(g_package||'EXPECTED_WEEK_OF_CONFINEMENT',99);
336:
337: return l_EWC;
338: --
339: end expected_week_of_confinement;

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

403:
404: --
405: begin
406: --
407: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',1);
408:
409: open csr_SMP_element_details (p_due_date,c_SMP_element_name);
410: fetch csr_SMP_element_details into l_SMP_element;
411: close csr_SMP_element_details;

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

409: open csr_SMP_element_details (p_due_date,c_SMP_element_name);
410: fetch csr_SMP_element_details into l_SMP_element;
411: close csr_SMP_element_details;
412:
413: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',2);
414: --
415:
416: l_Continuously_employed_since :=
417: next_day(next_day(Qualifying_Week (p_due_date),l_saturday)

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

416: l_Continuously_employed_since :=
417: next_day(next_day(Qualifying_Week (p_due_date),l_saturday)
418: - (l_SMP_element.continuous_employment_period),l_saturday);
419:
420: hr_utility.trace('l_Continuously_employed_since: '||l_Continuously_employed_since);
421:
422: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',99);
423: --
424: return l_Continuously_employed_since;

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

418: - (l_SMP_element.continuous_employment_period),l_saturday);
419:
420: hr_utility.trace('l_Continuously_employed_since: '||l_Continuously_employed_since);
421:
422: hr_utility.set_location(g_package||'CONTINUOUS_EMPLOYMENT_DATE',99);
423: --
424: return l_Continuously_employed_since;
425: --
426: end continuous_employment_date;

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

466: and effective_date = l_effective_date;
467: --
468: begin
469: --
470: hr_utility.set_location ('Entering '||l_proc,1);
471: --
472: if woman.actual_birth_date is not null then
473: l_effective_date := least (greatest(woman.QW, woman.date_start), ssp_smp_support_pkg.start_of_week
474: (woman.actual_birth_date));

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

491: end if;
492: --
493: close csr_average_earnings;
494: --
495: hr_utility.set_location ('Leaving '||l_proc,10);
496: --
497: return l_average_earnings;
498: --
499: end average_earnings;

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

576: procedure check_parameters is
577: --
578: begin
579: --
580: hr_utility.trace (l_proc||' p_reason = '||p_reason);
581: hr_utility.trace (l_proc||' withhold from '
582: ||to_char (p_withhold_from));
583: hr_utility.trace (l_proc||' withhold to '
584: ||to_char (p_withhold_to));

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

577: --
578: begin
579: --
580: hr_utility.trace (l_proc||' p_reason = '||p_reason);
581: hr_utility.trace (l_proc||' withhold from '
582: ||to_char (p_withhold_from));
583: hr_utility.trace (l_proc||' withhold to '
584: ||to_char (p_withhold_to));
585: --

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

579: --
580: hr_utility.trace (l_proc||' p_reason = '||p_reason);
581: hr_utility.trace (l_proc||' withhold from '
582: ||to_char (p_withhold_from));
583: hr_utility.trace (l_proc||' withhold to '
584: ||to_char (p_withhold_to));
585: --
586: hr_api.mandatory_arg_error (
587: p_api_name => l_proc,

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

596: end check_parameters;
597: --
598: begin
599: --
600: hr_utility.set_location (l_proc,1);
601: --
602: check_parameters;
603: --
604: l_reason_id := ssp_smp_support_pkg.withholding_reason_id (

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

621: p_maternity_id => p_maternity_id,
622: p_user_entered => 'N',
623: p_reason_id => l_reason_id);
624: else
625: hr_utility.trace (l_proc||' Stoppage is overridden');
626: end if;
627: --
628: hr_utility.set_location (l_proc,100);
629: --

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

624: else
625: hr_utility.trace (l_proc||' Stoppage is overridden');
626: end if;
627: --
628: hr_utility.set_location (l_proc,100);
629: --
630: end create_stoppage;
631: --
632: procedure remove_stoppages is

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

644: l_proc varchar2 (72) := g_package||'remove_stoppages';
645: --
646: begin
647: --
648: hr_utility.set_location (l_proc,1);
649: --
650: for each_stoppage in csr_stoppages LOOP
651: ssp_stp_del.del (p_stoppage_id => each_stoppage.stoppage_id,
652: p_object_version_number => l_dummy);

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

651: ssp_stp_del.del (p_stoppage_id => each_stoppage.stoppage_id,
652: p_object_version_number => l_dummy);
653: end loop;
654: --
655: hr_utility.set_location (l_proc,100);
656: --
657: end remove_stoppages;
658: --
659: procedure check_continuity_rule is

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

682: l_proc varchar2 (72) := g_package||'check_continuity_rule';
683: --
684: begin
685: --
686: hr_utility.set_location (l_proc,1);
687: --
688: open period_of_service;
689: fetch period_of_service into l_dummy;
690: --

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

698: end if;
699: --
700: close period_of_service;
701: --
702: hr_utility.set_location (l_proc,100);
703: --
704: end check_continuity_rule;
705: --
706: --

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

741: return nvl(l_leaving_reason,'-1');
742: end get_leaving_reason;
743: --
744: begin
745: hr_utility.set_location('Entering : '||l_proc,1);
746: --
747: open csr_period_of_service_qw;
748: fetch csr_period_of_service_qw into l_termination_date
749: ,l_leaving_reason ;

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

751: --
752:
753: l_leaving_reason := get_leaving_reason(l_leaving_reason);
754: --
755: hr_utility.set_location(l_proc,2);
756: --
757: --
758: -- Bug 2663735
759: -- For current regulations (due date less than 06-APR-2003)

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

762: -- But the employee gets complete SMP according to the
763: -- new regulations (due date after 06-APR-2003)
764: --
765: if woman.due_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
766: hr_utility.set_location(l_proc,3);
767: if l_termination_date < woman.qw then
768: hr_utility.set_location(l_proc,4);
769: create_stoppage(p_withhold_from => l_termination_date + 1
770: ,p_reason => 'Not employed in QW' );

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

764: --
765: if woman.due_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
766: hr_utility.set_location(l_proc,3);
767: if l_termination_date < woman.qw then
768: hr_utility.set_location(l_proc,4);
769: create_stoppage(p_withhold_from => l_termination_date + 1
770: ,p_reason => 'Not employed in QW' );
771: end if;
772: else

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

769: create_stoppage(p_withhold_from => l_termination_date + 1
770: ,p_reason => 'Not employed in QW' );
771: end if;
772: else
773: hr_utility.set_location(l_proc,5);
774: if (l_termination_date
775: between woman.qw
776: and nvl(woman.MPP_start_date
777: ,ssp_smp_pkg.earliest_mpp_start_date(woman.due_date)) )

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

777: ,ssp_smp_pkg.earliest_mpp_start_date(woman.due_date)) )
778: and
779: (l_leaving_reason <> 'MATERNITY')
780: then
781: hr_utility.set_location(l_proc,6);
782: create_stoppage(p_withhold_from => l_termination_date + 1
783: ,p_reason => 'Insufficient employment' );
784: elsif l_termination_date < woman.qw then
785: hr_utility.set_location(l_proc,7);

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

781: hr_utility.set_location(l_proc,6);
782: create_stoppage(p_withhold_from => l_termination_date + 1
783: ,p_reason => 'Insufficient employment' );
784: elsif l_termination_date < woman.qw then
785: hr_utility.set_location(l_proc,7);
786: create_stoppage(p_withhold_from => l_termination_date + 1
787: ,p_reason => 'Not employed in QW' );
788: end if;
789: hr_utility.set_location(l_proc,8);

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

785: hr_utility.set_location(l_proc,7);
786: create_stoppage(p_withhold_from => l_termination_date + 1
787: ,p_reason => 'Not employed in QW' );
788: end if;
789: hr_utility.set_location(l_proc,8);
790: end if;
791: --
792: hr_utility.set_location('Leaving : '||l_proc,9);
793: --

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

788: end if;
789: hr_utility.set_location(l_proc,8);
790: end if;
791: --
792: hr_utility.set_location('Leaving : '||l_proc,9);
793: --
794: end check_employment_qw;
795: --
796: procedure check_stillbirth is

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

800: l_proc varchar2 (72) := g_package||'check_stillbirth';
801: --
802: begin
803: --
804: hr_utility.set_location (l_proc,1);
805: --
806: -- Woman must be still pregnant, have had a live birth, or have had a
807: -- stillbirth after the threshhold week to be eligible for SMP
808: --

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

818: create_stoppage (p_withhold_from => woman.MPP_start_date,
819: p_reason => 'Stillbirth');
820: end if;
821: --
822: hr_utility.set_location (l_proc,100);
823: --
824: end check_stillbirth;
825: --
826: procedure check_new_employer is

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

831: l_proc varchar2 (72) := g_package||'check_new_employer';
832: --
833: begin
834: --
835: hr_utility.set_location (l_proc,1);
836: --
837: if woman.start_date_with_new_employer >= woman.actual_birth_date then
838: --
839: -- Stop SMP payment from the start of the week in which the woman

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

843: (woman.start_date_with_new_employer),
844: p_reason => 'Worked for another employer');
845: end if;
846: --
847: hr_utility.set_location (l_proc,100);
848: --
849: end check_new_employer;
850: --
851: procedure check_maternity_allowance is

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

855: l_proc varchar2 (72) := g_package||'check_maternity_allowance';
856: --
857: begin
858: --
859: hr_utility.set_location (l_proc,1);
860: --
861: if woman.start_date_maternity_allowance is not null then
862: --
863: -- Stop SMP payment from the start of the week in which SMA was first

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

867: (woman.start_date_maternity_allowance),
868: p_reason => 'Employee is receiving SMA');
869: end if;
870: --
871: hr_utility.set_location (l_proc,100);
872: --
873: end check_maternity_allowance;
874: --
875: procedure check_death is

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

896: l_day_of_the_week varchar2(20);
897: --
898: begin
899: --
900: hr_utility.set_location (l_proc,1);
901: --
902: if woman.date_of_death is not null then
903: --
904: -- SMP ceases on the Saturday following death

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

930: end if;
931: -- Bug 2663899 end
932: end if;
933: --
934: hr_utility.set_location (l_proc,100);
935: --
936: end check_death;
937: --
938: procedure check_average_earnings is

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

945: earnings_not_derived exception;
946: --
947: begin
948: --
949: hr_utility.set_location (l_proc,1);
950: --
951: if l_average_earnings = 0
952: then
953: --

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

984: create_stoppage (p_withhold_from => woman.MPP_start_date,
985: p_reason => 'Earnings too low');
986: end if;
987: --
988: hr_utility.set_location (l_proc,100);
989: --
990: exception
991: --
992: when earnings_not_derived then

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

992: when earnings_not_derived then
993: --
994: -- Exit silently from this procedure
995: --
996: hr_utility.trace (l_proc||' Earnings not derived');
997: null;
998: --
999: end check_average_earnings;
1000: --

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

1012: l_medical medical%rowtype;
1013: --
1014: begin
1015: --
1016: hr_utility.set_location (l_proc,1);
1017: --
1018: open medical;
1019: fetch medical into l_medical;
1020: --

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

1052: end if;
1053: --
1054: close medical;
1055: --
1056: hr_utility.set_location (l_proc,100);
1057: --
1058: end check_medical_evidence;
1059: --
1060: procedure check_birth_confirmation is

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

1064: l_proc varchar2 (72) := g_package||'check_birth_confirmation';
1065: --
1066: begin
1067: --
1068: hr_utility.set_location (l_proc,1);
1069: --
1070: --
1071: -- This should not create a stoppage. A quick fix for bug 1021179
1072: -- is to comment out the stoppage process.

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

1085: -- create_stoppage (p_withhold_from => woman.MPP_start_date,
1086: -- p_reason => 'Late notification of birth');
1087: -- end if;
1088: --
1089: hr_utility.set_location (l_proc,100);
1090: --
1091: end check_birth_confirmation;
1092: --
1093: procedure check_parameters is

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

1093: procedure check_parameters is
1094: --
1095: begin
1096: --
1097: hr_utility.trace (l_proc||' p_maternity_id = '
1098: ||to_char (p_maternity_id));
1099: --
1100: hr_api.mandatory_arg_error (
1101: p_api_name => l_proc,

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

1105: end check_parameters;
1106: --
1107: begin
1108: --
1109: hr_utility.set_location (l_proc,1);
1110: --
1111: check_parameters;
1112: --
1113: -- Get the details of the woman and her maternity.

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

1121: -- If no maternity record exists then there can be no entitlement to SMP
1122: --
1123: close csr_personal_details;
1124: --
1125: hr_utility.trace (l_proc||' Woman has no maternity record - exiting');
1126: --
1127: raise no_prima_facia_entitlement;
1128: end if;
1129: --

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

1132: if woman.MPP_start_date is null then
1133: --
1134: -- If the MPP has not started then there is no entitlement to SMP.
1135: --
1136: hr_utility.trace (l_proc||' Woman has no MPP start date - exiting');
1137: --
1138: raise no_prima_facia_entitlement;
1139: end if;
1140: --

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

1153: fetch csr_check_if_existing_entries into l_existing_entries;
1154: --
1155: if csr_check_if_existing_entries%NOTFOUND
1156: then
1157: hr_utility.trace (l_proc||' Woman has not stopped work - exiting');
1158: raise no_prima_facia_entitlement;
1159: end if;
1160: --
1161: -- if entries are found then the absence has been deleted and entries remain

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

1171: --
1172: -- Having established a prima facia entitlement to SMP, perform checks which
1173: -- may lead to creation of stoppages for particular periods.
1174: --
1175: hr_utility.set_location ('ssp_smp_pkg.entitled_to_SMP',2);
1176: --
1177: -- Get the SMP legislative parameters.
1178: --
1179: get_SMP_element (woman.due_date);

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

1223: p_withhold_from => woman.MPP_start_date,
1224: p_reason => 'Late absence notification');
1225: end if;
1226: --
1227: hr_utility.set_location ('ssp_smp_pkg.entitled_to_SMP',3);
1228:
1229: --8470655 begin
1230: if to_char(absence.date_start-1,'DAY') = to_char(woman.MPP_start_date - 1,'DAY')
1231: then

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

1312: --8470655 end
1313: --
1314: -- This is not the last absence in the maternity but it has no end date.
1315: --
1316: hr_utility.trace (l_proc||' ERROR: Invalid null absence end date');
1317: --
1318: raise invalid_absence_date;
1319: end if;
1320: end if;

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

1599: l_proc varchar2 (72) := g_package||'.remove_stoppages';
1600: --
1601: begin
1602: --
1603: hr_utility.set_location (l_proc,1);
1604: --
1605: for each_stoppage in csr_stoppages LOOP
1606: ssp_stp_del.del (p_stoppage_id => each_stoppage.stoppage_id,
1607: p_object_version_number => l_dummy);

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

1606: ssp_stp_del.del (p_stoppage_id => each_stoppage.stoppage_id,
1607: p_object_version_number => l_dummy);
1608: end loop;
1609: --
1610: hr_utility.set_location (l_proc,100);
1611: --
1612: end remove_stoppages;
1613: --
1614: begin

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

1612: end remove_stoppages;
1613: --
1614: begin
1615: --
1616: --hr_utility.trace_on(null,'ssp');
1617: hr_utility.set_location('Entering: '||l_proc,10);
1618:
1619: hr_utility.trace('woman.due_date='||woman.due_date);
1620: --

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

1613: --
1614: begin
1615: --
1616: --hr_utility.trace_on(null,'ssp');
1617: hr_utility.set_location('Entering: '||l_proc,10);
1618:
1619: hr_utility.trace('woman.due_date='||woman.due_date);
1620: --
1621: get_SMP_correction_element (woman.due_date);

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

1615: --
1616: --hr_utility.trace_on(null,'ssp');
1617: hr_utility.set_location('Entering: '||l_proc,10);
1618:
1619: hr_utility.trace('woman.due_date='||woman.due_date);
1620: --
1621: get_SMP_correction_element (woman.due_date);
1622: --
1623: -- Check each existing SMP entry in turn against all the potential new ones.

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

1623: -- Check each existing SMP entry in turn against all the potential new ones.
1624: --
1625: <>
1626:
1627: hr_utility.trace('Old entries');
1628:
1629:
1630: for old_entry in csr_existing_entries
1631: LOOP

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

1634: --a stoppage. If there isn't one, invalidate the old entry.
1635: --Assume we don't need to correct the entry until we discover otherwise:
1636: --
1637:
1638: hr_utility.trace('Entered csr_existing_entries');
1639:
1640: l_ins_corr_ele := FALSE;
1641: begin
1642: hr_utility.trace('Entering begin');

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

1638: hr_utility.trace('Entered csr_existing_entries');
1639:
1640: l_ins_corr_ele := FALSE;
1641: begin
1642: hr_utility.trace('Entering begin');
1643: entry_number := 0;
1644: if p_deleting then
1645: hr_utility.trace('Raising error');
1646: raise no_data_found; -- enter exception handler

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

1641: begin
1642: hr_utility.trace('Entering begin');
1643: entry_number := 0;
1644: if p_deleting then
1645: hr_utility.trace('Raising error');
1646: raise no_data_found; -- enter exception handler
1647: end if;
1648: LOOP
1649:

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

1646: raise no_data_found; -- enter exception handler
1647: end if;
1648: LOOP
1649:
1650: hr_utility.trace('First loop');
1651: entry_number := entry_number +1;
1652:
1653: -- Exit the loop when we find a hypothetical entry covering the
1654: -- same week as the old entry, which is not subject to a stoppage.

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

1667: = hypothetical_entry.week_commencing (entry_number)
1668: and not hypothetical_entry.stopped (entry_number) = 'TRUE'
1669: and g_smp_update = 'Y'));
1670:
1671: hr_utility.trace('Exiting');
1672: end loop;
1673:
1674: hr_utility.trace (l_proc||' Old entry / Hypo entry time Match with values:');
1675: hr_utility.trace (l_proc||' Rate: '

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

1670:
1671: hr_utility.trace('Exiting');
1672: end loop;
1673:
1674: hr_utility.trace (l_proc||' Old entry / Hypo entry time Match with values:');
1675: hr_utility.trace (l_proc||' Rate: '
1676: ||old_entry.rate||' / '
1677: ||hypothetical_entry.rate (Entry_number));
1678: hr_utility.trace (l_proc||' Amount: '

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

1671: hr_utility.trace('Exiting');
1672: end loop;
1673:
1674: hr_utility.trace (l_proc||' Old entry / Hypo entry time Match with values:');
1675: hr_utility.trace (l_proc||' Rate: '
1676: ||old_entry.rate||' / '
1677: ||hypothetical_entry.rate (Entry_number));
1678: hr_utility.trace (l_proc||' Amount: '
1679: ||old_entry.amount||' / '

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

1674: hr_utility.trace (l_proc||' Old entry / Hypo entry time Match with values:');
1675: hr_utility.trace (l_proc||' Rate: '
1676: ||old_entry.rate||' / '
1677: ||hypothetical_entry.rate (Entry_number));
1678: hr_utility.trace (l_proc||' Amount: '
1679: ||old_entry.amount||' / '
1680: ||hypothetical_entry.amount (entry_number));
1681: hr_utility.trace (l_proc||' Recoverable: '
1682: ||old_entry.recoverable_amount||' / '

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

1677: ||hypothetical_entry.rate (Entry_number));
1678: hr_utility.trace (l_proc||' Amount: '
1679: ||old_entry.amount||' / '
1680: ||hypothetical_entry.amount (entry_number));
1681: hr_utility.trace (l_proc||' Recoverable: '
1682: ||old_entry.recoverable_amount||' / '
1683: ||hypothetical_entry.recoverable_amount (entry_number));
1684: hr_utility.trace (l_proc||' Week Comm: '
1685: ||hypothetical_entry.week_commencing (entry_number) );

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

1680: ||hypothetical_entry.amount (entry_number));
1681: hr_utility.trace (l_proc||' Recoverable: '
1682: ||old_entry.recoverable_amount||' / '
1683: ||hypothetical_entry.recoverable_amount (entry_number));
1684: hr_utility.trace (l_proc||' Week Comm: '
1685: ||hypothetical_entry.week_commencing (entry_number) );
1686: --A hypo entry covers the same week as the old one
1687: if old_entry.rate = hypothetical_entry.rate (entry_number)
1688: and old_entry.amount = hypothetical_entry.amount(entry_number)

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

1692: -- the hypo entry has the same values as the old one
1693: -- don't create a correction element.
1694: -- don't create a new entry
1695: hypothetical_entry.dealt_with (entry_number) := 'TRUE';
1696: hr_utility.trace (l_proc||' leave unchanged');
1697: else
1698: if ssp_smp_support_pkg.entry_already_processed
1699: (old_entry.element_entry_id)
1700: then l_ins_corr_ele := TRUE;

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

1697: else
1698: if ssp_smp_support_pkg.entry_already_processed
1699: (old_entry.element_entry_id)
1700: then l_ins_corr_ele := TRUE;
1701: hr_utility.trace (l_proc||' processed - correct it');
1702: else
1703: -- update old entry
1704: hr_utility.trace (l_proc||' unprocessed - update it');
1705: hr_entry_api.update_element_entry (

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

1700: then l_ins_corr_ele := TRUE;
1701: hr_utility.trace (l_proc||' processed - correct it');
1702: else
1703: -- update old entry
1704: hr_utility.trace (l_proc||' unprocessed - update it');
1705: hr_entry_api.update_element_entry (
1706: p_dt_update_mode => 'CORRECTION',
1707: p_session_date => old_entry.effective_start_date,
1708: p_element_entry_id => old_entry.element_entry_id,

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

1724: when no_data_found then
1725: -- There was no new entry which exactly matched the old entry.
1726: -- or we are deleting.
1727: entry_number := null;
1728: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1729: hr_utility.trace (l_proc||' or p_deleting is true');
1730: hr_utility.trace (l_proc||' Old entry values:');
1731: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1732: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);

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

1725: -- There was no new entry which exactly matched the old entry.
1726: -- or we are deleting.
1727: entry_number := null;
1728: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1729: hr_utility.trace (l_proc||' or p_deleting is true');
1730: hr_utility.trace (l_proc||' Old entry values:');
1731: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1732: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1733: hr_utility.trace (l_proc||' Recoverable: '

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

1726: -- or we are deleting.
1727: entry_number := null;
1728: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1729: hr_utility.trace (l_proc||' or p_deleting is true');
1730: hr_utility.trace (l_proc||' Old entry values:');
1731: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1732: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1733: hr_utility.trace (l_proc||' Recoverable: '
1734: ||old_entry.recoverable_amount);

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

1727: entry_number := null;
1728: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1729: hr_utility.trace (l_proc||' or p_deleting is true');
1730: hr_utility.trace (l_proc||' Old entry values:');
1731: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1732: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1733: hr_utility.trace (l_proc||' Recoverable: '
1734: ||old_entry.recoverable_amount);
1735: if ssp_smp_support_pkg.entry_already_processed

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

1728: hr_utility.trace (l_proc||' No Old entry - Hypo entry time Match');
1729: hr_utility.trace (l_proc||' or p_deleting is true');
1730: hr_utility.trace (l_proc||' Old entry values:');
1731: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1732: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1733: hr_utility.trace (l_proc||' Recoverable: '
1734: ||old_entry.recoverable_amount);
1735: if ssp_smp_support_pkg.entry_already_processed
1736: (old_entry.element_entry_id)

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

1729: hr_utility.trace (l_proc||' or p_deleting is true');
1730: hr_utility.trace (l_proc||' Old entry values:');
1731: hr_utility.trace (l_proc||' Rate: '||old_entry.rate);
1732: hr_utility.trace (l_proc||' Amount: '||old_entry.amount);
1733: hr_utility.trace (l_proc||' Recoverable: '
1734: ||old_entry.recoverable_amount);
1735: if ssp_smp_support_pkg.entry_already_processed
1736: (old_entry.element_entry_id)
1737: then l_ins_corr_ele := TRUE;

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

1734: ||old_entry.recoverable_amount);
1735: if ssp_smp_support_pkg.entry_already_processed
1736: (old_entry.element_entry_id)
1737: then l_ins_corr_ele := TRUE;
1738: hr_utility.trace (l_proc||' Old entry already processed');
1739: else
1740: hr_utility.trace (l_proc||' Old entry NOT already processed');
1741: --Old entry not already processed so delete it
1742: hr_entry_api.delete_element_entry (

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

1736: (old_entry.element_entry_id)
1737: then l_ins_corr_ele := TRUE;
1738: hr_utility.trace (l_proc||' Old entry already processed');
1739: else
1740: hr_utility.trace (l_proc||' Old entry NOT already processed');
1741: --Old entry not already processed so delete it
1742: hr_entry_api.delete_element_entry (
1743: p_dt_delete_mode => 'ZAP',
1744: p_session_date => old_entry.effective_start_date,

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

1744: p_session_date => old_entry.effective_start_date,
1745: p_element_entry_id => old_entry.element_entry_id);
1746: end if;
1747: when others then
1748: hr_utility.trace('Entered error');
1749: hr_utility.trace('SQL ERROR:='||SQLERRM);
1750: end;
1751: if l_ins_corr_ele
1752: then

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

1745: p_element_entry_id => old_entry.element_entry_id);
1746: end if;
1747: when others then
1748: hr_utility.trace('Entered error');
1749: hr_utility.trace('SQL ERROR:='||SQLERRM);
1750: end;
1751: if l_ins_corr_ele
1752: then
1753: -- Create a correction element to reverse the old entry. Then create a

Line 1756: hr_utility.trace (l_proc ||

1752: then
1753: -- Create a correction element to reverse the old entry. Then create a
1754: -- brand new entry with the correct values.
1755: --
1756: hr_utility.trace (l_proc ||
1757: ' Inserting CORRECTION entry for week commencing ' ||
1758: to_char (old_entry.week_commencing));
1759: hr_utility.trace (l_proc||' Old value / New value:');
1760: if entry_number is null then

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

1755: --
1756: hr_utility.trace (l_proc ||
1757: ' Inserting CORRECTION entry for week commencing ' ||
1758: to_char (old_entry.week_commencing));
1759: hr_utility.trace (l_proc||' Old value / New value:');
1760: if entry_number is null then
1761: hr_utility.trace (l_proc||' Rate: '
1762: ||old_entry.rate||' / NA');
1763: hr_utility.trace (l_proc||' Amount: '

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

1757: ' Inserting CORRECTION entry for week commencing ' ||
1758: to_char (old_entry.week_commencing));
1759: hr_utility.trace (l_proc||' Old value / New value:');
1760: if entry_number is null then
1761: hr_utility.trace (l_proc||' Rate: '
1762: ||old_entry.rate||' / NA');
1763: hr_utility.trace (l_proc||' Amount: '
1764: ||old_entry.amount||' / NA');
1765: hr_utility.trace (l_proc||' Recoverable: '

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

1759: hr_utility.trace (l_proc||' Old value / New value:');
1760: if entry_number is null then
1761: hr_utility.trace (l_proc||' Rate: '
1762: ||old_entry.rate||' / NA');
1763: hr_utility.trace (l_proc||' Amount: '
1764: ||old_entry.amount||' / NA');
1765: hr_utility.trace (l_proc||' Recoverable: '
1766: ||old_entry.recoverable_amount||' / NA');
1767: else

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

1761: hr_utility.trace (l_proc||' Rate: '
1762: ||old_entry.rate||' / NA');
1763: hr_utility.trace (l_proc||' Amount: '
1764: ||old_entry.amount||' / NA');
1765: hr_utility.trace (l_proc||' Recoverable: '
1766: ||old_entry.recoverable_amount||' / NA');
1767: else
1768: hr_utility.trace (l_proc||' Rate: '
1769: ||old_entry.rate||' / '

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

1764: ||old_entry.amount||' / NA');
1765: hr_utility.trace (l_proc||' Recoverable: '
1766: ||old_entry.recoverable_amount||' / NA');
1767: else
1768: hr_utility.trace (l_proc||' Rate: '
1769: ||old_entry.rate||' / '
1770: ||hypothetical_entry.rate (Entry_number));
1771: hr_utility.trace (l_proc||' Amount: '
1772: ||old_entry.amount||' / '

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

1767: else
1768: hr_utility.trace (l_proc||' Rate: '
1769: ||old_entry.rate||' / '
1770: ||hypothetical_entry.rate (Entry_number));
1771: hr_utility.trace (l_proc||' Amount: '
1772: ||old_entry.amount||' / '
1773: ||hypothetical_entry.amount (entry_number));
1774: hr_utility.trace (l_proc||' Recoverable: '
1775: ||old_entry.recoverable_amount||' /'

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

1770: ||hypothetical_entry.rate (Entry_number));
1771: hr_utility.trace (l_proc||' Amount: '
1772: ||old_entry.amount||' / '
1773: ||hypothetical_entry.amount (entry_number));
1774: hr_utility.trace (l_proc||' Recoverable: '
1775: ||old_entry.recoverable_amount||' /'
1776: ||hypothetical_entry.recoverable_amount (entry_number));
1777: end if;
1778: --

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

1779: -- Determine the next available period in which to place the
1780: -- correction entry
1781: --
1782:
1783: hr_utility.trace('Correction Entry');
1784:
1785: ssp_smp_support_pkg.get_entry_details (
1786: p_date_earned => old_entry.week_commencing,
1787: p_last_process_date => woman.final_process_date,

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

1798: -- api. Later fix 647543 made old_entry (csr_existing_entries) return
1799: -- the meaning, so rate passed directly.
1800: --
1801:
1802: hr_utility.trace('Insert element entry');
1803:
1804: hr_entry_api.insert_element_entry (
1805: p_effective_start_date=> old_entry.effective_start_date,
1806: p_effective_end_date => old_entry.effective_end_date,

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

1829: -- Having been through all the existing entries, we now check that we
1830: -- have dealt with all the newly derived entries by inserting any which
1831: -- were not flagged as dealt with during the above actions.
1832: --
1833: hr_utility.set_location (l_proc,20);
1834: --
1835: <>
1836: begin
1837: if p_deleting then

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

1834: --
1835: <>
1836: begin
1837: if p_deleting then
1838: hr_utility.trace('Deleting an absence so don''t insert entries');
1839: else
1840: for new_entry in 1..g_SMP_element.maximum_MPP LOOP
1841: if (not hypothetical_entry.dealt_with (new_entry) = 'TRUE')
1842: and (not hypothetical_entry.stopped (new_entry) = 'TRUE')

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

1884: if l_no_of_absence_periods = 0 then
1885: remove_stoppages;
1886: end if;
1887: --
1888: hr_utility.set_location(' Leaving: '||l_proc,100);
1889: --
1890: end save_hypothetical_entries;
1891: --
1892: procedure derive_SMP_week (p_week_number in integer) is

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

1896: -- we are and finding the offset from the start date.
1897: --
1898: begin
1899: --
1900: hr_utility.set_location ('Entering: ssp_smp_pkg.derive_SMP_week',1);
1901: hr_utility.trace ('Entry number = '||to_char (p_week_number));
1902: --
1903: hypothetical_entry.week_commencing (p_week_number)
1904: := (woman.MPP_start_date + ((p_week_number -1) * 7));

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

1897: --
1898: begin
1899: --
1900: hr_utility.set_location ('Entering: ssp_smp_pkg.derive_SMP_week',1);
1901: hr_utility.trace ('Entry number = '||to_char (p_week_number));
1902: --
1903: hypothetical_entry.week_commencing (p_week_number)
1904: := (woman.MPP_start_date + ((p_week_number -1) * 7));
1905: --

Line 1911: hr_utility.trace ('week_commencing = '

1907: hypothetical_entry.stopped (p_week_number) := 'FALSE';
1908: hypothetical_entry.element_link_id (p_week_number) := null;
1909: hypothetical_entry.assignment_id (p_week_number) := null;
1910: --
1911: hr_utility.trace ('week_commencing = '
1912: ||to_char (hypothetical_entry.week_commencing (p_week_number)));
1913: --
1914: hr_utility.set_location ('Leaving : ssp_smp_pkg.derive_SMP_week',100);
1915: --

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

1910: --
1911: hr_utility.trace ('week_commencing = '
1912: ||to_char (hypothetical_entry.week_commencing (p_week_number)));
1913: --
1914: hr_utility.set_location ('Leaving : ssp_smp_pkg.derive_SMP_week',100);
1915: --
1916: end derive_SMP_week;
1917: --
1918: procedure Check_SMP_stoppages (p_week_number in integer) is

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

1948: l_dummy integer (1);
1949: --
1950: begin
1951: --
1952: hr_utility.set_location ('ssp_smp_pkg.Check_SMP_stoppages',1);
1953: --
1954: hypothetical_entry.stopped (p_week_number) := 'FALSE';
1955: --
1956: open csr_stoppages (

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

1967: -- is payable.
1968: --
1969: hypothetical_entry.stopped (p_week_number) := 'TRUE';
1970: --
1971: hr_utility.trace ('Entry is STOPPED');
1972: --
1973: -- Keep a tally of the number of stopped weeks
1974: --
1975: l_stopped_weeks := l_stopped_weeks +1;

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

1976: end if;
1977: --
1978: close csr_stoppages;
1979: --
1980: hr_utility.set_location ('ssp_smp_pkg.Check_SMP_stoppages',10);
1981: --
1982: end Check_SMP_stoppages;
1983: --
1984: procedure Calculate_correct_SMP_rate (p_week_number in number) is

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

1994: and lookup_code = p_rate_band;
1995: --
1996: begin
1997: --
1998: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',1);
1999: --
2000: if l_high_rate is null then
2001: --
2002: -- Get the meanings for the rate bands

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

2016: --
2017: if (p_week_number - l_stopped_weeks)
2018: <= g_SMP_element.period_at_higher_rate
2019: then
2020: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',1);
2021: --
2022: -- We have not yet given the employee all their higher rate weeks
2023: --
2024: hypothetical_entry.rate (p_week_number) := l_high_rate;

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

2025: else
2026: hypothetical_entry.rate (p_week_number) := l_low_rate;
2027: end if;
2028: --
2029: hr_utility.trace ('SMP Rate = '
2030: ||hypothetical_entry.rate (p_week_number));
2031: --
2032: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',10);
2033: --

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

2028: --
2029: hr_utility.trace ('SMP Rate = '
2030: ||hypothetical_entry.rate (p_week_number));
2031: --
2032: hr_utility.set_location ('ssp_smp_pkg.Calculate_correct_SMP_rate',10);
2033: --
2034: end Calculate_correct_SMP_rate;
2035: --
2036: procedure Calculate_SMP_amounts (p_week_number in integer, p_MPP_start_date in date) is

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

2036: procedure Calculate_SMP_amounts (p_week_number in integer, p_MPP_start_date in date) is
2037: --
2038: begin
2039: --
2040: hr_utility.set_location('Entering: ssp_smp_pkg.Calculate_SMP_amounts',1);
2041: --
2042: -- Get the SMP element for each week in case the SMP rate has changed
2043: --
2044: get_SMP_element (hypothetical_entry.week_commencing (p_week_number));

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

2048: -- The higher rate is the greater of the low SMP flat rate amount and
2049: -- the legislation-specified proportion of average earnings (rounded
2050: -- UP to the nearest penny)
2051: --
2052: hr_utility.trace('Calculate at high rate');
2053: hr_utility.trace('p_MPP_start_date : '||fnd_date.date_to_canonical(p_MPP_start_date));
2054: if p_MPP_start_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
2055: hr_utility.trace('MPP start date after 06-APR-2003, therefore 90 percent of average earnings');
2056: hypothetical_entry.amount (p_week_number)

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

2049: -- the legislation-specified proportion of average earnings (rounded
2050: -- UP to the nearest penny)
2051: --
2052: hr_utility.trace('Calculate at high rate');
2053: hr_utility.trace('p_MPP_start_date : '||fnd_date.date_to_canonical(p_MPP_start_date));
2054: if p_MPP_start_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
2055: hr_utility.trace('MPP start date after 06-APR-2003, therefore 90 percent of average earnings');
2056: hypothetical_entry.amount (p_week_number)
2057: := round((average_earnings * g_SMP_element.higher_SMP_rate)

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

2051: --
2052: hr_utility.trace('Calculate at high rate');
2053: hr_utility.trace('p_MPP_start_date : '||fnd_date.date_to_canonical(p_MPP_start_date));
2054: if p_MPP_start_date >= fnd_date.canonical_to_date('2003/04/06 00:00:00') then
2055: hr_utility.trace('MPP start date after 06-APR-2003, therefore 90 percent of average earnings');
2056: hypothetical_entry.amount (p_week_number)
2057: := round((average_earnings * g_SMP_element.higher_SMP_rate)
2058: + 0.0049,2);
2059: else

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

2056: hypothetical_entry.amount (p_week_number)
2057: := round((average_earnings * g_SMP_element.higher_SMP_rate)
2058: + 0.0049,2);
2059: else
2060: hr_utility.trace('Due date before 06-APR-2003, therfore under higher rate with lower rate, else 90 percent of average earnings');
2061: hypothetical_entry.amount (p_week_number)
2062: := greatest (round (
2063: (average_earnings * g_SMP_element.higher_SMP_rate)
2064: + 0.0049,2),

Line 2068: 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)));

2064: + 0.0049,2),
2065: g_SMP_element.lower_SMP_rate);
2066: end if;
2067: else
2068: 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)));
2069: if hypothetical_entry.week_commencing(p_week_number) <
2070: fnd_date.canonical_to_date('2003/04/06 00:00:00') then
2071: hr_utility.trace('Decided week commencing before 06-APR-2003');
2072: -- Any SMP weeks paid before 06-APR-2003 to be paid

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

2067: else
2068: 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)));
2069: if hypothetical_entry.week_commencing(p_week_number) <
2070: fnd_date.canonical_to_date('2003/04/06 00:00:00') then
2071: hr_utility.trace('Decided week commencing before 06-APR-2003');
2072: -- Any SMP weeks paid before 06-APR-2003 to be paid
2073: -- at floored lower amount
2074: hypothetical_entry.amount (p_week_number)
2075: := g_SMP_element.lower_SMP_rate;

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

2078: p_MPP_start_date < fnd_date.canonical_to_date('2003/04/06 00:00:00')) then
2079: -- For payments after 06-APR-2003 for maternities with MPP start date
2080: -- prior to 06-APR-2003, the payment must be underpinned by SMP
2081: -- lower rate
2082: hr_utility.trace('Week commenicng is after 06-APR-2003, but MPP start date is before 06-APR-2003, therfore amount must be underpinned');
2083: if g_SMP_element.lower_SMP_rate > round(
2084: (average_earnings * g_SMP_element.higher_SMP_rate)
2085: + 0.0049,2) then
2086: -- Payment to be underpinned

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

2083: if g_SMP_element.lower_SMP_rate > round(
2084: (average_earnings * g_SMP_element.higher_SMP_rate)
2085: + 0.0049,2) then
2086: -- Payment to be underpinned
2087: hr_utility.trace('Average earnings * 90 percent less than lower rate, therfore underpin');
2088: hypothetical_entry.amount (p_week_number)
2089: := g_SMP_element.lower_SMP_rate;
2090: else
2091: -- Calculated amount is higher than lower SMP rate, so

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

2089: := g_SMP_element.lower_SMP_rate;
2090: else
2091: -- Calculated amount is higher than lower SMP rate, so
2092: -- assign calculated amount
2093: hr_utility.trace('average earnings * 90 percent greater than lower rate, no need to underpin');
2094: hypothetical_entry.amount (p_week_number)
2095: := least(round(
2096: (average_earnings * g_SMP_element.higher_SMP_rate)
2097: + 0.0049,2), g_SMP_element.standard_SMP_rate);

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

2096: (average_earnings * g_SMP_element.higher_SMP_rate)
2097: + 0.0049,2), g_SMP_element.standard_SMP_rate);
2098: end if;
2099: else
2100: hr_utility.trace('Due date and week Commencing both after 06-APr-2003, therfore lowest of average earnings and standard rate');
2101: hypothetical_entry.amount (p_week_number)
2102: := least(round(
2103: (average_earnings * g_SMP_element.higher_SMP_rate)
2104: + 0.0049,2), g_SMP_element.standard_SMP_rate);

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

2108: hypothetical_entry.recoverable_amount (p_week_number)
2109: := round (hypothetical_entry.amount (p_week_number)
2110: * g_SMP_element.recovery_rate,2);
2111: --
2112: hr_utility.trace ('SMP amount = '
2113: ||to_char (hypothetical_entry.amount (p_week_number)));
2114: hr_utility.trace ('Recoverable amount = '
2115: ||to_char (hypothetical_entry.recoverable_amount (p_week_number)));
2116: --

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

2110: * g_SMP_element.recovery_rate,2);
2111: --
2112: hr_utility.trace ('SMP amount = '
2113: ||to_char (hypothetical_entry.amount (p_week_number)));
2114: hr_utility.trace ('Recoverable amount = '
2115: ||to_char (hypothetical_entry.recoverable_amount (p_week_number)));
2116: --
2117: hr_utility.set_location('Leaving : ssp_smp_pkg.Calculate_SMP_amounts',100);
2118: --

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

2113: ||to_char (hypothetical_entry.amount (p_week_number)));
2114: hr_utility.trace ('Recoverable amount = '
2115: ||to_char (hypothetical_entry.recoverable_amount (p_week_number)));
2116: --
2117: hr_utility.set_location('Leaving : ssp_smp_pkg.Calculate_SMP_amounts',100);
2118: --
2119: end calculate_SMP_amounts;
2120: --
2121: procedure check_parameters is

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

2128: end check_parameters;
2129: --
2130: begin
2131: --
2132: hr_utility.set_location ('ssp_smp_pkg.generate_payments',1);
2133: --
2134: check_parameters;
2135: --
2136: <>

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

2222: l_proc varchar2 (72) := g_package||'SMP_control';
2223: --
2224: begin
2225: --
2226: hr_utility.set_location (l_proc,1);
2227: --
2228: open csr_maternity;
2229: fetch csr_maternity into l_dummy;
2230: --

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

2250: -- The maternity may have been deleted. Remove any element entries associated
2251: -- with it (the absences, stoppages and medicals are handled by constraints).
2252: --
2253: for obsolete in csr_entries LOOP
2254: hr_utility.trace (l_proc||' Deleting element entry_id '||
2255: to_char (obsolete.element_entry_id));
2256: hr_utility.trace (l_proc||'-------------------------------------------');
2257: --
2258: hr_entry_api.delete_element_entry (

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

2252: --
2253: for obsolete in csr_entries LOOP
2254: hr_utility.trace (l_proc||' Deleting element entry_id '||
2255: to_char (obsolete.element_entry_id));
2256: hr_utility.trace (l_proc||'-------------------------------------------');
2257: --
2258: hr_entry_api.delete_element_entry (
2259: p_dt_delete_mode => 'ZAP',
2260: p_session_date => obsolete.effective_start_date,

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

2263: end if;
2264: --
2265: g_smp_update := 'N';
2266: --
2267: hr_utility.set_location (l_proc,100);
2268: --
2269: end SMP_control;
2270: --
2271: --------------------------------------------------------------------------------

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

2278: l_deleting_ch varchar2(1);
2279: --
2280: begin
2281: --
2282: hr_utility.set_location('Entering:'||l_proc,1);
2283: if p_deleting then
2284: l_deleting_ch := 'Y';
2285: else
2286: l_deleting_ch := 'N';

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

2286: l_deleting_ch := 'N';
2287: end if;
2288: --
2289: if p_maternity_id is not null then
2290: hr_utility.trace (l_proc||' Saving maternity_id #' || p_maternity_id ||
2291: ' for recalculation (p_del = '||l_deleting_ch||').');
2292: --
2293: insert into ssp_temp_affected_rows (MATERNITY_ID, p_deleting, locked)
2294: select p_maternity_id, l_deleting_ch, userenv('sessionid')

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

2298: from ssp_temp_affected_rows t2
2299: where t2.maternity_id = p_maternity_id);
2300: end if;
2301: --
2302: hr_utility.set_location('Leaving :'||l_proc,100);
2303: --
2304: end ins_ssp_temp_affected_rows_mat;
2305: --
2306: --------------------------------------------------------------------------------

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

2312: l_proc varchar2 (72) := g_package||'absence_control';
2313: --
2314: begin
2315: --
2316: hr_utility.set_location (l_proc,1);
2317: --
2318: g_smp_update := 'N';
2319: --
2320: if p_maternity_id is not null then

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

2320: if p_maternity_id is not null then
2321: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting);
2322: end if;
2323: --
2324: hr_utility.set_location (l_proc,100);
2325: --
2326: end absence_control;
2327: --------------------------------------------------------------------------------
2328: procedure maternity_control (p_maternity_id in number) is

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

2330: l_proc varchar2 (72) := g_package||'maternity_control';
2331: --
2332: begin
2333: --
2334: hr_utility.set_location (l_proc,1);
2335: --
2336: g_smp_update := 'Y';
2337: --
2338: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);

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

2336: g_smp_update := 'Y';
2337: --
2338: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);
2339: --
2340: hr_utility.set_location (l_proc,100);
2341: --
2342: end maternity_control;
2343: --------------------------------------------------------------------------------
2344: procedure medical_control (p_maternity_id in number) is

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

2346: l_proc varchar2 (72) := g_package||'medical_control';
2347: --
2348: begin
2349: --
2350: hr_utility.set_location (l_proc,1);
2351: --
2352: if p_maternity_id is not null -- the medical is for a maternity
2353: then
2354: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);

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

2353: then
2354: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);
2355: end if;
2356: --
2357: hr_utility.set_location (l_proc,100);
2358: --
2359: end medical_control;
2360: --
2361: --------------------------------------------------------------------------------

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

2387: l_proc varchar2(72) := g_package||'earnings_control';
2388: --
2389: begin
2390: --
2391: hr_utility.set_location (l_proc,1);
2392: --
2393: open csr_maternity;
2394: fetch csr_maternity into l_maternity_id;
2395: --

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

2396: if csr_maternity%found
2397: then
2398: ins_ssp_temp_affected_rows_mat(l_maternity_id, p_deleting => FALSE);
2399: else
2400: hr_utility.trace(l_proc||' No maternities affected by change in earnings');
2401: end if;
2402: --
2403: close csr_maternity;
2404: --

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

2401: end if;
2402: --
2403: close csr_maternity;
2404: --
2405: hr_utility.set_location (l_proc,100);
2406: --
2407: end earnings_control;
2408: --
2409: --------------------------------------------------------------------------------

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

2436: l_proc varchar2(72) := g_package||'person_control';
2437: --
2438: begin
2439: --
2440: hr_utility.set_location (l_proc,1);
2441: --
2442: open csr_maternity;
2443: fetch csr_maternity into l_maternity_id;
2444: --

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

2450: close csr_maternity;
2451: --
2452: ssp_smp_support_pkg.recalculate_ssp_and_smp(p_deleting => FALSE);
2453: --
2454: hr_utility.set_location (l_proc,100);
2455: --
2456: end person_control;
2457: --
2458: --------------------------------------------------------------------------------

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

2466: l_proc varchar2 (72) := g_package||'stoppage_control';
2467: --
2468: begin
2469: --
2470: hr_utility.set_location (l_proc,1);
2471: --
2472: if p_maternity_id is not null
2473: then
2474: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);

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

2473: then
2474: ins_ssp_temp_affected_rows_mat(p_maternity_id, p_deleting => FALSE);
2475: end if;
2476: --
2477: hr_utility.set_location (l_proc,100);
2478: --
2479: end stoppage_control;
2480: --
2481: --------------------------------------------------------------------------------