6: -- Constants for fragment view
7: c_for_fragment CONSTANT VARCHAR2(8) := 'FRAGMENT';
8: c_for_approver CONSTANT VARCHAR2(8) := 'APPROVER';
9:
10: g_debug boolean := hr_utility.debug_enabled;
11:
12: -- Types created for the Zero Hrs Template Enhancement.
13:
14: TYPE v_att_ids IS RECORD (
631:
632: -- DBMS_PROFILER.START_PROFILER('Kunal');
633: IF g_debug THEN
634: l_proc := 'modify_to_zero_hrs_template';
635: hr_utility.set_location (g_package || l_proc, 120);
636: END IF;
637: -- Get the range calculated
638: l_first_day := fnd_date.canonical_to_date (p_start_time);
639: --
642: IF g_debug THEN
643: l_index := p_block_array.first;
644: LOOP
645: EXIT WHEN NOT p_block_array.exists(l_index);
646: hr_utility.trace(
647: 'RESOURCE_ID :'||p_block_array(l_index).RESOURCE_ID
648: ||'BB id : '||p_block_array(l_index).TIME_BUILDING_BLOCK_ID
649: ||'['||p_block_array(l_index).OBJECT_VERSION_NUMBER||']'
650: ||' PARENT_BUILDING_BLOCK_ID: '||p_block_array(l_index).PARENT_BUILDING_BLOCK_ID
665: LOOP
666: EXIT WHEN NOT p_attribute_array.exists(l_index);
667: -- l_attribute := p_attribute_array(l_index);
668:
669: hr_utility.trace(
670: 'BB id : '||p_attribute_array(l_index).BUILDING_BLOCK_ID
671: ||'['||p_attribute_array(l_index).BUILDING_BLOCK_OVN||']'
672: ||' ATT CAT: '||p_attribute_array(l_index).ATTRIBUTE_CATEGORY
673: ||' ATTRIBUTE1: '||p_attribute_array(l_index).ATTRIBUTE1
711: END IF; -- l_day_found
712: END LOOP; -- l_index_day is not null
713:
714: IF g_debug THEN
715: hr_utility.trace('Update all DETAILS to be children of DAY ONE');
716: END IF;
717:
718: -- Update all DETAILS to be children of DAY ONE
719: l_index_detail := NULL;
741: IF g_debug THEN
742: l_index := p_block_array.first;
743: LOOP
744: EXIT WHEN NOT p_block_array.exists(l_index);
745: hr_utility.trace(
746: 'RESOURCE_ID :'||p_block_array(l_index).RESOURCE_ID
747: ||'BB id : '||p_block_array(l_index).TIME_BUILDING_BLOCK_ID
748: ||'['||p_block_array(l_index).OBJECT_VERSION_NUMBER||']'
749: ||' PARENT_BUILDING_BLOCK_ID: '||p_block_array(l_index).PARENT_BUILDING_BLOCK_ID
767: -- Since zero hours template is being used,
768: -- here we remove any DETAIL DDF attributes from the attribute list.
769:
770: IF g_debug THEN
771: hr_utility.trace('Remove any DETAIL DDF attributes from the attribute list');
772: END IF;
773:
774: l_index :=NULL;
775: l_index := p_attribute_array.FIRST;
800: END IF;
801: l_del_index := 1;
802:
803: IF g_debug THEN
804: hr_utility.trace('Processing start here...');
805: END IF;
806:
807: -- Start with looping thru all the DEATILS
808: l_index_detail := NULL;
846: l_det_att_index := l_detail_attributes.LAST +1;
847:
848:
849: /* IF g_debug THEN
850: hr_utility.trace('| '||p_attribute_array (l_index).BUILDING_BLOCK_ID||' | '||p_attribute_array (l_index).TIME_ATTRIBUTE_ID||' | '||p_attribute_array (l_index).ATTRIBUTE_CATEGORY);
851: END IF;
852: */
853: END IF; -- attribute BB_ID = Time BB_ID
854: l_index := p_attribute_array.NEXT (l_index);
854: l_index := p_attribute_array.NEXT (l_index);
855: END LOOP; -- l_index IS NOT NULL
856:
857: /* IF g_debug THEN
858: hr_utility.trace(p_block_array(l_index_detail).time_building_block_id||' | '||l_detail_attributes.COUNT);
859: END IF;
860: */
861: -- Here we have a list of all attributes for the main DETAIL id.
862: -- Now loop thru the rest of the DETAILS to find other DETAILS
910: END LOOP; -- l_index IS NOT NULL
911:
912: -- Just a check to see all is well
913: /* IF g_debug THEN
914: hr_utility.trace(p_block_array(l_index_detail).time_building_block_id||' | '||l_detail_attributes.COUNT||' | '||p_block_array(l_sub_index_detail).time_building_block_id||' | '||l_detail_sub_attributes.COUNT);
915: END IF;
916: */
917:
918:
927: THEN
928: --
929: -- Just a check to see all is well
930: /* IF g_debug THEN
931: hr_utility.trace(p_block_array(l_index_detail).time_building_block_id||' | '||l_detail_attributes.COUNT||' | '||p_block_array(l_sub_index_detail).time_building_block_id||' | '||l_detail_sub_attributes.COUNT);
932: END IF;
933: */
934: -- OK, here we go, Start the Comparison here
935: l_det_sub_att_index := null;
1053: THEN
1054:
1055: -- Check to see if the correct TBB is obtained
1056: /* IF g_debug THEN
1057: hr_utility.trace(p_block_array(l_index_detail).time_building_block_id||' | '||p_block_array(l_sub_index_detail).time_building_block_id||' | ');
1058: END IF;
1059: */
1060: -- First add the TBB ID to the temp table
1061: -- that will be used later to clear the attributes
1059: */
1060: -- First add the TBB ID to the temp table
1061: -- that will be used later to clear the attributes
1062: IF g_debug THEN
1063: hr_utility.trace('Translation Display Key :: '||p_block_array(l_sub_index_detail).translation_display_key);
1064:
1065: hr_utility.trace('Column Value ::'||SUBSTR(p_block_array(l_sub_index_detail).translation_display_key,
1066: INSTR(p_block_array(l_sub_index_detail).translation_display_key,'|',1,2)+1,3)
1067: );
1061: -- that will be used later to clear the attributes
1062: IF g_debug THEN
1063: hr_utility.trace('Translation Display Key :: '||p_block_array(l_sub_index_detail).translation_display_key);
1064:
1065: hr_utility.trace('Column Value ::'||SUBSTR(p_block_array(l_sub_index_detail).translation_display_key,
1066: INSTR(p_block_array(l_sub_index_detail).translation_display_key,'|',1,2)+1,3)
1067: );
1068: END IF;
1069:
1069:
1070: IF SUBSTR(p_block_array(l_sub_index_detail).translation_display_key,
1071: INSTR(p_block_array(l_sub_index_detail).translation_display_key,'|',1,2)+1,3) = '0' THEN
1072:
1073: hr_utility.trace('l_dup_attribute_set_found..make a note of it');
1074:
1075: l_dup_attribute_set_found := 'Y';
1076: END IF;
1077:
1133: l_index_detail := p_block_array.NEXT (l_index_detail);
1134: END LOOP; -- l_index_detail is not null (Main Processing)
1135:
1136: IF g_debug THEN
1137: hr_utility.trace('Processing ends here...');
1138:
1139: l_index := p_block_array.first;
1140: LOOP
1141: EXIT WHEN NOT p_block_array.exists(l_index);
1138:
1139: l_index := p_block_array.first;
1140: LOOP
1141: EXIT WHEN NOT p_block_array.exists(l_index);
1142: hr_utility.trace(
1143: 'RESOURCE_ID :'||p_block_array(l_index).RESOURCE_ID
1144: ||'BB id : '||p_block_array(l_index).TIME_BUILDING_BLOCK_ID
1145: ||'['||p_block_array(l_index).OBJECT_VERSION_NUMBER||']'
1146: ||' PARENT_BUILDING_BLOCK_ID: '||p_block_array(l_index).PARENT_BUILDING_BLOCK_ID
1159: END IF;
1160: -- Added for Bug 9715896
1161:
1162: IF g_debug THEN
1163: hr_utility.trace('In hxc_self_service_timecard.modify_to_zero_hrs_template procedure..');
1164: hr_utility.trace('Before deleting the building blocks with duplicate translation display key...');
1165: hr_utility.trace('printing p_block_array... ');
1166:
1167:
1160: -- Added for Bug 9715896
1161:
1162: IF g_debug THEN
1163: hr_utility.trace('In hxc_self_service_timecard.modify_to_zero_hrs_template procedure..');
1164: hr_utility.trace('Before deleting the building blocks with duplicate translation display key...');
1165: hr_utility.trace('printing p_block_array... ');
1166:
1167:
1168: l_index := p_block_array.first;
1161:
1162: IF g_debug THEN
1163: hr_utility.trace('In hxc_self_service_timecard.modify_to_zero_hrs_template procedure..');
1164: hr_utility.trace('Before deleting the building blocks with duplicate translation display key...');
1165: hr_utility.trace('printing p_block_array... ');
1166:
1167:
1168: l_index := p_block_array.first;
1169: LOOP
1167:
1168: l_index := p_block_array.first;
1169: LOOP
1170: EXIT WHEN NOT p_block_array.exists(l_index);
1171: hr_utility.trace('> '||
1172: 'RESOURCE_ID :'||p_block_array(l_index).RESOURCE_ID
1173: ||'BB id : '||p_block_array(l_index).TIME_BUILDING_BLOCK_ID
1174: ||'['||p_block_array(l_index).OBJECT_VERSION_NUMBER||']'
1175: ||' PARENT_BUILDING_BLOCK_ID: '||p_block_array(l_index).PARENT_BUILDING_BLOCK_ID
1185:
1186: l_index := p_block_array.next(l_index);
1187: END LOOP;
1188:
1189: hr_utility.trace('l_del_bb_ids.COUNT ::'||l_del_bb_ids.COUNT);
1190:
1191: IF l_del_bb_ids.COUNT > 0 THEN
1192:
1193: hr_utility.trace('l_del_bb_ids.FIRST ::'||l_del_bb_ids.FIRST);
1189: hr_utility.trace('l_del_bb_ids.COUNT ::'||l_del_bb_ids.COUNT);
1190:
1191: IF l_del_bb_ids.COUNT > 0 THEN
1192:
1193: hr_utility.trace('l_del_bb_ids.FIRST ::'||l_del_bb_ids.FIRST);
1194: hr_utility.trace('l_del_bb_ids.LAST ::'||l_del_bb_ids.LAST);
1195: END IF;
1196:
1197: hr_utility.trace('looping through building blocks for dupliate traslation display key...');
1190:
1191: IF l_del_bb_ids.COUNT > 0 THEN
1192:
1193: hr_utility.trace('l_del_bb_ids.FIRST ::'||l_del_bb_ids.FIRST);
1194: hr_utility.trace('l_del_bb_ids.LAST ::'||l_del_bb_ids.LAST);
1195: END IF;
1196:
1197: hr_utility.trace('looping through building blocks for dupliate traslation display key...');
1198:
1193: hr_utility.trace('l_del_bb_ids.FIRST ::'||l_del_bb_ids.FIRST);
1194: hr_utility.trace('l_del_bb_ids.LAST ::'||l_del_bb_ids.LAST);
1195: END IF;
1196:
1197: hr_utility.trace('looping through building blocks for dupliate traslation display key...');
1198:
1199:
1200: END IF;
1201:
1216: AND p_block_array(l_index_detail).DATE_TO = fnd_date.date_to_canonical (hr_general.end_of_time)
1217: THEN
1218:
1219: IF g_debug THEN
1220: hr_utility.trace('p_block_array(l_index_detail).TIME_BUILDING_BLOCK_ID ::'||p_block_array(l_index_detail).TIME_BUILDING_BLOCK_ID );
1221: hr_utility.trace('p_block_array(l_index_detail).START_TIME ::'||p_block_array(l_index_detail).START_TIME );
1222: hr_utility.trace('p_block_array(l_index_detail).STOP_TIME ::'||p_block_array(l_index_detail).STOP_TIME );
1223: hr_utility.trace('p_block_array(l_index_detail).TRANSLATION_DISPLAY_KEY ::'||p_block_array(l_index_detail).TRANSLATION_DISPLAY_KEY );
1224: END IF;
1217: THEN
1218:
1219: IF g_debug THEN
1220: hr_utility.trace('p_block_array(l_index_detail).TIME_BUILDING_BLOCK_ID ::'||p_block_array(l_index_detail).TIME_BUILDING_BLOCK_ID );
1221: hr_utility.trace('p_block_array(l_index_detail).START_TIME ::'||p_block_array(l_index_detail).START_TIME );
1222: hr_utility.trace('p_block_array(l_index_detail).STOP_TIME ::'||p_block_array(l_index_detail).STOP_TIME );
1223: hr_utility.trace('p_block_array(l_index_detail).TRANSLATION_DISPLAY_KEY ::'||p_block_array(l_index_detail).TRANSLATION_DISPLAY_KEY );
1224: END IF;
1225:
1218:
1219: IF g_debug THEN
1220: hr_utility.trace('p_block_array(l_index_detail).TIME_BUILDING_BLOCK_ID ::'||p_block_array(l_index_detail).TIME_BUILDING_BLOCK_ID );
1221: hr_utility.trace('p_block_array(l_index_detail).START_TIME ::'||p_block_array(l_index_detail).START_TIME );
1222: hr_utility.trace('p_block_array(l_index_detail).STOP_TIME ::'||p_block_array(l_index_detail).STOP_TIME );
1223: hr_utility.trace('p_block_array(l_index_detail).TRANSLATION_DISPLAY_KEY ::'||p_block_array(l_index_detail).TRANSLATION_DISPLAY_KEY );
1224: END IF;
1225:
1226: -- now check for duplicate translation display key and delete the block.
1219: IF g_debug THEN
1220: hr_utility.trace('p_block_array(l_index_detail).TIME_BUILDING_BLOCK_ID ::'||p_block_array(l_index_detail).TIME_BUILDING_BLOCK_ID );
1221: hr_utility.trace('p_block_array(l_index_detail).START_TIME ::'||p_block_array(l_index_detail).START_TIME );
1222: hr_utility.trace('p_block_array(l_index_detail).STOP_TIME ::'||p_block_array(l_index_detail).STOP_TIME );
1223: hr_utility.trace('p_block_array(l_index_detail).TRANSLATION_DISPLAY_KEY ::'||p_block_array(l_index_detail).TRANSLATION_DISPLAY_KEY );
1224: END IF;
1225:
1226: -- now check for duplicate translation display key and delete the block.
1227: l_sub_index_detail := p_block_array.first;
1236: -- and would get deleted.
1237: AND p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY <> '0'
1238: THEN
1239: IF g_debug THEN
1240: hr_utility.trace('duplicate found..');
1241: hr_utility.trace('p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID ::'||p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID );
1242: hr_utility.trace('p_block_array(l_sub_index_detail).START_TIME ::'||p_block_array(l_sub_index_detail).START_TIME );
1243: hr_utility.trace('p_block_array(l_sub_index_detail).STOP_TIME ::'||p_block_array(l_sub_index_detail).STOP_TIME );
1244: hr_utility.trace('p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY ::'||p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY );
1237: AND p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY <> '0'
1238: THEN
1239: IF g_debug THEN
1240: hr_utility.trace('duplicate found..');
1241: hr_utility.trace('p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID ::'||p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID );
1242: hr_utility.trace('p_block_array(l_sub_index_detail).START_TIME ::'||p_block_array(l_sub_index_detail).START_TIME );
1243: hr_utility.trace('p_block_array(l_sub_index_detail).STOP_TIME ::'||p_block_array(l_sub_index_detail).STOP_TIME );
1244: hr_utility.trace('p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY ::'||p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY );
1245: END IF;
1238: THEN
1239: IF g_debug THEN
1240: hr_utility.trace('duplicate found..');
1241: hr_utility.trace('p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID ::'||p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID );
1242: hr_utility.trace('p_block_array(l_sub_index_detail).START_TIME ::'||p_block_array(l_sub_index_detail).START_TIME );
1243: hr_utility.trace('p_block_array(l_sub_index_detail).STOP_TIME ::'||p_block_array(l_sub_index_detail).STOP_TIME );
1244: hr_utility.trace('p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY ::'||p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY );
1245: END IF;
1246:
1239: IF g_debug THEN
1240: hr_utility.trace('duplicate found..');
1241: hr_utility.trace('p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID ::'||p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID );
1242: hr_utility.trace('p_block_array(l_sub_index_detail).START_TIME ::'||p_block_array(l_sub_index_detail).START_TIME );
1243: hr_utility.trace('p_block_array(l_sub_index_detail).STOP_TIME ::'||p_block_array(l_sub_index_detail).STOP_TIME );
1244: hr_utility.trace('p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY ::'||p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY );
1245: END IF;
1246:
1247: l_del_bb_ids(l_del_index).time_building_block_id := p_block_array(l_sub_index_detail).time_building_block_id;
1240: hr_utility.trace('duplicate found..');
1241: hr_utility.trace('p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID ::'||p_block_array(l_sub_index_detail).TIME_BUILDING_BLOCK_ID );
1242: hr_utility.trace('p_block_array(l_sub_index_detail).START_TIME ::'||p_block_array(l_sub_index_detail).START_TIME );
1243: hr_utility.trace('p_block_array(l_sub_index_detail).STOP_TIME ::'||p_block_array(l_sub_index_detail).STOP_TIME );
1244: hr_utility.trace('p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY ::'||p_block_array(l_sub_index_detail).TRANSLATION_DISPLAY_KEY );
1245: END IF;
1246:
1247: l_del_bb_ids(l_del_index).time_building_block_id := p_block_array(l_sub_index_detail).time_building_block_id;
1248: l_del_index := l_del_index+1;
1295: --
1296: -- DBMS_PROFILER.STOP_PROFILER;
1297:
1298: IF g_debug THEN
1299: hr_utility.trace('printing p_block_arrays...before null out of tdk values ');
1300:
1301:
1302: l_index := p_block_array.first;
1303: LOOP
1301:
1302: l_index := p_block_array.first;
1303: LOOP
1304: EXIT WHEN NOT p_block_array.exists(l_index);
1305: hr_utility.trace('> '||
1306: 'RESOURCE_ID :'||p_block_array(l_index).RESOURCE_ID
1307: ||'BB id : '||p_block_array(l_index).TIME_BUILDING_BLOCK_ID
1308: ||'['||p_block_array(l_index).OBJECT_VERSION_NUMBER||']'
1309: ||' PARENT_BUILDING_BLOCK_ID: '||p_block_array(l_index).PARENT_BUILDING_BLOCK_ID
1340: IF g_debug THEN
1341: l_index := p_block_array.first;
1342: LOOP
1343: EXIT WHEN NOT p_block_array.exists(l_index);
1344: hr_utility.trace('> '||
1345: 'RESOURCE_ID :'||p_block_array(l_index).RESOURCE_ID
1346: ||'BB id : '||p_block_array(l_index).TIME_BUILDING_BLOCK_ID
1347: ||'['||p_block_array(l_index).OBJECT_VERSION_NUMBER||']'
1348: ||' PARENT_BUILDING_BLOCK_ID: '||p_block_array(l_index).PARENT_BUILDING_BLOCK_ID
2277:
2278:
2279: IF g_debug THEN
2280: l_proc := 'chk_all_days_in_block';
2281: hr_utility.set_location (g_package || l_proc, 120);
2282: END IF;
2283: -- Get the range calculated
2284: l_new_start_time := fnd_date.canonical_to_date (p_start_time);
2285: l_new_stop_time := fnd_date.canonical_to_date (p_stop_time);
2453:
2454:
2455: IF g_debug THEN
2456: l_proc := 'append_blocks';
2457: hr_utility.set_location ( g_package||l_proc, 300);
2458: END IF;
2459:
2460: l_new_blocks := p_new_blocks;
2461: l_new_attributes := p_new_attributes;
2464: -- blocks and attributes and return them
2465: IF p_block_array.count = 0
2466: THEN
2467: IF g_debug THEN
2468: hr_utility.set_location ( g_package||l_proc, 310);
2469: END IF;
2470:
2471: assign_block_ids(
2472: p_start_id => -2
2474: ,p_attributes => l_new_attributes
2475: );
2476:
2477: IF g_debug THEN
2478: hr_utility.set_location ( g_package||l_proc, 320);
2479: END IF;
2480:
2481: assign_attribute_ids(
2482: p_start_id => -2
2483: ,p_attributes => l_new_attributes
2484: );
2485:
2486: IF g_debug THEN
2487: hr_utility.set_location ( g_package||l_proc, 330);
2488: END IF;
2489:
2490:
2491: p_block_array := l_new_blocks;
2513: --
2514: IF p_overwrite = 'Y'
2515: THEN
2516: IF g_debug THEN
2517: hr_utility.set_location ( g_package||l_proc, 340);
2518: END IF;
2519:
2520: --end date all the existing blocks
2521: l_block_index := l_complete_blocks.first;
2527: l_block_index := l_complete_blocks.next(l_block_index);
2528: END LOOP;
2529:
2530: IF g_debug THEN
2531: hr_utility.set_location ( g_package||l_proc, 350);
2532: END IF;
2533:
2534: -- append new blocks
2535: -- before we append new blocks, we need to assign new ids to new blocks
2540: ,p_attributes => l_new_attributes
2541: );
2542:
2543: IF g_debug THEN
2544: hr_utility.set_location ( g_package||l_proc, 360);
2545: END IF;
2546:
2547: l_block_index := l_complete_blocks.last + 1;
2548: l_new_block_index := l_new_blocks.first;
2556: l_new_block_index := l_new_blocks.next(l_new_block_index);
2557: END LOOP;
2558:
2559: IF g_debug THEN
2560: hr_utility.set_location ( g_package||l_proc, 370);
2561: END IF;
2562:
2563: l_new_attribute_id := get_next_attribute_id(
2564: p_attributes => p_attribute_array
2651: l_new_attribute_id := get_next_attribute_id(
2652: p_attributes => l_complete_attributes
2653: );
2654: IF g_debug THEN
2655: hr_utility.set_location ( g_package||l_proc, 380);
2656: END IF;
2657:
2658: l_complete_block_count := l_complete_blocks.last + 1;
2659: l_complete_attribute_count := l_complete_attributes.last + 1;
2677: ,p_found => l_found
2678: );
2679:
2680: IF g_debug THEN
2681: hr_utility.set_location ( g_package||l_proc, 390);
2682: END IF;
2683:
2684: -- append comment to corrresponding block
2685: -- attach attributes to corrresponding block
2685: -- attach attributes to corrresponding block
2686: IF l_found
2687: THEN
2688: IF g_debug THEN
2689: hr_utility.set_location ( g_package||l_proc, 400);
2690: END IF;
2691:
2692: --append comments
2693: IF l_new_blocks_array(l_new_block_index).COMMENT_TEXT IS NOT NULL
2706: END IF;
2707: END IF;
2708:
2709: IF g_debug THEN
2710: hr_utility.set_location ( g_package||l_proc, 410);
2711: END IF;
2712:
2713: --append attributes
2714: l_attribute_index := l_new_attributes.first;
2764: l_attribute_index := l_new_attributes.next(l_attribute_index);
2765: END LOOP;
2766:
2767: IF g_debug THEN
2768: hr_utility.set_location ( g_package||l_proc, 420);
2769: END IF;
2770:
2771: IF l_new_blocks_array(l_new_block_index).SCOPE = 'DAY'
2772: THEN
2831: l_new_block_index := l_new_blocks_array.next(l_new_block_index);
2832: END LOOP;
2833:
2834: IF g_debug THEN
2835: hr_utility.set_location ( g_package||l_proc, 430);
2836: END IF;
2837:
2838: p_block_array := l_complete_blocks;
2839:
2857:
2858:
2859: IF g_debug THEN
2860: l_proc := 'attributes_to_array';
2861: hr_utility.set_location ( g_package||l_proc, 10);
2862: END IF;
2863:
2864: --initialize attribute array
2865: l_attribute_array := HXC_ATTRIBUTE_TABLE_TYPE();
2917: l_attribute_index := p_attributes.next(l_attribute_index);
2918: END LOOP;
2919:
2920: IF g_debug THEN
2921: hr_utility.set_location ( g_package||l_proc, 20);
2922: END IF;
2923: RETURN l_attribute_array;
2924: END attributes_to_array;
2925: */
2940:
2941:
2942: IF g_debug THEN
2943: l_proc := 'blocks_to_array';
2944: hr_utility.set_location ( g_package||l_proc, 10);
2945: END IF;
2946:
2947: l_block_array := HXC_BLOCK_TABLE_TYPE();
2948:
2980: l_block_index := p_blocks.next(l_block_index);
2981: END LOOP;
2982:
2983: IF g_debug THEN
2984: hr_utility.set_location ( g_package||l_proc, 140);
2985: END IF;
2986: RETURN l_block_array;
2987: END blocks_to_array;
2988: */
3027: begin
3028:
3029:
3030: IF g_debug THEN
3031: hr_utility.trace ('p_template_procedure='||p_template_procedure);
3032: END IF;
3033: hxc_timecard_message_helper.initializeErrors;
3034:
3035: l_dyn_template_sql := 'BEGIN '||fnd_global.newline
3042: ||',p_messages => :6);'||fnd_global.newline
3043: ||'END;';
3044:
3045: IF g_debug THEN
3046: hr_utility.trace ('l_dyn_template_sql='||l_dyn_template_sql);
3047: END IF;
3048:
3049:
3050: EXECUTE IMMEDIATE l_dyn_template_sql
3184:
3185: l_remove_redundant_entries := FALSE;
3186: IF g_debug THEN
3187: l_proc := 'get_blocks_from_template';
3188: hr_utility.set_location ( g_package||l_proc, 120);
3189: END IF;
3190: l_template_type := SUBSTR(p_template_code, 1, INSTR(p_template_code, '|') - 1);
3191: get_template_info(
3192: p_template_code => p_template_code
3194: ,p_template_action => l_template_action
3195: );
3196:
3197: IF g_debug THEN
3198: hr_utility.set_location ( g_package||l_proc, 130);
3199: END IF;
3200:
3201: IF l_template_action = 'INVALID'
3202: THEN
3211: IF l_template_handle = 'WORK_SCHEDULE'
3212: THEN
3213:
3214: IF g_debug THEN
3215: hr_utility.set_location ( g_package||l_proc, 140);
3216: END IF;
3217:
3218: HXT_TIMECARD_INFO.GENERATE_TIME(
3219: p_resource_id => TO_NUMBER(p_resource_id)
3239: END IF;
3240:
3241: ELSE
3242: IF g_debug THEN
3243: hr_utility.set_location ( g_package||l_proc, 150);
3244: END IF;
3245:
3246: -- find the corresponding dynamic template function for the
3247: -- specific application
3287: l_message_string,
3288: p_messages);
3289:
3290: IF g_debug THEN
3291: hr_utility.set_location ( g_package||l_proc, 160);
3292: END IF;
3293:
3294: OPEN c_retrieval_process(
3295: p_dyn_template_process => l_template_procedure
3306: CLOSE c_retrieval_process;
3307: END IF;
3308:
3309: IF g_debug THEN
3310: hr_utility.set_location ( g_package||l_proc, 170);
3311: END IF;
3312:
3313: l_temp_blocks := hxc_deposit_wrapper_utilities.string_to_blocks(
3314: p_block_string => l_block_string
3322:
3323: END IF;
3324:
3325: IF g_debug THEN
3326: hr_utility.set_location ( g_package||l_proc, 180);
3327: END IF;
3328:
3329: --now we need to update the returned block info
3330: l_blocks := hxc_deposit_wrapper_utilities.blocks_to_array(p_blocks => l_temp_blocks);
3362: RETURN;
3363: END IF;
3364:
3365: IF g_debug THEN
3366: hr_utility.trace('block count=' || l_blocks.count);
3367: hr_utility.set_location ( g_package||l_proc, 190);
3368: END IF;
3369:
3370: -- update the returned apps attributes and convert them to block attributes
3363: END IF;
3364:
3365: IF g_debug THEN
3366: hr_utility.trace('block count=' || l_blocks.count);
3367: hr_utility.set_location ( g_package||l_proc, 190);
3368: END IF;
3369:
3370: -- update the returned apps attributes and convert them to block attributes
3371: l_attributes := app_to_block_attributes(
3376: ,p_template_type => l_template_handle
3377: );
3378:
3379: IF g_debug THEN
3380: hr_utility.set_location ( g_package||l_proc, 200);
3381: END IF;
3382:
3383: append_blocks(
3384: p_block_array => p_block_array
3394: ,p_remove_redundant_entries => FALSE
3395: );
3396:
3397: IF g_debug THEN
3398: hr_utility.set_location ( g_package||l_proc, 210);
3399: END IF;
3400:
3401: p_message_string := l_message_string;
3402: RETURN;
3406: -- need to work out the last time card
3407: IF l_template_action = 'SYS' AND l_template_handle = 'LAST_TIMECARD'
3408: THEN
3409: IF g_debug THEN
3410: hr_utility.set_location ( g_package||l_proc, 220);
3411: END IF;
3412:
3413: OPEN c_last_timecard(
3414: p_resource_id => TO_NUMBER(p_resource_id)
3452: l_block_array_idx := p_block_array.next(l_block_array_idx);
3453: End Loop;
3454:
3455: IF g_debug THEN
3456: hr_utility.set_location ( g_package||l_proc, 230);
3457: END IF;
3458:
3459: -- we need to retrieve the template from time building blocks table
3460: IF l_template_action = 'STATIC'
3500: l_template_display_key := false;
3501: end if;
3502:
3503: IF g_debug THEN
3504: hr_utility.set_location ( g_package||l_proc, 246);
3505: END IF;
3506:
3507: IF l_template_action = 'LAST_TIMECARD'
3508: THEN
3613: END LOOP;
3614: END IF;
3615:
3616: IF g_debug THEN
3617: hr_utility.set_location ( g_package||l_proc, 250);
3618: END IF;
3619:
3620: if((l_blocks.COUNT > 0) AND (l_template_action = 'SYS' AND l_template_handle = 'LAST_TIMECARD'))
3621: then
3661: ,p_remove_redundant_entries =>l_remove_redundant_entries
3662: );
3663:
3664: IF g_debug THEN
3665: hr_utility.set_location ( g_package||l_proc, 260);
3666: END IF;
3667: --
3668: -- If the timecard, or the template are missing the display keys
3669: -- we must permit the timecard to dynamically allocate the row
3679: End Loop;
3680: end if;
3681:
3682: IF g_debug THEN
3683: hr_utility.set_location ( g_package||l_proc, 270);
3684: END IF;
3685:
3686: p_message_string := NULL;
3687:
3919: END IF;
3920:
3921: IF g_debug THEN
3922: l_proc := 'translate_alias_timecards';
3923: hr_utility.set_location ( g_package||l_proc, 20);
3924: END IF;
3925:
3926: HXC_ALIAS_TRANSLATOR.do_retrieval_translation(
3927: p_attributes => p_attribute_array
3932: ,p_messages => l_messages_table
3933: );
3934:
3935: IF g_debug THEN
3936: hr_utility.set_location ( g_package||l_proc, 30);
3937: END IF;
3938:
3939: END translate_alias_timecards;
3940:
4677:
4678: CLOSE c_timecard_block;
4679:
4680: IF g_debug THEN
4681: hr_utility.trace('found timecard');
4682: END IF;
4683:
4684: IF trunc(l_blocks(l_block_index).START_TIME) = trunc(l_app_period.start_time)
4685: AND trunc(l_blocks(l_block_index).STOP_TIME) = trunc(l_app_period.stop_time) THEN
5036:
5037: l_resp_id NUMBER;
5038: l_resp_appl_id NUMBER;
5039: BEGIN
5040: g_debug := hr_utility.debug_enabled;
5041:
5042: IF g_debug THEN
5043: l_proc := 'fetch_blocks_and_attributes';
5044: hr_utility.set_location (g_package||l_proc, 20);
5040: g_debug := hr_utility.debug_enabled;
5041:
5042: IF g_debug THEN
5043: l_proc := 'fetch_blocks_and_attributes';
5044: hr_utility.set_location (g_package||l_proc, 20);
5045: END IF;
5046:
5047: --if(p_timecard_action <> 'Template') then
5048: if(p_timecard_action NOT IN ('Template','Export')) then
5083: );
5084: END IF;*/
5085:
5086: IF g_debug THEN
5087: hr_utility.set_location ( g_package||l_proc, 20);
5088: END IF;
5089:
5090: IF p_timecard_id IS NOT NULL
5091: AND is_app_period(TO_NUMBER(p_timecard_id))
5118: );
5119: END IF;
5120:
5121: IF g_debug THEN
5122: hr_utility.set_location ( g_package||l_proc, 28);
5123: END IF;
5124:
5125:
5126: --(1) First check if we need to apply a template
5142: ,p_messages => p_messages
5143: );
5144:
5145: IF g_debug THEN
5146: hr_utility.set_location ( g_package||l_proc, 30);
5147: END IF;
5148:
5149: p_message_string := l_message_string;
5150:
5180: RETURN;
5181: END IF;
5182:
5183: IF g_debug THEN
5184: hr_utility.set_location ( g_package||l_proc, 40);
5185:
5186: hr_utility.trace(' p_resource_id=' || p_resource_id);
5187: hr_utility.trace('p_resource_type=' || p_resource_type);
5188: hr_utility.trace('p_start_time=' || p_start_time);
5182:
5183: IF g_debug THEN
5184: hr_utility.set_location ( g_package||l_proc, 40);
5185:
5186: hr_utility.trace(' p_resource_id=' || p_resource_id);
5187: hr_utility.trace('p_resource_type=' || p_resource_type);
5188: hr_utility.trace('p_start_time=' || p_start_time);
5189: hr_utility.trace('p_stop_time=' || p_stop_time);
5190: hr_utility.trace('p_timecard_id=' || p_timecard_id);
5183: IF g_debug THEN
5184: hr_utility.set_location ( g_package||l_proc, 40);
5185:
5186: hr_utility.trace(' p_resource_id=' || p_resource_id);
5187: hr_utility.trace('p_resource_type=' || p_resource_type);
5188: hr_utility.trace('p_start_time=' || p_start_time);
5189: hr_utility.trace('p_stop_time=' || p_stop_time);
5190: hr_utility.trace('p_timecard_id=' || p_timecard_id);
5191: END IF;
5184: hr_utility.set_location ( g_package||l_proc, 40);
5185:
5186: hr_utility.trace(' p_resource_id=' || p_resource_id);
5187: hr_utility.trace('p_resource_type=' || p_resource_type);
5188: hr_utility.trace('p_start_time=' || p_start_time);
5189: hr_utility.trace('p_stop_time=' || p_stop_time);
5190: hr_utility.trace('p_timecard_id=' || p_timecard_id);
5191: END IF;
5192:
5185:
5186: hr_utility.trace(' p_resource_id=' || p_resource_id);
5187: hr_utility.trace('p_resource_type=' || p_resource_type);
5188: hr_utility.trace('p_start_time=' || p_start_time);
5189: hr_utility.trace('p_stop_time=' || p_stop_time);
5190: hr_utility.trace('p_timecard_id=' || p_timecard_id);
5191: END IF;
5192:
5193: --(3)retrieve an existing timecard
5186: hr_utility.trace(' p_resource_id=' || p_resource_id);
5187: hr_utility.trace('p_resource_type=' || p_resource_type);
5188: hr_utility.trace('p_start_time=' || p_start_time);
5189: hr_utility.trace('p_stop_time=' || p_stop_time);
5190: hr_utility.trace('p_timecard_id=' || p_timecard_id);
5191: END IF;
5192:
5193: --(3)retrieve an existing timecard
5194: -- Make sure we replace the display key
5237: End Loop;
5238: end if;
5239:
5240: IF g_debug THEN
5241: hr_utility.set_location ( g_package||l_proc, 50);
5242: END IF;
5243:
5244: -- if there is an existing timecard, return the info in string
5245: IF p_block_array is not null THEN
5251: );
5252: end if;
5253:
5254: IF g_debug THEN
5255: hr_utility.set_location ( g_package||l_proc, 60);
5256: END IF;
5257:
5258: -- call translator alias package
5259: translate_alias_timecards(
5283: END IF;
5284:
5285:
5286: IF g_debug THEN
5287: hr_utility.trace('app period jxtan');
5288: END IF;
5289: --(4) there is no existing timecard, check if this period
5290: -- corresponds to an application period
5291: -- this part is here so that the url we created for
5343: p_block_array => p_block_array,
5344: p_attribute_array => p_attribute_array );
5345:
5346: p_messages := hxc_retrieve_absences.g_messages;
5347: hr_utility.trace('ABS Message count = '||p_messages.count);
5348: p_message_string := hxc_retrieve_absences.g_message_string;
5349: IF p_messages.COUNT > 0
5350: THEN
5351: IF g_debug
5351: IF g_debug
5352: THEN
5353: for i in p_messages.first..p_messages.last
5354: loop
5355: hr_utility.trace('ABS : message_name '||p_messages(i).message_name);
5356: hr_utility.trace('ABS : message_level '||p_messages(i).message_level);
5357: END LOOP;
5358: END IF;
5359: END IF;
5352: THEN
5353: for i in p_messages.first..p_messages.last
5354: loop
5355: hr_utility.trace('ABS : message_name '||p_messages(i).message_name);
5356: hr_utility.trace('ABS : message_level '||p_messages(i).message_level);
5357: END LOOP;
5358: END IF;
5359: END IF;
5360:
5373: );
5374: END IF;
5375:
5376: IF g_debug THEN
5377: hr_utility.set_location ( g_package||l_proc, 100);
5378: END IF;
5379:
5380: IF l_template_code IS NOT NULL
5381: THEN
5402: ,p_messages => p_messages
5403: );
5404:
5405: IF g_debug THEN
5406: hr_utility.set_location ( g_package||l_proc, 110);
5407: END IF;
5408:
5409: p_message_string := l_message_string;
5410:
5439: p_lock_rowid => p_lock_rowid,
5440: p_block_array => p_block_array,
5441: p_attribute_array => p_attribute_array );
5442: p_messages := hxc_retrieve_absences.g_messages;
5443: hr_utility.trace('ABS Message count2 = '||p_messages.count);
5444:
5445: IF p_messages.COUNT > 0
5446: THEN
5447: IF g_debug
5447: IF g_debug
5448: THEN
5449: for i in p_messages.first..p_messages.last
5450: loop
5451: hr_utility.trace('ABS : message_name '||p_messages(i).message_name);
5452: hr_utility.trace('ABS : message_level '||p_messages(i).message_level);
5453: END LOOP;
5454: END IF;
5455: END IF;
5448: THEN
5449: for i in p_messages.first..p_messages.last
5450: loop
5451: hr_utility.trace('ABS : message_name '||p_messages(i).message_name);
5452: hr_utility.trace('ABS : message_level '||p_messages(i).message_level);
5453: END LOOP;
5454: END IF;
5455: END IF;
5456:
5661: AND htr.time_recipient_id = hrp.time_recipient_id;
5662:
5663: BEGIN
5664:
5665: g_debug := hr_utility.debug_enabled;
5666:
5667: get_template_info(
5668: p_template_code => p_template_code
5669: ,p_template_handle => l_template_handle
5671: );
5672:
5673: IF g_debug THEN
5674: l_proc := 'get_blocks_from_template';
5675: hr_utility.set_location ( g_package||l_template_action, 130);
5676: END IF;
5677:
5678:
5679: IF l_template_action = 'APP'
5684: IF l_template_handle = 'WORK_SCHEDULE'
5685: THEN
5686:
5687: IF g_debug THEN
5688: hr_utility.set_location ( g_package||l_proc, 140);
5689: END IF;
5690:
5691: HXT_TIMECARD_INFO.GENERATE_TIME(
5692: p_resource_id => TO_NUMBER(p_resource_id)
5720:
5721: FETCH c_dyn_template_procedure INTO l_template_procedure;
5722:
5723: IF g_debug THEN
5724: hr_utility.set_location ( 'PJRM=='||l_template_procedure, 150);
5725: END IF;
5726:
5727: IF c_dyn_template_procedure%NOTFOUND
5728: THEN
5733:
5734: CLOSE c_dyn_template_procedure;
5735:
5736: IF g_debug THEN
5737: hr_utility.set_location ( 'calling get_dynamic_templates_info==', 160);
5738: END IF;
5739: get_dynamic_templates_info
5740: ( l_template_procedure,
5741: l_tp_resource_id,
5746: l_message_string,
5747: p_messages);
5748:
5749: IF g_debug THEN
5750: hr_utility.set_location ( 'completed get_dynamic_templates_info=='||p_messages.count, 170);
5751: END IF;
5752:
5753: OPEN c_retrieval_process(
5754: p_dyn_template_process => l_template_procedure
5871: INTO bb_id_tab,
5872: bb_ovn_tab;
5873: CLOSE c_get_latest_timecard_details;
5874:
5875: hr_utility.trace('Detail Building Blocks Count :' || bb_id_tab.COUNT);
5876:
5877:
5878:
5879: ------------------------------ check whether data has transfer or not------------------------------
5883: LOOP
5884: EXIT
5885: WHEN NOT bb_id_tab.EXISTS(l_index);
5886:
5887: hr_utility.trace(bb_id_tab(l_index) || '-' || bb_ovn_tab(l_index));
5888:
5889: OPEN c_get_transaction_id(bb_id_tab(l_index), bb_ovn_tab(l_index));
5890: FETCH c_get_transaction_id bulk collect
5891: INTO l_transaction_id_tab,l_transaction_process_id_tab;
5910: IF l_transaction_id_tab IS NOT NULL THEN
5911:
5912: IF g_debug
5913: THEN
5914: hr_utility.trace('l_transfer_to : YET TO DECIDE');
5915: hr_utility.trace('Transaction Ids Count :' || l_transaction_id_tab.COUNT);
5916: hr_utility.trace('l_transfer_to :' || l_transfer_to);
5917: END IF;
5918:
5911:
5912: IF g_debug
5913: THEN
5914: hr_utility.trace('l_transfer_to : YET TO DECIDE');
5915: hr_utility.trace('Transaction Ids Count :' || l_transaction_id_tab.COUNT);
5916: hr_utility.trace('l_transfer_to :' || l_transfer_to);
5917: END IF;
5918:
5919: l_index := l_transaction_id_tab.FIRST;
5912: IF g_debug
5913: THEN
5914: hr_utility.trace('l_transfer_to : YET TO DECIDE');
5915: hr_utility.trace('Transaction Ids Count :' || l_transaction_id_tab.COUNT);
5916: hr_utility.trace('l_transfer_to :' || l_transfer_to);
5917: END IF;
5918:
5919: l_index := l_transaction_id_tab.FIRST;
5920:
5920:
5921: LOOP
5922: EXIT
5923: WHEN NOT l_transaction_id_tab.EXISTS(l_index);
5924: hr_utility.trace('l_transaction_id_tab('||l_index||'):'||l_transaction_id_tab(l_index)
5925: ||'-'||'l_transaction_process_id_tab('||l_index||'):'||l_transaction_process_id_tab(l_index));
5926:
5927: IF l_transaction_process_id_tab(l_index) = -1 THEN
5928: SELECT retrieval_process_id
5946: WHERE retrieval_process_id = l_transaction_process_id_tab(l_index));
5947:
5948:
5949:
5950: hr_utility.trace('l_time_recipient_name :' || l_time_recipient_name);
5951:
5952: IF l_transfer_to = 'None' AND l_time_recipient_name IS NOT NULL THEN
5953: l_transfer_to := l_time_recipient_name;
5954: ELSIF instrb(l_transfer_to, l_time_recipient_name) = 0 THEN
5962: END IF; -- IF l_transaction_id IS NOT NULL THEN
5963:
5964: ------------------------------- pass the transfer_to data to TcActivitiesPG .------------------
5965:
5966: hr_utility.trace('l_transfer_to :' || l_transfer_to);
5967: hr_utility.trace('end');
5968:
5969:
5970: RETURN l_transfer_to;
5963:
5964: ------------------------------- pass the transfer_to data to TcActivitiesPG .------------------
5965:
5966: hr_utility.trace('l_transfer_to :' || l_transfer_to);
5967: hr_utility.trace('end');
5968:
5969:
5970: RETURN l_transfer_to;
5971: