206: hr_us_w2_mt.get_parameter
207: ('TRANSFER_GRE',ppa.legislative_parameters);
208: exception
209: when others then
210: hr_utility.trace('Legislative parameters not found for pactid '||to_char(pactid));
211: raise;
212: end;
213:
214: -- If it is not a PR W2 Report then only do the preprocess Agent GRE check
212: end;
213:
214: -- If it is not a PR W2 Report then only do the preprocess Agent GRE check
215: if l_report_type <> 'PRW2PAPER' then
216: hr_utility.trace('Checking for Preprocess Agent GRE setup');
217: hr_us_w2_rep.get_agent_tax_unit_id ( l_business_group_id
218: ,l_year
219: ,l_agent_tax_unit_id
220: ,l_error_mesg ) ;
246: pay_core_utils.push_token('record_name',' ');
247: pay_core_utils.push_token('description',substr(l_error_mesg,136,45));
248: end if;
249:
250: hr_utility.raise_error;
251: end if;
252:
253: end if;
254:
252:
253: end if;
254:
255:
256: hr_utility.trace('Before the range cursor');
257: hr_utility.trace('EOY Payroll action id = '||l_eoy_payroll_action_id);
258:
259: sqlstr :=
260:
253: end if;
254:
255:
256: hr_utility.trace('Before the range cursor');
257: hr_utility.trace('EOY Payroll action id = '||l_eoy_payroll_action_id);
258:
259: sqlstr :=
260:
261: 'SELECT
266: ' AND :payroll_action_id is not null
267: AND paa_arch.action_status = ''C''
268: order by to_number(paa_arch.serial_number) ';
269:
270: hr_utility.trace('After the range cursor');
271:
272: end range_cursor;
273:
274:
398: c_actions_where varchar2(10000);
399:
400: begin
401: l_procedure_name := 'action_creation_for_ee';
402: hr_utility.set_location(l_procedure_name, 1);
403: /* 4152323 { */
404: select effective_date,
405: report_type,
406: report_qualifier,
425: When Others Then
426: l_report_format := Null ;
427: End ;
428:
429: hr_utility.set_location(l_procedure_name, 2);
430: l_range_person_on := pay_ac_utility.range_person_on
431: ( p_report_type => l_report_type,
432: p_report_format => l_report_format,
433: p_report_qualifier => l_report_qualifier,
442: (p_ssn is null ) and
443: (p_state_code is null ) and
444: (p_asg_set_id is null )) then
445:
446: hr_utility.set_location(l_procedure_name, 5);
447: if l_range_person_on = TRUE Then
448: hr_utility.set_location(l_procedure_name, 10);
449: hr_utility.trace('Range Person ID Functionality is enabled') ;
450: c_actions_no_selection_sql :=
444: (p_asg_set_id is null )) then
445:
446: hr_utility.set_location(l_procedure_name, 5);
447: if l_range_person_on = TRUE Then
448: hr_utility.set_location(l_procedure_name, 10);
449: hr_utility.trace('Range Person ID Functionality is enabled') ;
450: c_actions_no_selection_sql :=
451: 'SELECT paa_arch.assignment_action_id,
452: paa_arch.assignment_id,
445:
446: hr_utility.set_location(l_procedure_name, 5);
447: if l_range_person_on = TRUE Then
448: hr_utility.set_location(l_procedure_name, 10);
449: hr_utility.trace('Range Person ID Functionality is enabled') ;
450: c_actions_no_selection_sql :=
451: 'SELECT paa_arch.assignment_action_id,
452: paa_arch.assignment_id,
453: paa_arch.tax_unit_id,
491: END IF;
492:
493:
494: -- c_actions_no_selection_sql := c_actions_no_selection_sql || c_actions_where;
495: hr_utility.trace(' c_actions_no_selection_sql' ||c_actions_no_selection_sql);
496: else
497: hr_utility.set_location(l_procedure_name, 15);
498: c_actions_no_selection_sql :=
499: 'SELECT paa_arch.assignment_action_id,
493:
494: -- c_actions_no_selection_sql := c_actions_no_selection_sql || c_actions_where;
495: hr_utility.trace(' c_actions_no_selection_sql' ||c_actions_no_selection_sql);
496: else
497: hr_utility.set_location(l_procedure_name, 15);
498: c_actions_no_selection_sql :=
499: 'SELECT paa_arch.assignment_action_id,
500: paa_arch.assignment_id,
501: paa_arch.tax_unit_id,
524: p_session_date);
525: ELSE
526: c_actions_no_selection_sql := c_actions_no_selection_sql || c_actions_where;
527: END IF;
528: hr_utility.trace(' c_actions_no_selection_sql' ||c_actions_no_selection_sql);
529:
530: end if ;
531:
532: hr_utility.set_location(l_procedure_name, 20);
528: hr_utility.trace(' c_actions_no_selection_sql' ||c_actions_no_selection_sql);
529:
530: end if ;
531:
532: hr_utility.set_location(l_procedure_name, 20);
533: OPEN c_actions_no_selection FOR c_actions_no_selection_sql;
534: num := 0;
535:
536: loop
536: loop
537: fetch c_actions_no_selection into lockedactid,assignid,greid,l_effective_end_date;
538: if c_actions_no_selection%found then
539: num := num + 1;
540: hr_utility.trace('In the c_actions_no_selection%found in action cursor');
541: else
542: hr_utility.trace('In the c_actions_no_selection%notfound in action cursor');
543: exit;
544: end if;
538: if c_actions_no_selection%found then
539: num := num + 1;
540: hr_utility.trace('In the c_actions_no_selection%found in action cursor');
541: else
542: hr_utility.trace('In the c_actions_no_selection%notfound in action cursor');
543: exit;
544: end if;
545:
546: if nvl(pay_us_employee_payslip_web.get_doc_eit('W-2',
551:
552: -- we need to insert one action for each of the
553: -- rows that we return from the cursor (i.e. one
554: -- for each assignment/pre-payment/reversal).
555: hr_utility.set_location(l_procedure_name, 25);
556: hr_utility.trace('Before inserting the action record');
557:
558: select pay_assignment_actions_s.nextval
559: into lockingactid
552: -- we need to insert one action for each of the
553: -- rows that we return from the cursor (i.e. one
554: -- for each assignment/pre-payment/reversal).
555: hr_utility.set_location(l_procedure_name, 25);
556: hr_utility.trace('Before inserting the action record');
557:
558: select pay_assignment_actions_s.nextval
559: into lockingactid
560: from dual;
571: end loop;
572: close c_actions_no_selection;
573:
574: end if;
575: hr_utility.set_location(l_procedure_name, 30);
576:
577: /* when location is entered */
578: if p_loc_id is not null then
579: if l_range_person_on = TRUE Then
576:
577: /* when location is entered */
578: if p_loc_id is not null then
579: if l_range_person_on = TRUE Then
580: hr_utility.set_location(l_procedure_name, 35);
581: c_actions_with_location_sql :=
582: 'SELECT paa_arch.assignment_action_id,
583: paa_arch.assignment_id,
584: paa_arch.tax_unit_id,
604: AND ppr.chunk_number = ' || chunk || '
605: AND paf.person_id = ppr.person_id ' ;
606:
607: else
608: hr_utility.set_location(l_procedure_name, 40);
609: c_actions_with_location_sql :=
610: 'SELECT paa_arch.assignment_action_id,
611: paa_arch.assignment_id,
612: paa_arch.tax_unit_id,
638: p_session_date);
639: ELSE
640: c_actions_with_location_sql := c_actions_with_location_sql || c_actions_where;
641: END IF;
642: hr_utility.trace(' c_actions_with_location_sql ' ||c_actions_with_location_sql);
643:
644:
645: hr_utility.set_location(l_procedure_name, 40);
646: OPEN c_actions_with_location FOR c_actions_with_location_sql;
641: END IF;
642: hr_utility.trace(' c_actions_with_location_sql ' ||c_actions_with_location_sql);
643:
644:
645: hr_utility.set_location(l_procedure_name, 40);
646: OPEN c_actions_with_location FOR c_actions_with_location_sql;
647: num := 0;
648:
649: loop
650: fetch c_actions_with_location into lockedactid,assignid,greid,l_effective_end_date;
651:
652: if c_actions_with_location%found then
653: num := num + 1;
654: hr_utility.trace('In the c_actions_with_location%found in action cursor');
655: else
656: hr_utility.trace('In the c_actions_with_location%notfound in action cursor');
657: exit;
658: end if;
652: if c_actions_with_location%found then
653: num := num + 1;
654: hr_utility.trace('In the c_actions_with_location%found in action cursor');
655: else
656: hr_utility.trace('In the c_actions_with_location%notfound in action cursor');
657: exit;
658: end if;
659:
660: if nvl(pay_us_employee_payslip_web.get_doc_eit('W-2',
665:
666: -- we need to insert one action for each of the
667: -- rows that we return from the cursor (i.e. one
668: -- for each assignment/pre-payment/reversal).
669: hr_utility.set_location(l_procedure_name, 45);
670: hr_utility.trace('Before inserting the action record');
671:
672: select pay_assignment_actions_s.nextval
673: into lockingactid
666: -- we need to insert one action for each of the
667: -- rows that we return from the cursor (i.e. one
668: -- for each assignment/pre-payment/reversal).
669: hr_utility.set_location(l_procedure_name, 45);
670: hr_utility.trace('Before inserting the action record');
671:
672: select pay_assignment_actions_s.nextval
673: into lockingactid
674: from dual;
685: end loop;
686: close c_actions_with_location;
687:
688: end if;
689: hr_utility.set_location(l_procedure_name, 50);
690:
691:
692: /* when org is entered */
693: if p_org_id is not null then
692: /* when org is entered */
693: if p_org_id is not null then
694:
695: if l_range_person_on = TRUE Then
696: hr_utility.set_location(l_procedure_name, 60);
697: hr_utility.trace('Range Person ID Functionality is enabled') ;
698: c_actions_with_org_sql :=
699: 'SELECT paa_arch.assignment_action_id,
700: paa_arch.assignment_id,
693: if p_org_id is not null then
694:
695: if l_range_person_on = TRUE Then
696: hr_utility.set_location(l_procedure_name, 60);
697: hr_utility.trace('Range Person ID Functionality is enabled') ;
698: c_actions_with_org_sql :=
699: 'SELECT paa_arch.assignment_action_id,
700: paa_arch.assignment_id,
701: paa_arch.tax_unit_id,
722: AND paf.person_id = ppr.person_id ';
723:
724:
725: else
726: hr_utility.set_location(l_procedure_name, 70);
727: c_actions_with_org_sql :=
728: 'SELECT paa_arch.assignment_action_id,
729: paa_arch.assignment_id,
730: paa_arch.tax_unit_id,
755: p_session_date);
756: ELSE
757: c_actions_with_org_sql := c_actions_with_org_sql || c_actions_where;
758: END IF;
759: hr_utility.trace(' c_actions_with_org_sql ' ||c_actions_with_org_sql);
760:
761:
762: hr_utility.set_location(l_procedure_name, 80);
763: OPEN c_actions_with_org FOR c_actions_with_org_sql;
758: END IF;
759: hr_utility.trace(' c_actions_with_org_sql ' ||c_actions_with_org_sql);
760:
761:
762: hr_utility.set_location(l_procedure_name, 80);
763: OPEN c_actions_with_org FOR c_actions_with_org_sql;
764: num := 0;
765:
766: loop
767: fetch c_actions_with_org into lockedactid,assignid,greid,l_effective_end_date;
768:
769: if c_actions_with_org%found then
770: num := num + 1;
771: hr_utility.trace('In the c_actions_with_org%found in action cursor');
772: else
773: hr_utility.trace('In the c_actions_with_org%notfound in action cursor');
774: exit;
775: end if;
769: if c_actions_with_org%found then
770: num := num + 1;
771: hr_utility.trace('In the c_actions_with_org%found in action cursor');
772: else
773: hr_utility.trace('In the c_actions_with_org%notfound in action cursor');
774: exit;
775: end if;
776:
777: if nvl(pay_us_employee_payslip_web.get_doc_eit('W-2',
782:
783: -- we need to insert one action for each of the
784: -- rows that we return from the cursor (i.e. one
785: -- for each assignment/pre-payment/reversal).
786: hr_utility.set_location(l_procedure_name, 90);
787: hr_utility.trace('Before inserting the action record');
788:
789: select pay_assignment_actions_s.nextval
790: into lockingactid
783: -- we need to insert one action for each of the
784: -- rows that we return from the cursor (i.e. one
785: -- for each assignment/pre-payment/reversal).
786: hr_utility.set_location(l_procedure_name, 90);
787: hr_utility.trace('Before inserting the action record');
788:
789: select pay_assignment_actions_s.nextval
790: into lockingactid
791: from dual;
803: close c_actions_with_org;
804:
805: end if;
806:
807: hr_utility.set_location(l_procedure_name, 100);
808: /* when person or SSN is entered */
809: if (p_per_id is not null OR p_ssn is not null ) then
810:
811: /* Bug# 5513289: If p_print_term is set to 'Y' then assignment_action_ids
837: p_session_date);
838: ELSE
839: c_actions_with_person_sql := c_actions_with_person_sql || c_actions_where;
840: END IF;
841: hr_utility.trace(' c_actions_with_person_sql ' ||c_actions_with_person_sql);
842:
843:
844: open c_actions_with_person for c_actions_with_person_sql;
845: /* Bug# 5513289 :Ending here */
844: open c_actions_with_person for c_actions_with_person_sql;
845: /* Bug# 5513289 :Ending here */
846: num := 0;
847: loop
848: hr_utility.set_location('procpyr',2);
849: hr_utility.trace('after the loop in c_actions_with_person');
850: fetch c_actions_with_person into lockedactid,assignid,greid,l_effective_end_date;
851:
852: if c_actions_with_person%found then
845: /* Bug# 5513289 :Ending here */
846: num := 0;
847: loop
848: hr_utility.set_location('procpyr',2);
849: hr_utility.trace('after the loop in c_actions_with_person');
850: fetch c_actions_with_person into lockedactid,assignid,greid,l_effective_end_date;
851:
852: if c_actions_with_person%found then
853: num := num + 1;
850: fetch c_actions_with_person into lockedactid,assignid,greid,l_effective_end_date;
851:
852: if c_actions_with_person%found then
853: num := num + 1;
854: hr_utility.trace('In the c_actions_with_person%found in action cursor');
855: else
856: hr_utility.trace('In the c_actions_with_person%notfound in action cursor');
857: exit;
858: end if;
852: if c_actions_with_person%found then
853: num := num + 1;
854: hr_utility.trace('In the c_actions_with_person%found in action cursor');
855: else
856: hr_utility.trace('In the c_actions_with_person%notfound in action cursor');
857: exit;
858: end if;
859:
860: if nvl(pay_us_employee_payslip_web.get_doc_eit('W-2',
865:
866: -- we need to insert one action for each of the
867: -- rows that we return from the cursor (i.e. one
868: -- for each assignment/pre-payment/reversal).
869: hr_utility.set_location(l_procedure_name, 110);
870: hr_utility.trace('Before inserting the action record');
871:
872: select pay_assignment_actions_s.nextval
873: into lockingactid
866: -- we need to insert one action for each of the
867: -- rows that we return from the cursor (i.e. one
868: -- for each assignment/pre-payment/reversal).
869: hr_utility.set_location(l_procedure_name, 110);
870: hr_utility.trace('Before inserting the action record');
871:
872: select pay_assignment_actions_s.nextval
873: into lockingactid
874: from dual;
886: close c_actions_with_person;
887:
888: end if;
889:
890: hr_utility.set_location(l_procedure_name, 120);
891: /* when state is entered */
892: if p_state_code is not null then
893: hr_utility.set_location(l_procedure_name, 130);
894:
889:
890: hr_utility.set_location(l_procedure_name, 120);
891: /* when state is entered */
892: if p_state_code is not null then
893: hr_utility.set_location(l_procedure_name, 130);
894:
895: hr_utility.trace('p_state_code = ' || p_state_code);
896: open c_state_context('TAX_UNIT_ID');
897: fetch c_state_context into l_tuid_context;
891: /* when state is entered */
892: if p_state_code is not null then
893: hr_utility.set_location(l_procedure_name, 130);
894:
895: hr_utility.trace('p_state_code = ' || p_state_code);
896: open c_state_context('TAX_UNIT_ID');
897: fetch c_state_context into l_tuid_context;
898: close c_state_context;
899:
901: fetch c_state_context into l_juri_context;
902: close c_state_context;
903:
904: if l_range_person_on = TRUE Then
905: hr_utility.set_location(l_procedure_name, 140);
906: hr_utility.trace('Range Person ID Functionality is enabled') ;
907: c_actions_with_state_sql :=
908: 'SELECT paa_arch.assignment_action_id,
909: paa_arch.assignment_id,
902: close c_state_context;
903:
904: if l_range_person_on = TRUE Then
905: hr_utility.set_location(l_procedure_name, 140);
906: hr_utility.trace('Range Person ID Functionality is enabled') ;
907: c_actions_with_state_sql :=
908: 'SELECT paa_arch.assignment_action_id,
909: paa_arch.assignment_id,
910: paa_arch.tax_unit_id,
926: AND ppr.payroll_action_id = ' || pactid || '
927: AND ppr.chunk_number = ' || chunk || '
928: AND paf.person_id = ppr.person_id ';
929: else
930: hr_utility.set_location(l_procedure_name, 150);
931: c_actions_with_state_sql :=
932: 'SELECT paa_arch.assignment_action_id,
933: paa_arch.assignment_id,
934: paa_arch.tax_unit_id,
956: p_session_date);
957: ELSE
958: c_actions_with_state_sql := c_actions_with_state_sql || c_actions_where;
959: END IF;
960: hr_utility.trace(' c_actions_with_state_sql ' ||c_actions_with_state_sql);
961:
962:
963: hr_utility.set_location(l_procedure_name, 160);
964: if p_locality_code is null then
959: END IF;
960: hr_utility.trace(' c_actions_with_state_sql ' ||c_actions_with_state_sql);
961:
962:
963: hr_utility.set_location(l_procedure_name, 160);
964: if p_locality_code is null then
965: open c_state_ueid('A_SIT_SUBJ_WHABLE_PER_JD_GRE_YTD');
966: fetch c_state_ueid into l_subj_whable;
967: close c_state_ueid;
969: open c_state_ueid('A_SIT_SUBJ_NWHABLE_PER_JD_GRE_YTD');
970: fetch c_state_ueid into l_subj_nwhable;
971: close c_state_ueid;
972:
973: hr_utility.set_location(l_procedure_name, 170);
974: c_actions_with_state_sql := c_actions_with_state_sql ||
975: ' AND exists ( select 1 from dual
976: where 1 =
977: (select decode(sign(nvl(sum(to_number(fai.value)),0)),-1,1,0,0,1)
991: -- County
992: --
993: elsif length(p_locality_code) = 11 and
994: substr(p_locality_code, 8,4) = '0000' then
995: hr_utility.set_location(l_procedure_name, 180);
996: --Bug #4886044
997: -- Added the check for the User Entity 'A_COUNTY_WITHHELD_PER_JD_GRE_YTD'
998: -- Only employees who have both Wages and Taxes withheld
999: -- from the specified locality shoule be reported for that
1047: -- City
1048: --
1049: elsif length(p_locality_code) = 11 and
1050: substr(p_locality_code, 8,4) <> '0000' then
1051: hr_utility.set_location(l_procedure_name, 190);
1052:
1053: -- Bug 4645408
1054: -- Added the check for the User Entity 'A_CITY_WK_WITHHELD_PER_JD_GRE_YTD'
1055: -- Only employees who have both Wages and Taxes withheld
1060: open c_state_ueid('A_CITY_WITHHELD_PER_JD_GRE_YTD'); /* 6909926 */
1061: fetch c_state_ueid into l_city_wk_whld;
1062: close c_state_ueid;
1063:
1064: hr_utility.set_location(l_procedure_name, 170);
1065: c_actions_with_state_sql := c_actions_with_state_sql ||
1066: ' AND exists ( select 1 from dual
1067: where 1 =
1068: (select decode(sign(nvl(sum(to_number(fai.value)),0)),-1,1,0,0,1)
1105: --
1106: -- School District
1107: --
1108: elsif length(p_locality_code) = 8 then
1109: hr_utility.set_location(l_procedure_name, 200);
1110: --Bug #4886044
1111: -- Added the check for the User Entity 'A_SCHOOL_WITHHELD_PER_JD_GRE_YTD'
1112: -- Only employees who have both Wages and Taxes withheld
1113: -- from the specified locality shoule be reported for that
1157: and fai.archive_item_id = fic2.archive_item_id
1158: and fic2.context_id = ' || l_juri_context || '
1159: and substr(ltrim(rtrim(fic2.context)),1,8) = ''' || p_locality_code || '''))';
1160: end if;
1161: hr_utility.set_location(l_procedure_name, 210);
1162:
1163:
1164: num := 0;
1165: OPEN c_actions_with_state FOR c_actions_with_state_sql;
1167: fetch c_actions_with_state into lockedactid,assignid,greid,l_effective_end_date;
1168:
1169: if c_actions_with_state%found then
1170: num := num + 1;
1171: hr_utility.trace('In the c_actions_with_state%found in action cursor');
1172: else
1173: hr_utility.trace('In the c_actions_with_state%notfound in action cursor');
1174: exit;
1175: end if;
1169: if c_actions_with_state%found then
1170: num := num + 1;
1171: hr_utility.trace('In the c_actions_with_state%found in action cursor');
1172: else
1173: hr_utility.trace('In the c_actions_with_state%notfound in action cursor');
1174: exit;
1175: end if;
1176:
1177: if nvl(pay_us_employee_payslip_web.get_doc_eit('W-2',
1182:
1183: -- we need to insert one action for each of the
1184: -- rows that we return from the cursor (i.e. one
1185: -- for each assignment/pre-payment/reversal).
1186: hr_utility.set_location(l_procedure_name, 220);
1187: hr_utility.trace('Before inserting the action record');
1188:
1189: select pay_assignment_actions_s.nextval
1190: into lockingactid
1183: -- we need to insert one action for each of the
1184: -- rows that we return from the cursor (i.e. one
1185: -- for each assignment/pre-payment/reversal).
1186: hr_utility.set_location(l_procedure_name, 220);
1187: hr_utility.trace('Before inserting the action record');
1188:
1189: select pay_assignment_actions_s.nextval
1190: into lockingactid
1191: from dual;
1202: end loop;
1203: close c_actions_with_state;
1204:
1205: end if;
1206: hr_utility.set_location(l_procedure_name, 230);
1207:
1208: /* when assignment set is entered */
1209: if p_asg_set_id is not null then
1210:
1208: /* when assignment set is entered */
1209: if p_asg_set_id is not null then
1210:
1211: if l_range_person_on = TRUE Then
1212: hr_utility.set_location(l_procedure_name, 240);
1213: hr_utility.trace('Range Person ID Functionality is enabled') ;
1214: c_actions_with_assign_sql :=
1215: 'SELECT paa_arch.assignment_action_id,
1216: paa_arch.assignment_id,
1209: if p_asg_set_id is not null then
1210:
1211: if l_range_person_on = TRUE Then
1212: hr_utility.set_location(l_procedure_name, 240);
1213: hr_utility.trace('Range Person ID Functionality is enabled') ;
1214: c_actions_with_assign_sql :=
1215: 'SELECT paa_arch.assignment_action_id,
1216: paa_arch.assignment_id,
1217: paa_arch.tax_unit_id,
1237: where hasa.assignment_set_id = ' || p_asg_set_id || '
1238: and hasa.assignment_id = paa_arch.assignment_id
1239: and upper(hasa.include_or_exclude) = ''I'') ';
1240: else
1241: hr_utility.set_location(l_procedure_name, 250);
1242: c_actions_with_assign_sql :=
1243: 'SELECT paa_arch.assignment_action_id,
1244: paa_arch.assignment_id,
1245: paa_arch.tax_unit_id,
1271: p_session_date);
1272: ELSE
1273: c_actions_with_assign_sql := c_actions_with_assign_sql || c_actions_where;
1274: END IF;
1275: hr_utility.trace(' c_actions_with_assign_sql ' ||c_actions_with_assign_sql);
1276:
1277: hr_utility.set_location(l_procedure_name, 260);
1278: OPEN c_actions_with_assign_set FOR c_actions_with_assign_sql;
1279: num := 0;
1273: c_actions_with_assign_sql := c_actions_with_assign_sql || c_actions_where;
1274: END IF;
1275: hr_utility.trace(' c_actions_with_assign_sql ' ||c_actions_with_assign_sql);
1276:
1277: hr_utility.set_location(l_procedure_name, 260);
1278: OPEN c_actions_with_assign_set FOR c_actions_with_assign_sql;
1279: num := 0;
1280:
1281: loop
1282: fetch c_actions_with_assign_set into lockedactid,assignid,greid,l_effective_end_date;
1283:
1284: if c_actions_with_assign_set%found then
1285: num := num + 1;
1286: hr_utility.trace('In the c_actions_with_assign_set%found in action cursor');
1287: else
1288: hr_utility.trace('In the c_actions_with_assign_set%notfound in action cursor');
1289: exit;
1290: end if;
1284: if c_actions_with_assign_set%found then
1285: num := num + 1;
1286: hr_utility.trace('In the c_actions_with_assign_set%found in action cursor');
1287: else
1288: hr_utility.trace('In the c_actions_with_assign_set%notfound in action cursor');
1289: exit;
1290: end if;
1291:
1292: if nvl(pay_us_employee_payslip_web.get_doc_eit('W-2',
1297:
1298: -- we need to insert one action for each of the
1299: -- rows that we return from the cursor (i.e. one
1300: -- for each assignment/pre-payment/reversal).
1301: hr_utility.set_location(l_procedure_name, 270);
1302: hr_utility.trace('Before inserting the action record');
1303:
1304: hr_utility.set_location('procpyr',3);
1305:
1298: -- we need to insert one action for each of the
1299: -- rows that we return from the cursor (i.e. one
1300: -- for each assignment/pre-payment/reversal).
1301: hr_utility.set_location(l_procedure_name, 270);
1302: hr_utility.trace('Before inserting the action record');
1303:
1304: hr_utility.set_location('procpyr',3);
1305:
1306: select pay_assignment_actions_s.nextval
1300: -- for each assignment/pre-payment/reversal).
1301: hr_utility.set_location(l_procedure_name, 270);
1302: hr_utility.trace('Before inserting the action record');
1303:
1304: hr_utility.set_location('procpyr',3);
1305:
1306: select pay_assignment_actions_s.nextval
1307: into lockingactid
1308: from dual;
1319: end loop;
1320: close c_actions_with_assign_set;
1321:
1322: end if;
1323: hr_utility.set_location(l_procedure_name, 300);
1324: hr_utility.trace('End of the action cursor');
1325:
1326: end action_creation_for_ee;
1327:
1320: close c_actions_with_assign_set;
1321:
1322: end if;
1323: hr_utility.set_location(l_procedure_name, 300);
1324: hr_utility.trace('End of the action cursor');
1325:
1326: end action_creation_for_ee;
1327:
1328: ---------------------------------- action_creation_for_er -----------------------------
1431: c_actions_with_person_sql varchar2(10000); --6712851
1432: c_actions_where varchar2(10000); --6712851
1433:
1434: begin
1435: hr_utility.set_location('procpyr',1);
1436: hr_utility.trace('In the ER action cursor');
1437:
1438: /* 4152323 { */
1439: select effective_date,
1432: c_actions_where varchar2(10000); --6712851
1433:
1434: begin
1435: hr_utility.set_location('procpyr',1);
1436: hr_utility.trace('In the ER action cursor');
1437:
1438: /* 4152323 { */
1439: select effective_date,
1440: report_type,
1496: (p_ssn is null ) and
1497: (p_asg_set_id is null )) then
1498:
1499: if l_range_person_on = TRUE Then
1500: hr_utility.trace('Range Person ID Functionality is enabled') ;
1501: c_actions_no_selection_sql :=
1502: 'SELECT paa_arch.assignment_action_id,
1503: paa_arch.assignment_id,
1504: paa_arch.tax_unit_id,
1602: p_session_date);
1603: ELSE
1604: c_actions_no_selection_sql := c_actions_no_selection_sql || c_actions_where;
1605: END IF;
1606: hr_utility.trace(' c_actions_no_selection_sql' ||c_actions_no_selection_sql);
1607:
1608: end if ;
1609:
1610: OPEN c_actions_no_selection for c_actions_no_selection_sql;
1610: OPEN c_actions_no_selection for c_actions_no_selection_sql;
1611: num := 0;
1612:
1613: loop
1614: hr_utility.set_location('procpyr',2);
1615: hr_utility.trace('after the loop in action cursor');
1616: fetch c_actions_no_selection into lockedactid,assignid,greid,l_effective_end_date;
1617:
1618: if c_actions_no_selection%found then
1611: num := 0;
1612:
1613: loop
1614: hr_utility.set_location('procpyr',2);
1615: hr_utility.trace('after the loop in action cursor');
1616: fetch c_actions_no_selection into lockedactid,assignid,greid,l_effective_end_date;
1617:
1618: if c_actions_no_selection%found then
1619: num := num + 1;
1616: fetch c_actions_no_selection into lockedactid,assignid,greid,l_effective_end_date;
1617:
1618: if c_actions_no_selection%found then
1619: num := num + 1;
1620: hr_utility.trace('In the c_actions_no_selection%found in action cursor');
1621: else
1622: hr_utility.trace('In the c_actions_no_selection%notfound in action cursor');
1623: exit;
1624: end if;
1618: if c_actions_no_selection%found then
1619: num := num + 1;
1620: hr_utility.trace('In the c_actions_no_selection%found in action cursor');
1621: else
1622: hr_utility.trace('In the c_actions_no_selection%notfound in action cursor');
1623: exit;
1624: end if;
1625: -- we need to insert one action for each of the
1626: -- rows that we return from the cursor (i.e. one
1624: end if;
1625: -- we need to insert one action for each of the
1626: -- rows that we return from the cursor (i.e. one
1627: -- for each assignment/pre-payment/reversal).
1628: hr_utility.trace('Before inserting the action record');
1629:
1630: hr_utility.set_location('procpyr',3);
1631:
1632: select pay_assignment_actions_s.nextval
1626: -- rows that we return from the cursor (i.e. one
1627: -- for each assignment/pre-payment/reversal).
1628: hr_utility.trace('Before inserting the action record');
1629:
1630: hr_utility.set_location('procpyr',3);
1631:
1632: select pay_assignment_actions_s.nextval
1633: into lockingactid
1634: from dual;
1650:
1651: if p_loc_id is not null then
1652:
1653: if l_range_person_on = TRUE Then
1654: hr_utility.trace('Range Person ID Functionality is enabled') ;
1655: c_actions_with_location_sql :=
1656: 'SELECT paa_arch.assignment_action_id,
1657: paa_arch.assignment_id,
1658: paa_arch.tax_unit_id,
1742: p_session_date);
1743: ELSE
1744: c_actions_with_location_sql := c_actions_with_location_sql || c_actions_where;
1745: END IF;
1746: hr_utility.trace(' c_actions_with_location_sql ' ||c_actions_with_location_sql);
1747:
1748:
1749: OPEN c_actions_with_location for c_actions_with_location_sql;
1750: num := 0;
1749: OPEN c_actions_with_location for c_actions_with_location_sql;
1750: num := 0;
1751:
1752: loop
1753: hr_utility.set_location('procpyr',2);
1754: hr_utility.trace('after the loop in action cursor');
1755: fetch c_actions_with_location into lockedactid,assignid,greid,l_effective_end_date;
1756:
1757: if c_actions_with_location%found then
1750: num := 0;
1751:
1752: loop
1753: hr_utility.set_location('procpyr',2);
1754: hr_utility.trace('after the loop in action cursor');
1755: fetch c_actions_with_location into lockedactid,assignid,greid,l_effective_end_date;
1756:
1757: if c_actions_with_location%found then
1758: num := num + 1;
1755: fetch c_actions_with_location into lockedactid,assignid,greid,l_effective_end_date;
1756:
1757: if c_actions_with_location%found then
1758: num := num + 1;
1759: hr_utility.trace('In the c_actions_with_location%found in action cursor');
1760: else
1761: hr_utility.trace('In the c_actions_with_location%notfound in action cursor');
1762: exit;
1763: end if;
1757: if c_actions_with_location%found then
1758: num := num + 1;
1759: hr_utility.trace('In the c_actions_with_location%found in action cursor');
1760: else
1761: hr_utility.trace('In the c_actions_with_location%notfound in action cursor');
1762: exit;
1763: end if;
1764:
1765:
1765:
1766: -- we need to insert one action for each of the
1767: -- rows that we return from the cursor (i.e. one
1768: -- for each assignment/pre-payment/reversal).
1769: hr_utility.trace('Before inserting the action record');
1770:
1771: hr_utility.set_location('procpyr',3);
1772:
1773: select pay_assignment_actions_s.nextval
1767: -- rows that we return from the cursor (i.e. one
1768: -- for each assignment/pre-payment/reversal).
1769: hr_utility.trace('Before inserting the action record');
1770:
1771: hr_utility.set_location('procpyr',3);
1772:
1773: select pay_assignment_actions_s.nextval
1774: into lockingactid
1775: from dual;
1792:
1793: if p_org_id is not null then
1794:
1795: if l_range_person_on = TRUE Then
1796: hr_utility.trace('Range Person ID Functionality is enabled') ;
1797: c_actions_with_org_sql :=
1798: 'SELECT paa_arch.assignment_action_id,
1799: paa_arch.assignment_id,
1800: paa_arch.tax_unit_id,
1889: OPEN c_actions_with_org for c_actions_with_org_sql;
1890: num := 0;
1891:
1892: loop
1893: hr_utility.set_location('procpyr',2);
1894: hr_utility.trace('after the loop in c_actions_with_org');
1895: fetch c_actions_with_org into lockedactid,assignid,greid,l_effective_end_date;
1896:
1897: if c_actions_with_org%found then
1890: num := 0;
1891:
1892: loop
1893: hr_utility.set_location('procpyr',2);
1894: hr_utility.trace('after the loop in c_actions_with_org');
1895: fetch c_actions_with_org into lockedactid,assignid,greid,l_effective_end_date;
1896:
1897: if c_actions_with_org%found then
1898: num := num + 1;
1895: fetch c_actions_with_org into lockedactid,assignid,greid,l_effective_end_date;
1896:
1897: if c_actions_with_org%found then
1898: num := num + 1;
1899: hr_utility.trace('In the c_actions_with_org%found in action cursor');
1900: else
1901: hr_utility.trace('In the c_actions_with_org%notfound in action cursor');
1902: exit;
1903: end if;
1897: if c_actions_with_org%found then
1898: num := num + 1;
1899: hr_utility.trace('In the c_actions_with_org%found in action cursor');
1900: else
1901: hr_utility.trace('In the c_actions_with_org%notfound in action cursor');
1902: exit;
1903: end if;
1904:
1905:
1905:
1906: -- we need to insert one action for each of the
1907: -- rows that we return from the cursor (i.e. one
1908: -- for each assignment/pre-payment/reversal).
1909: hr_utility.trace('Before inserting the action record');
1910:
1911: hr_utility.set_location('procpyr',3);
1912:
1913: select pay_assignment_actions_s.nextval
1907: -- rows that we return from the cursor (i.e. one
1908: -- for each assignment/pre-payment/reversal).
1909: hr_utility.trace('Before inserting the action record');
1910:
1911: hr_utility.set_location('procpyr',3);
1912:
1913: select pay_assignment_actions_s.nextval
1914: into lockingactid
1915: from dual;
1984: /* Bug# 5513289 :Ending here */
1985: num := 0;
1986:
1987: loop
1988: hr_utility.set_location('procpyr',2);
1989: hr_utility.trace('after the loop in c_actions_with_person');
1990: fetch c_actions_with_person into lockedactid,assignid,greid,l_effective_end_date;
1991:
1992: if c_actions_with_person%found then
1985: num := 0;
1986:
1987: loop
1988: hr_utility.set_location('procpyr',2);
1989: hr_utility.trace('after the loop in c_actions_with_person');
1990: fetch c_actions_with_person into lockedactid,assignid,greid,l_effective_end_date;
1991:
1992: if c_actions_with_person%found then
1993: num := num + 1;
1990: fetch c_actions_with_person into lockedactid,assignid,greid,l_effective_end_date;
1991:
1992: if c_actions_with_person%found then
1993: num := num + 1;
1994: hr_utility.trace('In the c_actions_with_person%found in action cursor');
1995: else
1996: hr_utility.trace('In the c_actions_with_person%notfound in action cursor');
1997: exit;
1998: end if;
1992: if c_actions_with_person%found then
1993: num := num + 1;
1994: hr_utility.trace('In the c_actions_with_person%found in action cursor');
1995: else
1996: hr_utility.trace('In the c_actions_with_person%notfound in action cursor');
1997: exit;
1998: end if;
1999:
2000: -- we need to insert one action for each of the
1999:
2000: -- we need to insert one action for each of the
2001: -- rows that we return from the cursor (i.e. one
2002: -- for each assignment/pre-payment/reversal).
2003: hr_utility.trace('Before inserting the action record');
2004:
2005: hr_utility.set_location('procpyr',3);
2006:
2007: select pay_assignment_actions_s.nextval
2001: -- rows that we return from the cursor (i.e. one
2002: -- for each assignment/pre-payment/reversal).
2003: hr_utility.trace('Before inserting the action record');
2004:
2005: hr_utility.set_location('procpyr',3);
2006:
2007: select pay_assignment_actions_s.nextval
2008: into lockingactid
2009: from dual;
2025:
2026: if p_asg_set_id is not null then
2027:
2028: if l_range_person_on = TRUE Then
2029: hr_utility.trace('Range Person ID Functionality is enabled') ;
2030: c_actions_with_assign_sql :=
2031: 'SELECT paa_arch.assignment_action_id,
2032: paa_arch.assignment_id,
2033: paa_arch.tax_unit_id,
2126: OPEN c_actions_with_assign_set for c_actions_with_assign_sql;
2127: num := 0;
2128:
2129: loop
2130: hr_utility.set_location('procpyr',2);
2131: hr_utility.trace('after the loop in c_actions_with_assign_set');
2132: fetch c_actions_with_assign_set into lockedactid,assignid,greid,l_effective_end_date;
2133:
2134: if c_actions_with_assign_set%found then
2127: num := 0;
2128:
2129: loop
2130: hr_utility.set_location('procpyr',2);
2131: hr_utility.trace('after the loop in c_actions_with_assign_set');
2132: fetch c_actions_with_assign_set into lockedactid,assignid,greid,l_effective_end_date;
2133:
2134: if c_actions_with_assign_set%found then
2135: num := num + 1;
2132: fetch c_actions_with_assign_set into lockedactid,assignid,greid,l_effective_end_date;
2133:
2134: if c_actions_with_assign_set%found then
2135: num := num + 1;
2136: hr_utility.trace('In the c_actions_with_assign_set%found in action cursor');
2137: else
2138: hr_utility.trace('In the c_actions_with_assign_set%notfound in action cursor');
2139: exit;
2140: end if;
2134: if c_actions_with_assign_set%found then
2135: num := num + 1;
2136: hr_utility.trace('In the c_actions_with_assign_set%found in action cursor');
2137: else
2138: hr_utility.trace('In the c_actions_with_assign_set%notfound in action cursor');
2139: exit;
2140: end if;
2141:
2142: -- we need to insert one action for each of the
2141:
2142: -- we need to insert one action for each of the
2143: -- rows that we return from the cursor (i.e. one
2144: -- for each assignment/pre-payment/reversal).
2145: hr_utility.trace('Before inserting the action record');
2146:
2147: hr_utility.set_location('procpyr',3);
2148:
2149: select pay_assignment_actions_s.nextval
2143: -- rows that we return from the cursor (i.e. one
2144: -- for each assignment/pre-payment/reversal).
2145: hr_utility.trace('Before inserting the action record');
2146:
2147: hr_utility.set_location('procpyr',3);
2148:
2149: select pay_assignment_actions_s.nextval
2150: into lockingactid
2151: from dual;
2161: end loop;
2162: close c_actions_with_assign_set;
2163:
2164: end if;
2165: hr_utility.trace('End of the action cursor');
2166:
2167: end action_creation_for_er;
2168:
2169: ---------------------------------- action_creation -----------------------------
2198:
2199: l_report_type pay_payroll_actions.report_type%TYPE;
2200:
2201: begin
2202: -- hr_utility.trace_on(null,'ORACLE');
2203: hr_utility.set_location('procpyr',1);
2204: hr_utility.trace('In the action cursor');
2205: Begin
2206: select to_number(hr_us_w2_mt.get_parameter('Year',ppa1.legislative_parameters)),
2199: l_report_type pay_payroll_actions.report_type%TYPE;
2200:
2201: begin
2202: -- hr_utility.trace_on(null,'ORACLE');
2203: hr_utility.set_location('procpyr',1);
2204: hr_utility.trace('In the action cursor');
2205: Begin
2206: select to_number(hr_us_w2_mt.get_parameter('Year',ppa1.legislative_parameters)),
2207: to_number(hr_us_w2_mt.get_parameter('GRE_ID',ppa1.legislative_parameters)),
2200:
2201: begin
2202: -- hr_utility.trace_on(null,'ORACLE');
2203: hr_utility.set_location('procpyr',1);
2204: hr_utility.trace('In the action cursor');
2205: Begin
2206: select to_number(hr_us_w2_mt.get_parameter('Year',ppa1.legislative_parameters)),
2207: to_number(hr_us_w2_mt.get_parameter('GRE_ID',ppa1.legislative_parameters)),
2208: to_number(hr_us_w2_mt.get_parameter('ORG_ID',ppa1.legislative_parameters)),
2242: hr_us_w2_mt.get_parameter
2243: ('TRANSFER_GRE',ppa.legislative_parameters);
2244: Exception
2245: when no_data_found then
2246: hr_utility.trace('Legislative parameters not found for pactid '||to_char(pactid));
2247: raise;
2248: End ;
2249: hr_utility.trace('report_type = '||l_report_type);
2250: hr_utility.trace('l_locality_code = '||l_locality_code);
2245: when no_data_found then
2246: hr_utility.trace('Legislative parameters not found for pactid '||to_char(pactid));
2247: raise;
2248: End ;
2249: hr_utility.trace('report_type = '||l_report_type);
2250: hr_utility.trace('l_locality_code = '||l_locality_code);
2251:
2252:
2253: /* Now the SSN value set return person_id. Since the submittion is based on
2246: hr_utility.trace('Legislative parameters not found for pactid '||to_char(pactid));
2247: raise;
2248: End ;
2249: hr_utility.trace('report_type = '||l_report_type);
2250: hr_utility.trace('l_locality_code = '||l_locality_code);
2251:
2252:
2253: /* Now the SSN value set return person_id. Since the submittion is based on
2254: selection citeria only only value can be entered so in case l_ssn is not
2280: elsif l_report_type = 'PRW2PAPER' then /*Puerto Rico Employee W2*/
2281:
2282: l_state_code :=null;
2283:
2284: hr_utility.trace('Action creation for Puerto Rico Employee W2');
2285: hr_utility.trace('stperson ' ||to_char(stperson));
2286: hr_utility.trace('endperson ' ||to_char(endperson));
2287: hr_utility.trace('l_eoy_payroll_action_id = '||to_char(l_eoy_payroll_action_id));
2288:
2281:
2282: l_state_code :=null;
2283:
2284: hr_utility.trace('Action creation for Puerto Rico Employee W2');
2285: hr_utility.trace('stperson ' ||to_char(stperson));
2286: hr_utility.trace('endperson ' ||to_char(endperson));
2287: hr_utility.trace('l_eoy_payroll_action_id = '||to_char(l_eoy_payroll_action_id));
2288:
2289: hr_utility.trace('pactid = '||to_char(pactid));
2282: l_state_code :=null;
2283:
2284: hr_utility.trace('Action creation for Puerto Rico Employee W2');
2285: hr_utility.trace('stperson ' ||to_char(stperson));
2286: hr_utility.trace('endperson ' ||to_char(endperson));
2287: hr_utility.trace('l_eoy_payroll_action_id = '||to_char(l_eoy_payroll_action_id));
2288:
2289: hr_utility.trace('pactid = '||to_char(pactid));
2290: action_creation_for_ee(pactid,stperson,endperson,chunk,l_year,
2283:
2284: hr_utility.trace('Action creation for Puerto Rico Employee W2');
2285: hr_utility.trace('stperson ' ||to_char(stperson));
2286: hr_utility.trace('endperson ' ||to_char(endperson));
2287: hr_utility.trace('l_eoy_payroll_action_id = '||to_char(l_eoy_payroll_action_id));
2288:
2289: hr_utility.trace('pactid = '||to_char(pactid));
2290: action_creation_for_ee(pactid,stperson,endperson,chunk,l_year,
2291: l_gre_id,l_org_id,l_loc_id,l_per_id,
2285: hr_utility.trace('stperson ' ||to_char(stperson));
2286: hr_utility.trace('endperson ' ||to_char(endperson));
2287: hr_utility.trace('l_eoy_payroll_action_id = '||to_char(l_eoy_payroll_action_id));
2288:
2289: hr_utility.trace('pactid = '||to_char(pactid));
2290: action_creation_for_ee(pactid,stperson,endperson,chunk,l_year,
2291: l_gre_id,l_org_id,l_loc_id,l_per_id,
2292: l_ssn,l_state_code,l_asg_set_id,
2293: l_session_date,l_eoy_payroll_action_id,
2354: from pay_payroll_actions ppa
2355: where ppa.payroll_action_id = payactid;
2356:
2357: exception when no_data_found then
2358: hr_utility.trace('Error in Sort Procedure - getting legislative param');
2359: raise;
2360: end;
2361: /* changed this with the if statement below
2362: begin
2379: if l_year_end > l_dt then
2380: l_dt := l_year_end;
2381: end if;
2382:
2383: hr_utility.trace('Beginning of the sort_action cursor');
2384:
2385: sqlstr :=
2386: 'select mt.rowid
2387: from hr_organization_units hou, hr_locations_all hl, per_periods_of_service pps,
2426: -- changed on 11sep02
2427: -- for update of paf.assignment_id';
2428:
2429: len := length(sqlstr); -- return the length of the string.
2430: hr_utility.trace('End of the sort_Action cursor');
2431: end sort_action;
2432: --
2433: ------------------------------ get_parameter -------------------------------
2434: function get_parameter(name in varchar2,