75: begin
76:
77: select 'Y' into l_exists from dual where regexp_like(trim(p_correlation_ids),'[,]*\s*'||f_correlation_id|| '$') OR
78: regexp_like(trim(p_correlation_ids),',\s*' || f_correlation_id || '\s*,') OR regexp_like(trim(p_correlation_ids),'^' || f_correlation_id || '\s*[,]*') ;
79: fnd_file.put_line(fnd_file.LOG,'correlation id <' || f_correlation_id || '>' ||'Matches');
80: return true;
81: exception
82: when no_data_found then
83: fnd_file.put_line(fnd_file.LOG,'correlation id <' || f_correlation_id || '>' ||' doesnot match');
79: fnd_file.put_line(fnd_file.LOG,'correlation id <' || f_correlation_id || '>' ||'Matches');
80: return true;
81: exception
82: when no_data_found then
83: fnd_file.put_line(fnd_file.LOG,'correlation id <' || f_correlation_id || '>' ||' doesnot match');
84: return false;
85: end check_correlation_ids;
86: */
87: function validate_paye_ref(l_employer_paye_ref varchar2 , p_business_group number) return
91: and org_information1 = l_employer_paye_ref
92: and org_information_context = 'Tax Details References';
93: l_paye_exists number := null;
94: begin
95: fnd_file.put_line(fnd_file.LOG,'Validating Paye Reference');
96: open csr_paye_ref_exists;
97: fetch csr_paye_ref_exists into l_paye_exists;
98: close csr_paye_ref_exists;
99: if l_paye_exists = 1 then
118: select PERSON_EXTRA_INFO_ID,object_version_number,pei_information1, pei_information5
119: from per_people_extra_info where PERSON_ID = f_person_id
120: and pei_information_category = 'RTI_NINO';
121: begin
122: fnd_file.put_line(fnd_file.LOG,'Entering ' ||l_package_name || '.update_extra_information');
123:
124: /*select PERSON_EXTRA_INFO_ID,object_version_number,pei_information1, pei_information5 into
125: l_extra_info_id, l_object_version_number, l_nino_verified_flag,l_correlation_id
126: from per_people_extra_info where PERSON_ID = f_person_id
126: from per_people_extra_info where PERSON_ID = f_person_id
127: and pei_information_category = 'RTI_NINO';
128: */
129:
130: fnd_file.put_line(fnd_file.LOG, 'f_person_id: ' ||to_char(f_person_id) ||
131: fnd_global.local_chr(10) || 'f_nino_verifed ' || f_nino_verifed
132: ||fnd_global.local_chr(10) || to_char(f_date_of_issue)
133: ||fnd_global.local_chr(10) || f_nvrep_status
134: ||fnd_global.local_chr(10) || f_nino_ver_type
145: 1. Correlation id on the reply file matches the correlation id stamped on the employee.
146: 2. Correlation id is null in reply file due to notification from EAS/FPS and no correlation id is stamped on employee.
147: */
148: if nvl(l_correlation_id,' ') = nvl(f_correlation_id,' ') then
149: fnd_file.put_line(fnd_file.LOG,'Updating the person EIT record');
150: hr_person_extra_info_api.update_person_extra_info(
151: p_person_extra_info_id => l_extra_info_id,
152: p_pei_information_category => 'RTI_NINO',
153: p_pei_information1 => f_nino_verifed,
188: else
189: l_processed_already := l_processed_already + 1;
190: report_output_already_process(l_processed_already) := 'NINO is verified already for this person: employee no. <' || l_emp_number ||'> last name <' ||l_last_name || '> first name <'
191: || l_first_name ||'> NI Number <' || l_nino_provided ||'>' || ' New NI Number <' || l_nino_to_use || '>';
192: fnd_file.put_line(fnd_file.LOG,'NINO is verified already for this person: last name <' ||l_last_name || '> first name <' || l_first_name ||'> NI Number <' || l_nino_provided ||'>');
193: return -1;
194: end if;
195: elsif f_correlation_id is null then -- insert a new record, this should happen for only Notification status where correlation id is empty.
196: -- insert a new record.
193: return -1;
194: end if;
195: elsif f_correlation_id is null then -- insert a new record, this should happen for only Notification status where correlation id is empty.
196: -- insert a new record.
197: fnd_file.put_line(fnd_file.LOG,'Inserting the person EIT record');
198: fnd_file.put_line(fnd_file.LOG,'f_nvrep_status:--> ' || f_nvrep_status || ' f_nino_ver_type:--> ['|| f_nino_ver_type||']');
199:
200: hr_person_extra_info_api.create_person_extra_info(
201: p_person_id =>f_person_id,
194: end if;
195: elsif f_correlation_id is null then -- insert a new record, this should happen for only Notification status where correlation id is empty.
196: -- insert a new record.
197: fnd_file.put_line(fnd_file.LOG,'Inserting the person EIT record');
198: fnd_file.put_line(fnd_file.LOG,'f_nvrep_status:--> ' || f_nvrep_status || ' f_nino_ver_type:--> ['|| f_nino_ver_type||']');
199:
200: hr_person_extra_info_api.create_person_extra_info(
201: p_person_id =>f_person_id,
202: p_information_type => 'RTI_NINO',
216: 'Correlation ID ' || f_correlation_id || ' not present for matched employee <,' || l_emp_number || ', ' || l_last_name ||
217: '> - please check and update NI number manually or enter the correlation ID on employee record that was received from NVREQ acknowledgement and re-run process';
218: return -1;
219: end if;
220: fnd_file.put_line(fnd_file.LOG,'Leaving ' ||l_package_name || '.update_extra_information');
221: return 1;
222: exception
223: when OTHERS then
224: fnd_file.put_line(fnd_file.LOG,DBMS_UTILITY.format_error_backtrace);
220: fnd_file.put_line(fnd_file.LOG,'Leaving ' ||l_package_name || '.update_extra_information');
221: return 1;
222: exception
223: when OTHERS then
224: fnd_file.put_line(fnd_file.LOG,DBMS_UTILITY.format_error_backtrace);
225: fnd_file.put_line(fnd_file.LOG,sqlcode ||' - ' || sqlerrm);
226: rollback;
227: raise application_error;
228:
221: return 1;
222: exception
223: when OTHERS then
224: fnd_file.put_line(fnd_file.LOG,DBMS_UTILITY.format_error_backtrace);
225: fnd_file.put_line(fnd_file.LOG,sqlcode ||' - ' || sqlerrm);
226: rollback;
227: raise application_error;
228:
229: end update_extra_information;
267: order by 3;
268: l_update_status number;
269: l_obj_version number;
270: begin
271: fnd_file.put_line(fnd_file.LOG,'Entering ' || l_package_name || '.update_emp_record');
272: fnd_file.put_line(fnd_file.LOG,'Parameters ' || ' p_person_id: ' || to_char(p_person_id)
273: || fnd_global.local_chr(10) || 'p_start_date: ' || to_char(p_start_date)
274: || fnd_global.local_chr(10) || 'p_end_date: ' || to_char(p_end_date )
275: || fnd_global.local_chr(10) || 'p_nino_to_use: ' || p_nino_to_use
268: l_update_status number;
269: l_obj_version number;
270: begin
271: fnd_file.put_line(fnd_file.LOG,'Entering ' || l_package_name || '.update_emp_record');
272: fnd_file.put_line(fnd_file.LOG,'Parameters ' || ' p_person_id: ' || to_char(p_person_id)
273: || fnd_global.local_chr(10) || 'p_start_date: ' || to_char(p_start_date)
274: || fnd_global.local_chr(10) || 'p_end_date: ' || to_char(p_end_date )
275: || fnd_global.local_chr(10) || 'p_nino_to_use: ' || p_nino_to_use
276: || fnd_global.local_chr(10) || 'p_date_issued: ' || to_date(p_date_issued)
286: 3. For future submissions please use the NINO provided in this notification
287: 4. The NINO you have provided is correct. For future submissions please continue to use this NINO.
288: 5. Service currently unavailable
289: */
290: --fnd_file.put_line(fnd_file.LOG,'NVREP Status --> ' || l_return_status);
291: if p_msg_ident = '2' then
292:
293: -- update EIT
294: l_update_status := update_extra_information(
373: f_date_of_issue => p_date_issued,
374: f_nvrep_status =>p_msg_ident,
375: f_nino_ver_type => p_nino_reply_type,
376: f_correlation_id => p_correlation_id);
377: fnd_file.put_line(fnd_file.LOG,'Update Status = ' || to_char(l_update_status));
378: if l_update_status <> -1 then
379: --update the Employee NI Number record in update_change_insert mode.
380: l_obj_version := p_object_version_number;
381: l_emp_number := p_employee_number;
388: end if;
389:
390: close csr_future_records_count;
391:
392: fnd_file.put_line(fnd_file.LOG,'l_datetrack_update_mode' || l_datetrack_update_mode);
393: hr_person_api.update_person (
394: p_effective_date =>p_date_issued
395: ,p_datetrack_update_mode => l_datetrack_update_mode
396: ,p_person_id =>p_person_id
424: ,p_name_combination_warning =>p_name_combination_warning
425: ,p_assign_payroll_warning =>p_assign_payroll_warning
426: ,p_orig_hire_warning =>p_orig_hire_warning
427: );
428: fnd_file.put_line(fnd_file.LOG,'Updated future record for person_id = ' ||to_char(p_person_id));
429: fnd_file.put_line(fnd_file.LOG,' Effective start date = ' ||to_char(p_effective_start_date));
430: fnd_file.put_line(fnd_file.LOG,' Effective end date = ' ||to_char(p_effective_end_date));
431: fnd_file.put_line(fnd_file.LOG,' New NI Number = ' || p_nino_to_use);
432: end loop;
425: ,p_assign_payroll_warning =>p_assign_payroll_warning
426: ,p_orig_hire_warning =>p_orig_hire_warning
427: );
428: fnd_file.put_line(fnd_file.LOG,'Updated future record for person_id = ' ||to_char(p_person_id));
429: fnd_file.put_line(fnd_file.LOG,' Effective start date = ' ||to_char(p_effective_start_date));
430: fnd_file.put_line(fnd_file.LOG,' Effective end date = ' ||to_char(p_effective_end_date));
431: fnd_file.put_line(fnd_file.LOG,' New NI Number = ' || p_nino_to_use);
432: end loop;
433:
426: ,p_orig_hire_warning =>p_orig_hire_warning
427: );
428: fnd_file.put_line(fnd_file.LOG,'Updated future record for person_id = ' ||to_char(p_person_id));
429: fnd_file.put_line(fnd_file.LOG,' Effective start date = ' ||to_char(p_effective_start_date));
430: fnd_file.put_line(fnd_file.LOG,' Effective end date = ' ||to_char(p_effective_end_date));
431: fnd_file.put_line(fnd_file.LOG,' New NI Number = ' || p_nino_to_use);
432: end loop;
433:
434: end if;
427: );
428: fnd_file.put_line(fnd_file.LOG,'Updated future record for person_id = ' ||to_char(p_person_id));
429: fnd_file.put_line(fnd_file.LOG,' Effective start date = ' ||to_char(p_effective_start_date));
430: fnd_file.put_line(fnd_file.LOG,' Effective end date = ' ||to_char(p_effective_end_date));
431: fnd_file.put_line(fnd_file.LOG,' New NI Number = ' || p_nino_to_use);
432: end loop;
433:
434: end if;
435: -- Update all the EIT's.
439: f_person_id => p_person_id,
440: f_nvrep_status =>p_msg_ident,
441: f_nino_ver_type => p_nino_reply_type);
442: end if;
443: fnd_file.put_line(fnd_file.LOG,'Update Status before leaving= ' || to_char(l_update_status));
444: fnd_file.put_line(fnd_file.LOG,'Leaving ' || l_package_name || '.update_emp_record');
445: if l_update_status <> -1 then
446: return true;
447: else
440: f_nvrep_status =>p_msg_ident,
441: f_nino_ver_type => p_nino_reply_type);
442: end if;
443: fnd_file.put_line(fnd_file.LOG,'Update Status before leaving= ' || to_char(l_update_status));
444: fnd_file.put_line(fnd_file.LOG,'Leaving ' || l_package_name || '.update_emp_record');
445: if l_update_status <> -1 then
446: return true;
447: else
448: return false;
490: )
491: order by 2,3;
492:
493: begin
494: fnd_file.put_line(fnd_file.LOG,'Entering: ' || l_package_name || '.get_emp_details');
495: p_emp_count := 0;
496: FOR CUR_REC in csr_emp_details
497: loop
498: p_emp_count := p_emp_count + 1;
506: p_object_version_number := CUR_REC.object_version_number;
507: end loop;
508: select max(date_start) into p_recent_start_date from per_periods_of_service where person_id = p_person_id;
509:
510: fnd_file.put_line(fnd_file.LOG,'Leaving: ' || l_package_name || '.get_emp_details');
511: end get_emp_details;
512:
513: begin
514: -- hr_utility.trace_on(null,'suma');
511: end get_emp_details;
512:
513: begin
514: -- hr_utility.trace_on(null,'suma');
515: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
516: fnd_file.put_line(fnd_file.LOG,'Parameter values:');
517: fnd_file.put_line(fnd_file.LOG,'p_business_group: '|| to_char(p_business_group)
518: || fnd_global.local_chr(10) || 'p_validate_mode: ' || p_validate_mode
519: || fnd_global.local_chr(10) || 'p_filename: ' || p_filename);
512:
513: begin
514: -- hr_utility.trace_on(null,'suma');
515: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
516: fnd_file.put_line(fnd_file.LOG,'Parameter values:');
517: fnd_file.put_line(fnd_file.LOG,'p_business_group: '|| to_char(p_business_group)
518: || fnd_global.local_chr(10) || 'p_validate_mode: ' || p_validate_mode
519: || fnd_global.local_chr(10) || 'p_filename: ' || p_filename);
520: --
513: begin
514: -- hr_utility.trace_on(null,'suma');
515: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
516: fnd_file.put_line(fnd_file.LOG,'Parameter values:');
517: fnd_file.put_line(fnd_file.LOG,'p_business_group: '|| to_char(p_business_group)
518: || fnd_global.local_chr(10) || 'p_validate_mode: ' || p_validate_mode
519: || fnd_global.local_chr(10) || 'p_filename: ' || p_filename);
520: --
521: l_filename := p_filename;
525: fnd_profile.get('PER_DATA_EXCHANGE_DIR', l_location);
526: -- Get request id
527: l_request_id := FND_GLOBAL.CONC_REQUEST_ID;
528:
529: fnd_file.put_line(fnd_file.LOG,'directory: <'|| l_location || '>');
530: if l_location is null then
531: -- error : I/O directory not defined
532: retcode := 2;
533: errbuf := 'Input directory not defined. Set PER_DATA_EXCHANGE_DIR profile (HR: Data Exchange directory).';
530: if l_location is null then
531: -- error : I/O directory not defined
532: retcode := 2;
533: errbuf := 'Input directory not defined. Set PER_DATA_EXCHANGE_DIR profile (HR: Data Exchange directory).';
534: fnd_file.put_line(fnd_file.LOG,'Input directory not defined in PER_DATA_EXCHANGE_DIR profile.');
535: raise e_fatal_error;
536: end if;
537: --
538: -- Open flat file
540: --l_file_handle := utl_file.fopen('/usr/tmp','Reply.mf','r');
541: --
542: utl_file.get_line(l_file_handle,l_present_line);
543:
544: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
545:
546: fnd_file.put_line(fnd_file.LOG,'line: '|| l_present_line);
547:
548: report_output_success(success) := 'The following employees have been updated with NINO received: ';
542: utl_file.get_line(l_file_handle,l_present_line);
543:
544: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
545:
546: fnd_file.put_line(fnd_file.LOG,'line: '|| l_present_line);
547:
548: report_output_success(success) := 'The following employees have been updated with NINO received: ';
549: success := success +1;
550: report_output_success(success) := '-------------------------------------------------------------';
569: end if;
570: -- Reading the header section for the first time
571: l_record_name := rtrim(ltrim(substr(l_present_line, 1,5)));
572: l_qualifier := trim(substr(l_present_line,7,3));
573: fnd_file.put_line(fnd_file.LOG,'l_present_line is <' || l_present_line || '>');
574: fnd_file.put_line(fnd_file.LOG,'l_rec_name is <' || l_record_name || '>');
575: fnd_file.put_line(fnd_file.LOG,'l_quali is <' || l_qualifier || '>');
576:
577:
570: -- Reading the header section for the first time
571: l_record_name := rtrim(ltrim(substr(l_present_line, 1,5)));
572: l_qualifier := trim(substr(l_present_line,7,3));
573: fnd_file.put_line(fnd_file.LOG,'l_present_line is <' || l_present_line || '>');
574: fnd_file.put_line(fnd_file.LOG,'l_rec_name is <' || l_record_name || '>');
575: fnd_file.put_line(fnd_file.LOG,'l_quali is <' || l_qualifier || '>');
576:
577:
578:
571: l_record_name := rtrim(ltrim(substr(l_present_line, 1,5)));
572: l_qualifier := trim(substr(l_present_line,7,3));
573: fnd_file.put_line(fnd_file.LOG,'l_present_line is <' || l_present_line || '>');
574: fnd_file.put_line(fnd_file.LOG,'l_rec_name is <' || l_record_name || '>');
575: fnd_file.put_line(fnd_file.LOG,'l_quali is <' || l_qualifier || '>');
576:
577:
578:
579: -- if the record is header section, get the details of the header section
590: elsif l_record_name = 'BGM1' then
591: if l_qualifier = '28' then
592: l_form_type := 'NVREP';
593: else
594: fnd_file.put_line(fnd_file.LOG,'Form Type is not NVREP');
595: retcode:=2;
596: errbuf := 'Form Type is not NVREP.';
597: raise e_fatal_error;
598: end if;
645: end if;
646: -- writing into the database
647: if ((l_record_name = 'LIN1' and (l_employee_count > 1)) or
648: (l_record_name = 'UNS2')) then
649: fnd_file.put_line(fnd_file.LOG,'p_business_group:' || to_number(p_business_group)
650: || fnd_global.local_chr(10) || 'l_employer_paye_ref: ' || l_employer_paye_ref
651: || fnd_global.local_chr(10) || 'l_employee_number: ' || l_employee_number
652: || fnd_global.local_chr(10) || 'l_last_name: ' || l_last_name
653: || fnd_global.local_chr(10) || 'l_first_name: ' || l_first_name
676: p_object_version_number =>l_obj_ver,
677: p_employee_number =>l_emp_number,
678: p_emp_count => l_emp_count
679: );
680: fnd_file.put_line(fnd_file.LOG,'person_id ' || to_char(l_person_id) );
681: fnd_file.put_line(fnd_file.LOG,'person_count' || to_char(l_emp_count) );
682: -- Update the records of the employees found .
683: if (l_person_id is not null) then
684: fnd_file.put_line(fnd_file.LOG,'Employee found for NI Number ' || l_nino_provided);
677: p_employee_number =>l_emp_number,
678: p_emp_count => l_emp_count
679: );
680: fnd_file.put_line(fnd_file.LOG,'person_id ' || to_char(l_person_id) );
681: fnd_file.put_line(fnd_file.LOG,'person_count' || to_char(l_emp_count) );
682: -- Update the records of the employees found .
683: if (l_person_id is not null) then
684: fnd_file.put_line(fnd_file.LOG,'Employee found for NI Number ' || l_nino_provided);
685: fnd_file.put_line(fnd_file.LOG,'person_id ' || to_char(l_person_id)
680: fnd_file.put_line(fnd_file.LOG,'person_id ' || to_char(l_person_id) );
681: fnd_file.put_line(fnd_file.LOG,'person_count' || to_char(l_emp_count) );
682: -- Update the records of the employees found .
683: if (l_person_id is not null) then
684: fnd_file.put_line(fnd_file.LOG,'Employee found for NI Number ' || l_nino_provided);
685: fnd_file.put_line(fnd_file.LOG,'person_id ' || to_char(l_person_id)
686: || fnd_global.local_chr(10) || 'start_date' || to_char(l_start_date)
687: || fnd_global.local_chr(10) || 'end_date' || to_char(l_end_date)
688: || fnd_global.local_chr(10) || 'recent_start_date ' || to_char(l_recent_start_date)
681: fnd_file.put_line(fnd_file.LOG,'person_count' || to_char(l_emp_count) );
682: -- Update the records of the employees found .
683: if (l_person_id is not null) then
684: fnd_file.put_line(fnd_file.LOG,'Employee found for NI Number ' || l_nino_provided);
685: fnd_file.put_line(fnd_file.LOG,'person_id ' || to_char(l_person_id)
686: || fnd_global.local_chr(10) || 'start_date' || to_char(l_start_date)
687: || fnd_global.local_chr(10) || 'end_date' || to_char(l_end_date)
688: || fnd_global.local_chr(10) || 'recent_start_date ' || to_char(l_recent_start_date)
689: || fnd_global.local_chr(10) || 'employee_number ' || l_employee_number );
718: warnings := warnings + 1;
719: retcode := 1;
720: report_output_warnings(warnings) := 'Employee not Found/Terminated for - NI Number:- ' || l_nino_provided || ' - Name:- ' || l_last_name || ' ' || l_first_name
721: || ' Employee Number:- ' || l_payroll_id || ' NI Number to user:- ' || l_nino_to_use;
722: fnd_file.put_line(fnd_file.LOG, 'Employee Not found for NI Number ' || l_nino_provided || ' Name ' || l_last_name || ' ' || l_first_name
723: || ' Employee Number:- ' || l_payroll_id || ' NI Number to user:- ' || l_nino_to_use);
724: end if;
725:
726: -- re initialising the local variables.
746: --
747: begin
748: utl_file.get_line(l_file_handle,l_present_line);
749: --
750: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
751: fnd_file.put_line(fnd_file.LOG,'line: '|| l_present_line);
752: --
753: exception
754: when no_data_found then
747: begin
748: utl_file.get_line(l_file_handle,l_present_line);
749: --
750: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
751: fnd_file.put_line(fnd_file.LOG,'line: '|| l_present_line);
752: --
753: exception
754: when no_data_found then
755: l_processing := false;
761: end loop; -- end l_processing loop as we reached end of file.
762:
763: if p_validate_mode = 'Validate Only' then
764: rollback;
765: fnd_file.put_line(FND_FILE.OUTPUT,'Following details are only validated.');
766: elsif p_validate_mode = 'Validate and Commit - Live' then
767: if l_test_indicator = '1' then
768: rollback;
769: retcode := 1;
766: elsif p_validate_mode = 'Validate and Commit - Live' then
767: if l_test_indicator = '1' then
768: rollback;
769: retcode := 1;
770: fnd_file.put_line(FND_FILE.OUTPUT,'Warning: File requested for processing is a test file. Process will not update records.');
771: else
772: commit;
773: fnd_file.put_line(FND_FILE.OUTPUT,'Following details are validated and saved in the database.');
774: end if;
769: retcode := 1;
770: fnd_file.put_line(FND_FILE.OUTPUT,'Warning: File requested for processing is a test file. Process will not update records.');
771: else
772: commit;
773: fnd_file.put_line(FND_FILE.OUTPUT,'Following details are validated and saved in the database.');
774: end if;
775: elsif p_validate_mode = 'Validate and Commit - Always' then
776: commit;
777: fnd_file.put_line(FND_FILE.OUTPUT,'Following details are validated and saved in the database.');
773: fnd_file.put_line(FND_FILE.OUTPUT,'Following details are validated and saved in the database.');
774: end if;
775: elsif p_validate_mode = 'Validate and Commit - Always' then
776: commit;
777: fnd_file.put_line(FND_FILE.OUTPUT,'Following details are validated and saved in the database.');
778: end if;
779: -- Printing the header
780: FOR i IN 1..report_output_header.count
781: LOOP
778: end if;
779: -- Printing the header
780: FOR i IN 1..report_output_header.count
781: LOOP
782: fnd_file.put_line(FND_FILE.OUTPUT,report_output_header(i));
783: fnd_file.put_line(fnd_file.LOG,report_output_header(i));
784: END LOOP;
785: fnd_file.put_line(FND_FILE.OUTPUT,' ');
786: fnd_file.put_line(FND_FILE.OUTPUT,' ');
779: -- Printing the header
780: FOR i IN 1..report_output_header.count
781: LOOP
782: fnd_file.put_line(FND_FILE.OUTPUT,report_output_header(i));
783: fnd_file.put_line(fnd_file.LOG,report_output_header(i));
784: END LOOP;
785: fnd_file.put_line(FND_FILE.OUTPUT,' ');
786: fnd_file.put_line(FND_FILE.OUTPUT,' ');
787: fnd_file.put_line(fnd_file.LOG,rpad(' ',70, '-'));
781: LOOP
782: fnd_file.put_line(FND_FILE.OUTPUT,report_output_header(i));
783: fnd_file.put_line(fnd_file.LOG,report_output_header(i));
784: END LOOP;
785: fnd_file.put_line(FND_FILE.OUTPUT,' ');
786: fnd_file.put_line(FND_FILE.OUTPUT,' ');
787: fnd_file.put_line(fnd_file.LOG,rpad(' ',70, '-'));
788:
789: -- printing the already processed employee details
782: fnd_file.put_line(FND_FILE.OUTPUT,report_output_header(i));
783: fnd_file.put_line(fnd_file.LOG,report_output_header(i));
784: END LOOP;
785: fnd_file.put_line(FND_FILE.OUTPUT,' ');
786: fnd_file.put_line(FND_FILE.OUTPUT,' ');
787: fnd_file.put_line(fnd_file.LOG,rpad(' ',70, '-'));
788:
789: -- printing the already processed employee details
790: FOR i IN 1..report_output_already_process.count
783: fnd_file.put_line(fnd_file.LOG,report_output_header(i));
784: END LOOP;
785: fnd_file.put_line(FND_FILE.OUTPUT,' ');
786: fnd_file.put_line(FND_FILE.OUTPUT,' ');
787: fnd_file.put_line(fnd_file.LOG,rpad(' ',70, '-'));
788:
789: -- printing the already processed employee details
790: FOR i IN 1..report_output_already_process.count
791: LOOP
788:
789: -- printing the already processed employee details
790: FOR i IN 1..report_output_already_process.count
791: LOOP
792: fnd_file.put_line(FND_FILE.OUTPUT,report_output_already_process(i));
793: END LOOP;
794: fnd_file.put_line(FND_FILE.OUTPUT,' ');
795: fnd_file.put_line(FND_FILE.OUTPUT,'Total Number of employees with NINO previously verified: ' || to_char(l_processed_already) );
796: fnd_file.put_line(FND_FILE.OUTPUT,' ');
790: FOR i IN 1..report_output_already_process.count
791: LOOP
792: fnd_file.put_line(FND_FILE.OUTPUT,report_output_already_process(i));
793: END LOOP;
794: fnd_file.put_line(FND_FILE.OUTPUT,' ');
795: fnd_file.put_line(FND_FILE.OUTPUT,'Total Number of employees with NINO previously verified: ' || to_char(l_processed_already) );
796: fnd_file.put_line(FND_FILE.OUTPUT,' ');
797: --Prinitng the Success part
798: FOR i IN 1..report_output_success.count
791: LOOP
792: fnd_file.put_line(FND_FILE.OUTPUT,report_output_already_process(i));
793: END LOOP;
794: fnd_file.put_line(FND_FILE.OUTPUT,' ');
795: fnd_file.put_line(FND_FILE.OUTPUT,'Total Number of employees with NINO previously verified: ' || to_char(l_processed_already) );
796: fnd_file.put_line(FND_FILE.OUTPUT,' ');
797: --Prinitng the Success part
798: FOR i IN 1..report_output_success.count
799: LOOP
792: fnd_file.put_line(FND_FILE.OUTPUT,report_output_already_process(i));
793: END LOOP;
794: fnd_file.put_line(FND_FILE.OUTPUT,' ');
795: fnd_file.put_line(FND_FILE.OUTPUT,'Total Number of employees with NINO previously verified: ' || to_char(l_processed_already) );
796: fnd_file.put_line(FND_FILE.OUTPUT,' ');
797: --Prinitng the Success part
798: FOR i IN 1..report_output_success.count
799: LOOP
800: fnd_file.put_line(FND_FILE.OUTPUT,report_output_success(i));
796: fnd_file.put_line(FND_FILE.OUTPUT,' ');
797: --Prinitng the Success part
798: FOR i IN 1..report_output_success.count
799: LOOP
800: fnd_file.put_line(FND_FILE.OUTPUT,report_output_success(i));
801: fnd_file.put_line(fnd_file.LOG,report_output_success(i));
802: END LOOP;
803: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed successfully:' || to_char(l_processed_success));
804: fnd_file.put_line(fnd_file.LOG,'No Of employees updated with NINO: ' || to_char(l_processed_success));
797: --Prinitng the Success part
798: FOR i IN 1..report_output_success.count
799: LOOP
800: fnd_file.put_line(FND_FILE.OUTPUT,report_output_success(i));
801: fnd_file.put_line(fnd_file.LOG,report_output_success(i));
802: END LOOP;
803: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed successfully:' || to_char(l_processed_success));
804: fnd_file.put_line(fnd_file.LOG,'No Of employees updated with NINO: ' || to_char(l_processed_success));
805: fnd_file.put_line(FND_FILE.OUTPUT,' ');
799: LOOP
800: fnd_file.put_line(FND_FILE.OUTPUT,report_output_success(i));
801: fnd_file.put_line(fnd_file.LOG,report_output_success(i));
802: END LOOP;
803: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed successfully:' || to_char(l_processed_success));
804: fnd_file.put_line(fnd_file.LOG,'No Of employees updated with NINO: ' || to_char(l_processed_success));
805: fnd_file.put_line(FND_FILE.OUTPUT,' ');
806: fnd_file.put_line(FND_FILE.OUTPUT,' ');
807: -- Printing the warnings part
800: fnd_file.put_line(FND_FILE.OUTPUT,report_output_success(i));
801: fnd_file.put_line(fnd_file.LOG,report_output_success(i));
802: END LOOP;
803: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed successfully:' || to_char(l_processed_success));
804: fnd_file.put_line(fnd_file.LOG,'No Of employees updated with NINO: ' || to_char(l_processed_success));
805: fnd_file.put_line(FND_FILE.OUTPUT,' ');
806: fnd_file.put_line(FND_FILE.OUTPUT,' ');
807: -- Printing the warnings part
808: FOR i IN 1..report_output_warnings.count
801: fnd_file.put_line(fnd_file.LOG,report_output_success(i));
802: END LOOP;
803: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed successfully:' || to_char(l_processed_success));
804: fnd_file.put_line(fnd_file.LOG,'No Of employees updated with NINO: ' || to_char(l_processed_success));
805: fnd_file.put_line(FND_FILE.OUTPUT,' ');
806: fnd_file.put_line(FND_FILE.OUTPUT,' ');
807: -- Printing the warnings part
808: FOR i IN 1..report_output_warnings.count
809: LOOP
802: END LOOP;
803: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed successfully:' || to_char(l_processed_success));
804: fnd_file.put_line(fnd_file.LOG,'No Of employees updated with NINO: ' || to_char(l_processed_success));
805: fnd_file.put_line(FND_FILE.OUTPUT,' ');
806: fnd_file.put_line(FND_FILE.OUTPUT,' ');
807: -- Printing the warnings part
808: FOR i IN 1..report_output_warnings.count
809: LOOP
810: fnd_file.put_line(FND_FILE.OUTPUT,report_output_warnings(i));
806: fnd_file.put_line(FND_FILE.OUTPUT,' ');
807: -- Printing the warnings part
808: FOR i IN 1..report_output_warnings.count
809: LOOP
810: fnd_file.put_line(FND_FILE.OUTPUT,report_output_warnings(i));
811: fnd_file.put_line(fnd_file.LOG,report_output_warnings(i));
812: END LOOP;
813: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed with Warnings:' || to_char(l_processed_warnings));
814: fnd_file.put_line(fnd_file.LOG,'No Of employees processed with warnings:' || to_char(warnings -1));
807: -- Printing the warnings part
808: FOR i IN 1..report_output_warnings.count
809: LOOP
810: fnd_file.put_line(FND_FILE.OUTPUT,report_output_warnings(i));
811: fnd_file.put_line(fnd_file.LOG,report_output_warnings(i));
812: END LOOP;
813: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed with Warnings:' || to_char(l_processed_warnings));
814: fnd_file.put_line(fnd_file.LOG,'No Of employees processed with warnings:' || to_char(warnings -1));
815:
809: LOOP
810: fnd_file.put_line(FND_FILE.OUTPUT,report_output_warnings(i));
811: fnd_file.put_line(fnd_file.LOG,report_output_warnings(i));
812: END LOOP;
813: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed with Warnings:' || to_char(l_processed_warnings));
814: fnd_file.put_line(fnd_file.LOG,'No Of employees processed with warnings:' || to_char(warnings -1));
815:
816: fnd_file.put_line(FND_FILE.OUTPUT,fnd_global.local_chr(10) || 'Total number of employees in the file: ' || to_char(l_employee_count));
817: fnd_file.put_line(fnd_file.LOG, 'Total No of employees in the file: ' || to_char(l_employee_count));
810: fnd_file.put_line(FND_FILE.OUTPUT,report_output_warnings(i));
811: fnd_file.put_line(fnd_file.LOG,report_output_warnings(i));
812: END LOOP;
813: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed with Warnings:' || to_char(l_processed_warnings));
814: fnd_file.put_line(fnd_file.LOG,'No Of employees processed with warnings:' || to_char(warnings -1));
815:
816: fnd_file.put_line(FND_FILE.OUTPUT,fnd_global.local_chr(10) || 'Total number of employees in the file: ' || to_char(l_employee_count));
817: fnd_file.put_line(fnd_file.LOG, 'Total No of employees in the file: ' || to_char(l_employee_count));
818:
812: END LOOP;
813: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed with Warnings:' || to_char(l_processed_warnings));
814: fnd_file.put_line(fnd_file.LOG,'No Of employees processed with warnings:' || to_char(warnings -1));
815:
816: fnd_file.put_line(FND_FILE.OUTPUT,fnd_global.local_chr(10) || 'Total number of employees in the file: ' || to_char(l_employee_count));
817: fnd_file.put_line(fnd_file.LOG, 'Total No of employees in the file: ' || to_char(l_employee_count));
818:
819: exception
820: when e_invalid_paye_ref then
813: fnd_file.put_line(FND_FILE.OUTPUT, fnd_global.local_chr(10) || 'Total number of employees processed with Warnings:' || to_char(l_processed_warnings));
814: fnd_file.put_line(fnd_file.LOG,'No Of employees processed with warnings:' || to_char(warnings -1));
815:
816: fnd_file.put_line(FND_FILE.OUTPUT,fnd_global.local_chr(10) || 'Total number of employees in the file: ' || to_char(l_employee_count));
817: fnd_file.put_line(fnd_file.LOG, 'Total No of employees in the file: ' || to_char(l_employee_count));
818:
819: exception
820: when e_invalid_paye_ref then
821: fnd_file.put_line(fnd_file.LOG,'No match found on database for PAYE Ref <'|| l_employer_paye_ref ||'>');
817: fnd_file.put_line(fnd_file.LOG, 'Total No of employees in the file: ' || to_char(l_employee_count));
818:
819: exception
820: when e_invalid_paye_ref then
821: fnd_file.put_line(fnd_file.LOG,'No match found on database for PAYE Ref <'|| l_employer_paye_ref ||'>');
822: retcode := 2;
823: errbuf := 'No match found in the database for PAYE Ref <'|| l_employer_paye_ref ||'>.';
824: utl_file.fclose(l_file_handle);
825: rollback;
824: utl_file.fclose(l_file_handle);
825: rollback;
826: when e_multiple_emp_err then
827: UTL_FILE.FCLOSE(l_file_handle);
828: fnd_file.put_line(fnd_file.LOG,'Multiple employees matched for < ' || l_last_name || ' ' || l_first_name || '> ');
829: retcode := 2;
830: rollback;
831: when e_fatal_error then
832: UTL_FILE.FCLOSE(l_file_handle);
829: retcode := 2;
830: rollback;
831: when e_fatal_error then
832: UTL_FILE.FCLOSE(l_file_handle);
833: fnd_file.put_line(fnd_file.LOG,'Fatal Error');
834: rollback;
835: when UTL_FILE.INVALID_OPERATION then
836: UTL_FILE.FCLOSE(l_file_handle);
837: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
833: fnd_file.put_line(fnd_file.LOG,'Fatal Error');
834: rollback;
835: when UTL_FILE.INVALID_OPERATION then
836: UTL_FILE.FCLOSE(l_file_handle);
837: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
838: retcode:=2;
839: errbuf := 'Reading NINO Reply File - Invalid Operation (file not found).';
840: when UTL_FILE.INTERNAL_ERROR then
841: UTL_FILE.FCLOSE(l_file_handle);
838: retcode:=2;
839: errbuf := 'Reading NINO Reply File - Invalid Operation (file not found).';
840: when UTL_FILE.INTERNAL_ERROR then
841: UTL_FILE.FCLOSE(l_file_handle);
842: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
843: retcode:=2;
844: errbuf := 'Reading NINO Reply File - Internal Error.';
845: when UTL_FILE.INVALID_MODE then
846: UTL_FILE.FCLOSE(l_file_handle);
843: retcode:=2;
844: errbuf := 'Reading NINO Reply File - Internal Error.';
845: when UTL_FILE.INVALID_MODE then
846: UTL_FILE.FCLOSE(l_file_handle);
847: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
848: retcode:=2;
849: errbuf := 'Reading NINO Reply File - Invalid Mode.';
850: when UTL_FILE.INVALID_PATH then
851: UTL_FILE.FCLOSE(l_file_handle);
848: retcode:=2;
849: errbuf := 'Reading NINO Reply File - Invalid Mode.';
850: when UTL_FILE.INVALID_PATH then
851: UTL_FILE.FCLOSE(l_file_handle);
852: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
853: retcode:=2;
854: errbuf := 'Reading NINO Reply File - Invalid Path.';
855: when UTL_FILE.INVALID_FILEHANDLE then
856: UTL_FILE.FCLOSE(l_file_handle);
853: retcode:=2;
854: errbuf := 'Reading NINO Reply File - Invalid Path.';
855: when UTL_FILE.INVALID_FILEHANDLE then
856: UTL_FILE.FCLOSE(l_file_handle);
857: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
858: retcode:=2;
859: errbuf := 'Reading NINO Reply File - Invalid File Handle.';
860: when UTL_FILE.READ_ERROR then
861: UTL_FILE.FCLOSE(l_file_handle);
858: retcode:=2;
859: errbuf := 'Reading NINO Reply File - Invalid File Handle.';
860: when UTL_FILE.READ_ERROR then
861: UTL_FILE.FCLOSE(l_file_handle);
862: fnd_file.put_line(fnd_file.LOG,'PAY_GB_RTI_NINO_REPLY_PKG.read_nino_reply');
863: retcode:=2;
864: errbuf := 'Reading NINO Reply File - Read Error.';
865:
866: when others then
864: errbuf := 'Reading NINO Reply File - Read Error.';
865:
866: when others then
867: retcode := 2;
868: fnd_file.put_line(fnd_file.LOG,'Exception : ' || SQLERRM || ' ' || sqlcode);
869: fnd_file.put_line(fnd_file.LOG,DBMS_UTILITY.format_error_backtrace);
870: retcode := 2;
871: utl_file.fclose(l_file_handle);
872: rollback;
865:
866: when others then
867: retcode := 2;
868: fnd_file.put_line(fnd_file.LOG,'Exception : ' || SQLERRM || ' ' || sqlcode);
869: fnd_file.put_line(fnd_file.LOG,DBMS_UTILITY.format_error_backtrace);
870: retcode := 2;
871: utl_file.fclose(l_file_handle);
872: rollback;
873: