DBA Data[Home] [Help]

APPS.CSF_TRIPS_PUB dependencies on FND_LOG

Line 7: g_level_cp_output CONSTANT NUMBER := fnd_log.level_unexpected + 1;

3:
4: g_pkg_name CONSTANT VARCHAR2(30) := 'CSF_TRIPS_PUB';
5: g_debug VARCHAR2(1);
6: g_debug_level NUMBER;
7: g_level_cp_output CONSTANT NUMBER := fnd_log.level_unexpected + 1;
8:
9: g_hours_in_day CONSTANT NUMBER := 24;
10: g_mins_in_day CONSTANT NUMBER := 24 * 60;
11: g_secs_in_day CONSTANT NUMBER := 24 * 60 * 60;

Line 76: fnd_log.string(p_level, 'csf.plsql.CSF_TRIPS_PUB.' || p_module, p_message);

72: ELSE
73: fnd_file.put_line(fnd_file.log, rpad(p_module, 20) || ': ' || p_message);
74: END IF;
75: ELSE
76: fnd_log.string(p_level, 'csf.plsql.CSF_TRIPS_PUB.' || p_module, p_message);
77: END IF;
78: END IF;
79: --dbms_output.put_line(rpad(p_module, 20) || ': ' || p_message);
80: END debug;

Line 241: , fnd_log.level_event

237: || ' between ' || format_date(g_messages(i).start_datetime)
238: || ' and ' || format_date(g_messages(i).end_datetime)
239: || ' processed successfully'
240: , 'PROCESS_ACTION'
241: , fnd_log.level_event
242: );
243: END IF;
244: l_success := l_success + 1;
245: END IF;

Line 287: g_debug_level := NVL(fnd_profile.value_specific('AFLOG_LEVEL'), fnd_log.level_event);

283: BEGIN
284: g_duration_uom := fnd_profile.value('CSF_UOM_MINUTES');
285: g_overtime := NVL(fnd_profile.value('MAXOVERTIME'), 0) / g_mins_in_day;
286: g_debug := NVL(fnd_profile.value('AFLOG_ENABLED'), 'N');
287: g_debug_level := NVL(fnd_profile.value_specific('AFLOG_LEVEL'), fnd_log.level_event);
288: g_datetime_fmt_mask := NVL(fnd_profile.value('ICX_DATE_FORMAT_MASK'), 'DD-MON-YYYY') || ' HH24:MI';
289: g_tz_enabled := fnd_timezones.timezones_enabled;
290: g_server_tz_code := fnd_timezones.get_server_timezone_code;
291: g_client_tz_code := fnd_timezones.get_client_timezone_code;

Line 310: debug('Unable to initialize the Package - SQLCODE = ' || SQLCODE || ' : SQLERRM = ' || SQLERRM, 'INIT', fnd_log.level_unexpected);

306: --EXECUTE IMMEDIATE 'alter session set statistics_level=all';
307: --EXECUTE IMMEDIATE 'alter session set events ''10046 trace name context forever, level 12''';
308: EXCEPTION
309: WHEN OTHERS THEN
310: debug('Unable to initialize the Package - SQLCODE = ' || SQLCODE || ' : SQLERRM = ' || SQLERRM, 'INIT', fnd_log.level_unexpected);
311: END;
312:
313: FUNCTION trip_has_active_tasks(p_trip_id NUMBER)
314: RETURN BOOLEAN IS

Line 455: debug(' Got the Party Site ID ' || l_address.party_site_id || ' for the resource on ' || p_start_date_time, l_api_name, fnd_log.level_statement);

451: , p_date => p_start_date_time
452: );
453:
454: IF l_debug THEN
455: debug(' Got the Party Site ID ' || l_address.party_site_id || ' for the resource on ' || p_start_date_time, l_api_name, fnd_log.level_statement);
456: END IF;
457:
458: IF l_address.party_site_id IS NULL THEN
459: IF l_debug THEN

Line 461: debug(' CSF_RESOURCE_ADDRESS_PVT failed to give Party Site ID' || x_msg_data, l_api_name, fnd_log.level_error);

457:
458: IF l_address.party_site_id IS NULL THEN
459: IF l_debug THEN
460: x_msg_data := fnd_msg_pub.get(p_msg_index => fnd_msg_pub.g_last, p_encoded => fnd_api.g_false);
461: debug(' CSF_RESOURCE_ADDRESS_PVT failed to give Party Site ID' || x_msg_data, l_api_name, fnd_log.level_error);
462: END IF;
463: fnd_message.set_name('CSF', 'CSF_RESOURCE_NO_ACTIVE_PARTY');
464: fnd_message.set_token('RESOURCE', get_resource_info(p_resource_id, p_resource_type));
465: fnd_message.set_token('DATE', format_date(p_start_date_time));

Line 514: debug(' Created Departure Task - Task ID = ' || x_dep_task_id, l_api_name, fnd_log.level_statement);

510: RAISE fnd_api.g_exc_error;
511: END IF;
512:
513: IF l_debug THEN
514: debug(' Created Departure Task - Task ID = ' || x_dep_task_id, l_api_name, fnd_log.level_statement);
515: END IF;
516: END IF;
517:
518: -- Create the Arrival Task

Line 556: debug(' Created Arrival Task - Task ID = ' || x_arr_task_id, l_api_name, fnd_log.level_statement);

552: END IF;
553: RAISE fnd_api.g_exc_error;
554: END IF;
555: IF l_debug THEN
556: debug(' Created Arrival Task - Task ID = ' || x_arr_task_id, l_api_name, fnd_log.level_statement);
557: END IF;
558: END IF;
559: EXCEPTION
560: WHEN fnd_api.g_exc_error THEN

Line 663: debug(' Creating Trip between ' || format_date(p_start_date_time) || ' and ' || format_date(p_end_date_time), l_api_name, fnd_log.level_statement);

659:
660: x_return_status := fnd_api.g_ret_sts_success;
661:
662: IF l_debug THEN
663: debug(' Creating Trip between ' || format_date(p_start_date_time) || ' and ' || format_date(p_end_date_time), l_api_name, fnd_log.level_statement);
664: END IF;
665:
666: -- Trip Available Hours
667: l_available_hours := (p_end_date_time - p_start_date_time) * g_hours_in_day;

Line 672: debug(' The specified Trip Length is greater than one day', l_api_name, fnd_log.level_error);

668:
669: -- Check#3 - The Trip Duration should be lesser than 24 Hours.
670: IF l_available_hours > g_hours_in_day THEN
671: IF l_debug THEN
672: debug(' The specified Trip Length is greater than one day', l_api_name, fnd_log.level_error);
673: END IF;
674: fnd_message.set_name('CSF', 'CSF_TRIP_LENGTH_MORE_THAN_DAY');
675: fnd_msg_pub.ADD;
676: RAISE fnd_api.g_exc_error;

Line 701: debug(' Unable to Create Shift Tasks: Error = ' || x_msg_data, l_api_name, fnd_log.level_error);

697: );
698:
699: IF x_return_status <> fnd_api.g_ret_sts_success THEN
700: IF l_debug THEN
701: debug(' Unable to Create Shift Tasks: Error = ' || x_msg_data, l_api_name, fnd_log.level_error);
702: END IF;
703: IF x_return_status = fnd_api.g_ret_sts_error THEN
704: RAISE fnd_api.g_exc_error;
705: ELSE

Line 710: debug(' Created new Shift Tasks - Dep#' || l_dep_task_id || ' : Arr#' || l_arr_task_id, l_api_name, fnd_log.level_statement);

706: RAISE fnd_api.g_exc_unexpected_error;
707: END IF;
708: END IF;
709: IF l_debug THEN
710: debug(' Created new Shift Tasks - Dep#' || l_dep_task_id || ' : Arr#' || l_arr_task_id, l_api_name, fnd_log.level_statement);
711: END IF;
712: l_dep_task_id := NVL(p_dep_task_id, l_dep_task_id);
713: l_arr_task_id := NVL(p_arr_task_id, l_arr_task_id);
714: ELSE

Line 719: debug(' Using existing Shift Tasks - Dep#' || l_dep_task_id || ' : Arr#' || l_arr_task_id, l_api_name, fnd_log.level_statement);

715: -- Use the existing ones.
716: l_dep_task_id := p_dep_task_id;
717: l_arr_task_id := p_arr_task_id;
718: IF l_debug THEN
719: debug(' Using existing Shift Tasks - Dep#' || l_dep_task_id || ' : Arr#' || l_arr_task_id, l_api_name, fnd_log.level_statement);
720: END IF;
721: END IF;
722:
723: i := 0;

Line 731: debug(' Linking TaskID #' || v_task.task_id || ' : Time Used = ' || l_time_occupied * g_hours_in_day, l_api_name, fnd_log.level_statement);

727: l_time_occupied := l_time_occupied + NVL(v_task.travel_time, 0) / g_mins_in_day; -- Scheduled Travel Duration
728: l_available_hours := l_available_hours - l_time_occupied * g_hours_in_day;
729:
730: IF l_debug THEN
731: debug(' Linking TaskID #' || v_task.task_id || ' : Time Used = ' || l_time_occupied * g_hours_in_day, l_api_name, fnd_log.level_statement);
732: END IF;
733:
734: i := i + 1;
735: l_object_tasks_tbl(i).task_assignment_id := v_task.task_assignment_id;

Line 742: debug(' Linking Shift TaskID #' || v_task.task_id, l_api_name, fnd_log.level_statement);

738: END LOOP;
739: ELSE
740: FOR v_task IN c_shift_tasks_info LOOP
741: IF l_debug THEN
742: debug(' Linking Shift TaskID #' || v_task.task_id, l_api_name, fnd_log.level_statement);
743: END IF;
744:
745: i := i + 1;
746: l_object_tasks_tbl(i).task_assignment_id := v_task.task_assignment_id;

Line 762: debug(' Trip Available Hours = ' || l_available_hours, l_api_name, fnd_log.level_statement);

758: l_object_capacity_tbl(1).status := p_status;
759: l_object_capacity_tbl(1).schedule_detail_id := p_schedule_detail_id;
760:
761: IF l_debug THEN
762: debug(' Trip Available Hours = ' || l_available_hours, l_api_name, fnd_log.level_statement);
763: END IF;
764:
765: -- Create the Trip by calling Object Capacity Table Handlers
766: cac_sr_object_capacity_pub.insert_object_capacity(

Line 780: debug(' Unable to Create the Object Capacity: Error = ' || x_msg_data, l_api_name, fnd_log.level_error);

776:
777: IF x_return_status <> fnd_api.g_ret_sts_success THEN
778: IF l_debug THEN
779: x_msg_data := fnd_msg_pub.get(p_msg_index => fnd_msg_pub.g_last, p_encoded => fnd_api.g_false);
780: debug(' Unable to Create the Object Capacity: Error = ' || x_msg_data, l_api_name, fnd_log.level_error);
781: END IF;
782: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
783: RAISE fnd_api.g_exc_unexpected_error;
784: END IF;

Line 799: debug(' Created Trip - TripID#' || x_trip.trip_id, l_api_name, fnd_log.level_statement);

795: x_trip.status := p_status;
796: x_trip.schedule_detail_id := p_schedule_detail_id;
797:
798: IF l_debug THEN
799: debug(' Created Trip - TripID#' || x_trip.trip_id, l_api_name, fnd_log.level_statement);
800: END IF;
801: EXCEPTION
802: WHEN fnd_api.g_exc_error THEN
803: ROLLBACK TO csf_new_trip;

Line 811: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

807: ROLLBACK TO csf_new_trip;
808: x_return_status := fnd_api.g_ret_sts_unexp_error;
809: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
810: WHEN OTHERS THEN
811: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
812: x_return_status := fnd_api.g_ret_sts_unexp_error;
813: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
814: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
815: END IF;

Line 905: debug(' Trip Availability is more than Shift Length', l_api_name, fnd_log.level_error);

901: OR (l_available_hours_after <> fnd_api.g_miss_num AND l_available_hours_after > l_shift_length)
902: THEN
903: -- Trip Availability is more than the Shift Length
904: IF l_debug THEN
905: debug(' Trip Availability is more than Shift Length', l_api_name, fnd_log.level_error);
906: END IF;
907:
908: fnd_message.set_name('CSF', 'CSF_TRIP_WRONG_AVAILABILITY');
909: fnd_message.set_token('AVAILABLE', l_available_hours);

Line 923: debug(' Available Hours Before and After must be NULL when Availability is Trip Length', l_api_name, fnd_log.level_error);

919: )
920: THEN
921: -- Trip Availability is equal to the Shift Length and Before and Afters are not NULL
922: IF l_debug THEN
923: debug(' Available Hours Before and After must be NULL when Availability is Trip Length', l_api_name, fnd_log.level_error);
924: END IF;
925:
926: fnd_message.set_name('CSF', 'CSF_TRIP_WRONG_AVL_BEFOREAFTER');
927: fnd_message.set_token('AVLBEFORE', l_available_hours_before);

Line 949: debug(' Unable to Update the Object Capacity', l_api_name, fnd_log.level_error);

945: );
946:
947: IF x_return_status <> fnd_api.g_ret_sts_success THEN
948: IF l_debug THEN
949: debug(' Unable to Update the Object Capacity', l_api_name, fnd_log.level_error);
950: END IF;
951: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
952: RAISE fnd_api.g_exc_unexpected_error;
953: END IF;

Line 979: debug(' Updating the Task - TaskID# ' || v_task.task_id, l_api_name, fnd_log.level_statement);

975: FOR v_task IN c_tasks(l_task_type) LOOP
976: l_new_task_status := get_new_task_status(p_task_action, v_task.assignment_status_id);
977: IF l_new_task_status IS NOT NULL THEN
978: IF l_debug THEN
979: debug(' Updating the Task - TaskID# ' || v_task.task_id, l_api_name, fnd_log.level_statement);
980: END IF;
981: csf_task_assignments_pub.update_assignment_status(
982: p_api_version => 1.0
983: , p_init_msg_list => fnd_api.g_false

Line 1001: debug(' Unable to update the Assignment: Error = ' || x_msg_data, l_api_name, fnd_log.level_error);

997: -- Somehow direct population of the Token using fnd_msg_pub is not working
998: -- Therefore populating it in x_msg_data and using it to populate the Token REASON.
999: x_msg_data := fnd_msg_pub.get(fnd_msg_pub.g_last, fnd_api.g_false);
1000: IF l_debug THEN
1001: debug(' Unable to update the Assignment: Error = ' || x_msg_data, l_api_name, fnd_log.level_error);
1002: END IF;
1003: fnd_message.set_name('CSF', 'CSF_ASSIGNMENT_UPDATE_FAIL');
1004: fnd_message.set_token('TASK', v_task.task_number);
1005: fnd_message.set_token('REASON', x_msg_data);

Line 1024: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

1020: ROLLBACK TO csf_change_trip;
1021: x_return_status := fnd_api.g_ret_sts_unexp_error;
1022: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
1023: WHEN OTHERS THEN
1024: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
1025: x_return_status := fnd_api.g_ret_sts_unexp_error;
1026: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1027: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1028: END IF;

Line 1066: , l_api_name, fnd_log.level_procedure

1062: IF l_debug THEN
1063: debug( ' Deleting the Trip #' || p_trip.trip_id
1064: || ' between ' || format_date(p_trip.start_date_time)
1065: || ' and ' || format_date(p_trip.end_date_time)
1066: , l_api_name, fnd_log.level_procedure
1067: );
1068: END IF;
1069:
1070: -- Check whether the Trip is blocked

Line 1073: debug(' The Trip is unavailable and so cant be deleted', l_api_name, fnd_log.level_error);

1069:
1070: -- Check whether the Trip is blocked
1071: IF p_trip.status = g_trip_unavailable THEN
1072: IF l_debug THEN
1073: debug(' The Trip is unavailable and so cant be deleted', l_api_name, fnd_log.level_error);
1074: END IF;
1075:
1076: fnd_message.set_name('CSF', 'CSF_TRIP_IS_BLOCKED');
1077: fnd_msg_pub.ADD;

Line 1086: debug(' Trip has active Tasks and so cant be deleted', l_api_name, fnd_log.level_error);

1082: IF NVL(p_check_active_tasks, fnd_api.g_true) = fnd_api.g_true THEN
1083: IF trip_has_active_tasks(p_trip.trip_id) THEN
1084: -- There are Active Task Assignments for the Trip.
1085: IF l_debug THEN
1086: debug(' Trip has active Tasks and so cant be deleted', l_api_name, fnd_log.level_error);
1087: END IF;
1088:
1089: fnd_message.set_name('CSF', 'CSF_TRIP_HAS_ACTIVE_TASKS');
1090: fnd_msg_pub.ADD;

Line 1098: debug(' Deleting the Shift Task #' || v_shift_task.task_id, l_api_name, fnd_log.level_statement);

1094:
1095: -- Delete the Shift Tasks
1096: FOR v_shift_task IN c_shift_tasks LOOP
1097: IF l_debug THEN
1098: debug(' Deleting the Shift Task #' || v_shift_task.task_id, l_api_name, fnd_log.level_statement);
1099: END IF;
1100: jtf_tasks_pub.delete_task(
1101: p_api_version => 1.0
1102: , x_return_status => x_return_status

Line 1110: debug(' Unable to Delete the Shift Task - ' || v_shift_task.task_name, l_api_name, fnd_log.level_error);

1106: , p_object_version_number => v_shift_task.object_version_number
1107: );
1108: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1109: IF l_debug THEN
1110: debug(' Unable to Delete the Shift Task - ' || v_shift_task.task_name, l_api_name, fnd_log.level_error);
1111: END IF;
1112:
1113: fnd_message.set_name('CSF', 'CSF_TASK_DELETE_FAIL');
1114: fnd_message.set_token('TASK', v_shift_task.task_number);

Line 1137: debug(' Unable to Delete the Object Capacity', l_api_name, fnd_log.level_error);

1133: );
1134:
1135: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1136: IF l_debug THEN
1137: debug(' Unable to Delete the Object Capacity', l_api_name, fnd_log.level_error);
1138: END IF;
1139: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1140: RAISE fnd_api.g_exc_unexpected_error;
1141: END IF;

Line 1146: debug(' Deleted the Trip', l_api_name, fnd_log.level_statement);

1142: RAISE fnd_api.g_exc_error;
1143: END IF;
1144:
1145: IF l_debug THEN
1146: debug(' Deleted the Trip', l_api_name, fnd_log.level_statement);
1147: END IF;
1148: EXCEPTION
1149: WHEN fnd_api.g_exc_error THEN
1150: ROLLBACK TO csf_remove_trip;

Line 1158: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

1154: ROLLBACK TO csf_remove_trip;
1155: x_return_status := fnd_api.g_ret_sts_unexp_error;
1156: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
1157: WHEN OTHERS THEN
1158: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
1159: x_return_status := fnd_api.g_ret_sts_unexp_error;
1160: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1161: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1162: END IF;

Line 1278: debug(' Checking Shift Tasks', l_api_name, fnd_log.level_statement);

1274:
1275: x_return_status := fnd_api.g_ret_sts_success;
1276:
1277: IF l_debug THEN
1278: debug(' Checking Shift Tasks', l_api_name, fnd_log.level_statement);
1279: END IF;
1280:
1281: -- Clean up the Shift Tasks for the Trip.
1282: l_dep_task_exists := FALSE;

Line 1287: debug(' Deleting the Duplicate Shift Task #' || v_shift_task.task_id, l_api_name, fnd_log.level_statement);

1283: l_arr_task_exists := FALSE;
1284: FOR v_shift_task IN c_shift_tasks LOOP
1285: IF v_shift_task.duplicate IS NOT NULL THEN
1286: IF l_debug THEN
1287: debug(' Deleting the Duplicate Shift Task #' || v_shift_task.task_id, l_api_name, fnd_log.level_statement);
1288: END IF;
1289: -- Departure Task already exists... Delete this Duplicate.
1290: jtf_tasks_pub.delete_task(
1291: p_api_version => 1.0

Line 1301: debug(' Unable to Delete the Task', l_api_name, fnd_log.level_error);

1297: );
1298: END IF;
1299: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1300: IF l_debug THEN
1301: debug(' Unable to Delete the Task', l_api_name, fnd_log.level_error);
1302: END IF;
1303:
1304: fnd_message.set_name('CSF', 'CSF_TASK_DELETE_FAIL');
1305: fnd_message.set_token('TASK', v_shift_task.task_number);

Line 1323: debug(' Either Departure or Arrival Task is absent. Creating them', l_api_name, fnd_log.level_statement);

1319: END LOOP;
1320:
1321: IF NOT(l_dep_task_exists) OR NOT(l_arr_task_exists) THEN
1322: IF l_debug THEN
1323: debug(' Either Departure or Arrival Task is absent. Creating them', l_api_name, fnd_log.level_statement);
1324: END IF;
1325:
1326: create_shift_tasks(
1327: p_api_version => 1.0

Line 1343: debug(' Creation of Shift Tasks failed', l_api_name, fnd_log.level_error);

1339: );
1340:
1341: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1342: IF l_debug THEN
1343: debug(' Creation of Shift Tasks failed', l_api_name, fnd_log.level_error);
1344: END IF;
1345: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1346: RAISE fnd_api.g_exc_unexpected_error;
1347: END IF;

Line 1354: debug(' TaskID#' || v_task.task_id || ' is part of Trip#' || v_task.wrong_trip_id || '. But should be in Trip#' || v_task.correct_trip_id || '. Fixing the Task', l_api_name, fnd_log.level_statement);

1350: END IF;
1351:
1352: FOR v_task IN c_tasks LOOP
1353: IF l_debug THEN
1354: debug(' TaskID#' || v_task.task_id || ' is part of Trip#' || v_task.wrong_trip_id || '. But should be in Trip#' || v_task.correct_trip_id || '. Fixing the Task', l_api_name, fnd_log.level_statement);
1355: END IF;
1356:
1357: jtf_task_assignments_pub.update_task_assignment(
1358: p_api_version => 1.0

Line 1416: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

1412: ROLLBACK TO csf_correct_trip;
1413: x_return_status := fnd_api.g_ret_sts_unexp_error;
1414: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
1415: WHEN OTHERS THEN
1416: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
1417: x_return_status := fnd_api.g_ret_sts_unexp_error;
1418: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1419: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1420: END IF;

Line 1470: debug('Deleting the given Trips', l_api_name, fnd_log.level_procedure);

1466: BEGIN
1467: x_return_status := fnd_api.g_ret_sts_success;
1468:
1469: IF l_debug THEN
1470: debug('Deleting the given Trips', l_api_name, fnd_log.level_procedure);
1471: END IF;
1472:
1473: FOR i IN 1..p_trips.COUNT LOOP
1474: remove_trip(

Line 1504: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

1500: WHEN fnd_api.g_exc_unexpected_error THEN
1501: x_return_status := fnd_api.g_ret_sts_unexp_error;
1502: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
1503: WHEN OTHERS THEN
1504: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
1505: x_return_status := fnd_api.g_ret_sts_unexp_error;
1506: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1507: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1508: END IF;

Line 1524: debug('Fixing the given Trips', l_api_name, fnd_log.level_procedure);

1520: BEGIN
1521: x_return_status := fnd_api.g_ret_sts_success;
1522:
1523: IF l_debug THEN
1524: debug('Fixing the given Trips', l_api_name, fnd_log.level_procedure);
1525: END IF;
1526:
1527: FOR i IN 1..p_trips.COUNT LOOP
1528: correct_trip(

Line 1558: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

1554: WHEN fnd_api.g_exc_unexpected_error THEN
1555: x_return_status := fnd_api.g_ret_sts_unexp_error;
1556: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
1557: WHEN OTHERS THEN
1558: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
1559: x_return_status := fnd_api.g_ret_sts_unexp_error;
1560: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1561: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1562: END IF;

Line 1662: debug('Replacing Trips for Resource#' || l_res_id || ' between ' || p_start_date || ' and ' || p_end_date, l_api_name, fnd_log.level_procedure);

1658: l_res_type := p_resource_tbl(1).resource_type;
1659:
1660: IF l_debug THEN
1661: IF p_delete_trips THEN
1662: debug('Replacing Trips for Resource#' || l_res_id || ' between ' || p_start_date || ' and ' || p_end_date, l_api_name, fnd_log.level_procedure);
1663: ELSE
1664: debug('Creating Trips for Resource#' || l_res_id || ' between ' || p_start_date || ' and ' || p_end_date, l_api_name, fnd_log.level_procedure);
1665: END IF;
1666: END IF;

Line 1664: debug('Creating Trips for Resource#' || l_res_id || ' between ' || p_start_date || ' and ' || p_end_date, l_api_name, fnd_log.level_procedure);

1660: IF l_debug THEN
1661: IF p_delete_trips THEN
1662: debug('Replacing Trips for Resource#' || l_res_id || ' between ' || p_start_date || ' and ' || p_end_date, l_api_name, fnd_log.level_procedure);
1663: ELSE
1664: debug('Creating Trips for Resource#' || l_res_id || ' between ' || p_start_date || ' and ' || p_end_date, l_api_name, fnd_log.level_procedure);
1665: END IF;
1666: END IF;
1667:
1668: -- Get the Resource's Shifts

Line 1683: debug(' No Shifts were found for the resource between the timeframe', l_api_name, fnd_log.level_error);

1679: );
1680:
1681: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1682: IF l_debug THEN
1683: debug(' No Shifts were found for the resource between the timeframe', l_api_name, fnd_log.level_error);
1684: END IF;
1685: add_message(
1686: p_res_id => l_res_id
1687: , p_res_type => l_res_type

Line 1714: debug(' Shift tasks are present between the timeframe', l_api_name, fnd_log.level_error);

1710:
1711: IF l_check_failed = 'Y' THEN
1712: -- Shift Tasks exists. Should use "Upgrade to Trips" API rather than "Create Trip".
1713: IF l_debug THEN
1714: debug(' Shift tasks are present between the timeframe', l_api_name, fnd_log.level_error);
1715: END IF;
1716: add_message(
1717: p_res_id => l_res_id
1718: , p_res_type => l_res_type

Line 1732: debug(' Querying for the Trips between ' || format_date(l_start) || ' and ' || format_date(l_end), l_api_name, fnd_log.level_statement);

1728: l_start := LEAST(p_start_date, l_shifts(l_shifts.FIRST).start_datetime);
1729: l_end := GREATEST(p_end_date, l_shifts(l_shifts.LAST).end_datetime);
1730:
1731: IF l_debug THEN
1732: debug(' Querying for the Trips between ' || format_date(l_start) || ' and ' || format_date(l_end), l_api_name, fnd_log.level_statement);
1733: END IF;
1734:
1735: l_old_trips := find_trips(p_resource_tbl, l_start, l_end);
1736:

Line 1738: debug(' Current Trips existing: Count = ' || l_old_trips.COUNT, l_api_name, fnd_log.level_statement);

1734:
1735: l_old_trips := find_trips(p_resource_tbl, l_start, l_end);
1736:
1737: IF l_debug THEN
1738: debug(' Current Trips existing: Count = ' || l_old_trips.COUNT, l_api_name, fnd_log.level_statement);
1739: FOR i IN 1..l_old_trips.COUNT LOOP
1740: debug( ' Trip ID = ' || l_old_trips(i).trip_id
1741: || ' Start Time = ' || format_date(l_old_trips(i).start_date_time)
1742: || ' End Time = ' || format_date(l_old_trips(i).end_date_time)

Line 1743: , l_api_name, fnd_log.level_statement);

1739: FOR i IN 1..l_old_trips.COUNT LOOP
1740: debug( ' Trip ID = ' || l_old_trips(i).trip_id
1741: || ' Start Time = ' || format_date(l_old_trips(i).start_date_time)
1742: || ' End Time = ' || format_date(l_old_trips(i).end_date_time)
1743: , l_api_name, fnd_log.level_statement);
1744: END LOOP;
1745: END IF;
1746:
1747: l_del_trip_tbl := jtf_number_table();

Line 1756: , l_api_name, fnd_log.level_statement

1752: IF l_debug THEN
1753: debug( ' Trying to create trip for shift between '
1754: || format_date(l_shifts(l_shift_idx).start_datetime) || ' and '
1755: || format_date(l_shifts(l_shift_idx).end_datetime)
1756: , l_api_name, fnd_log.level_statement
1757: );
1758: END IF;
1759: BEGIN
1760: SAVEPOINT csf_process_shift;

Line 1773: , l_api_name, fnd_log.level_statement);

1769: l_trip_idx := l_old_trips.FIRST;
1770: WHILE l_trip_idx IS NOT NULL LOOP
1771: IF l_debug THEN
1772: debug(' Checking for overlap with old trip ' || l_old_trips(l_trip_idx).trip_id
1773: , l_api_name, fnd_log.level_statement);
1774: END IF;
1775:
1776: IF time_overlaps(l_old_trips(l_trip_idx), l_shifts(l_shift_idx)) THEN
1777: -- If Trips can be deleted, then we can avoid the error "Duplicate Trip"

Line 1815: , l_api_name, fnd_log.level_statement);

1811: l_trip_idx := l_new_trips.LAST;
1812: WHILE l_trip_idx IS NOT NULL LOOP
1813: IF l_debug THEN
1814: debug(' Checking for overlap with new trip ' || l_new_trips(l_trip_idx).trip_id
1815: , l_api_name, fnd_log.level_statement);
1816: END IF;
1817: IF time_overlaps(l_new_trips(l_trip_idx), l_shifts(l_shift_idx)) THEN
1818: l_msg_name := 'CSF_TRIP_CREATE_FAIL_DUP';
1819: RAISE fnd_api.g_exc_error;

Line 1882: , l_api_name, fnd_log.level_error

1878: IF l_debug THEN
1879: IF l_msg_name = 'CSF_TRIP_CREATE_FAIL_DUP' THEN
1880: IF NOT p_delete_trips THEN
1881: debug( ' Since delete trips not allowed.. we have overlap with existing trip'
1882: , l_api_name, fnd_log.level_error
1883: );
1884: ELSE
1885: debug( ' Delete trips allowed.. but we have conflict with new trip'
1886: , l_api_name, fnd_log.level_error

Line 1886: , l_api_name, fnd_log.level_error

1882: , l_api_name, fnd_log.level_error
1883: );
1884: ELSE
1885: debug( ' Delete trips allowed.. but we have conflict with new trip'
1886: , l_api_name, fnd_log.level_error
1887: );
1888: END IF;
1889: ELSIF l_msg_name = 'CSF_TRIP_CREATE_FAIL_OTHER' THEN
1890: debug( ' Error occurred while creating the trip between '

Line 1893: , l_api_name, fnd_log.level_error

1889: ELSIF l_msg_name = 'CSF_TRIP_CREATE_FAIL_OTHER' THEN
1890: debug( ' Error occurred while creating the trip between '
1891: || format_date(l_start) || ' and ' || format_date(l_end)
1892: || ' : Error = ' || l_reason
1893: , l_api_name, fnd_log.level_error
1894: );
1895: ELSIF l_msg_name = 'CSF_TRIP_DELETE_FAIL_OTHER' THEN
1896: debug( ' Error occurred while deleting the trip between '
1897: || format_date(l_start) || ' and ' || format_date(l_end)

Line 1899: , l_api_name, fnd_log.level_error

1895: ELSIF l_msg_name = 'CSF_TRIP_DELETE_FAIL_OTHER' THEN
1896: debug( ' Error occurred while deleting the trip between '
1897: || format_date(l_start) || ' and ' || format_date(l_end)
1898: || ' : Error = ' || l_reason
1899: , l_api_name, fnd_log.level_error
1900: );
1901: END IF;
1902: END IF;
1903:

Line 1924: debug(' Linking unlinked Task Assignments if any of old trips to new trips', l_api_name, fnd_log.level_statement);

1920:
1921: IF p_delete_trips THEN
1922: -- Link all the Unlinked Task Assignments to the corresponding shifts
1923: IF l_debug THEN
1924: debug(' Linking unlinked Task Assignments if any of old trips to new trips', l_api_name, fnd_log.level_statement);
1925: END IF;
1926:
1927: l_trip_length := 0;
1928: FOR v_task IN c_unlinked_tasks LOOP

Line 1936: , l_api_name, fnd_log.level_statement

1932: IF l_prev_trip_id <> l_new_trips(l_trip_idx).trip_id THEN
1933: IF l_debug THEN
1934: debug( ' Decreasing Trip#' || l_prev_trip_id
1935: || ' Capacity to be lesser by ' || l_trip_length*g_hours_in_day
1936: , l_api_name, fnd_log.level_statement
1937: );
1938: END IF;
1939:
1940: OPEN c_trip_info(l_prev_trip_id);

Line 1959: debug( ' Error updating Trip. ' || fnd_msg_pub.get(fnd_msg_pub.g_last, fnd_api.g_false), l_api_name, fnd_log.level_error);

1955: );
1956:
1957: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1958: IF l_debug THEN
1959: debug( ' Error updating Trip. ' || fnd_msg_pub.get(fnd_msg_pub.g_last, fnd_api.g_false), l_api_name, fnd_log.level_error);
1960: END IF;
1961: END IF;
1962:
1963: l_trip_length := 0;

Line 1970: , l_api_name, fnd_log.level_statement

1966: IF l_debug THEN
1967: debug( ' Linking Task ' || v_task.task_id
1968: || ' : Old Trip = ' || v_task.object_capacity_id
1969: || ' : New Trip = ' || l_new_trips(l_trip_idx).trip_id
1970: , l_api_name, fnd_log.level_statement
1971: );
1972: END IF;
1973:
1974: l_trip_length := l_trip_length

Line 1992: debug( ' Error updating Task Assignment', l_api_name, fnd_log.level_error);

1988: );
1989:
1990: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1991: IF l_debug THEN
1992: debug( ' Error updating Task Assignment', l_api_name, fnd_log.level_error);
1993: END IF;
1994: add_message(
1995: p_res_id => l_res_id
1996: , p_res_type => l_res_type

Line 2032: , l_api_name, fnd_log.level_statement

2028: IF l_debug THEN
2029: debug( ' Deleting the non-overlapping Trip ' || l_old_trips(l_trip_idx).trip_id
2030: || ' between ' || format_date(l_old_trips(l_trip_idx).start_date_Time)
2031: || ' and ' || format_date(l_old_trips(l_trip_idx).end_date_Time)
2032: , l_api_name, fnd_log.level_statement
2033: );
2034: END IF;
2035:
2036: IF trip_has_active_tasks(l_old_trips(l_trip_idx).trip_id) THEN

Line 2042: , l_api_name, fnd_log.level_error

2038: debug( ' Cant delete trip' || l_old_trips(l_trip_idx).trip_id
2039: || ' between ' || format_date(l_old_trips(l_trip_idx).start_date_Time)
2040: || ' and ' || format_date(l_old_trips(l_trip_idx).end_date_Time)
2041: || ' as there active tasks present'
2042: , l_api_name, fnd_log.level_error
2043: );
2044: END IF;
2045: add_message(l_old_trips(l_trip_idx), NULL, 'CSF_TRIP_REPLACE_FAIL_ACTIVE', g_error_message);
2046: ELSE

Line 2092: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

2088: ROLLBACK TO csf_create_trips;
2089: x_return_status := fnd_api.g_ret_sts_unexp_error;
2090: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
2091: WHEN OTHERS THEN
2092: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
2093: x_return_status := fnd_api.g_ret_sts_unexp_error;
2094: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2095: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2096: END IF;

Line 2187: debug('Upgrading to Trips for Resource#' || p_resource_tbl(1).resource_id || ' between ' || p_start_date || ' and ' || p_end_date, l_api_name, fnd_log.level_procedure);

2183: BEGIN
2184: x_return_status := fnd_api.g_ret_sts_success;
2185:
2186: IF l_debug THEN
2187: debug('Upgrading to Trips for Resource#' || p_resource_tbl(1).resource_id || ' between ' || p_start_date || ' and ' || p_end_date, l_api_name, fnd_log.level_procedure);
2188: END IF;
2189:
2190: -- Bulk Collecting all information about Shift Tasks.
2191: OPEN c_shift_tasks;

Line 2197: debug(' Found Shift Tasks - Dep #' || l_dep_task_tbl(i) || ' : Arr # ' || l_arr_task_tbl(i), l_api_name, fnd_log.level_procedure);

2193: CLOSE c_shift_tasks;
2194:
2195: FOR i IN 1..l_dep_task_tbl.COUNT LOOP
2196: IF l_debug THEN
2197: debug(' Found Shift Tasks - Dep #' || l_dep_task_tbl(i) || ' : Arr # ' || l_arr_task_tbl(i), l_api_name, fnd_log.level_procedure);
2198: END IF;
2199: -- Create a Trip between the Shift Tasks.
2200: new_trip(
2201: x_return_status => x_return_status

Line 2243: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

2239: WHEN fnd_api.g_exc_unexpected_error THEN
2240: x_return_status := fnd_api.g_ret_sts_unexp_error;
2241: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
2242: WHEN OTHERS THEN
2243: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
2244: x_return_status := fnd_api.g_ret_sts_unexp_error;
2245: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2246: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2247: END IF;

Line 2267: debug('Updating the status of the given trips', l_api_name, fnd_log.level_procedure);

2263: BEGIN
2264: x_return_status := fnd_api.g_ret_sts_success;
2265:
2266: IF l_debug THEN
2267: debug('Updating the status of the given trips', l_api_name, fnd_log.level_procedure);
2268: END IF;
2269:
2270: IF p_trip_action IN (g_action_block_trip, g_action_close_trip) THEN
2271: l_new_trip_status := g_trip_unavailable;

Line 2278: debug('Updating Trip# ' || p_trips(i).trip_id, l_api_name, fnd_log.level_statement);

2274: END IF;
2275:
2276: FOR i IN 1..p_trips.COUNT LOOP
2277: IF l_debug THEN
2278: debug('Updating Trip# ' || p_trips(i).trip_id, l_api_name, fnd_log.level_statement);
2279: END IF;
2280:
2281: IF l_new_trip_status = p_trips(i).status THEN
2282: IF l_debug THEN

Line 2283: debug(' Trip is already in correct status ' || p_trips(i).status, l_api_name, fnd_log.level_statement);

2279: END IF;
2280:
2281: IF l_new_trip_status = p_trips(i).status THEN
2282: IF l_debug THEN
2283: debug(' Trip is already in correct status ' || p_trips(i).status, l_api_name, fnd_log.level_statement);
2284: END IF;
2285: GOTO NEXT_TRIP;
2286: END IF;
2287:

Line 2290: debug(' Trip is present or future dated. Cant close', l_api_name, fnd_log.level_error);

2286: END IF;
2287:
2288: IF p_trip_action = g_action_close_trip AND (p_trips(i).end_date_time + g_overtime) > SYSDATE THEN
2289: IF l_debug THEN
2290: debug(' Trip is present or future dated. Cant close', l_api_name, fnd_log.level_error);
2291: END IF;
2292: add_message(
2293: p_trip => p_trips(i)
2294: , p_msg_name => 'CSF_TRIP_CLOSE_FAIL_ACTIVE'

Line 2302: debug(' Trip is past dated. Close it rather than blocking', l_api_name, fnd_log.level_statement);

2298: END IF;
2299:
2300: IF p_trip_action = g_action_block_trip AND (p_trips(i).end_date_time + g_overtime) < SYSDATE THEN
2301: IF l_debug THEN
2302: debug(' Trip is past dated. Close it rather than blocking', l_api_name, fnd_log.level_statement);
2303: END IF;
2304: l_trip_action := g_action_close_trip;
2305: ELSE
2306: l_trip_action := p_trip_action;

Line 2345: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

2341: WHEN fnd_api.g_exc_unexpected_error THEN
2342: x_return_status := fnd_api.g_ret_sts_unexp_error;
2343: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
2344: WHEN OTHERS THEN
2345: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
2346: x_return_status := fnd_api.g_ret_sts_unexp_error;
2347: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2348: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2349: END IF;

Line 2414: || to_char(p_end_date_time, 'DD-MON-YYYY HH24:MI:SS'), l_api_name, fnd_log.level_procedure);

2410:
2411: IF l_debug THEN
2412: debug('Creating a Trip for Resource#' || p_resource_id || ' between '
2413: || to_char(p_start_date_time, 'DD-MON-YYYY HH24:MI:SS') || ' and '
2414: || to_char(p_end_date_time, 'DD-MON-YYYY HH24:MI:SS'), l_api_name, fnd_log.level_procedure);
2415: END IF;
2416:
2417: l_resource := csf_resource_pub.resource_tbl_type();
2418: l_resource.extend();

Line 2426: debug(' Trips already exists for the Resource in the specified interval', l_api_name, fnd_log.level_error);

2422:
2423: -- Check#1 - No Trips should be found for the given criteria
2424: IF l_trips.COUNT > 0 THEN
2425: IF l_debug THEN
2426: debug(' Trips already exists for the Resource in the specified interval', l_api_name, fnd_log.level_error);
2427: END IF;
2428: fnd_message.set_name('CSF', 'CSF_TRIP_CREATE_FAIL_DUP');
2429: fnd_message.set_token('RESOURCE', get_resource_info(p_resource_id, p_resource_type));
2430: fnd_message.set_token('START_TIME', format_date(p_start_date_time));

Line 2438: debug(' Searching for existence of any Shift Tasks in that interval', l_api_name, fnd_log.level_statement);

2434: END IF;
2435:
2436: -- Check#2 - No Shift Tasks in the Interval where the Trip is going to be created.
2437: IF l_debug THEN
2438: debug(' Searching for existence of any Shift Tasks in that interval', l_api_name, fnd_log.level_statement);
2439: END IF;
2440:
2441: OPEN c_st_exist;
2442: FETCH c_st_exist INTO l_shift_tasks_exist;

Line 2450: debug(' Shift Tasks exist for the Resource in the specified interval', l_api_name, fnd_log.level_error);

2446: CLOSE c_st_exist;
2447:
2448: IF l_shift_tasks_exist = 'Y' THEN
2449: IF l_debug THEN
2450: debug(' Shift Tasks exist for the Resource in the specified interval', l_api_name, fnd_log.level_error);
2451: END IF;
2452: fnd_message.set_name('CSF', 'CSF_TRIP_CREATE_FAIL_ST_EXIST');
2453: fnd_message.set_token('RESOURCE', get_resource_info(p_resource_id, p_resource_type));
2454: fnd_message.set_token('START_TIME', format_date(p_start_date_time));

Line 2502: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

2498: WHEN fnd_api.g_exc_unexpected_error THEN
2499: x_return_status := fnd_api.g_ret_sts_unexp_error;
2500: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
2501: WHEN OTHERS THEN
2502: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
2503: x_return_status := fnd_api.g_ret_sts_unexp_error;
2504: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2505: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2506: END IF;

Line 2620: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

2616: WHEN fnd_api.g_exc_unexpected_error THEN
2617: x_return_status := fnd_api.g_ret_sts_unexp_error;
2618: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
2619: WHEN OTHERS THEN
2620: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
2621: x_return_status := fnd_api.g_ret_sts_unexp_error;
2622: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2623: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2624: END IF;

Line 2662: debug('Deleting the Trip #' || p_trip_id, l_api_name, fnd_log.level_procedure);

2658: -- Initialize Return Status
2659: x_return_status := fnd_api.g_ret_sts_success;
2660:
2661: IF l_debug THEN
2662: debug('Deleting the Trip #' || p_trip_id, l_api_name, fnd_log.level_procedure);
2663: END IF;
2664:
2665: IF p_trip_id IS NULL OR p_trip_id = fnd_api.g_miss_num THEN
2666: -- Invalid Trip ID passed.

Line 2704: , l_api_name, fnd_log.level_error);

2700: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2701: IF l_debug THEN
2702: debug( ' Unable to delete the Trip: Error = '
2703: || fnd_msg_pub.get(fnd_msg_pub.g_last, fnd_api.g_false)
2704: , l_api_name, fnd_log.level_error);
2705: END IF;
2706: fnd_message.set_name('CSF', 'CSF_TRIP_DELETE_FAIL_OTHER');
2707: fnd_message.set_token('RESOURCE', get_resource_info(l_trip.resource_id, l_trip.resource_type));
2708: fnd_message.set_token('START_TIME', format_date(l_trip.start_date_time));

Line 2732: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

2728: x_return_status := fnd_api.g_ret_sts_unexp_error;
2729: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
2730: WHEN OTHERS THEN
2731: ROLLBACK TO delete_trip;
2732: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
2733: x_return_status := fnd_api.g_ret_sts_unexp_error;
2734: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2735: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2736: END IF;

Line 2773: debug('Fixing the Trip #' || p_trip_id, l_api_name, fnd_log.level_procedure);

2769: -- Initialize Return Status
2770: x_return_status := fnd_api.g_ret_sts_success;
2771:
2772: IF l_debug THEN
2773: debug('Fixing the Trip #' || p_trip_id, l_api_name, fnd_log.level_procedure);
2774: END IF;
2775:
2776: IF p_trip_id IS NULL OR p_trip_id = fnd_api.g_miss_num THEN
2777: -- Invalid Trip ID passed.

Line 2812: debug(' Unable to fix the Trip', l_api_name, fnd_log.level_error);

2808: );
2809:
2810: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2811: IF l_debug THEN
2812: debug(' Unable to fix the Trip', l_api_name, fnd_log.level_error);
2813: END IF;
2814: fnd_message.set_name('CSF', 'CSF_TRIP_FIX_FAIL_OTHER');
2815: fnd_message.set_token('RESOURCE', get_resource_info(l_trip.resource_id, l_trip.resource_type));
2816: fnd_message.set_token('START_TIME', format_date(l_trip.start_date_time));

Line 2837: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

2833: WHEN fnd_api.g_exc_unexpected_error THEN
2834: x_return_status := fnd_api.g_ret_sts_unexp_error;
2835: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
2836: WHEN OTHERS THEN
2837: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
2838: x_return_status := fnd_api.g_ret_sts_unexp_error;
2839: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2840: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2841: END IF;

Line 2915: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

2911: WHEN fnd_api.g_exc_unexpected_error THEN
2912: x_return_status := fnd_api.g_ret_sts_unexp_error;
2913: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
2914: WHEN OTHERS THEN
2915: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
2916: x_return_status := fnd_api.g_ret_sts_unexp_error;
2917: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2918: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2919: END IF;

Line 2983: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

2979: WHEN fnd_api.g_exc_unexpected_error THEN
2980: x_return_status := fnd_api.g_ret_sts_unexp_error;
2981: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
2982: WHEN OTHERS THEN
2983: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
2984: x_return_status := fnd_api.g_ret_sts_unexp_error;
2985: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2986: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2987: END IF;

Line 3033: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

3029: WHEN fnd_api.g_exc_unexpected_error THEN
3030: x_return_status := fnd_api.g_ret_sts_unexp_error;
3031: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
3032: WHEN OTHERS THEN
3033: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
3034: x_return_status := fnd_api.g_ret_sts_unexp_error;
3035: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3036: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
3037: END IF;

Line 3080: debug('Generating Resource Trips for a Resource', l_api_name, fnd_log.level_procedure);

3076: -- Initialize Return Status
3077: x_return_status := fnd_api.g_ret_sts_success;
3078:
3079: IF l_debug THEN
3080: debug('Generating Resource Trips for a Resource', l_api_name, fnd_log.level_procedure);
3081: debug(' Action = ' || p_action, l_api_name, fnd_log.level_statement);
3082: IF p_trip_id IS NOT NULL THEN
3083: debug(' Trip ID = ' || p_trip_id, l_api_name, fnd_log.level_statement);
3084: END IF;

Line 3081: debug(' Action = ' || p_action, l_api_name, fnd_log.level_statement);

3077: x_return_status := fnd_api.g_ret_sts_success;
3078:
3079: IF l_debug THEN
3080: debug('Generating Resource Trips for a Resource', l_api_name, fnd_log.level_procedure);
3081: debug(' Action = ' || p_action, l_api_name, fnd_log.level_statement);
3082: IF p_trip_id IS NOT NULL THEN
3083: debug(' Trip ID = ' || p_trip_id, l_api_name, fnd_log.level_statement);
3084: END IF;
3085:

Line 3083: debug(' Trip ID = ' || p_trip_id, l_api_name, fnd_log.level_statement);

3079: IF l_debug THEN
3080: debug('Generating Resource Trips for a Resource', l_api_name, fnd_log.level_procedure);
3081: debug(' Action = ' || p_action, l_api_name, fnd_log.level_statement);
3082: IF p_trip_id IS NOT NULL THEN
3083: debug(' Trip ID = ' || p_trip_id, l_api_name, fnd_log.level_statement);
3084: END IF;
3085:
3086: IF p_start_date IS NOT NULL THEN
3087: debug(' Time Frame = ' || format_date(p_start_date) || ' to ' || format_date(p_end_date), l_api_name, fnd_log.level_statement);

Line 3087: debug(' Time Frame = ' || format_date(p_start_date) || ' to ' || format_date(p_end_date), l_api_name, fnd_log.level_statement);

3083: debug(' Trip ID = ' || p_trip_id, l_api_name, fnd_log.level_statement);
3084: END IF;
3085:
3086: IF p_start_date IS NOT NULL THEN
3087: debug(' Time Frame = ' || format_date(p_start_date) || ' to ' || format_date(p_end_date), l_api_name, fnd_log.level_statement);
3088: END IF;
3089:
3090: IF p_resource_tbl IS NOT NULL AND p_resource_tbl.COUNT = 1 THEN
3091: debug(' Resource = ' || p_resource_tbl(p_resource_tbl.FIRST).resource_id, l_api_name, fnd_log.level_statement);

Line 3091: debug(' Resource = ' || p_resource_tbl(p_resource_tbl.FIRST).resource_id, l_api_name, fnd_log.level_statement);

3087: debug(' Time Frame = ' || format_date(p_start_date) || ' to ' || format_date(p_end_date), l_api_name, fnd_log.level_statement);
3088: END IF;
3089:
3090: IF p_resource_tbl IS NOT NULL AND p_resource_tbl.COUNT = 1 THEN
3091: debug(' Resource = ' || p_resource_tbl(p_resource_tbl.FIRST).resource_id, l_api_name, fnd_log.level_statement);
3092: END IF;
3093: END IF;
3094:
3095: -- Checking whether all required parameters are passed.

Line 3225: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

3221: WHEN fnd_api.g_exc_unexpected_error THEN
3222: x_return_status := fnd_api.g_ret_sts_unexp_error;
3223: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
3224: WHEN OTHERS THEN
3225: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
3226: x_return_status := fnd_api.g_ret_sts_unexp_error;
3227: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3228: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
3229: END IF;

Line 3465: debug('CSF_TRIPS_PUB.Optimize Across Trips', l_api_name, fnd_log.level_procedure);

3461: -- Initialize Return Status
3462: x_return_status := fnd_api.g_ret_sts_success;
3463:
3464: IF l_debug THEN
3465: debug('CSF_TRIPS_PUB.Optimize Across Trips', l_api_name, fnd_log.level_procedure);
3466: debug(' No of resources in list = ' || p_resource_tbl.COUNT, l_api_name, fnd_log.level_statement);
3467: debug(' Time Frame = ' || p_start_date || ' to ' || p_end_date, l_api_name, fnd_log.level_statement);
3468: END IF;
3469:

Line 3466: debug(' No of resources in list = ' || p_resource_tbl.COUNT, l_api_name, fnd_log.level_statement);

3462: x_return_status := fnd_api.g_ret_sts_success;
3463:
3464: IF l_debug THEN
3465: debug('CSF_TRIPS_PUB.Optimize Across Trips', l_api_name, fnd_log.level_procedure);
3466: debug(' No of resources in list = ' || p_resource_tbl.COUNT, l_api_name, fnd_log.level_statement);
3467: debug(' Time Frame = ' || p_start_date || ' to ' || p_end_date, l_api_name, fnd_log.level_statement);
3468: END IF;
3469:
3470: l_resources_tbl := p_resource_tbl;

Line 3467: debug(' Time Frame = ' || p_start_date || ' to ' || p_end_date, l_api_name, fnd_log.level_statement);

3463:
3464: IF l_debug THEN
3465: debug('CSF_TRIPS_PUB.Optimize Across Trips', l_api_name, fnd_log.level_procedure);
3466: debug(' No of resources in list = ' || p_resource_tbl.COUNT, l_api_name, fnd_log.level_statement);
3467: debug(' Time Frame = ' || p_start_date || ' to ' || p_end_date, l_api_name, fnd_log.level_statement);
3468: END IF;
3469:
3470: l_resources_tbl := p_resource_tbl;
3471: FOR i IN 1..l_resources_tbl.COUNT LOOP

Line 3527: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);

3523: x_return_status := fnd_api.g_ret_sts_unexp_error;
3524: fnd_msg_pub.count_and_get(p_data => x_msg_data, p_count => x_msg_count);
3525: WHEN OTHERS THEN
3526: ROLLBACK;
3527: debug('Fatal Exception occurred: Code = ' || SQLCODE || ' Error = ' || SQLERRM, l_api_name, fnd_log.level_unexpected);
3528: x_return_status := fnd_api.g_ret_sts_unexp_error;
3529: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3530: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
3531: END IF;