32:
33: lv_format varchar2(1000);
34:
35: BEGIN
36: hr_utility.set_location(gv_package_name || '.formated_data_string', 10);
37: if p_output_file_type = 'CSV' then
38: hr_utility.set_location(gv_package_name || '.formated_data_string', 20);
39: lv_format := gc_csv_data_delimiter || p_input_string ||
40: gc_csv_data_delimiter || gc_csv_delimiter;
34:
35: BEGIN
36: hr_utility.set_location(gv_package_name || '.formated_data_string', 10);
37: if p_output_file_type = 'CSV' then
38: hr_utility.set_location(gv_package_name || '.formated_data_string', 20);
39: lv_format := gc_csv_data_delimiter || p_input_string ||
40: gc_csv_data_delimiter || gc_csv_delimiter;
41: elsif p_output_file_type = 'HTML' then
42: if p_input_string is null then
39: lv_format := gc_csv_data_delimiter || p_input_string ||
40: gc_csv_data_delimiter || gc_csv_delimiter;
41: elsif p_output_file_type = 'HTML' then
42: if p_input_string is null then
43: hr_utility.set_location(gv_package_name || '.formated_data_string', 30);
44: lv_format := gv_html_start_data || ' ' || gv_html_end_data;
45: else
46: if p_bold = 'Y' then
47: hr_utility.set_location(gv_package_name || '.formated_data_string', 40);
43: hr_utility.set_location(gv_package_name || '.formated_data_string', 30);
44: lv_format := gv_html_start_data || ' ' || gv_html_end_data;
45: else
46: if p_bold = 'Y' then
47: hr_utility.set_location(gv_package_name || '.formated_data_string', 40);
48: lv_format := gv_html_start_data || ' ' || p_input_string
49: || '' || gv_html_end_data;
50: else
51: hr_utility.set_location(gv_package_name || '.formated_data_string', 50);
47: hr_utility.set_location(gv_package_name || '.formated_data_string', 40);
48: lv_format := gv_html_start_data || ' ' || p_input_string
49: || '' || gv_html_end_data;
50: else
51: hr_utility.set_location(gv_package_name || '.formated_data_string', 50);
52: lv_format := gv_html_start_data || p_input_string || gv_html_end_data;
53: end if;
54: end if;
55: end if;
53: end if;
54: end if;
55: end if;
56:
57: hr_utility.set_location(gv_package_name || '.formated_data_string', 60);
58: return lv_format;
59:
60: END formated_data_string;
61:
70: RETURN VARCHAR2
71: IS
72: lv_format varchar2(1000);
73: BEGIN
74: hr_utility.set_location(gv_package_name || '.formated_header_string', 10);
75: if p_output_file_type = 'CSV' then
76: hr_utility.set_location(gv_package_name || '.formated_header_string', 20);
77: lv_format := p_input_string;
78: elsif p_output_file_type = 'HTML' then
72: lv_format varchar2(1000);
73: BEGIN
74: hr_utility.set_location(gv_package_name || '.formated_header_string', 10);
75: if p_output_file_type = 'CSV' then
76: hr_utility.set_location(gv_package_name || '.formated_header_string', 20);
77: lv_format := p_input_string;
78: elsif p_output_file_type = 'HTML' then
79: hr_utility.set_location(gv_package_name || '.formated_header_string', 30);
80: lv_format := '
75: if p_output_file_type = 'CSV' then
76: hr_utility.set_location(gv_package_name || '.formated_header_string', 20);
77: lv_format := p_input_string;
78: elsif p_output_file_type = 'HTML' then
79: hr_utility.set_location(gv_package_name || '.formated_header_string', 30);
80: lv_format := '
79: hr_utility.set_location(gv_package_name || '.formated_header_string', 30);
80: lv_format := '
140: if lv_ssl_number IS NULL
141: then
142: lv_ssl_number := 'National Identifier';
143: end if;
144: hr_utility.trace('HR_NATIONAL_ID_NUMBER_'||lv_legislation_code ||' = ' || lv_ssl_number);
145:
146:
147: hr_utility.set_location(gv_package_name || '.formated_static_header', 10);
148: lv_format1 :=
143: end if;
144: hr_utility.trace('HR_NATIONAL_ID_NUMBER_'||lv_legislation_code ||' = ' || lv_ssl_number);
145:
146:
147: hr_utility.set_location(gv_package_name || '.formated_static_header', 10);
148: lv_format1 :=
149: formated_data_string (p_input_string =>
150: hr_general.decode_fnd_comm_lookup
151: ('PAYROLL_REPORTS', --lookup_type
225: ,p_bold => 'Y'
226: ,p_output_file_type => p_output_file_type) ;
227:
228:
229: hr_utility.set_location(gv_package_name || '.formated_static_header', 20);
230: lv_format2 :=
231: formated_data_string (p_input_string =>
232: hr_general.decode_fnd_comm_lookup
233: ('PAYROLL_REPORTS', --lookup_type
266: ,p_bold => 'Y'
267: ,p_output_file_type => p_output_file_type)
268: ;
269:
270: hr_utility.set_location(gv_package_name || '.formated_static_header', 30);
271:
272: p_static_label1 := lv_format1;
273: p_static_label2 := lv_format2;
274: hr_utility.trace('Static Label1 = ' || lv_format1);
270: hr_utility.set_location(gv_package_name || '.formated_static_header', 30);
271:
272: p_static_label1 := lv_format1;
273: p_static_label2 := lv_format2;
274: hr_utility.trace('Static Label1 = ' || lv_format1);
275: hr_utility.trace('Static Label2 = ' || lv_format2);
276: hr_utility.set_location(gv_package_name || '.formated_static_header', 40);
277:
278: END formated_static_header;
271:
272: p_static_label1 := lv_format1;
273: p_static_label2 := lv_format2;
274: hr_utility.trace('Static Label1 = ' || lv_format1);
275: hr_utility.trace('Static Label2 = ' || lv_format2);
276: hr_utility.set_location(gv_package_name || '.formated_static_header', 40);
277:
278: END formated_static_header;
279:
272: p_static_label1 := lv_format1;
273: p_static_label2 := lv_format2;
274: hr_utility.trace('Static Label1 = ' || lv_format1);
275: hr_utility.trace('Static Label2 = ' || lv_format2);
276: hr_utility.set_location(gv_package_name || '.formated_static_header', 40);
277:
278: END formated_static_header;
279:
280:
325: lv_action_effective_date varchar2(20);
326:
327: BEGIN
328:
329: hr_utility.set_location(gv_package_name || '.formated_static_data', 10);
330: lv_action_effective_date := to_char(p_action_effective_date, 'dd-MON-yyyy');
331: lv_format1 :=
332: formated_data_string (p_input_string => p_consolidation_set_name
333: ,p_output_file_type => p_output_file_type) ||
358: formated_data_string (p_input_string => p_accrual_type
359: ,p_output_file_type => p_output_file_type)
360: ;
361:
362: hr_utility.set_location(gv_package_name || '.formated_static_data', 20);
363:
364: lv_format2 :=
365: formated_data_string (p_input_string => p_org_name
366: ,p_output_file_type => p_output_file_type) ||
380: formated_data_string (p_input_string => p_assignment_number
381: ,p_output_file_type => p_output_file_type)
382: ;
383:
384: hr_utility.set_location(gv_package_name || '.formated_static_data', 30);
385:
386: p_static_data1 := lv_format1;
387: p_static_data2 := lv_format2;
388: hr_utility.trace('Static Data1 = ' || lv_format1);
384: hr_utility.set_location(gv_package_name || '.formated_static_data', 30);
385:
386: p_static_data1 := lv_format1;
387: p_static_data2 := lv_format2;
388: hr_utility.trace('Static Data1 = ' || lv_format1);
389: hr_utility.trace('Static Data2 = ' || lv_format2);
390: hr_utility.set_location(gv_package_name || '.formated_static_data', 40);
391:
392: END;
385:
386: p_static_data1 := lv_format1;
387: p_static_data2 := lv_format2;
388: hr_utility.trace('Static Data1 = ' || lv_format1);
389: hr_utility.trace('Static Data2 = ' || lv_format2);
390: hr_utility.set_location(gv_package_name || '.formated_static_data', 40);
391:
392: END;
393:
386: p_static_data1 := lv_format1;
387: p_static_data2 := lv_format2;
388: hr_utility.trace('Static Data1 = ' || lv_format1);
389: hr_utility.trace('Static Data2 = ' || lv_format2);
390: hr_utility.set_location(gv_package_name || '.formated_static_data', 40);
391:
392: END;
393:
394: /******************************************************************
603: ELSE
604: execute immediate ('alter session set nls_numeric_characters =''.,''');
605: END IF;
606:
607: hr_utility.trace('Cost Type = ' || p_cost_type);
608: hr_utility.set_location(gv_package_name || '.costing_extract', 10);
609: hr_utility.trace('Start Date = ' || p_start_date);
610: hr_utility.trace('End Date = ' || p_end_date);
611: hr_utility.trace('Business Group ID = '|| p_business_group_id);
604: execute immediate ('alter session set nls_numeric_characters =''.,''');
605: END IF;
606:
607: hr_utility.trace('Cost Type = ' || p_cost_type);
608: hr_utility.set_location(gv_package_name || '.costing_extract', 10);
609: hr_utility.trace('Start Date = ' || p_start_date);
610: hr_utility.trace('End Date = ' || p_end_date);
611: hr_utility.trace('Business Group ID = '|| p_business_group_id);
612: hr_utility.trace('Classification ID = '|| nvl(to_char(p_element_classification_id), 'NULL'));
605: END IF;
606:
607: hr_utility.trace('Cost Type = ' || p_cost_type);
608: hr_utility.set_location(gv_package_name || '.costing_extract', 10);
609: hr_utility.trace('Start Date = ' || p_start_date);
610: hr_utility.trace('End Date = ' || p_end_date);
611: hr_utility.trace('Business Group ID = '|| p_business_group_id);
612: hr_utility.trace('Classification ID = '|| nvl(to_char(p_element_classification_id), 'NULL'));
613: hr_utility.trace('Element Set ID = ' || nvl(to_char(p_element_set_id), 'NULL'));
606:
607: hr_utility.trace('Cost Type = ' || p_cost_type);
608: hr_utility.set_location(gv_package_name || '.costing_extract', 10);
609: hr_utility.trace('Start Date = ' || p_start_date);
610: hr_utility.trace('End Date = ' || p_end_date);
611: hr_utility.trace('Business Group ID = '|| p_business_group_id);
612: hr_utility.trace('Classification ID = '|| nvl(to_char(p_element_classification_id), 'NULL'));
613: hr_utility.trace('Element Set ID = ' || nvl(to_char(p_element_set_id), 'NULL'));
614: hr_utility.trace('Element Type ID = ' || nvl(to_char(p_element_type_id), 'NULL'));
607: hr_utility.trace('Cost Type = ' || p_cost_type);
608: hr_utility.set_location(gv_package_name || '.costing_extract', 10);
609: hr_utility.trace('Start Date = ' || p_start_date);
610: hr_utility.trace('End Date = ' || p_end_date);
611: hr_utility.trace('Business Group ID = '|| p_business_group_id);
612: hr_utility.trace('Classification ID = '|| nvl(to_char(p_element_classification_id), 'NULL'));
613: hr_utility.trace('Element Set ID = ' || nvl(to_char(p_element_set_id), 'NULL'));
614: hr_utility.trace('Element Type ID = ' || nvl(to_char(p_element_type_id), 'NULL'));
615: hr_utility.trace('Person ID = ' || p_person_id);
608: hr_utility.set_location(gv_package_name || '.costing_extract', 10);
609: hr_utility.trace('Start Date = ' || p_start_date);
610: hr_utility.trace('End Date = ' || p_end_date);
611: hr_utility.trace('Business Group ID = '|| p_business_group_id);
612: hr_utility.trace('Classification ID = '|| nvl(to_char(p_element_classification_id), 'NULL'));
613: hr_utility.trace('Element Set ID = ' || nvl(to_char(p_element_set_id), 'NULL'));
614: hr_utility.trace('Element Type ID = ' || nvl(to_char(p_element_type_id), 'NULL'));
615: hr_utility.trace('Person ID = ' || p_person_id);
616: hr_utility.trace('Location ID = ' || p_location_id);
609: hr_utility.trace('Start Date = ' || p_start_date);
610: hr_utility.trace('End Date = ' || p_end_date);
611: hr_utility.trace('Business Group ID = '|| p_business_group_id);
612: hr_utility.trace('Classification ID = '|| nvl(to_char(p_element_classification_id), 'NULL'));
613: hr_utility.trace('Element Set ID = ' || nvl(to_char(p_element_set_id), 'NULL'));
614: hr_utility.trace('Element Type ID = ' || nvl(to_char(p_element_type_id), 'NULL'));
615: hr_utility.trace('Person ID = ' || p_person_id);
616: hr_utility.trace('Location ID = ' || p_location_id);
617: hr_utility.trace('Organization ID = ' || p_organization_id);
610: hr_utility.trace('End Date = ' || p_end_date);
611: hr_utility.trace('Business Group ID = '|| p_business_group_id);
612: hr_utility.trace('Classification ID = '|| nvl(to_char(p_element_classification_id), 'NULL'));
613: hr_utility.trace('Element Set ID = ' || nvl(to_char(p_element_set_id), 'NULL'));
614: hr_utility.trace('Element Type ID = ' || nvl(to_char(p_element_type_id), 'NULL'));
615: hr_utility.trace('Person ID = ' || p_person_id);
616: hr_utility.trace('Location ID = ' || p_location_id);
617: hr_utility.trace('Organization ID = ' || p_organization_id);
618: hr_utility.trace('Tax Unit ID = ' || p_tax_unit_id);
611: hr_utility.trace('Business Group ID = '|| p_business_group_id);
612: hr_utility.trace('Classification ID = '|| nvl(to_char(p_element_classification_id), 'NULL'));
613: hr_utility.trace('Element Set ID = ' || nvl(to_char(p_element_set_id), 'NULL'));
614: hr_utility.trace('Element Type ID = ' || nvl(to_char(p_element_type_id), 'NULL'));
615: hr_utility.trace('Person ID = ' || p_person_id);
616: hr_utility.trace('Location ID = ' || p_location_id);
617: hr_utility.trace('Organization ID = ' || p_organization_id);
618: hr_utility.trace('Tax Unit ID = ' || p_tax_unit_id);
619: hr_utility.trace('Payroll ID = ' || p_payroll_id);
612: hr_utility.trace('Classification ID = '|| nvl(to_char(p_element_classification_id), 'NULL'));
613: hr_utility.trace('Element Set ID = ' || nvl(to_char(p_element_set_id), 'NULL'));
614: hr_utility.trace('Element Type ID = ' || nvl(to_char(p_element_type_id), 'NULL'));
615: hr_utility.trace('Person ID = ' || p_person_id);
616: hr_utility.trace('Location ID = ' || p_location_id);
617: hr_utility.trace('Organization ID = ' || p_organization_id);
618: hr_utility.trace('Tax Unit ID = ' || p_tax_unit_id);
619: hr_utility.trace('Payroll ID = ' || p_payroll_id);
620: hr_utility.trace('Consolidation ID = ' || p_consolidation_set_id);
613: hr_utility.trace('Element Set ID = ' || nvl(to_char(p_element_set_id), 'NULL'));
614: hr_utility.trace('Element Type ID = ' || nvl(to_char(p_element_type_id), 'NULL'));
615: hr_utility.trace('Person ID = ' || p_person_id);
616: hr_utility.trace('Location ID = ' || p_location_id);
617: hr_utility.trace('Organization ID = ' || p_organization_id);
618: hr_utility.trace('Tax Unit ID = ' || p_tax_unit_id);
619: hr_utility.trace('Payroll ID = ' || p_payroll_id);
620: hr_utility.trace('Consolidation ID = ' || p_consolidation_set_id);
621: hr_utility.trace('Asgn Set ID = ' || p_assignment_set_id);
614: hr_utility.trace('Element Type ID = ' || nvl(to_char(p_element_type_id), 'NULL'));
615: hr_utility.trace('Person ID = ' || p_person_id);
616: hr_utility.trace('Location ID = ' || p_location_id);
617: hr_utility.trace('Organization ID = ' || p_organization_id);
618: hr_utility.trace('Tax Unit ID = ' || p_tax_unit_id);
619: hr_utility.trace('Payroll ID = ' || p_payroll_id);
620: hr_utility.trace('Consolidation ID = ' || p_consolidation_set_id);
621: hr_utility.trace('Asgn Set ID = ' || p_assignment_set_id);
622: hr_utility.set_location(gv_package_name || '.costing_extract', 20);
615: hr_utility.trace('Person ID = ' || p_person_id);
616: hr_utility.trace('Location ID = ' || p_location_id);
617: hr_utility.trace('Organization ID = ' || p_organization_id);
618: hr_utility.trace('Tax Unit ID = ' || p_tax_unit_id);
619: hr_utility.trace('Payroll ID = ' || p_payroll_id);
620: hr_utility.trace('Consolidation ID = ' || p_consolidation_set_id);
621: hr_utility.trace('Asgn Set ID = ' || p_assignment_set_id);
622: hr_utility.set_location(gv_package_name || '.costing_extract', 20);
623:
616: hr_utility.trace('Location ID = ' || p_location_id);
617: hr_utility.trace('Organization ID = ' || p_organization_id);
618: hr_utility.trace('Tax Unit ID = ' || p_tax_unit_id);
619: hr_utility.trace('Payroll ID = ' || p_payroll_id);
620: hr_utility.trace('Consolidation ID = ' || p_consolidation_set_id);
621: hr_utility.trace('Asgn Set ID = ' || p_assignment_set_id);
622: hr_utility.set_location(gv_package_name || '.costing_extract', 20);
623:
624: /* Added by ssmukher for Bug 4142845 */
617: hr_utility.trace('Organization ID = ' || p_organization_id);
618: hr_utility.trace('Tax Unit ID = ' || p_tax_unit_id);
619: hr_utility.trace('Payroll ID = ' || p_payroll_id);
620: hr_utility.trace('Consolidation ID = ' || p_consolidation_set_id);
621: hr_utility.trace('Asgn Set ID = ' || p_assignment_set_id);
622: hr_utility.set_location(gv_package_name || '.costing_extract', 20);
623:
624: /* Added by ssmukher for Bug 4142845 */
625: open c_leg_code(p_business_group_id);
618: hr_utility.trace('Tax Unit ID = ' || p_tax_unit_id);
619: hr_utility.trace('Payroll ID = ' || p_payroll_id);
620: hr_utility.trace('Consolidation ID = ' || p_consolidation_set_id);
621: hr_utility.trace('Asgn Set ID = ' || p_assignment_set_id);
622: hr_utility.set_location(gv_package_name || '.costing_extract', 20);
623:
624: /* Added by ssmukher for Bug 4142845 */
625: open c_leg_code(p_business_group_id);
626: fetch c_leg_code into lv_legislation_code;
642: ,p_business_group_id);
643:
644: lv_header_label := lv_header_label1;
645:
646: hr_utility.set_location(gv_package_name || '.costing_extract', 30);
647: lv_header_label := lv_header_label ||
648: formated_data_string (
649: p_input_string => 'Accrual Type'
650: ,p_bold => 'Y'
652:
653: open c_costing_flex_id (p_business_group_id);
654: fetch c_costing_flex_id into ln_costing_id_flex_num;
655: if c_costing_flex_id%found then
656: hr_utility.set_location(gv_package_name || '.costing_extract', 40);
657: open c_costing_flex_segments (ln_costing_id_flex_num);
658: loop
659: fetch c_costing_flex_segments into lv_segment_name, lv_column_name;
660: if c_costing_flex_segments%notfound then
674: close c_costing_flex_segments;
675:
676: end if;
677: close c_costing_flex_id;
678: hr_utility.set_location(gv_package_name || '.costing_extract', 50);
679:
680: /****************************************************************
681: ** Concatnating the second Header Label which includes the
682: ** data set which has to be printed at the end of the report.
682: ** data set which has to be printed at the end of the report.
683: ****************************************************************/
684: lv_header_label := lv_header_label || lv_header_label2;
685:
686: hr_utility.set_location(gv_package_name || '.costing_extract', 60);
687: hr_utility.trace('Static and Element Label = ' || lv_header_label);
688:
689: gv_title := hr_general.decode_fnd_comm_lookup
690: ('PAYROLL_REPORTS',
683: ****************************************************************/
684: lv_header_label := lv_header_label || lv_header_label2;
685:
686: hr_utility.set_location(gv_package_name || '.costing_extract', 60);
687: hr_utility.trace('Static and Element Label = ' || lv_header_label);
688:
689: gv_title := hr_general.decode_fnd_comm_lookup
690: ('PAYROLL_REPORTS',
691: 'COSTING_REPORT_TITLE');
694: gv_title
695: ,p_output_file_type
696: ));
697:
698: hr_utility.set_location(gv_package_name || '.costing_extract', 70);
699: /****************************************************************
700: ** Print the Header Information. If the format is HTML then open
701: ** the body and table before printing the header info, otherwise
702: ** just print the header information.
712: if p_output_file_type ='HTML' then
713: FND_FILE.PUT_LINE(FND_FILE.OUTPUT, '');
714: end if;
715:
716: hr_utility.set_location(gv_package_name || '.costing_extract', 80);
717: /*****************************************************
718: ** Start of the Data Section of the Report
719: *****************************************************/
720: /*Bug 3179050 - changed cursor c_asg_costing_details to a REF CURSOR*/
1217: ,lv_segment30
1218: ;
1219:
1220: if c_asg_costing_details%notfound then
1221: hr_utility.set_location(gv_package_name || '.costing_extract', 90);
1222: exit;
1223: end if;
1224:
1225: lv_accrual_type:=nvl(hr_general.decode_lookup('PAY_PAYRPCBR',lv_cost_mode),' ');
1231: ** If Assignment Set is used, pick up only those employee
1232: ** assignments which are part of the Assignment Set - STATIC
1233: ** or DYNAMIC.
1234: ************************************************************/
1235: hr_utility.set_location(gv_package_name || '.costing_extract', 100);
1236: hr_utility.trace('Assignment ID = ' || ln_assignment_id);
1237:
1238: /* for bug 9569291
1239: if hr_assignment_set.assignment_in_set(
1232: ** assignments which are part of the Assignment Set - STATIC
1233: ** or DYNAMIC.
1234: ************************************************************/
1235: hr_utility.set_location(gv_package_name || '.costing_extract', 100);
1236: hr_utility.trace('Assignment ID = ' || ln_assignment_id);
1237:
1238: /* for bug 9569291
1239: if hr_assignment_set.assignment_in_set(
1240: p_assignment_set_id
1240: p_assignment_set_id
1241: ,ln_assignment_id) = 'Y' then
1242: */
1243:
1244: hr_utility.set_location(gv_package_name || '.costing_extract', 110);
1245:
1246: formated_static_data(
1247: p_consolidation_set_name => lv_consolidation_set_name
1248: ,p_payroll_name => lv_payroll_name
1268: ,p_static_data1 => lv_data_row1
1269: ,p_static_data2 => lv_data_row2);
1270:
1271: lv_data_row := lv_data_row1;
1272: hr_utility.set_location(gv_package_name || '.costing_extract', 120);
1273:
1274: for i in ltr_costing_segment.first .. ltr_costing_segment.last loop
1275: if ltr_costing_segment(i).column_name = 'SEGMENT1' then
1276: lv_segment_value := lv_segment1;
1338: formated_data_string (
1339: p_input_string => lv_segment_value
1340: ,p_output_file_type => p_output_file_type);
1341: end loop ;
1342: hr_utility.set_location(gv_package_name || '.costing_extract', 130);
1343:
1344: /****************************************************************
1345: ** Concatnating the second Header Label which includes the
1346: ** data set which is printed at the end of the report.
1345: ** Concatnating the second Header Label which includes the
1346: ** data set which is printed at the end of the report.
1347: ****************************************************************/
1348: lv_data_row := lv_data_row || lv_data_row2;
1349: hr_utility.set_location(gv_package_name || '.costing_extract', 140);
1350:
1351: if p_output_file_type ='HTML' then
1352: lv_data_row := '
1371:
1372: if p_output_file_type ='HTML' then
1373: FND_FILE.PUT_LINE(FND_FILE.OUTPUT, '');
1374: end if;
1375: hr_utility.trace('Concurrent Request ID = ' || FND_GLOBAL.CONC_REQUEST_ID);
1376:
1377: END costing_extract;
1378:
1379: function get_costing_tax_unit_id(p_ACTION_TYPE pay_payroll_actions.action_type%TYPE,
1423: g_tax_unit_name(p_tax_unit_id) := l_tax_unit_name;
1424: return l_tax_unit_name;
1425: END;
1426: --begin
1427: --hr_utility.trace_on(null, 'COSTING');
1428: end pay_costing_detail_rep_pkg;