231: l_frequency per_all_assignments_f.frequency%type;
232: --
233: Begin
234: --
235: hr_utility.set_location('hr_us_reports.get_salary',5);
236: hr_utility.trace('p_business_group_id ->'||to_char(p_business_group_id));
237: hr_utility.trace('p_assignment_id ->'||to_char(p_assignment_id));
238: hr_utility.trace('p_report_date ->'||p_report_date );
239: --
232: --
233: Begin
234: --
235: hr_utility.set_location('hr_us_reports.get_salary',5);
236: hr_utility.trace('p_business_group_id ->'||to_char(p_business_group_id));
237: hr_utility.trace('p_assignment_id ->'||to_char(p_assignment_id));
238: hr_utility.trace('p_report_date ->'||p_report_date );
239: --
240: Begin
233: Begin
234: --
235: hr_utility.set_location('hr_us_reports.get_salary',5);
236: hr_utility.trace('p_business_group_id ->'||to_char(p_business_group_id));
237: hr_utility.trace('p_assignment_id ->'||to_char(p_assignment_id));
238: hr_utility.trace('p_report_date ->'||p_report_date );
239: --
240: Begin
241: --
234: --
235: hr_utility.set_location('hr_us_reports.get_salary',5);
236: hr_utility.trace('p_business_group_id ->'||to_char(p_business_group_id));
237: hr_utility.trace('p_assignment_id ->'||to_char(p_assignment_id));
238: hr_utility.trace('p_report_date ->'||p_report_date );
239: --
240: Begin
241: --
242: Select
280: and asg.effective_end_date
281: And p_report_date between pee.effective_start_date
282: and pee.effective_end_date;
283: --
284: hr_utility.trace('l_effective_start_date ->'||l_effective_start_date);
285: hr_utility.trace('l_pay_basis ->'||l_pay_basis);
286: hr_utility.trace('l_normal_hours ->'||to_char(l_normal_hours));
287: hr_utility.trace('l_work_schedule ->'||l_work_schedule);
288: hr_utility.trace('l_salary ->'||to_char(l_salary));
281: And p_report_date between pee.effective_start_date
282: and pee.effective_end_date;
283: --
284: hr_utility.trace('l_effective_start_date ->'||l_effective_start_date);
285: hr_utility.trace('l_pay_basis ->'||l_pay_basis);
286: hr_utility.trace('l_normal_hours ->'||to_char(l_normal_hours));
287: hr_utility.trace('l_work_schedule ->'||l_work_schedule);
288: hr_utility.trace('l_salary ->'||to_char(l_salary));
289: --
282: and pee.effective_end_date;
283: --
284: hr_utility.trace('l_effective_start_date ->'||l_effective_start_date);
285: hr_utility.trace('l_pay_basis ->'||l_pay_basis);
286: hr_utility.trace('l_normal_hours ->'||to_char(l_normal_hours));
287: hr_utility.trace('l_work_schedule ->'||l_work_schedule);
288: hr_utility.trace('l_salary ->'||to_char(l_salary));
289: --
290: exception
283: --
284: hr_utility.trace('l_effective_start_date ->'||l_effective_start_date);
285: hr_utility.trace('l_pay_basis ->'||l_pay_basis);
286: hr_utility.trace('l_normal_hours ->'||to_char(l_normal_hours));
287: hr_utility.trace('l_work_schedule ->'||l_work_schedule);
288: hr_utility.trace('l_salary ->'||to_char(l_salary));
289: --
290: exception
291: when NO_DATA_FOUND then RETURN NULL;
284: hr_utility.trace('l_effective_start_date ->'||l_effective_start_date);
285: hr_utility.trace('l_pay_basis ->'||l_pay_basis);
286: hr_utility.trace('l_normal_hours ->'||to_char(l_normal_hours));
287: hr_utility.trace('l_work_schedule ->'||l_work_schedule);
288: hr_utility.trace('l_salary ->'||to_char(l_salary));
289: --
290: exception
291: when NO_DATA_FOUND then RETURN NULL;
292: when others then
289: --
290: exception
291: when NO_DATA_FOUND then RETURN NULL;
292: when others then
293: hr_utility.set_location('hr_us_reports.get_salary',10);
294: RETURN NULL;
295: --
296: end;
297: --
299: l_annual_salary := hr_us_ff_udfs.Convert_Period_Type
300: (p_business_group_id,null,l_work_schedule,l_normal_hours,l_salary,l_pay_basis,'Year',
301: null,null,l_frequency); -- Bug 3669973
302: --
303: hr_utility.set_location('hr_us_reports.get_salary',15);
304: hr_utility.trace('l_annual_salary ->'||to_char(l_annual_salary));
305: --
306: return (l_annual_salary);
307: --
300: (p_business_group_id,null,l_work_schedule,l_normal_hours,l_salary,l_pay_basis,'Year',
301: null,null,l_frequency); -- Bug 3669973
302: --
303: hr_utility.set_location('hr_us_reports.get_salary',15);
304: hr_utility.trace('l_annual_salary ->'||to_char(l_annual_salary));
305: --
306: return (l_annual_salary);
307: --
308: end get_salary;
342:
343: --
344: begin
345: --
346: hr_utility.set_location('Entered hr_us_reports.get_new_hire_contact',5);
347: --
348: OPEN c_new_hire_record;
349:
350: --LOOP
358: --END LOOP;
359:
360: CLOSE c_new_hire_record;
361: --
362: hr_utility.trace('Contact name : '||v_contact_name);
363: hr_utility.trace('Contact title : '||v_contact_title);
364: hr_utility.set_location('Leaving hr_us_reports.get_new_hire_contact',10);
365: --
366: exception
359:
360: CLOSE c_new_hire_record;
361: --
362: hr_utility.trace('Contact name : '||v_contact_name);
363: hr_utility.trace('Contact title : '||v_contact_title);
364: hr_utility.set_location('Leaving hr_us_reports.get_new_hire_contact',10);
365: --
366: exception
367: when no_data_found then
360: CLOSE c_new_hire_record;
361: --
362: hr_utility.trace('Contact name : '||v_contact_name);
363: hr_utility.trace('Contact title : '||v_contact_title);
364: hr_utility.set_location('Leaving hr_us_reports.get_new_hire_contact',10);
365: --
366: exception
367: when no_data_found then
368: hr_utility.set_location('Error found in hr_us_reports.get_new_hire.contact',20);
364: hr_utility.set_location('Leaving hr_us_reports.get_new_hire_contact',10);
365: --
366: exception
367: when no_data_found then
368: hr_utility.set_location('Error found in hr_us_reports.get_new_hire.contact',20);
369: NULL;
370: when others then
371: hr_utility.set_location('Error found in hr_us_reports.get_new_hire_contact',15);
372: --
367: when no_data_found then
368: hr_utility.set_location('Error found in hr_us_reports.get_new_hire.contact',20);
369: NULL;
370: when others then
371: hr_utility.set_location('Error found in hr_us_reports.get_new_hire_contact',15);
372: --
373: end get_new_hire_contact;
374: --
375: --
391: where location_id = p_location_id;
392: --
393: begin
394: --
395: hr_utility.set_location('Entered hr_us_reports.get_address', 5);
396: --
397: open get_location_record;
398: --
399: fetch get_location_record into v_address_line_1, v_address_line_2,
398: --
399: fetch get_location_record into v_address_line_1, v_address_line_2,
400: v_address_line_3, v_town_or_city, v_region_2, v_postal_code;
401: --
402: hr_utility.set_location('hr_us_reports.get_address', 10);
403: --
404: if get_location_record%found
405: then
406: --
433: end if;
434: --
435: close get_location_record;
436: --
437: hr_utility.set_location('hr_us_reports.get_address', 15);
438: --
439: hr_utility.trace('location is '|| f_address);
440: p_address := f_address;
441: --
435: close get_location_record;
436: --
437: hr_utility.set_location('hr_us_reports.get_address', 15);
438: --
439: hr_utility.trace('location is '|| f_address);
440: p_address := f_address;
441: --
442: end if;
443: --
442: end if;
443: --
444: exception
445: when others then
446: hr_utility.trace('Error in hr_us_reports.get_address');
447: hr_utility.set_location('hr_us_reports.get_address', 20);
448: --
449: end get_address;
450: --
443: --
444: exception
445: when others then
446: hr_utility.trace('Error in hr_us_reports.get_address');
447: hr_utility.set_location('hr_us_reports.get_address', 20);
448: --
449: end get_address;
450: --
451: --
498: substr(address_record.postal_code,1,12);
499: end if;
500: --
501: close get_location_record;
502: hr_utility.trace('location is '|| f_address);
503: p_address := f_address;
504: end if;
505: end get_address_31;
506: --
541: --
542: p_addr_line1 := f_addr_line1;
543: p_addr_line2 := f_addr_line2;
544: p_city_state_zip := f_city_state_zip;
545: hr_utility.trace('address is '|| f_addr_line1 );
546: hr_utility.trace( f_addr_line2 );
547: hr_utility.trace( f_city_state_zip );
548: end if;
549: end get_address_3lines;
542: p_addr_line1 := f_addr_line1;
543: p_addr_line2 := f_addr_line2;
544: p_city_state_zip := f_city_state_zip;
545: hr_utility.trace('address is '|| f_addr_line1 );
546: hr_utility.trace( f_addr_line2 );
547: hr_utility.trace( f_city_state_zip );
548: end if;
549: end get_address_3lines;
550: --
543: p_addr_line2 := f_addr_line2;
544: p_city_state_zip := f_city_state_zip;
545: hr_utility.trace('address is '|| f_addr_line1 );
546: hr_utility.trace( f_addr_line2 );
547: hr_utility.trace( f_city_state_zip );
548: end if;
549: end get_address_3lines;
550: --
551:
593: and nvl(date_to, sysdate) >= sysdate;
594: --
595: begin
596: --
597: hr_utility.set_location('Entered hr_us_reports.get_employee_address', 0);
598: --
599: open get_address_record;
600: --
601: fetch get_address_record into v_address_line1, v_address_line2,
600: --
601: fetch get_address_record into v_address_line1, v_address_line2,
602: v_address_line3, v_town_or_city, v_region_2, v_postal_code;
603: --
604: hr_utility.set_location('Entered hr_us_reports.get_employee_address', 5);
605: --
606: if get_address_record%found
607: then
608: --
639: --
640: /* 9912897 - Commented this dbug DML stmt.
641: insert into pay_us_rpt_totals(ATTRIBUTE30,attribute1) values(f_address,'test1');
642: commit;*/
643: hr_utility.set_location('hr_us_reports.get_employee_address', 10);
644: close get_address_record;
645: --
646: hr_utility.trace('Person Address is '|| f_address);
647: --
642: commit;*/
643: hr_utility.set_location('hr_us_reports.get_employee_address', 10);
644: close get_address_record;
645: --
646: hr_utility.trace('Person Address is '|| f_address);
647: --
648: p_address := f_address;
649: --
650: end if;
648: p_address := f_address;
649: --
650: end if;
651: --
652: hr_utility.set_location('Leaving hr_us_reports.get_employee_address', 15);
653: --
654: exception when NO_DATA_FOUND then NULL;
655: --
656: end get_employee_address;
695: f_address := f_address ||address_record.region_2||' '||
696: address_record.postal_code;
697: end if;
698: close get_location_record;
699: hr_utility.trace('location is '|| f_address);
700: p_address := f_address;
701: end if;
702: end get_county_address;
703: --
734: f_activity := f_activity ||
735: rpad(activity_record.activity_line4,40,' ');
736: end if;
737: close get_establishment_record;
738: hr_utility.trace('establishment activity is '|| f_activity);
739: p_activity := f_activity;
740: end if;
741: end get_activity;
742: --
747: l_consolidation_set_name VARCHAR2(60);
748: --
749: begin
750: --
751: hr_utility.trace('Entered Get_consolidation_set');
752: --
753: begin
754: hr_utility.set_location('hr_us_reports.get_consolidation_set',5);
755: SELECT consolidation_set_name
750: --
751: hr_utility.trace('Entered Get_consolidation_set');
752: --
753: begin
754: hr_utility.set_location('hr_us_reports.get_consolidation_set',5);
755: SELECT consolidation_set_name
756: INTO l_consolidation_set_name
757: FROM pay_consolidation_sets
758: WHERE consolidation_set_id = p_consolidation_set_id;
772: l_payment_type_name VARCHAR2(60);
773: --
774: begin
775: --
776: hr_utility.trace('Entered Get_payment_type_name');
777: --
778: begin
779: hr_utility.set_location('hr_us_reports.get_payment_type_name',5);
780: SELECT ppt_tl.payment_type_name
775: --
776: hr_utility.trace('Entered Get_payment_type_name');
777: --
778: begin
779: hr_utility.set_location('hr_us_reports.get_payment_type_name',5);
780: SELECT ppt_tl.payment_type_name
781: INTO l_payment_type_name
782: FROM pay_payment_types_tl ppt_tl,
783: pay_payment_types ppt
800: l_element_type_name VARCHAR2(60);
801: --
802: begin
803: --
804: hr_utility.trace('Entered Get_element_type_name');
805: --
806: begin
807: hr_utility.set_location('hr_us_reports.get_element_type_name',5);
808: SELECT pet_tl.element_name
803: --
804: hr_utility.trace('Entered Get_element_type_name');
805: --
806: begin
807: hr_utility.set_location('hr_us_reports.get_element_type_name',5);
808: SELECT pet_tl.element_name
809: INTO l_element_type_name
810: FROM pay_element_classifications pec,
811: pay_element_types_f_tl pet_tl,
830: l_tax_unit_name VARCHAR2(240);
831: --
832: begin
833: --
834: hr_utility.trace('Entered Get_tax_unit');
835: --
836: begin
837: hr_utility.set_location('hr_us_reports.get_tax_unit',5);
838: SELECT name
833: --
834: hr_utility.trace('Entered Get_tax_unit');
835: --
836: begin
837: hr_utility.set_location('hr_us_reports.get_tax_unit',5);
838: SELECT name
839: INTO l_tax_unit_name
840: FROM hr_organization_units
841: WHERE organization_id = p_tax_unit_id;
855: l_person_name VARCHAR2(240);
856: --
857: begin
858: --
859: hr_utility.trace('Entered get_person_name');
860: --
861: begin
862: hr_utility.set_location('hr_us_reports.get_person_name',5);
863: SELECT distinct full_name
858: --
859: hr_utility.trace('Entered get_person_name');
860: --
861: begin
862: hr_utility.set_location('hr_us_reports.get_person_name',5);
863: SELECT distinct full_name
864: INTO l_person_name
865: FROM per_people_f ppf
866: WHERE person_id = p_person_id
885: l_payroll_action_name VARCHAR2(60);
886: --
887: begin
888: --
889: hr_utility.trace('Entered Get_payroll_action');
890: --
891: begin
892: hr_utility.set_location('hr_us_reports.get_payroll_action',5);
893: SELECT action_type
888: --
889: hr_utility.trace('Entered Get_payroll_action');
890: --
891: begin
892: hr_utility.set_location('hr_us_reports.get_payroll_action',5);
893: SELECT action_type
894: INTO l_action_type
895: FROM pay_payroll_actions
896: WHERE payroll_action_id = p_payroll_action_id;
898: exception when NO_DATA_FOUND then RETURN NULL;
899: end;
900: if l_action_type = 'P' then
901: begin
902: hr_utility.set_location('hr_us_reports.get_payroll_action',10);
903: SELECT ppa.display_run_number || '-' || pcs.consolidation_set_name
904: || '-' || ppa.effective_date || '-' || ppa.payroll_action_id
905: INTO l_payroll_action_name
906: FROM pay_consolidation_sets pcs,
911: when no_data_found then RETURN NULL;
912: end;
913: elsif l_action_type = 'R' then
914: begin
915: hr_utility.set_location('hr_us_reports.get_payroll_action',15);
916: SELECT ppa.display_run_number || '-' || has.assignment_set_name
917: || '-' || pes.element_set_name
918: INTO l_payroll_action_name
919: FROM hr_assignment_sets has,
958: l_legislation_code VARCHAR2(30);
959: --
960: begin
961: --
962: hr_utility.trace('Entered Get_legislation_code');
963: --
964: begin
965: hr_utility.set_location('hr_us_reports.get_legislation_code',5);
966: SELECT org_information9
961: --
962: hr_utility.trace('Entered Get_legislation_code');
963: --
964: begin
965: hr_utility.set_location('hr_us_reports.get_legislation_code',5);
966: SELECT org_information9
967: INTO l_legislation_code
968: FROM hr_organization_information
969: WHERE organization_id = p_business_group_id
988: l_found BOOLEAN;
989: --
990: begin
991: --
992: hr_utility.trace('Entered Get_defined_balance_id');
993: --
994: -- Search for the defined balance in the Cache.
995: --
996: l_defbal_name := p_balance_name||p_dimension_suffix||p_business_group_id;
1007: -- If the balance is not in the Cache get it from the database.
1008: --
1009: if (l_found = FALSE) then
1010: begin
1011: hr_utility.set_location('hr_us_reports.get_defined_balance_id',5);
1012: /* Legislation code is added in this query so that it does not
1013: fetch multiple values after Canadian Payroll is installed - mmukherj*/
1014: SELECT pdb.defined_balance_id
1015: INTO l_defined_balance_id
1048: l_defined_balance_id NUMBER;
1049: --
1050: begin
1051: --
1052: hr_utility.trace('Entered Get_startup_defined_balance');
1053: --
1054: begin
1055: hr_utility.set_location('hr_us_reports.get_startup_defined_balance',5);
1056: SELECT pdb.defined_balance_id
1051: --
1052: hr_utility.trace('Entered Get_startup_defined_balance');
1053: --
1054: begin
1055: hr_utility.set_location('hr_us_reports.get_startup_defined_balance',5);
1056: SELECT pdb.defined_balance_id
1057: INTO l_defined_balance_id
1058: FROM pay_defined_balances pdb
1059: , pay_balance_dimensions pbd
1082: l_balance_type_name VARCHAR2(30);
1083: --
1084: begin
1085: --
1086: hr_utility.trace('Entered Get_defined_balance_by_type');
1087: --
1088: -- **NOTE** We do not yet have the 'US_TAX DEDUCTIONS' category seeded yet.
1089: --
1090: hr_utility.set_location('hr_us_reports.get_defined_balance_by_type',5);
1086: hr_utility.trace('Entered Get_defined_balance_by_type');
1087: --
1088: -- **NOTE** We do not yet have the 'US_TAX DEDUCTIONS' category seeded yet.
1089: --
1090: hr_utility.set_location('hr_us_reports.get_defined_balance_by_type',5);
1091: --
1092: IF
1093: p_box_num = '10' THEN
1094: l_balance_type_name := 'Dependent Care'; -- *OK*
1114: when NO_DATA_FOUND then RETURN NULL;
1115: end;
1116: --
1117: begin
1118: hr_utility.set_location('hr_us_reports.get_defined_balance_by_type',10);
1119: --
1120: SELECT pdb.defined_balance_id
1121: INTO l_defined_balance_id
1122: FROM pay_defined_balances pdb
1142: --
1143: v_benefit_class_name ben_benefit_classifications.benefit_classification_name%type;
1144: --
1145: begin
1146: hr_utility.trace('Entered hr_reports.get_ben_class_name');
1147: --
1148: hr_utility.set_location('hr_reports.get_ben_class_name',5);
1149: if p_benefit_classification_id is null then
1150: null;
1144: --
1145: begin
1146: hr_utility.trace('Entered hr_reports.get_ben_class_name');
1147: --
1148: hr_utility.set_location('hr_reports.get_ben_class_name',5);
1149: if p_benefit_classification_id is null then
1150: null;
1151: else
1152: begin
1149: if p_benefit_classification_id is null then
1150: null;
1151: else
1152: begin
1153: hr_utility.set_location('hr_reports.get_ben_class_name',10);
1154: select benefit_classification_name
1155: into v_benefit_class_name
1156: from ben_benefit_classifications
1157: where benefit_classification_id = p_benefit_classification_id;
1159: when no_data_found then RETURN NULL;
1160: end;
1161: end if;
1162: --
1163: hr_utility.trace('Leaving hr_reports.get_ben_class_name');
1164: --
1165: return v_benefit_class_name;
1166: --
1167: end get_ben_class_name;
1172: --
1173: v_qualifying_event_meaning hr_lookups.meaning%type;
1174: --
1175: BEGIN
1176: hr_utility.trace('Entered hr_reports.get_cobra_qualifying_event');
1177: --
1178: hr_utility.set_location('hr_reports.get_cobra_qualifying_event',5);
1179: IF p_qualifying_event IS NULL
1180: THEN
1174: --
1175: BEGIN
1176: hr_utility.trace('Entered hr_reports.get_cobra_qualifying_event');
1177: --
1178: hr_utility.set_location('hr_reports.get_cobra_qualifying_event',5);
1179: IF p_qualifying_event IS NULL
1180: THEN
1181: NULL;
1182: ELSE
1180: THEN
1181: NULL;
1182: ELSE
1183: BEGIN
1184: hr_utility.set_location('hr_reports.get_cobra_qualifying_event',10);
1185: SELECT meaning
1186: INTO v_qualifying_event_meaning
1187: FROM hr_lookups
1188: WHERE lookup_type = 'US_COBRA_EVENT'
1191: WHEN no_data_found THEN RETURN NULL;
1192: END;
1193: END IF;
1194: --
1195: hr_utility.trace('Leaving hr_reports.get_cobra_qualifying_event');
1196: --
1197: return v_qualifying_event_meaning;
1198: --
1199: END get_cobra_qualifying_event;
1204: --
1205: v_cobra_status_meaning hr_lookups.meaning%type;
1206: --
1207: BEGIN
1208: hr_utility.trace('Entered hr_reports.get_cobra_status');
1209: --
1210: hr_utility.set_location('hr_reports.get_cobra_status',5);
1211: IF p_cobra_status IS NULL
1212: THEN
1206: --
1207: BEGIN
1208: hr_utility.trace('Entered hr_reports.get_cobra_status');
1209: --
1210: hr_utility.set_location('hr_reports.get_cobra_status',5);
1211: IF p_cobra_status IS NULL
1212: THEN
1213: NULL;
1214: ELSE
1212: THEN
1213: NULL;
1214: ELSE
1215: BEGIN
1216: hr_utility.set_location('hr_reports.get_cobra_status',10);
1217: SELECT meaning
1218: INTO v_cobra_status_meaning
1219: FROM hr_lookups
1220: WHERE lookup_type = 'US_COBRA_STATUS'
1223: WHEN no_data_found THEN RETURN NULL;
1224: END;
1225: END IF;
1226: --
1227: hr_utility.trace('Leaving hr_reports.get_cobra_status');
1228: --
1229: return v_cobra_status_meaning;
1230: --
1231: END get_cobra_status;
1262: tax_unit_flag := 'N';
1263: OPEN get_parent;
1264: WHILE tax_unit_flag = 'N' LOOP
1265: FETCH get_parent INTO parent_tax_unit_id;
1266: hr_utility.trace('Parent tax unit >'||parent_tax_unit_id);
1267: EXIT WHEN get_parent%NOTFOUND;
1268: hr_utility.trace('Parent tax unit >'||parent_tax_unit_id);
1269: /* sackumar */
1270: begin
1264: WHILE tax_unit_flag = 'N' LOOP
1265: FETCH get_parent INTO parent_tax_unit_id;
1266: hr_utility.trace('Parent tax unit >'||parent_tax_unit_id);
1267: EXIT WHEN get_parent%NOTFOUND;
1268: hr_utility.trace('Parent tax unit >'||parent_tax_unit_id);
1269: /* sackumar */
1270: begin
1271: SELECT 'Y'
1272: INTO tax_unit_flag
1289: */
1290: END LOOP;
1291: CLOSE get_parent;
1292: --
1293: hr_utility.trace('Est tax unit >'||parent_tax_unit_id);
1294: return (parent_tax_unit_id);
1295: --
1296: end get_est_tax_unit;
1297: --
1368: hr_tax_unit_flag := 'N';
1369: l_proc := 'get_hr_est_tax_unit';
1370:
1371: --
1372: hr_utility.set_location('Entering...' || l_proc,10);
1373: OPEN check_if_top_org;
1374: LOOP
1375: BEGIN
1376: FETCH check_if_top_org INTO hr_tax_unit_id;
1383: CLOSE check_if_top_org;
1384: --
1385: IF p_starting_org_id = hr_tax_unit_id
1386: THEN
1387: hr_utility.set_location(l_proc,20);
1388: parent_hr_tax_unit_id := p_starting_org_id;
1389: --
1390: ELSE
1391: --
1393: OPEN get_hr_parent;
1394: WHILE hr_tax_unit_flag = 'N'
1395: LOOP
1396: FETCH get_hr_parent INTO parent_hr_tax_unit_id;
1397: --hr_utility.trace('Parent hr_tax unit >'||parent_hr_tax_unit_id);
1398: EXIT WHEN get_hr_parent%NOTFOUND;
1399: hr_utility.trace('Parent hr_tax unit >'||parent_hr_tax_unit_id);
1400:
1401: /* commented out for BUG3141907
1395: LOOP
1396: FETCH get_hr_parent INTO parent_hr_tax_unit_id;
1397: --hr_utility.trace('Parent hr_tax unit >'||parent_hr_tax_unit_id);
1398: EXIT WHEN get_hr_parent%NOTFOUND;
1399: hr_utility.trace('Parent hr_tax unit >'||parent_hr_tax_unit_id);
1400:
1401: /* commented out for BUG3141907
1402: --
1403: SELECT decode(hr_tax_unit_id,'','N','Y')
1409: */
1410: --
1411: -- BUG3141907
1412: --
1413: hr_utility.set_location(l_proc,30);
1414: open csr_tax_unit_flag(parent_hr_tax_unit_id);
1415: hr_utility.set_location(l_proc,31);
1416: fetch csr_tax_unit_flag into l_tax_unit_id;
1417: if csr_tax_unit_flag%found then
1411: -- BUG3141907
1412: --
1413: hr_utility.set_location(l_proc,30);
1414: open csr_tax_unit_flag(parent_hr_tax_unit_id);
1415: hr_utility.set_location(l_proc,31);
1416: fetch csr_tax_unit_flag into l_tax_unit_id;
1417: if csr_tax_unit_flag%found then
1418: hr_utility.set_location(l_proc,40);
1419: hr_tax_unit_flag := 'Y';
1414: open csr_tax_unit_flag(parent_hr_tax_unit_id);
1415: hr_utility.set_location(l_proc,31);
1416: fetch csr_tax_unit_flag into l_tax_unit_id;
1417: if csr_tax_unit_flag%found then
1418: hr_utility.set_location(l_proc,40);
1419: hr_tax_unit_flag := 'Y';
1420: else
1421: hr_utility.set_location(l_proc,50);
1422: hr_tax_unit_flag := 'N';
1417: if csr_tax_unit_flag%found then
1418: hr_utility.set_location(l_proc,40);
1419: hr_tax_unit_flag := 'Y';
1420: else
1421: hr_utility.set_location(l_proc,50);
1422: hr_tax_unit_flag := 'N';
1423: end if;
1424: close csr_tax_unit_flag;
1425:
1422: hr_tax_unit_flag := 'N';
1423: end if;
1424: close csr_tax_unit_flag;
1425:
1426: hr_utility.trace('hr_tax_unit_flag > '||hr_tax_unit_flag);
1427: hr_utility.set_location(l_proc,50);
1428: END LOOP;
1429: CLOSE get_hr_parent;
1430: --
1423: end if;
1424: close csr_tax_unit_flag;
1425:
1426: hr_utility.trace('hr_tax_unit_flag > '||hr_tax_unit_flag);
1427: hr_utility.set_location(l_proc,50);
1428: END LOOP;
1429: CLOSE get_hr_parent;
1430: --
1431: --
1430: --
1431: --
1432: END IF;
1433: --
1434: hr_utility.trace('Est hr_tax unit >'||parent_hr_tax_unit_id);
1435: hr_utility.set_location('Leaving...' || l_proc,100);
1436: return (parent_hr_tax_unit_id);
1437: --
1438: end get_hr_est_tax_unit;
1431: --
1432: END IF;
1433: --
1434: hr_utility.trace('Est hr_tax unit >'||parent_hr_tax_unit_id);
1435: hr_utility.set_location('Leaving...' || l_proc,100);
1436: return (parent_hr_tax_unit_id);
1437: --
1438: end get_hr_est_tax_unit;
1439: --
1468: l_state_name VARCHAR2(60);
1469: --
1470: begin
1471: --
1472: hr_utility.set_location('Entered hr_us_reports.get_state_name',5);
1473: --
1474: SELECT state_name
1475: INTO l_state_name
1476: FROM pay_us_states
1475: INTO l_state_name
1476: FROM pay_us_states
1477: WHERE state_abbrev = p_state_code;
1478: --
1479: hr_utility.set_location('Leaving hr_us_reports.get_state_name',10);
1480: --
1481: return l_state_name;
1482: --
1483: exception when NO_DATA_FOUND then RETURN NULL;
1492: l_org_name VARCHAR2(240);
1493: --
1494: begin
1495: --
1496: hr_utility.set_location('Entered hr_us_reports.get_org_name',5);
1497: --
1498: SELECT name
1499: INTO l_org_name
1500: FROM hr_organization_units
1500: FROM hr_organization_units
1501: WHERE organization_id = p_organization_id
1502: AND business_group_id + 0 = p_business_group_id;
1503: --
1504: hr_utility.set_location('Leaving hr_us_reports.get_org_name',10);
1505: return l_org_name;
1506: --
1507: exception when NO_DATA_FOUND then RETURN NULL;
1508: when others then
1505: return l_org_name;
1506: --
1507: exception when NO_DATA_FOUND then RETURN NULL;
1508: when others then
1509: hr_utility.set_location('Error found in hr_us_reports.get_org_name',15);
1510: RETURN NULL;
1511: --
1512: end get_org_name;
1513: --
1615: BEGIN
1616:
1617: l_proc := 'hr_us_reports.get_top_org_id';
1618:
1619: hr_utility.set_location('Entering...' || l_proc,10);
1620:
1621: open csr_get_element;
1622: fetch csr_get_element into l_exists;
1623: if csr_get_element%NOTFOUND then
1621: open csr_get_element;
1622: fetch csr_get_element into l_exists;
1623: if csr_get_element%NOTFOUND then
1624: close csr_get_element;
1625: hr_utility.set_location(l_proc,20);
1626: l_organization_id_child := p_business_group_id;
1627: else
1628: close csr_get_element;
1629: open csr_get_max_child_id;
1628: close csr_get_element;
1629: open csr_get_max_child_id;
1630: fetch csr_get_max_child_id into l_organization_id_child;
1631: close csr_get_max_child_id;
1632: hr_utility.trace('l_organization_id_child : ' || l_organization_id_child);
1633: hr_utility.set_location(l_proc,30);
1634: loop
1635: open csr_get_parent(l_organization_id_child);
1636: fetch csr_get_parent into l_organization_id_parent;
1629: open csr_get_max_child_id;
1630: fetch csr_get_max_child_id into l_organization_id_child;
1631: close csr_get_max_child_id;
1632: hr_utility.trace('l_organization_id_child : ' || l_organization_id_child);
1633: hr_utility.set_location(l_proc,30);
1634: loop
1635: open csr_get_parent(l_organization_id_child);
1636: fetch csr_get_parent into l_organization_id_parent;
1637: exit when csr_get_parent%NOTFOUND;
1635: open csr_get_parent(l_organization_id_child);
1636: fetch csr_get_parent into l_organization_id_parent;
1637: exit when csr_get_parent%NOTFOUND;
1638: close csr_get_parent;
1639: hr_utility.trace('l_organization_id_patent : ' || l_organization_id_parent);
1640: l_organization_id_child := l_organization_id_parent;
1641: end loop;
1642: close csr_get_parent;
1643: end if;
1640: l_organization_id_child := l_organization_id_parent;
1641: end loop;
1642: close csr_get_parent;
1643: end if;
1644: hr_utility.trace('top_org_id is ' || l_organization_id_child);
1645: hr_utility.set_location('Leaving...' || l_proc,40);
1646: return l_organization_id_child;
1647: --
1648: exception when NO_DATA_FOUND then RETURN p_business_group_id;
1641: end loop;
1642: close csr_get_parent;
1643: end if;
1644: hr_utility.trace('top_org_id is ' || l_organization_id_child);
1645: hr_utility.set_location('Leaving...' || l_proc,40);
1646: return l_organization_id_child;
1647: --
1648: exception when NO_DATA_FOUND then RETURN p_business_group_id;
1649: --
1793: --
1794: begin
1795: --
1796:
1797: hr_utility.set_location('Entered hr_us_reports.get_employee_address40', 0);
1798: --
1799: open get_address_record;
1800: --
1801: fetch get_address_record into v_address_line1, v_address_line2,
1800: --
1801: fetch get_address_record into v_address_line1, v_address_line2,
1802: v_address_line3, v_town_or_city, v_region_2, v_postal_code;
1803: --
1804: hr_utility.set_location('Entered hr_us_reports.get_employee_address40', 5);
1805: --
1806: if get_address_record%found
1807: then
1808: --
1833: f_address := f_address ||v_region_2||' '||
1834: v_postal_code;
1835: end if;
1836: --
1837: hr_utility.set_location('hr_us_reports.get_employee_address40', 10);
1838: close get_address_record;
1839: --
1840: hr_utility.trace('Person Address is '|| f_address);
1841: --
1836: --
1837: hr_utility.set_location('hr_us_reports.get_employee_address40', 10);
1838: close get_address_record;
1839: --
1840: hr_utility.trace('Person Address is '|| f_address);
1841: --
1842: p_address := f_address;
1843: --
1844: end if;
1842: p_address := f_address;
1843: --
1844: end if;
1845: --
1846: hr_utility.set_location('Leaving hr_us_reports.get_employee_address40', 15);
1847: --
1848: exception when NO_DATA_FOUND then NULL;
1849: --
1850: end get_employee_address40;