5: l_name varchar2(61) := 'BEFORE_REPORT';
6:
7: begin
8: -- hr_standard.event('BEFORE REPORT');
9: hr_utility.set_location('Entering.... :' || l_name,10);
10: p_multi_state_1 := p_multi_state;
11: c_end_of_time := hr_general.end_of_time;
12:
13: c_business_group_name := hr_reports.get_business_group(p_business_group_id);
29: c_state_name := hr_us_reports.get_state_name
30: (p_state_code);
31: end if;
32:
33: hr_utility.set_location(l_name,20);
34:
35: --file_io.open;
36: hr_utility.set_location(l_name,30);
37: --file_io.open_a01;
32:
33: hr_utility.set_location(l_name,20);
34:
35: --file_io.open;
36: hr_utility.set_location(l_name,30);
37: --file_io.open_a01;
38:
39:
40: hr_utility.set_location(l_name,40);
36: hr_utility.set_location(l_name,30);
37: --file_io.open_a01;
38:
39:
40: hr_utility.set_location(l_name,40);
41: char_set_init('US7ASCII') ;
42:
43: if p_audit_report = 'Y' then
44: hr_utility.set_location(l_name,50);
40: hr_utility.set_location(l_name,40);
41: char_set_init('US7ASCII') ;
42:
43: if p_audit_report = 'Y' then
44: hr_utility.set_location(l_name,50);
45: --file_io.open_a03;
46: end if;
47:
48: hr_utility.set_location('Leaving.....:' || l_name,100);
44: hr_utility.set_location(l_name,50);
45: --file_io.open_a03;
46: end if;
47:
48: hr_utility.set_location('Leaving.....:' || l_name,100);
49: return (TRUE);
50:
51: RETURN NULL; exception when no_data_found then null;
52: RETURN NULL; when others then
91: l_salary number;
92:
93: begin
94:
95: hr_utility.set_location('Entered c_salary formula', 5);
96:
97: if p_state_code = 'TX' or p_state_code = 'OR'
98: or p_state_code = 'MD' then
99: l_business_group_id := P_BUSINESS_GROUP_ID;
102: l_salary := hr_us_reports.get_salary(l_business_group_id,
103: assignment_id,
104: l_report_date
105: );
106: hr_utility.set_location('Leaving c_salary formula', 10);
107: if p_state_code = 'TX' then
108: return(l_salary);
109: else
110: return(l_salary/12);
109: else
110: return(l_salary/12);
111: end if;
112: else
113: hr_utility.set_location('Leaving c_salary formula', 15);
114: return(NULL);
115: end if;
116:
117:
130: begin
131:
132: --hr_standard.event('AFTER REPORT');
133:
134: hr_utility.set_location('Entered after report trigger',1);
135:
136:
137: if c_fatal_error_flag is null and C_NO_OF_NEWHIRE > 0 then
138: total_record() ;
135:
136:
137: if c_fatal_error_flag is null and C_NO_OF_NEWHIRE > 0 then
138: total_record() ;
139: hr_utility.set_location('after report trigger',2);
140: end if;
141: hr_utility.set_location('after report trigger',3);
142:
143: -- file_io.close;
137: if c_fatal_error_flag is null and C_NO_OF_NEWHIRE > 0 then
138: total_record() ;
139: hr_utility.set_location('after report trigger',2);
140: end if;
141: hr_utility.set_location('after report trigger',3);
142:
143: -- file_io.close;
144:
145: if c_fatal_error_flag is null then
142:
143: -- file_io.close;
144:
145: if c_fatal_error_flag is null then
146: hr_utility.set_location('after report trigger',4);
147: p_output_new_hire_null() ;
148: hr_utility.set_location('after report trigger',5);
149: p_mag_update_status() ;
150: hr_utility.set_location('after report trigger',6);
144:
145: if c_fatal_error_flag is null then
146: hr_utility.set_location('after report trigger',4);
147: p_output_new_hire_null() ;
148: hr_utility.set_location('after report trigger',5);
149: p_mag_update_status() ;
150: hr_utility.set_location('after report trigger',6);
151: end if;
152:
146: hr_utility.set_location('after report trigger',4);
147: p_output_new_hire_null() ;
148: hr_utility.set_location('after report trigger',5);
149: p_mag_update_status() ;
150: hr_utility.set_location('after report trigger',6);
151: end if;
152:
153:
154: if c_fatal_error_flag is null then
157: -- file_io.close_a01;
158:
159:
160: if p_audit_report = 'Y' then
161: hr_utility.set_location('after report trigger',8);
162: -- file_io.close_a03;
163: end if;
164: hr_utility.set_location('Leaving after report trigger',10);
165: return(TRUE);
160: if p_audit_report = 'Y' then
161: hr_utility.set_location('after report trigger',8);
162: -- file_io.close_a03;
163: end if;
164: hr_utility.set_location('Leaving after report trigger',10);
165: return(TRUE);
166: RETURN NULL; exception when others then
167: hr_utility.set_location('Error found in after report trigger',20);
168: hr_utility.trace('The error message is '||sqlerrm);
163: end if;
164: hr_utility.set_location('Leaving after report trigger',10);
165: return(TRUE);
166: RETURN NULL; exception when others then
167: hr_utility.set_location('Error found in after report trigger',20);
168: hr_utility.trace('The error message is '||sqlerrm);
169:
170: RETURN NULL; end;
171:
164: hr_utility.set_location('Leaving after report trigger',10);
165: return(TRUE);
166: RETURN NULL; exception when others then
167: hr_utility.set_location('Error found in after report trigger',20);
168: hr_utility.trace('The error message is '||sqlerrm);
169:
170: RETURN NULL; end;
171:
172: function G_new_hiresGroupFilter return boolean is
179: end;
180:
181: function BetweenPage return boolean is
182: begin
183: hr_utility.set_location('Entered between page trigger',5);
184: return (TRUE);
185: end;
186:
187: function CF_new_hireFormula (SUI_COMPANY_STATE_ID in varchar2,DATE_START in date,FEDERAL_ID in varchar2,
191: c_contact_name in varchar2,c_contact_phone in varchar2)return Number is
192: l_name varchar2(60) := 'CF_new_hireFormula';
193: begin
194:
195: hr_utility.set_location('Entering... :' || l_name,10);
196:
197: new_hire_record(person_id ,NATIONAL_IDENTIFIER ,FIRST_NAME,MIDDLE_NAME ,LAST_NAME,DATE_START,
198: FULL_MIDDLE_NAME ,gre_location_id ,DATE_OF_BIRTH ,HIRE_STATE ,FEDERAL_ID,SUI_COMPANY_STATE_ID,
199: TAX_UNIT_NAME ,c_contact_phone ,c_contact_name ,SIT_COMPANY_STATE_ID );
197: new_hire_record(person_id ,NATIONAL_IDENTIFIER ,FIRST_NAME,MIDDLE_NAME ,LAST_NAME,DATE_START,
198: FULL_MIDDLE_NAME ,gre_location_id ,DATE_OF_BIRTH ,HIRE_STATE ,FEDERAL_ID,SUI_COMPANY_STATE_ID,
199: TAX_UNIT_NAME ,c_contact_phone ,c_contact_name ,SIT_COMPANY_STATE_ID );
200:
201: hr_utility.set_location('Leaving... :' || l_name,20);
202:
203: return(0);
204: end;
205:
249:
250:
251: BEGIN
252:
253: hr_utility.set_location('Entering....' || l_name,10);
254: l_person_id := person_id;
255:
256:
257: if p_state_code = 'CA' then
254: l_person_id := person_id;
255:
256:
257: if p_state_code = 'CA' then
258: hr_utility.set_location(l_name,20);
259:
260: per_new_hire_pkg.get_employee_address
261: (l_person_id,l_address,l_city,l_state,l_zip,l_zip_extension);
262: l_buffer := per_new_hire_pkg.ca_w4_record(
271: ,p_zip => l_zip
272: ,p_zip_extension => l_zip_extension
273: ,p_date_of_hire => DATE_START
274: );
275: hr_utility.set_location(l_name,30);
276: c_no_of_newhire := c_no_of_newhire + 1;
277: -- file_io.put(l_buffer);
278: if p_audit_report = 'Y' then
279:
290: ,p_emp_zip_extension => l_zip_extension
291: ,p_date_of_hire => DATE_START
292:
293: );
294: hr_utility.set_location(l_name,35);
295: -- file_io.put_a03(l_buffer);
296: end if;
297: elsif p_state_code = 'NY' then
298: hr_utility.set_location(l_name,40);
294: hr_utility.set_location(l_name,35);
295: -- file_io.put_a03(l_buffer);
296: end if;
297: elsif p_state_code = 'NY' then
298: hr_utility.set_location(l_name,40);
299:
300: per_new_hire_pkg.get_employee_address
301: (l_person_id,l_address,l_city,l_state,l_zip,l_zip_extension);
302: hr_utility.trace('date_start = ' ||to_char(DATE_START));
298: hr_utility.set_location(l_name,40);
299:
300: per_new_hire_pkg.get_employee_address
301: (l_person_id,l_address,l_city,l_state,l_zip,l_zip_extension);
302: hr_utility.trace('date_start = ' ||to_char(DATE_START));
303:
304: l_buffer := per_new_hire_pkg.ny_1h_record(
305: p_record_identifier => '1H'
306: ,p_last_name => LAST_NAME
330: );
331: --file_io.put_a03(l_buffer);
332: end if;
333:
334: hr_utility.set_location(l_name,50);
335: elsif p_state_code = 'FL' then
336: hr_utility.trace('p_state_code = FL');
337: l_location_id := gre_location_id;
338: per_new_hire_pkg.get_location_address_3lines
332: end if;
333:
334: hr_utility.set_location(l_name,50);
335: elsif p_state_code = 'FL' then
336: hr_utility.trace('p_state_code = FL');
337: l_location_id := gre_location_id;
338: per_new_hire_pkg.get_location_address_3lines
339: (l_location_id,l_loc_address_line1,l_loc_address_line2,l_loc_address_line3
340: ,l_loc_city,l_loc_state,l_loc_zip,l_loc_zip_extension,l_loc_country);
340: ,l_loc_city,l_loc_state,l_loc_zip,l_loc_zip_extension,l_loc_country);
341: per_new_hire_pkg.get_employee_address_3lines
342: (l_person_id,l_emp_address_line1,l_emp_address_line2,l_emp_address_line3
343: ,l_emp_city,l_emp_state,l_emp_zip,l_emp_zip_extension,l_emp_country);
344: hr_utility.set_location(l_name,51);
345: hr_utility.trace('p_mult_state = ' || p_multi_state_1);
346: hr_utility.trace('l_loc_state = ' || l_loc_state);
347: l_buffer := per_new_hire_pkg.fl_new_hire_record(
348: p_record_identifier => 'FL Newhire Record'
341: per_new_hire_pkg.get_employee_address_3lines
342: (l_person_id,l_emp_address_line1,l_emp_address_line2,l_emp_address_line3
343: ,l_emp_city,l_emp_state,l_emp_zip,l_emp_zip_extension,l_emp_country);
344: hr_utility.set_location(l_name,51);
345: hr_utility.trace('p_mult_state = ' || p_multi_state_1);
346: hr_utility.trace('l_loc_state = ' || l_loc_state);
347: l_buffer := per_new_hire_pkg.fl_new_hire_record(
348: p_record_identifier => 'FL Newhire Record'
349: ,p_national_identifier => NATIONAL_IDENTIFIER
342: (l_person_id,l_emp_address_line1,l_emp_address_line2,l_emp_address_line3
343: ,l_emp_city,l_emp_state,l_emp_zip,l_emp_zip_extension,l_emp_country);
344: hr_utility.set_location(l_name,51);
345: hr_utility.trace('p_mult_state = ' || p_multi_state_1);
346: hr_utility.trace('l_loc_state = ' || l_loc_state);
347: l_buffer := per_new_hire_pkg.fl_new_hire_record(
348: p_record_identifier => 'FL Newhire Record'
349: ,p_national_identifier => NATIONAL_IDENTIFIER
350: ,p_first_name => FIRST_NAME
487: -- file_io.put_a03(l_buffer);
488: end if;
489: elsif p_state_code = 'TX' then
490: l_location_id := gre_location_id;
491: hr_utility.trace('gre_location_id = ' || l_location_id);
492: per_new_hire_pkg.get_location_address_3lines
493: (l_location_id,l_loc_address_line1,l_loc_address_line2,l_loc_address_line3
494: ,l_loc_city,l_loc_state,l_loc_zip,l_loc_zip_extension,l_loc_country);
495: per_new_hire_pkg.get_employee_address_3lines
574: );
575: -- file_io.put_a03(l_buffer);
576: end if;
577: end if;
578: hr_utility.set_location('Leaving...' || l_name,100);
579: exception when others then
580: hr_utility.set_location('Leaving....' || l_name,999);
581: c_fatal_error_flag := 7;
582: /*srw.message(288, 'Error found in ' || l_name);*/null;
576: end if;
577: end if;
578: hr_utility.set_location('Leaving...' || l_name,100);
579: exception when others then
580: hr_utility.set_location('Leaving....' || l_name,999);
581: c_fatal_error_flag := 7;
582: /*srw.message(288, 'Error found in ' || l_name);*/null;
583:
584: fnd_message.raise_error;
588: l_buffer varchar2(2000);
589: l_name varchar(60) := 'TOTAL_RECORD';
590: BEGIN
591:
592: hr_utility.set_location('Entering.....:' || l_name,10);
593: if p_state_code = 'CA' then
594: l_buffer := per_new_hire_pkg.ca_t4_record(
595: p_record_identifier => 'T4'
596: ,p_number_of_employee => C_NO_OF_NEWHIRE
595: p_record_identifier => 'T4'
596: ,p_number_of_employee => C_NO_OF_NEWHIRE
597: );
598:
599: hr_utility.trace('l_buffer = ' || l_buffer);
600: --file_io.put(l_buffer);
601: elsif p_state_code = 'NY' then
602: l_buffer := per_new_hire_pkg.ny_1t_record(
603: p_record_identifier => '1T'
603: p_record_identifier => '1T'
604: ,p_number_of_employee => C_NO_OF_NEWHIRE
605: );
606:
607: hr_utility.trace('l_buffer = ' || l_buffer);
608: --file_io.put(l_buffer);
609: l_buffer := per_new_hire_pkg.ny_1f_record(
610: p_record_identifier => '1F'
611: ,p_number_of_employer => c_no_of_gre
610: p_record_identifier => '1F'
611: ,p_number_of_employer => c_no_of_gre
612: );
613:
614: hr_utility.trace('l_buffer = ' || l_buffer);
615: --file_io.put(l_buffer);
616:
617: end if;
618: hr_utility.set_location('Leaving.....:' || l_name,100);
614: hr_utility.trace('l_buffer = ' || l_buffer);
615: --file_io.put(l_buffer);
616:
617: end if;
618: hr_utility.set_location('Leaving.....:' || l_name,100);
619: exception when others then
620: hr_utility.set_location('Leaving....' || l_name,999);
621: c_fatal_error_flag := 9;
622: /*srw.message(288, 'Error found in ' || l_name);*/null;
616:
617: end if;
618: hr_utility.set_location('Leaving.....:' || l_name,100);
619: exception when others then
620: hr_utility.set_location('Leaving....' || l_name,999);
621: c_fatal_error_flag := 9;
622: /*srw.message(288, 'Error found in ' || l_name);*/null;
623:
624:
649: and hou.organization_id = TAX_UNIT_ID;
650:
651: BEGIN
652:
653: hr_utility.set_location('Entering....' || l_name,10);
654: hr_utility.trace('p_tax_unit_id = ' || to_char(P_TAX_UNIT_ID));
655: hr_utility.trace('p_business_group_id = ' || to_char(P_BUSINESS_GROUP_ID));
656:
657: open c_tax_unit_name;
650:
651: BEGIN
652:
653: hr_utility.set_location('Entering....' || l_name,10);
654: hr_utility.trace('p_tax_unit_id = ' || to_char(P_TAX_UNIT_ID));
655: hr_utility.trace('p_business_group_id = ' || to_char(P_BUSINESS_GROUP_ID));
656:
657: open c_tax_unit_name;
658: fetch c_tax_unit_name into l_tax_unit_name,l_location_id;
651: BEGIN
652:
653: hr_utility.set_location('Entering....' || l_name,10);
654: hr_utility.trace('p_tax_unit_id = ' || to_char(P_TAX_UNIT_ID));
655: hr_utility.trace('p_business_group_id = ' || to_char(P_BUSINESS_GROUP_ID));
656:
657: open c_tax_unit_name;
658: fetch c_tax_unit_name into l_tax_unit_name,l_location_id;
659: close c_tax_unit_name;
657: open c_tax_unit_name;
658: fetch c_tax_unit_name into l_tax_unit_name,l_location_id;
659: close c_tax_unit_name;
660:
661: hr_utility.trace('location_id = ' || to_char(l_location_id));
662: per_new_hire_pkg.get_location_address_3lines
663: (l_location_id,l_loc_address_line1,l_loc_address_line2,l_loc_address_line3
664: ,l_loc_city,l_loc_state,l_loc_zip,l_loc_zip_extension,l_loc_country);
665:
682: else
683: file_io.put_a01('zip : ' || l_loc_zip || '-' || l_loc_zip_extension || g_delimiter);
684: end if;
685: file_io.put_a01(g_delimiter); */
686: hr_utility.set_location('Leaving....' || l_name,100);
687:
688: exception when others then
689: hr_utility.set_location('Leaving....' || l_name,999);
690: c_fatal_error_flag := 3;
685: file_io.put_a01(g_delimiter); */
686: hr_utility.set_location('Leaving....' || l_name,100);
687:
688: exception when others then
689: hr_utility.set_location('Leaving....' || l_name,999);
690: c_fatal_error_flag := 3;
691: /*srw.message(288, 'Error found in ' || l_name);*/null;
692:
693:
700:
701:
702: BEGIN
703:
704: hr_utility.set_location('Entering....' || l_name,10);
705: l_total_number := CS_NO_OF_NEW_HIRE ;
706: -- file_io.put_a01('All state new hire reported Totals : ' || l_total_number);
707: hr_utility.set_location('Leaving....' || l_name,100);
708: END;
703:
704: hr_utility.set_location('Entering....' || l_name,10);
705: l_total_number := CS_NO_OF_NEW_HIRE ;
706: -- file_io.put_a01('All state new hire reported Totals : ' || l_total_number);
707: hr_utility.set_location('Leaving....' || l_name,100);
708: END;
709:
710: PROCEDURE A03_HEADER_RECORD IS
711: l_name varchar(60) := 'a03_header_record';
712: l_buffer varchar2(2000);
713:
714: BEGIN
715:
716: hr_utility.set_location('Entering....' || l_name,10);
717: if p_state_code = 'CA' then
718: l_buffer := per_new_hire_pkg.a03_ca_new_hire_header;
719: elsif p_state_code = 'NY' then
720: l_buffer := per_new_hire_pkg.a03_ny_new_hire_header;
724: l_buffer := per_new_hire_pkg.a03_fl_new_hire_header;
725: elsif p_state_code = 'TX' then
726: l_buffer := per_new_hire_pkg.a03_tx_new_hire_header;
727: end if;
728: hr_utility.set_location('Entering....' || l_name,20);
729:
730: -- file_io.put_a03(l_buffer);
731:
732: hr_utility.set_location('Leaving....' || l_name,100);
728: hr_utility.set_location('Entering....' || l_name,20);
729:
730: -- file_io.put_a03(l_buffer);
731:
732: hr_utility.set_location('Leaving....' || l_name,100);
733: exception when others then
734: hr_utility.set_location('Leaving....' || l_name,999);
735: c_fatal_error_flag := 4;
736: /*srw.message(288, 'Error found in ' || l_name);*/null;
730: -- file_io.put_a03(l_buffer);
731:
732: hr_utility.set_location('Leaving....' || l_name,100);
733: exception when others then
734: hr_utility.set_location('Leaving....' || l_name,999);
735: c_fatal_error_flag := 4;
736: /*srw.message(288, 'Error found in ' || l_name);*/null;
737:
738: END;
863: l_name varchar(60) := 'P_MAG_UPDATE_STATUS';
864: g_delimiter varchar2(1) := fnd_global.local_chr(10);
865:
866: BEGIN
867: hr_utility.set_location('Entered ......:' || l_name,10);
868: if c_person_id%ISOPEN then
869: close c_person_id;
870: end if;
871: OPEN c_person_id;
872: LOOP
873:
874: FETCH c_person_id INTO v_person_id, v_last_name, v_first_name, v_state;
875:
876: hr_utility.trace('v_person_id = ' || to_char(v_person_id));
877: hr_utility.trace('v_state = ' || v_state);
878:
879: if p_report_mode = 'F' then
880: UPDATE per_people_f
873:
874: FETCH c_person_id INTO v_person_id, v_last_name, v_first_name, v_state;
875:
876: hr_utility.trace('v_person_id = ' || to_char(v_person_id));
877: hr_utility.trace('v_state = ' || v_state);
878:
879: if p_report_mode = 'F' then
880: UPDATE per_people_f
881: SET per_information7 = 'DONE'
883: AND per_information7 = 'INCL';
884: end if;
885:
886:
887: hr_utility.trace('c_old_state = ' || c_old_state);
888: if c_old_state is NULL then
889: hr_utility.set_location(l_name,20);
890: c_old_state := v_state;
891: c_state_count := 1;
885:
886:
887: hr_utility.trace('c_old_state = ' || c_old_state);
888: if c_old_state is NULL then
889: hr_utility.set_location(l_name,20);
890: c_old_state := v_state;
891: c_state_count := 1;
892: elsif c_old_state <> v_state then
893: hr_utility.set_location(l_name,30);
889: hr_utility.set_location(l_name,20);
890: c_old_state := v_state;
891: c_state_count := 1;
892: elsif c_old_state <> v_state then
893: hr_utility.set_location(l_name,30);
894: -- file_io.put_a01(c_old_state || ' state new hire reported Totals : ' || c_state_count || g_delimiter);
895: c_state_count := 1;
896: c_old_state := v_state;
897: else
894: -- file_io.put_a01(c_old_state || ' state new hire reported Totals : ' || c_state_count || g_delimiter);
895: c_state_count := 1;
896: c_old_state := v_state;
897: else
898: hr_utility.set_location(l_name,40);
899: c_state_count := c_state_count + 1;
900: hr_utility.trace('c_state_count =' || c_state_count);
901: end if;
902:
896: c_old_state := v_state;
897: else
898: hr_utility.set_location(l_name,40);
899: c_state_count := c_state_count + 1;
900: hr_utility.trace('c_state_count =' || c_state_count);
901: end if;
902:
903: EXIT WHEN c_person_id%NOTFOUND;
904:
903: EXIT WHEN c_person_id%NOTFOUND;
904:
905: END LOOP;
906:
907: hr_utility.set_location(l_name,50);
908:
909: c_state_count := c_state_count - 1;
910: if c_state_count <> 0 then
911: -- file_io.put_a01(c_old_state || ' state new hire reported Totals : ' || c_state_count || g_delimiter);
910: if c_state_count <> 0 then
911: -- file_io.put_a01(c_old_state || ' state new hire reported Totals : ' || c_state_count || g_delimiter);
912: null;
913: end if;
914: hr_utility.set_location(l_name,60);
915: CLOSE c_person_id;
916: COMMIT;
917: hr_utility.set_location(l_name,90);
918:
913: end if;
914: hr_utility.set_location(l_name,60);
915: CLOSE c_person_id;
916: COMMIT;
917: hr_utility.set_location(l_name,90);
918:
919: /*srw.message('101', 'Report Mode : ' || p_report_mode);*/null;
920:
921: if p_report_mode = 'F' then
923:
924: end if;
925: /*srw.message('102', 'Called Status Update');*/null;
926:
927: hr_utility.set_location('Leaving....' || l_name,100);
928: exception
929: when others then
930: /*srw.message(290, 'The error message is '||sqlerrm);*/null;
931:
941: l_buffer varchar2(1000);
942: g_delimiter varchar2(1) := fnd_global.local_chr(10);
943: begin
944:
945: hr_utility.set_location('Entering...' || l_name,0);
946: hr_utility.trace('p_audit_report = ' || p_audit_report);
947: hr_utility.trace('p_state_code = ' || p_state_code);
948:
949: hr_utility.set_location(l_name,20);
942: g_delimiter varchar2(1) := fnd_global.local_chr(10);
943: begin
944:
945: hr_utility.set_location('Entering...' || l_name,0);
946: hr_utility.trace('p_audit_report = ' || p_audit_report);
947: hr_utility.trace('p_state_code = ' || p_state_code);
948:
949: hr_utility.set_location(l_name,20);
950: gre_record(gre_location_id,tax_unit_id,FEDERAL_ID,SIT_COMPANY_STATE_ID,TAX_UNIT_NAME) ;
943: begin
944:
945: hr_utility.set_location('Entering...' || l_name,0);
946: hr_utility.trace('p_audit_report = ' || p_audit_report);
947: hr_utility.trace('p_state_code = ' || p_state_code);
948:
949: hr_utility.set_location(l_name,20);
950: gre_record(gre_location_id,tax_unit_id,FEDERAL_ID,SIT_COMPANY_STATE_ID,TAX_UNIT_NAME) ;
951: hr_utility.set_location(l_name,30);
945: hr_utility.set_location('Entering...' || l_name,0);
946: hr_utility.trace('p_audit_report = ' || p_audit_report);
947: hr_utility.trace('p_state_code = ' || p_state_code);
948:
949: hr_utility.set_location(l_name,20);
950: gre_record(gre_location_id,tax_unit_id,FEDERAL_ID,SIT_COMPANY_STATE_ID,TAX_UNIT_NAME) ;
951: hr_utility.set_location(l_name,30);
952:
953:
947: hr_utility.trace('p_state_code = ' || p_state_code);
948:
949: hr_utility.set_location(l_name,20);
950: gre_record(gre_location_id,tax_unit_id,FEDERAL_ID,SIT_COMPANY_STATE_ID,TAX_UNIT_NAME) ;
951: hr_utility.set_location(l_name,30);
952:
953:
954: hr_utility.set_location('Leaving....:' || l_name,100);
955: return(0);
950: gre_record(gre_location_id,tax_unit_id,FEDERAL_ID,SIT_COMPANY_STATE_ID,TAX_UNIT_NAME) ;
951: hr_utility.set_location(l_name,30);
952:
953:
954: hr_utility.set_location('Leaving....:' || l_name,100);
955: return(0);
956:
957: end;
958:
982: l_contact_title,
983: l_contact_phone
984: );
985:
986: hr_utility.set_location('Entered c_person_dets',5);
987:
988:
989: hr_utility.trace('Contact name => '||l_contact_name);
990: hr_utility.set_location('Leaving c_contact_name', 10);
985:
986: hr_utility.set_location('Entered c_person_dets',5);
987:
988:
989: hr_utility.trace('Contact name => '||l_contact_name);
990: hr_utility.set_location('Leaving c_contact_name', 10);
991:
992: return(l_contact_name);
993:
986: hr_utility.set_location('Entered c_person_dets',5);
987:
988:
989: hr_utility.trace('Contact name => '||l_contact_name);
990: hr_utility.set_location('Leaving c_contact_name', 10);
991:
992: return(l_contact_name);
993:
994: exception when NO_DATA_FOUND then
991:
992: return(l_contact_name);
993:
994: exception when NO_DATA_FOUND then
995: hr_utility.trace('Error is found in c_contact_name');
996: null;
997:
998: end;
999:
1026: l_contact_title,
1027: l_contact_phone
1028: );
1029:
1030: hr_utility.set_location('Entered c_contact_phone',5);
1031:
1032:
1033: hr_utility.trace('Contact phone => '||l_contact_phone);
1034: hr_utility.set_location('Leaving c_contact_phone', 10);
1029:
1030: hr_utility.set_location('Entered c_contact_phone',5);
1031:
1032:
1033: hr_utility.trace('Contact phone => '||l_contact_phone);
1034: hr_utility.set_location('Leaving c_contact_phone', 10);
1035:
1036: return(l_contact_phone);
1037:
1030: hr_utility.set_location('Entered c_contact_phone',5);
1031:
1032:
1033: hr_utility.trace('Contact phone => '||l_contact_phone);
1034: hr_utility.set_location('Leaving c_contact_phone', 10);
1035:
1036: return(l_contact_phone);
1037:
1038: exception when NO_DATA_FOUND then
1035:
1036: return(l_contact_phone);
1037:
1038: exception when NO_DATA_FOUND then
1039: hr_utility.trace('Error is found in c_contact_phone');
1040: null;
1041:
1042: end;
1043:
1069: l_contact_title,
1070: l_contact_phone
1071: );
1072:
1073: hr_utility.set_location('Entered c_contact_title',5);
1074:
1075:
1076: hr_utility.trace('Contact title => '||l_contact_title);
1077: hr_utility.set_location('Leaving c_contact_title',10);
1072:
1073: hr_utility.set_location('Entered c_contact_title',5);
1074:
1075:
1076: hr_utility.trace('Contact title => '||l_contact_title);
1077: hr_utility.set_location('Leaving c_contact_title',10);
1078:
1079: return(l_contact_title);
1080:
1073: hr_utility.set_location('Entered c_contact_title',5);
1074:
1075:
1076: hr_utility.trace('Contact title => '||l_contact_title);
1077: hr_utility.set_location('Leaving c_contact_title',10);
1078:
1079: return(l_contact_title);
1080:
1081: exception when NO_DATA_FOUND then
1078:
1079: return(l_contact_title);
1080:
1081: exception when NO_DATA_FOUND then
1082: hr_utility.trace('Error is found in c_contact_title');
1083: null;
1084:
1085: end;
1086:
1100: return(l_tax_unit_address);
1101:
1102: exception
1103: when others then
1104: hr_utility.trace('the error is '|| to_char(sqlcode)||sqlerrm);
1105: /*srw.message('1','Error is found in tax_unit_address formula');*/null;
1106:
1107: /*srw.message('10','sqlcode is : '||to_char(sqlcode)||sqlerrm);*/null;
1108:
1286:
1287:
1288:
1289: BEGIN
1290: hr_utility.set_location('Entering.. ' || l_name,10);
1291: l_location_id := gre_location_id;
1292: hr_utility.trace('l_location_id = ' || l_location_id);
1293: hr_utility.set_location(l_name,20);
1294: hr_utility.trace('p_state_code = ' || p_state_code);
1288:
1289: BEGIN
1290: hr_utility.set_location('Entering.. ' || l_name,10);
1291: l_location_id := gre_location_id;
1292: hr_utility.trace('l_location_id = ' || l_location_id);
1293: hr_utility.set_location(l_name,20);
1294: hr_utility.trace('p_state_code = ' || p_state_code);
1295:
1296: if p_state_code = 'CA' then
1289: BEGIN
1290: hr_utility.set_location('Entering.. ' || l_name,10);
1291: l_location_id := gre_location_id;
1292: hr_utility.trace('l_location_id = ' || l_location_id);
1293: hr_utility.set_location(l_name,20);
1294: hr_utility.trace('p_state_code = ' || p_state_code);
1295:
1296: if p_state_code = 'CA' then
1297: hr_utility.set_location(l_name,30);
1290: hr_utility.set_location('Entering.. ' || l_name,10);
1291: l_location_id := gre_location_id;
1292: hr_utility.trace('l_location_id = ' || l_location_id);
1293: hr_utility.set_location(l_name,20);
1294: hr_utility.trace('p_state_code = ' || p_state_code);
1295:
1296: if p_state_code = 'CA' then
1297: hr_utility.set_location(l_name,30);
1298: hr_utility.trace('cp_pre_tax_unit_id = ' || cp_pre_tax_unit_id);
1293: hr_utility.set_location(l_name,20);
1294: hr_utility.trace('p_state_code = ' || p_state_code);
1295:
1296: if p_state_code = 'CA' then
1297: hr_utility.set_location(l_name,30);
1298: hr_utility.trace('cp_pre_tax_unit_id = ' || cp_pre_tax_unit_id);
1299: hr_utility.trace('tax_unit_id = ' || tax_unit_id);
1300:
1301: per_new_hire_pkg.get_location_address
1294: hr_utility.trace('p_state_code = ' || p_state_code);
1295:
1296: if p_state_code = 'CA' then
1297: hr_utility.set_location(l_name,30);
1298: hr_utility.trace('cp_pre_tax_unit_id = ' || cp_pre_tax_unit_id);
1299: hr_utility.trace('tax_unit_id = ' || tax_unit_id);
1300:
1301: per_new_hire_pkg.get_location_address
1302: (l_location_id,l_address,l_city,l_state,l_zip,l_zip_extension);
1295:
1296: if p_state_code = 'CA' then
1297: hr_utility.set_location(l_name,30);
1298: hr_utility.trace('cp_pre_tax_unit_id = ' || cp_pre_tax_unit_id);
1299: hr_utility.trace('tax_unit_id = ' || tax_unit_id);
1300:
1301: per_new_hire_pkg.get_location_address
1302: (l_location_id,l_address,l_city,l_state,l_zip,l_zip_extension);
1303:
1315: ,p_state => l_state
1316: ,p_zip => l_zip
1317: ,p_zip_extension => l_zip_extension
1318: );
1319: hr_utility.trace('l_buffer = ' || l_buffer);
1320: --file_io.put(l_buffer);
1321: cp_pre_tax_unit_id := tax_unit_id;
1322: c_no_of_newhire := 0;
1323: c_no_of_gre := c_no_of_gre + 1;
1326: p_record_identifier => 'T4'
1327: ,p_number_of_employee => C_NO_OF_NEWHIRE
1328: );
1329:
1330: hr_utility.trace('l_buffer = ' || l_buffer);
1331: --file_io.put(l_buffer);
1332:
1333: a01_header_record(TAX_UNIT_ID,federal_id) ;
1334:
1343: ,p_state => l_state
1344: ,p_zip => l_zip
1345: ,p_zip_extension => l_zip_extension
1346: );
1347: hr_utility.trace('l_buffer = ' || l_buffer);
1348: --file_io.put(l_buffer);
1349: cp_pre_tax_unit_id := tax_unit_id;
1350: c_no_of_newhire := 0;
1351: c_no_of_gre := c_no_of_gre + 1;
1351: c_no_of_gre := c_no_of_gre + 1;
1352: end if;
1353:
1354: elsif p_state_code = 'NY' then
1355: hr_utility.set_location(l_name,40);
1356: hr_utility.trace('p_report_date = ' || p_report_date);
1357: per_new_hire_pkg.get_location_address
1358: (l_location_id,l_address,l_city,l_state,l_zip,l_zip_extension);
1359:
1352: end if;
1353:
1354: elsif p_state_code = 'NY' then
1355: hr_utility.set_location(l_name,40);
1356: hr_utility.trace('p_report_date = ' || p_report_date);
1357: per_new_hire_pkg.get_location_address
1358: (l_location_id,l_address,l_city,l_state,l_zip,l_zip_extension);
1359:
1360: if cp_pre_tax_unit_id is NULL then
1357: per_new_hire_pkg.get_location_address
1358: (l_location_id,l_address,l_city,l_state,l_zip,l_zip_extension);
1359:
1360: if cp_pre_tax_unit_id is NULL then
1361: hr_utility.set_location(l_name,41);
1362: open c_transmitter;
1363: fetch c_transmitter into l_trans_tax_unit_name,l_trans_federal_id,
1364: l_trans_tax_unit_id,l_trans_location_id;
1365: if c_transmitter%NOTFOUND then
1362: open c_transmitter;
1363: fetch c_transmitter into l_trans_tax_unit_name,l_trans_federal_id,
1364: l_trans_tax_unit_id,l_trans_location_id;
1365: if c_transmitter%NOTFOUND then
1366: hr_utility.set_location(l_name,42);
1367: close c_transmitter;
1368: /*srw.message('100', 'You have selected New York to be your reporting state, but have not identified a GRE as the transmitter for the New Hire report.');*/null;
1369:
1370: /*srw.message('100', 'Please select one of your GREs as the transmitter for this report in the New Hire Reporting organization information type.');*/null;
1373: fnd_message.raise_error;
1374: else
1375: open c_transmitter_count;
1376: fetch c_transmitter_count into l_transmitter_count;
1377: hr_utility.trace('transmitter count = ' || to_char(l_transmitter_count));
1378: if l_transmitter_count > 1 then
1379: hr_utility.set_location(l_name,43);
1380: close c_transmitter_count;
1381: close c_transmitter;
1375: open c_transmitter_count;
1376: fetch c_transmitter_count into l_transmitter_count;
1377: hr_utility.trace('transmitter count = ' || to_char(l_transmitter_count));
1378: if l_transmitter_count > 1 then
1379: hr_utility.set_location(l_name,43);
1380: close c_transmitter_count;
1381: close c_transmitter;
1382: c_fatal_error_flag := 2;
1383: /*srw.message('100', 'You have selected New York to be your reporting state, and have identified two GREs as the transmitter for the New Hire report.');*/null;
1388: end if;
1389: close c_transmitter_count;
1390: end if;
1391: close c_transmitter;
1392: hr_utility.trace('transmitter_tax_unit_name = ' || l_trans_tax_unit_name);
1393: hr_utility.trace('transmitter_federal_id = ' || l_trans_federal_id);
1394: hr_utility.trace('transmitter_location_id = ' || to_char(l_trans_location_id));
1395:
1396: per_new_hire_pkg.get_location_address
1389: close c_transmitter_count;
1390: end if;
1391: close c_transmitter;
1392: hr_utility.trace('transmitter_tax_unit_name = ' || l_trans_tax_unit_name);
1393: hr_utility.trace('transmitter_federal_id = ' || l_trans_federal_id);
1394: hr_utility.trace('transmitter_location_id = ' || to_char(l_trans_location_id));
1395:
1396: per_new_hire_pkg.get_location_address
1397: (l_trans_location_id,l_trans_address
1390: end if;
1391: close c_transmitter;
1392: hr_utility.trace('transmitter_tax_unit_name = ' || l_trans_tax_unit_name);
1393: hr_utility.trace('transmitter_federal_id = ' || l_trans_federal_id);
1394: hr_utility.trace('transmitter_location_id = ' || to_char(l_trans_location_id));
1395:
1396: per_new_hire_pkg.get_location_address
1397: (l_trans_location_id,l_trans_address
1398: ,l_trans_city,l_trans_state,l_trans_zip,l_trans_zip_extension);
1408: ,p_state => l_trans_state
1409: ,p_zip => l_trans_zip
1410: );
1411:
1412: hr_utility.set_location(l_name,42);
1413: /*file_io.put(l_buffer);
1414:
1415: file_io.put_a01('Transmitter Record' || g_delimiter);
1416: file_io.put_a01(g_delimiter);
1436: ,p_city => l_city
1437: ,p_state => l_state
1438: ,p_zip => l_zip
1439: );
1440: hr_utility.set_location(l_name,45);
1441: hr_utility.trace('l_buffer = ' || l_buffer);
1442: -- file_io.put(l_buffer);
1443: cp_pre_tax_unit_id := tax_unit_id;
1444: c_no_of_newhire := 0;
1437: ,p_state => l_state
1438: ,p_zip => l_zip
1439: );
1440: hr_utility.set_location(l_name,45);
1441: hr_utility.trace('l_buffer = ' || l_buffer);
1442: -- file_io.put(l_buffer);
1443: cp_pre_tax_unit_id := tax_unit_id;
1444: c_no_of_newhire := 0;
1445: c_no_of_gre := 1;
1444: c_no_of_newhire := 0;
1445: c_no_of_gre := 1;
1446:
1447: elsif cp_pre_tax_unit_id <> tax_unit_id then
1448: hr_utility.set_location(l_name,50);
1449:
1450: a01_header_record(TAX_UNIT_ID,federal_id) ;
1451:
1452: l_buffer := per_new_hire_pkg.ny_1t_record(
1453: p_record_identifier => '1T'
1454: ,p_number_of_employee => C_NO_OF_NEWHIRE
1455: );
1456:
1457: hr_utility.trace('l_buffer = ' || l_buffer);
1458: -- file_io.put(l_buffer);
1459: l_buffer := per_new_hire_pkg.ny_1e_record(
1460: p_record_identifier => '1E'
1461: ,p_federal_id => FEDERAL_ID
1464: ,p_city => l_city
1465: ,p_state => l_state
1466: ,p_zip => l_zip
1467: );
1468: hr_utility.set_location(l_name,60);
1469: hr_utility.trace('l_buffer = ' || l_buffer);
1470: -- file_io.put(l_buffer);
1471: cp_pre_tax_unit_id := tax_unit_id;
1472: c_no_of_newhire := 0;
1465: ,p_state => l_state
1466: ,p_zip => l_zip
1467: );
1468: hr_utility.set_location(l_name,60);
1469: hr_utility.trace('l_buffer = ' || l_buffer);
1470: -- file_io.put(l_buffer);
1471: cp_pre_tax_unit_id := tax_unit_id;
1472: c_no_of_newhire := 0;
1473: C_no_of_gre := c_no_of_gre + 1;
1472: c_no_of_newhire := 0;
1473: C_no_of_gre := c_no_of_gre + 1;
1474: end if;
1475: elsif p_state_code = 'TX' then
1476: hr_utility.set_location(l_name,70);
1477: if cp_pre_tax_unit_id is NULL then
1478: hr_utility.set_location(l_name,71);
1479: a01_header_record(TAX_UNIT_ID,federal_id) ;
1480: cp_pre_tax_unit_id := tax_unit_id;
1474: end if;
1475: elsif p_state_code = 'TX' then
1476: hr_utility.set_location(l_name,70);
1477: if cp_pre_tax_unit_id is NULL then
1478: hr_utility.set_location(l_name,71);
1479: a01_header_record(TAX_UNIT_ID,federal_id) ;
1480: cp_pre_tax_unit_id := tax_unit_id;
1481: open c_tx_emp_number;
1482: fetch c_tx_emp_number into l_tx_emp_num;
1484: l_tx_emp_num := 0;
1485: end if;
1486: close c_tx_emp_number;
1487:
1488: hr_utility.trace('l_tx_emp_num = ' || l_tx_emp_num);
1489: open c_tx_term_number;
1490: fetch c_tx_term_number into l_tx_term_num;
1491: if c_tx_term_number%NOTFOUND then
1492: l_tx_term_num := 0;
1491: if c_tx_term_number%NOTFOUND then
1492: l_tx_term_num := 0;
1493: end if;
1494: close c_tx_term_number;
1495: hr_utility.trace('l_tx_term_num = ' || l_tx_term_num);
1496:
1497: l_buffer := per_new_hire_pkg.tx_t4_record(
1498: p_record_identifier => 'T4'
1499: ,p_number_of_employee => l_tx_emp_num + l_tx_term_num
1498: p_record_identifier => 'T4'
1499: ,p_number_of_employee => l_tx_emp_num + l_tx_term_num
1500: );
1501:
1502: hr_utility.trace('l_buffer = ' || l_buffer);
1503: --file_io.put(l_buffer);
1504: elsif cp_pre_tax_unit_id <> tax_unit_id then
1505: hr_utility.set_location(l_name,72);
1506: a01_header_record(TAX_UNIT_ID,federal_id) ;
1501:
1502: hr_utility.trace('l_buffer = ' || l_buffer);
1503: --file_io.put(l_buffer);
1504: elsif cp_pre_tax_unit_id <> tax_unit_id then
1505: hr_utility.set_location(l_name,72);
1506: a01_header_record(TAX_UNIT_ID,federal_id) ;
1507: cp_pre_tax_unit_id := tax_unit_id;
1508: end if;
1509: else hr_utility.set_location(l_name,80);
1505: hr_utility.set_location(l_name,72);
1506: a01_header_record(TAX_UNIT_ID,federal_id) ;
1507: cp_pre_tax_unit_id := tax_unit_id;
1508: end if;
1509: else hr_utility.set_location(l_name,80);
1510: if cp_pre_tax_unit_id is NULL then
1511: hr_utility.set_location(l_name,81);
1512: a01_header_record(TAX_UNIT_ID,federal_id) ;
1513: cp_pre_tax_unit_id := tax_unit_id;
1507: cp_pre_tax_unit_id := tax_unit_id;
1508: end if;
1509: else hr_utility.set_location(l_name,80);
1510: if cp_pre_tax_unit_id is NULL then
1511: hr_utility.set_location(l_name,81);
1512: a01_header_record(TAX_UNIT_ID,federal_id) ;
1513: cp_pre_tax_unit_id := tax_unit_id;
1514: elsif cp_pre_tax_unit_id <> tax_unit_id then
1515: hr_utility.set_location(l_name,82);
1511: hr_utility.set_location(l_name,81);
1512: a01_header_record(TAX_UNIT_ID,federal_id) ;
1513: cp_pre_tax_unit_id := tax_unit_id;
1514: elsif cp_pre_tax_unit_id <> tax_unit_id then
1515: hr_utility.set_location(l_name,82);
1516: a01_header_record(TAX_UNIT_ID,federal_id) ;
1517: cp_pre_tax_unit_id := tax_unit_id;
1518: end if;
1519: end if;
1516: a01_header_record(TAX_UNIT_ID,federal_id) ;
1517: cp_pre_tax_unit_id := tax_unit_id;
1518: end if;
1519: end if;
1520: hr_utility.set_location('Leaving... ' || l_name,100);
1521: exception when others then
1522: hr_utility.set_location('Leaving....' || l_name,999);
1523: c_fatal_error_flag := 6;
1524: fnd_message.raise_error;
1518: end if;
1519: end if;
1520: hr_utility.set_location('Leaving... ' || l_name,100);
1521: exception when others then
1522: hr_utility.set_location('Leaving....' || l_name,999);
1523: c_fatal_error_flag := 6;
1524: fnd_message.raise_error;
1525:
1526: END;
1642: v_state hr_locations_all.region_2%TYPE;
1643:
1644:
1645: BEGIN
1646: hr_utility.set_location('Entered p_output_new_hire_null',10);
1647: v_header := 0;
1648: if c_person_id%ISOPEN then
1649: close c_person_id;
1650: end if;
1689:
1690: END LOOP;
1691: fnd_file.put_line(1,' ');
1692:
1693: hr_utility.set_location('p_output_new_hire_null',100);
1694:
1695: CLOSE c_person_id;
1696: exception
1697: when others then