250: INSERT INTO fnd_sessions(SESSION_ID , EFFECTIVE_DATE )
251: VALUES(userenv('SESSIONID'),fnd_date.canonical_to_date(p_effective_date)) ;
252:
253: -- input parameters
254: hr_utility.set_location('p_file_name '||p_file_name,1);
255: hr_utility.set_location('p_effective_date '||p_effective_date,1);
256: hr_utility.set_location('p_business_group_id '||p_business_group_id,1 );
257: hr_utility.set_location('p_batch_name '||p_batch_name,1);
258: hr_utility.set_location('p_reference '||p_reference,1);
251: VALUES(userenv('SESSIONID'),fnd_date.canonical_to_date(p_effective_date)) ;
252:
253: -- input parameters
254: hr_utility.set_location('p_file_name '||p_file_name,1);
255: hr_utility.set_location('p_effective_date '||p_effective_date,1);
256: hr_utility.set_location('p_business_group_id '||p_business_group_id,1 );
257: hr_utility.set_location('p_batch_name '||p_batch_name,1);
258: hr_utility.set_location('p_reference '||p_reference,1);
259:
252:
253: -- input parameters
254: hr_utility.set_location('p_file_name '||p_file_name,1);
255: hr_utility.set_location('p_effective_date '||p_effective_date,1);
256: hr_utility.set_location('p_business_group_id '||p_business_group_id,1 );
257: hr_utility.set_location('p_batch_name '||p_batch_name,1);
258: hr_utility.set_location('p_reference '||p_reference,1);
259:
260: hr_utility.set_location ( 'Entering:' || l_proc, 10);
253: -- input parameters
254: hr_utility.set_location('p_file_name '||p_file_name,1);
255: hr_utility.set_location('p_effective_date '||p_effective_date,1);
256: hr_utility.set_location('p_business_group_id '||p_business_group_id,1 );
257: hr_utility.set_location('p_batch_name '||p_batch_name,1);
258: hr_utility.set_location('p_reference '||p_reference,1);
259:
260: hr_utility.set_location ( 'Entering:' || l_proc, 10);
261:
254: hr_utility.set_location('p_file_name '||p_file_name,1);
255: hr_utility.set_location('p_effective_date '||p_effective_date,1);
256: hr_utility.set_location('p_business_group_id '||p_business_group_id,1 );
257: hr_utility.set_location('p_batch_name '||p_batch_name,1);
258: hr_utility.set_location('p_reference '||p_reference,1);
259:
260: hr_utility.set_location ( 'Entering:' || l_proc, 10);
261:
262: OPEN csr_leg (p_business_group_id);
256: hr_utility.set_location('p_business_group_id '||p_business_group_id,1 );
257: hr_utility.set_location('p_batch_name '||p_batch_name,1);
258: hr_utility.set_location('p_reference '||p_reference,1);
259:
260: hr_utility.set_location ( 'Entering:' || l_proc, 10);
261:
262: OPEN csr_leg (p_business_group_id);
263: FETCH csr_leg INTO l_legislation_code, l_bg_name;
264: CLOSE csr_leg;
262: OPEN csr_leg (p_business_group_id);
263: FETCH csr_leg INTO l_legislation_code, l_bg_name;
264: CLOSE csr_leg;
265:
266: hr_utility.set_location ( 'Legislation = ' || l_legislation_code, 20);
267:
268: l_filename := p_file_name;
269: fnd_profile.get (c_data_exchange_dir, l_location);
270: hr_utility.set_location ( 'Directory = ' || l_location, 30);
266: hr_utility.set_location ( 'Legislation = ' || l_legislation_code, 20);
267:
268: l_filename := p_file_name;
269: fnd_profile.get (c_data_exchange_dir, l_location);
270: hr_utility.set_location ( 'Directory = ' || l_location, 30);
271:
272: IF l_location IS NULL THEN
273: -- error : I/O directory not defined
274: RAISE e_fatal_error;
283: (p_batch_name => p_batch_name,
284: p_business_group_name => l_bg_name,
285: p_reference => substr(p_reference||'('||fnd_date.date_to_displaydt(SYSDATE)||')',1,30));
286:
287: hr_utility.set_location ( ' Batch ID = ' || l_batch_id, 40);
288:
289: -- Loop over the file, reading in each line. GET_LINE will
290: -- raise NO_DATA_FOUND when it is done, so we use that as the
291: -- exit condition for the loop
302: IF UTL_FILE.is_open (l_file_type) THEN
303: UTL_FILE.fclose (l_file_type);
304: END IF;
305:
306: hr_utility.set_location (l_proc, 50);
307: retcode := c_error;
308: -- The error will mean batch_seq doesn't get upped so add 1 when
309: -- reporting line
310: errbuf := 'Input line (line nr = '
317: WHEN NO_DATA_FOUND THEN
318: EXIT;
319: END;
320:
321: hr_utility.set_location ( ' line read: ' || SUBSTR (l_line_read, 1, 40),60);
322:
323: BEGIN
324: -- setting default value for element link found flag
325: l_element_link_found := 'FOUND';
349: ,p_return_value2 => l_employer_org_no
350: ,p_return_value3 => l_employment_type
351: );
352:
353: hr_utility.set_location ( ' NI Number = ' || l_ni, 130);
354: hr_utility.set_location ( ' Employer Organization Number = ' || l_employer_org_no, 140);
355:
356: OPEN csr_get_prim_assg
357: ( p_business_group_id => p_business_group_id
350: ,p_return_value3 => l_employment_type
351: );
352:
353: hr_utility.set_location ( ' NI Number = ' || l_ni, 130);
354: hr_utility.set_location ( ' Employer Organization Number = ' || l_employer_org_no, 140);
355:
356: OPEN csr_get_prim_assg
357: ( p_business_group_id => p_business_group_id
358: ,p_ni => l_ni
393: END IF;
394: CLOSE csr_get_element_details;
395:
396:
397: hr_utility.set_location ( ' Element Entry ID = ' || l_element_entry_id, 150);
398: hr_utility.set_location ( ' Element Name = ' || l_element_name, 150);
399: hr_utility.set_location ( ' Element Entry Start Date = '||l_effective_start_date, 150);
400: hr_utility.set_location ( ' Element Entry End Date = '||l_effective_end_date, 150);
401:
394: CLOSE csr_get_element_details;
395:
396:
397: hr_utility.set_location ( ' Element Entry ID = ' || l_element_entry_id, 150);
398: hr_utility.set_location ( ' Element Name = ' || l_element_name, 150);
399: hr_utility.set_location ( ' Element Entry Start Date = '||l_effective_start_date, 150);
400: hr_utility.set_location ( ' Element Entry End Date = '||l_effective_end_date, 150);
401:
402: l_element_link_id := get_element_link_id(l_assignment_id ,p_business_group_id,p_effective_date,'Tax Card');
395:
396:
397: hr_utility.set_location ( ' Element Entry ID = ' || l_element_entry_id, 150);
398: hr_utility.set_location ( ' Element Name = ' || l_element_name, 150);
399: hr_utility.set_location ( ' Element Entry Start Date = '||l_effective_start_date, 150);
400: hr_utility.set_location ( ' Element Entry End Date = '||l_effective_end_date, 150);
401:
402: l_element_link_id := get_element_link_id(l_assignment_id ,p_business_group_id,p_effective_date,'Tax Card');
403:
396:
397: hr_utility.set_location ( ' Element Entry ID = ' || l_element_entry_id, 150);
398: hr_utility.set_location ( ' Element Name = ' || l_element_name, 150);
399: hr_utility.set_location ( ' Element Entry Start Date = '||l_effective_start_date, 150);
400: hr_utility.set_location ( ' Element Entry End Date = '||l_effective_end_date, 150);
401:
402: l_element_link_id := get_element_link_id(l_assignment_id ,p_business_group_id,p_effective_date,'Tax Card');
403:
404: -- Add User Keys for Data Pump
422:
423: END IF;
424: CLOSE csr_get_user_key;
425:
426: hr_utility.set_location ( ' User Key added ' , 160);
427:
428: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 170);
429: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 170);
430: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 170);
424: CLOSE csr_get_user_key;
425:
426: hr_utility.set_location ( ' User Key added ' , 160);
427:
428: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 170);
429: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 170);
430: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 170);
431: hr_utility.set_location ( ' c_end_of_time:' || to_char(c_end_of_time), 170);
432:
425:
426: hr_utility.set_location ( ' User Key added ' , 160);
427:
428: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 170);
429: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 170);
430: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 170);
431: hr_utility.set_location ( ' c_end_of_time:' || to_char(c_end_of_time), 170);
432:
433: -- Define Datetrack Updation Mode
426: hr_utility.set_location ( ' User Key added ' , 160);
427:
428: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 170);
429: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 170);
430: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 170);
431: hr_utility.set_location ( ' c_end_of_time:' || to_char(c_end_of_time), 170);
432:
433: -- Define Datetrack Updation Mode
434: IF(l_effective_start_date = fnd_date.canonical_to_date(p_effective_date))
427:
428: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 170);
429: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 170);
430: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 170);
431: hr_utility.set_location ( ' c_end_of_time:' || to_char(c_end_of_time), 170);
432:
433: -- Define Datetrack Updation Mode
434: IF(l_effective_start_date = fnd_date.canonical_to_date(p_effective_date))
435: THEN
440: ELSE
441: l_datetrack_update_mode := 'UPDATE';
442: END IF;
443:
444: hr_utility.set_location ( ' Datetrack Update Mode:' || l_datetrack_update_mode, 180);
445:
446:
447: -- Data Pump procedure called to create batch lines to update element entries
448: hrdpp_update_element_entry.insert_batch_lines
564: ,P_INPUT_VALUE_NAME15 =>l_input_value_name15);
565:
566: END IF;
567:
568: hr_utility.set_location ( ' Batch Lines created ' , 190);
569:
570: -- commit the records uppon reaching the commit point
571: END IF;
572:
640: END IF;
641: CLOSE csr_get_element_details;
642:
643:
644: hr_utility.set_location ( ' Element Entry ID = ' || l_element_entry_id, 200);
645: hr_utility.set_location ( ' Element Name = ' || l_element_name, 200);
646: hr_utility.set_location ( ' Element Entry Start Date = '||l_effective_start_date, 200);
647: hr_utility.set_location ( ' Element Entry End Date = '||l_effective_end_date, 200);
648:
641: CLOSE csr_get_element_details;
642:
643:
644: hr_utility.set_location ( ' Element Entry ID = ' || l_element_entry_id, 200);
645: hr_utility.set_location ( ' Element Name = ' || l_element_name, 200);
646: hr_utility.set_location ( ' Element Entry Start Date = '||l_effective_start_date, 200);
647: hr_utility.set_location ( ' Element Entry End Date = '||l_effective_end_date, 200);
648:
649:
642:
643:
644: hr_utility.set_location ( ' Element Entry ID = ' || l_element_entry_id, 200);
645: hr_utility.set_location ( ' Element Name = ' || l_element_name, 200);
646: hr_utility.set_location ( ' Element Entry Start Date = '||l_effective_start_date, 200);
647: hr_utility.set_location ( ' Element Entry End Date = '||l_effective_end_date, 200);
648:
649:
650: l_element_link_id := get_element_link_id(l_assignment_id ,p_business_group_id,p_effective_date,'Tax');
643:
644: hr_utility.set_location ( ' Element Entry ID = ' || l_element_entry_id, 200);
645: hr_utility.set_location ( ' Element Name = ' || l_element_name, 200);
646: hr_utility.set_location ( ' Element Entry Start Date = '||l_effective_start_date, 200);
647: hr_utility.set_location ( ' Element Entry End Date = '||l_effective_end_date, 200);
648:
649:
650: l_element_link_id := get_element_link_id(l_assignment_id ,p_business_group_id,p_effective_date,'Tax');
651:
658: hr_pump_utils.add_user_key(l_t_ee_user_key,l_element_entry_id);
659: END IF;
660: CLOSE csr_get_user_key;
661:
662: hr_utility.set_location ( ' User Key added ' , 210);
663:
664: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 220);
665: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 220);
666: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 220);
660: CLOSE csr_get_user_key;
661:
662: hr_utility.set_location ( ' User Key added ' , 210);
663:
664: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 220);
665: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 220);
666: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 220);
667: hr_utility.set_location ( ' c_end_of_time:' || to_char(c_end_of_time), 220);
668:
661:
662: hr_utility.set_location ( ' User Key added ' , 210);
663:
664: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 220);
665: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 220);
666: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 220);
667: hr_utility.set_location ( ' c_end_of_time:' || to_char(c_end_of_time), 220);
668:
669: -- Define Datetrack Updation Mode
662: hr_utility.set_location ( ' User Key added ' , 210);
663:
664: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 220);
665: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 220);
666: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 220);
667: hr_utility.set_location ( ' c_end_of_time:' || to_char(c_end_of_time), 220);
668:
669: -- Define Datetrack Updation Mode
670: IF(l_effective_start_date = fnd_date.canonical_to_date(p_effective_date))
663:
664: hr_utility.set_location ( ' l_effective_start_date:' || to_char(l_effective_start_date), 220);
665: hr_utility.set_location ( ' l_effective_end_date:' || to_char(l_effective_end_date), 220);
666: hr_utility.set_location ( ' p_effective_date:' || to_char(fnd_date.canonical_to_date(p_effective_date)), 220);
667: hr_utility.set_location ( ' c_end_of_time:' || to_char(c_end_of_time), 220);
668:
669: -- Define Datetrack Updation Mode
670: IF(l_effective_start_date = fnd_date.canonical_to_date(p_effective_date))
671: THEN
676: ELSE
677: l_datetrack_update_mode := 'UPDATE';
678: END IF;
679:
680: hr_utility.set_location ( ' Datetrack Update Mode:' || l_datetrack_update_mode, 230);
681:
682:
683: -- Data Pump procedure called to create batch lines to update element entries
684: hrdpp_update_element_entry.insert_batch_lines
743:
744: retcode := c_warning;
745:
746: -- Set the application error
747: hr_utility.set_message (801, 'HR_376620_FI_RECORD_TOO_LONG');
748: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
749: hr_utility.set_message_token (801, 'LINE', l_line_read);
750: hr_utility.set_location (l_proc, 280);
751:
744: retcode := c_warning;
745:
746: -- Set the application error
747: hr_utility.set_message (801, 'HR_376620_FI_RECORD_TOO_LONG');
748: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
749: hr_utility.set_message_token (801, 'LINE', l_line_read);
750: hr_utility.set_location (l_proc, 280);
751:
752: -- Write the message to log file, do not raise an application error but continue
745:
746: -- Set the application error
747: hr_utility.set_message (801, 'HR_376620_FI_RECORD_TOO_LONG');
748: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
749: hr_utility.set_message_token (801, 'LINE', l_line_read);
750: hr_utility.set_location (l_proc, 280);
751:
752: -- Write the message to log file, do not raise an application error but continue
753: -- (with next line)
746: -- Set the application error
747: hr_utility.set_message (801, 'HR_376620_FI_RECORD_TOO_LONG');
748: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
749: hr_utility.set_message_token (801, 'LINE', l_line_read);
750: hr_utility.set_location (l_proc, 280);
751:
752: -- Write the message to log file, do not raise an application error but continue
753: -- (with next line)
754:
751:
752: -- Write the message to log file, do not raise an application error but continue
753: -- (with next line)
754:
755: fnd_file.put_line (fnd_file.LOG, hr_utility.get_message);
756:
757: WHEN e_mismatch_tax_card THEN
758: --Mismatch Between Employment Type and Tax card
759:
761:
762: retcode := c_warning;
763:
764: -- Set the application error
765: hr_utility.set_message (801, 'HR_376621_FI_MISMATCH_TAXCARD');
766: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
767: hr_utility.set_message_token (801, 'LINE', l_line_read);
768: hr_utility.set_location (l_proc, 290);
769:
762: retcode := c_warning;
763:
764: -- Set the application error
765: hr_utility.set_message (801, 'HR_376621_FI_MISMATCH_TAXCARD');
766: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
767: hr_utility.set_message_token (801, 'LINE', l_line_read);
768: hr_utility.set_location (l_proc, 290);
769:
770: -- Write the message to log file, do not raise an application error but continue
763:
764: -- Set the application error
765: hr_utility.set_message (801, 'HR_376621_FI_MISMATCH_TAXCARD');
766: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
767: hr_utility.set_message_token (801, 'LINE', l_line_read);
768: hr_utility.set_location (l_proc, 290);
769:
770: -- Write the message to log file, do not raise an application error but continue
771: -- (with next line)
764: -- Set the application error
765: hr_utility.set_message (801, 'HR_376621_FI_MISMATCH_TAXCARD');
766: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
767: hr_utility.set_message_token (801, 'LINE', l_line_read);
768: hr_utility.set_location (l_proc, 290);
769:
770: -- Write the message to log file, do not raise an application error but continue
771: -- (with next line)
772:
769:
770: -- Write the message to log file, do not raise an application error but continue
771: -- (with next line)
772:
773: fnd_file.put_line (fnd_file.LOG, hr_utility.get_message);
774: WHEN e_no_asg THEN
775: -- No assignment for the employee
776:
777: -- Set retcode to 1, indicating a WARNING to the ConcMgr
778:
779: retcode := c_warning;
780:
781: -- Set the application error
782: hr_utility.set_message (801, 'HR_376619_FI_NO_ASG');
783: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
784: hr_utility.set_message_token (801, 'LINE', l_line_read);
785: hr_utility.set_location (l_proc, 280);
786:
779: retcode := c_warning;
780:
781: -- Set the application error
782: hr_utility.set_message (801, 'HR_376619_FI_NO_ASG');
783: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
784: hr_utility.set_message_token (801, 'LINE', l_line_read);
785: hr_utility.set_location (l_proc, 280);
786:
787: -- Write the message to log file, do not raise an application error but continue
780:
781: -- Set the application error
782: hr_utility.set_message (801, 'HR_376619_FI_NO_ASG');
783: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
784: hr_utility.set_message_token (801, 'LINE', l_line_read);
785: hr_utility.set_location (l_proc, 280);
786:
787: -- Write the message to log file, do not raise an application error but continue
788: -- (with next line)
781: -- Set the application error
782: hr_utility.set_message (801, 'HR_376619_FI_NO_ASG');
783: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
784: hr_utility.set_message_token (801, 'LINE', l_line_read);
785: hr_utility.set_location (l_proc, 280);
786:
787: -- Write the message to log file, do not raise an application error but continue
788: -- (with next line)
789:
786:
787: -- Write the message to log file, do not raise an application error but continue
788: -- (with next line)
789:
790: fnd_file.put_line (fnd_file.LOG, hr_utility.get_message);
791:
792:
793: WHEN e_no_data_tax THEN
794: --No data returned by Tax Authorities
797:
798: retcode := c_warning;
799:
800: -- Set the application error
801: hr_utility.set_message (801, 'HR_376622_FI_NO_DATA_TAX');
802: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
803: hr_utility.set_message_token (801, 'LINE', l_line_read);
804: hr_utility.set_location (l_proc, 330);
805:
798: retcode := c_warning;
799:
800: -- Set the application error
801: hr_utility.set_message (801, 'HR_376622_FI_NO_DATA_TAX');
802: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
803: hr_utility.set_message_token (801, 'LINE', l_line_read);
804: hr_utility.set_location (l_proc, 330);
805:
806: -- Write the message to log file, do not raise an application error but continue
799:
800: -- Set the application error
801: hr_utility.set_message (801, 'HR_376622_FI_NO_DATA_TAX');
802: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
803: hr_utility.set_message_token (801, 'LINE', l_line_read);
804: hr_utility.set_location (l_proc, 330);
805:
806: -- Write the message to log file, do not raise an application error but continue
807: -- (with next line)
800: -- Set the application error
801: hr_utility.set_message (801, 'HR_376622_FI_NO_DATA_TAX');
802: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
803: hr_utility.set_message_token (801, 'LINE', l_line_read);
804: hr_utility.set_location (l_proc, 330);
805:
806: -- Write the message to log file, do not raise an application error but continue
807: -- (with next line)
808:
805:
806: -- Write the message to log file, do not raise an application error but continue
807: -- (with next line)
808:
809: fnd_file.put_line (fnd_file.LOG, hr_utility.get_message);
810:
811:
812: WHEN e_no_tax_element THEN
813: --Tax Element not attached to Assignment
816:
817: retcode := c_warning;
818:
819: -- Set the application error
820: hr_utility.set_message (801, 'HR_376623_FI_NO_TAX_ELEMENT');
821: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
822: hr_utility.set_message_token (801, 'LINE', l_line_read);
823: hr_utility.set_location (l_proc, 310);
824:
817: retcode := c_warning;
818:
819: -- Set the application error
820: hr_utility.set_message (801, 'HR_376623_FI_NO_TAX_ELEMENT');
821: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
822: hr_utility.set_message_token (801, 'LINE', l_line_read);
823: hr_utility.set_location (l_proc, 310);
824:
825: -- Write the message to log file, do not raise an application error but continue
818:
819: -- Set the application error
820: hr_utility.set_message (801, 'HR_376623_FI_NO_TAX_ELEMENT');
821: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
822: hr_utility.set_message_token (801, 'LINE', l_line_read);
823: hr_utility.set_location (l_proc, 310);
824:
825: -- Write the message to log file, do not raise an application error but continue
826: -- (with next line)
819: -- Set the application error
820: hr_utility.set_message (801, 'HR_376623_FI_NO_TAX_ELEMENT');
821: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
822: hr_utility.set_message_token (801, 'LINE', l_line_read);
823: hr_utility.set_location (l_proc, 310);
824:
825: -- Write the message to log file, do not raise an application error but continue
826: -- (with next line)
827:
824:
825: -- Write the message to log file, do not raise an application error but continue
826: -- (with next line)
827:
828: fnd_file.put_line (fnd_file.LOG, hr_utility.get_message);
829: WHEN e_no_tax_link
830: -- Wrong CSR routine
831: THEN
832: -- Set retcode to 1, indicating a WARNING to the ConcMgr
832: -- Set retcode to 1, indicating a WARNING to the ConcMgr
833: retcode := c_warning;
834:
835: -- Set the application error
836: hr_utility.set_message (801, 'HR_376624_FI_NO_TAX_CARD_LINK');
837: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
838: hr_utility.set_message_token (801, 'LINE', l_line_read);
839: hr_utility.set_location (l_proc, 320);
840:
833: retcode := c_warning;
834:
835: -- Set the application error
836: hr_utility.set_message (801, 'HR_376624_FI_NO_TAX_CARD_LINK');
837: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
838: hr_utility.set_message_token (801, 'LINE', l_line_read);
839: hr_utility.set_location (l_proc, 320);
840:
841: -- Write the message to log file, do not raise an application error but continue
834:
835: -- Set the application error
836: hr_utility.set_message (801, 'HR_376624_FI_NO_TAX_CARD_LINK');
837: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
838: hr_utility.set_message_token (801, 'LINE', l_line_read);
839: hr_utility.set_location (l_proc, 320);
840:
841: -- Write the message to log file, do not raise an application error but continue
842: -- (with next line)
835: -- Set the application error
836: hr_utility.set_message (801, 'HR_376624_FI_NO_TAX_CARD_LINK');
837: hr_utility.set_message_token (801, 'LINE_NO', l_batch_seq);
838: hr_utility.set_message_token (801, 'LINE', l_line_read);
839: hr_utility.set_location (l_proc, 320);
840:
841: -- Write the message to log file, do not raise an application error but continue
842: -- (with next line)
843:
840:
841: -- Write the message to log file, do not raise an application error but continue
842: -- (with next line)
843:
844: fnd_file.put_line (fnd_file.LOG, hr_utility.get_message);
845:
846:
847: END;
848: END LOOP read_lines_in_file;
850: -- Commit the outstanding records
851: COMMIT;
852:
853: UTL_FILE.fclose (l_file_type);
854: hr_utility.set_location ( 'Leaving:'|| l_proc, 320);
855:
856: -- Most of these exceptions are not translated as they should not happen normally
857: -- If they do happen, something is seriously wrong and SysAdmin interference will be necessary.
858:
863: IF UTL_FILE.is_open (l_file_type) THEN
864: UTL_FILE.fclose (l_file_type);
865: END IF;
866:
867: hr_utility.set_location (l_proc, 330);
868:
869: -- Set retcode to 2, indicating an ERROR to the ConcMgr
870: retcode := c_error;
871:
869: -- Set retcode to 2, indicating an ERROR to the ConcMgr
870: retcode := c_error;
871:
872: -- Set the application error
873: hr_utility.set_message (801, 'HR_FI_DATA_EXCHANGE_DIR_MIS');
874:
875: -- Return the message to the ConcMgr (This msg will appear in the log file)
876: errbuf := hr_utility.get_message;
877:
872: -- Set the application error
873: hr_utility.set_message (801, 'HR_FI_DATA_EXCHANGE_DIR_MIS');
874:
875: -- Return the message to the ConcMgr (This msg will appear in the log file)
876: errbuf := hr_utility.get_message;
877:
878: WHEN UTL_FILE.invalid_operation THEN
879: -- File could not be opened as requested, perhaps because of operating system permissions
880: -- Also raised when attempting a write operation on a file opened for read, or a read operation
884: IF UTL_FILE.is_open (l_file_type) THEN
885: UTL_FILE.fclose (l_file_type);
886: END IF;
887:
888: hr_utility.set_location (l_proc, 340);
889: retcode := c_error;
890: errbuf := 'Reading File ('||l_location ||' -> '
891: || l_filename
892: || ') - Invalid Operation.';
895: IF UTL_FILE.is_open (l_file_type) THEN
896: UTL_FILE.fclose (l_file_type);
897: END IF;
898:
899: hr_utility.set_location (l_proc, 350);
900: retcode := c_error;
901: errbuf := 'Reading File ('
902: || l_location
903: || ' -> '
911: THEN
912: UTL_FILE.fclose (l_file_type);
913: END IF;
914:
915: hr_utility.set_location (l_proc, 360);
916: retcode := c_error;
917: errbuf := 'Reading File ('
918: || l_location
919: || ' -> '
932: || l_location
933: || ' -> '
934: || l_filename
935: || ') - Invalid Path or Filename.';
936: hr_utility.set_location (l_proc, 370);
937:
938: WHEN UTL_FILE.invalid_filehandle THEN
939: -- File type does not specify an open file
940:
941: IF UTL_FILE.is_open (l_file_type) THEN
942: UTL_FILE.fclose (l_file_type);
943: END IF;
944:
945: hr_utility.set_location (l_proc, 380);
946: retcode := c_error;
947: errbuf := 'Reading File ('
948: || l_location
949: || ' -> '
956: IF UTL_FILE.is_open (l_file_type) THEN
957: UTL_FILE.fclose (l_file_type);
958: END IF;
959:
960: hr_utility.set_location (l_proc, 390);
961: retcode := c_error;
962: errbuf := 'Reading File ('
963: || l_location
964: || ' -> '
1003: l_one_income_limit NUMBER;
1004:
1005: BEGIN
1006:
1007: hr_utility.set_location ( 'Entering:'|| l_proc, 70);
1008:
1009: /* p_entry_value1 Method of Receipt ( Not from file)
1010: * p_entry_value2 Tax Municipality, 3 positions
1011: * p_entry_value3 Tax Card Type, 1 position
1020: */
1021:
1022: --Set record length
1023: l_record_length := 140;
1024: hr_utility.set_location ( ' Record length:'|| l_record_length, 80);
1025:
1026: l_tax_card_type := substr( p_line ,72,1);
1027: l_one_income_limit := nvl(to_number(substr( p_line ,62,10)),0);
1028: l_employment_type := substr( p_line ,51,1);
1038:
1039:
1040: IF l_tax_card_type IN ('5','6') then
1041:
1042: hr_utility.set_location ( ' No Data Returned from Tax Authorities', 90);
1043: RAISE e_no_data_tax;
1044:
1045: ELSE
1046:
1050: IF l_tax_card_type =1 then
1051:
1052: -- Mismatch between the Employment Type and Tax Card
1053: IF l_employment_type ='0' THEN
1054: hr_utility.set_location ( ' Mismatch in Tax Card ', 100);
1055: RAISE e_mismatch_tax_card;
1056: END IF;
1057:
1058: IF l_one_income_limit > 0 then
1071: p_entry_value4 := substr( p_line ,89,3);
1072: ELSIF l_tax_card_type =3 then
1073: -- Mismatch between the Employment Type and Tax Card
1074: IF l_employment_type ='1' THEN
1075: hr_utility.set_location ( ' Mismatch in Tax Card ', 100);
1076: RAISE e_mismatch_tax_card;
1077: END IF;
1078: p_entry_value3:='EI';
1079: p_entry_value4 := substr( p_line ,92,3);
1096:
1097:
1098: -- Error in record if it is too long according to given format
1099: IF (length(p_line)> l_record_length) THEN
1100: hr_utility.set_location ( ' Record too long', 110);
1101: RAISE e_record_too_long;
1102: END IF;
1103:
1104: hr_utility.set_location ( 'Leaving:'|| l_proc, 120);
1100: hr_utility.set_location ( ' Record too long', 110);
1101: RAISE e_record_too_long;
1102: END IF;
1103:
1104: hr_utility.set_location ( 'Leaving:'|| l_proc, 120);
1105: END read_record;
1106:
1107: FUNCTION get_element_link_id
1108: (