DBA Data[Home] [Help]

APPS.WIP_WS_LABOR_METRIC_PUB dependencies on WIP_CONSTANTS

Line 337: and fnd_date.canonical_to_date(to_char((bsd.shift_date + st.to_time/(60*60*24)),WIP_CONSTANTS.DATETIME_FMT)) <= end_period

333: and bsd.shift_num = bcs.shift_num
334: /*Fix bug 14674233, shouldn't use the operator < because it should be inclusive of end_period
335: end period is the last shift before sysdate and was retrieved by get_period_end(). So, if we
336: used operator < instead of <=, the last shift will be considered as part of labor metric calculation*/
337: and fnd_date.canonical_to_date(to_char((bsd.shift_date + st.to_time/(60*60*24)),WIP_CONSTANTS.DATETIME_FMT)) <= end_period
338: and brs.shift_num= bcs.shift_num
339: and brs.department_id = dept_id
340: and brs.resource_id = res_id;
341:

Line 673: if (g_logLevel <= wip_constants.trace_logging) then

669: l_calendar_code := get_calendar_code(p_organization_id);
670: window_end_time := get_period_end(l_calendar_code,l_current_date);
671: window_start_time := get_period_start(p_organization_id,window_end_time);
672:
673: if (g_logLevel <= wip_constants.trace_logging) then
674: wip_ws_util.trace_log('Calendar: '||l_calendar_code);
675: wip_ws_util.trace_log('Start Time: '||to_char(window_start_time,WIP_CONSTANTS.DATETIME_FMT));
676: wip_ws_util.trace_log('End Time: '||to_char(window_end_time,WIP_CONSTANTS.DATETIME_FMT));
677: wip_ws_util.trace_log('Base Time UOM: '||l_bom_uom_code);

Line 675: wip_ws_util.trace_log('Start Time: '||to_char(window_start_time,WIP_CONSTANTS.DATETIME_FMT));

671: window_start_time := get_period_start(p_organization_id,window_end_time);
672:
673: if (g_logLevel <= wip_constants.trace_logging) then
674: wip_ws_util.trace_log('Calendar: '||l_calendar_code);
675: wip_ws_util.trace_log('Start Time: '||to_char(window_start_time,WIP_CONSTANTS.DATETIME_FMT));
676: wip_ws_util.trace_log('End Time: '||to_char(window_end_time,WIP_CONSTANTS.DATETIME_FMT));
677: wip_ws_util.trace_log('Base Time UOM: '||l_bom_uom_code);
678: end if;
679:

Line 676: wip_ws_util.trace_log('End Time: '||to_char(window_end_time,WIP_CONSTANTS.DATETIME_FMT));

672:
673: if (g_logLevel <= wip_constants.trace_logging) then
674: wip_ws_util.trace_log('Calendar: '||l_calendar_code);
675: wip_ws_util.trace_log('Start Time: '||to_char(window_start_time,WIP_CONSTANTS.DATETIME_FMT));
676: wip_ws_util.trace_log('End Time: '||to_char(window_end_time,WIP_CONSTANTS.DATETIME_FMT));
677: wip_ws_util.trace_log('Base Time UOM: '||l_bom_uom_code);
678: end if;
679:
680: l_stmt_num :=40;

Line 809: if (g_logLevel <= wip_constants.trace_logging) then

805: end loop;
806:
807: l_stmt_num :=50;
808:
809: if (g_logLevel <= wip_constants.trace_logging) then
810:
811: wip_ws_util.trace_log('Metric 1: '||log_metric1);
812: wip_ws_util.trace_log('Metric 2: '||log_metric2);
813: wip_ws_util.trace_log('Metric 3: '||log_metric3);

Line 832: if (g_logLevel <= wip_constants.trace_logging) then

828: where organization_id= p_organization_id;
829:
830: l_stmt_num :=60;
831:
832: if (g_logLevel <= wip_constants.trace_logging) then
833: wip_ws_util.trace_log('Deleted Existing records for this Organization.');
834: end if;
835: /* calculate the metrics for every employee associated to any of
836: the department for this organization. */

Line 840: if (g_logLevel <= wip_constants.trace_logging) then

836: the department for this organization. */
837: new_index :=0;
838: for employee in employees(p_organization_id) Loop
839:
840: if (g_logLevel <= wip_constants.trace_logging) then
841: wip_ws_util.trace_log('Calculation for Emp with Dep_Id: '||to_char(employee.department_id)
842: ||' Res_Id: '||to_char(employee.resource_id)
843: ||' Pers_Id: '||to_char(employee.person_id));
844: end if;

Line 870: if (g_logLevel <= wip_constants.trace_logging) then

866: v_emp_perf_temp(emp_index).act_att_hrs :=0;
867: v_emp_perf_temp(emp_index).dir_lab_hrs :=0;
868: v_emp_perf_temp(emp_index).sch_avl_hrs :=0;
869: v_emp_perf_temp(emp_index).earned_hrs :=0;
870: if (g_logLevel <= wip_constants.trace_logging) then
871: wip_ws_util.trace_log('Employee Shift Info: '||emp_index);
872: end if;
873: end loop;
874: if (g_logLevel <= wip_constants.trace_logging) then

Line 874: if (g_logLevel <= wip_constants.trace_logging) then

870: if (g_logLevel <= wip_constants.trace_logging) then
871: wip_ws_util.trace_log('Employee Shift Info: '||emp_index);
872: end if;
873: end loop;
874: if (g_logLevel <= wip_constants.trace_logging) then
875: wip_ws_util.trace_log('Re-Creating Shift Information for Employee');
876: end if;
877: else
878: l_stmt_num :=90;

Line 888: if (g_logLevel <= wip_constants.trace_logging) then

884: v_emp_perf_temp(emp_index).earned_hrs :=0;
885: emp_index := v_emp_perf_temp.next(emp_index);
886: end loop;
887:
888: if (g_logLevel <= wip_constants.trace_logging) then
889: wip_ws_util.trace_log('Re-Using Shift Information for Employee');
890: end if;
891: end if;
892:

Line 895: if (g_logLevel <= wip_constants.trace_logging) then

891: end if;
892:
893: if l_act_avl_hrs_required then /* Calculate actual available hours here. */
894: l_stmt_num :=100;
895: if (g_logLevel <= wip_constants.trace_logging) then
896: wip_ws_util.trace_log('Inside Actual Available Hours Calculation');
897: end if;
898: for emp_act_avl_hrs in aah_records(p_organization_id,
899: employee.person_id,

Line 904: if (g_logLevel <= wip_constants.trace_logging) then

900: window_start_time,
901: window_end_time)
902: loop
903: l_stmt_num :=110;
904: if (g_logLevel <= wip_constants.trace_logging) then
905: wip_ws_util.trace_log('Record found for Actual Available Hours Calculation');
906: end if;
907: is_aah_record_valid := true;
908: wip_ws_dl_util.get_first_dept_resource_shift

Line 923: if (g_logLevel <= wip_constants.trace_logging) then

919: l_time_uom_flag := is_time_uom(emp_act_avl_hrs.uom_code);
920: l_stmt_num :=120;
921: -- Modified for bug 6972129.
922: if l_time_uom_flag = 2 then
923: if (g_logLevel <= wip_constants.trace_logging) then
924: fnd_message.set_name('WIP','WIP_LM_TIME_UOM');
925: fnd_message.set_token('EMP', to_char(employee.person_id));
926: x_error_msg := fnd_message.get;
927: wip_ws_util.trace_log(l_proc_name||'( stmt_num: '||l_stmt_num||') '||x_error_msg);

Line 952: if (g_logLevel <= wip_constants.trace_logging) then

948: if v_emp_perf_temp.exists(to_char(l_date_seq||':'||l_shift_num)) then
949: v_emp_perf_temp(to_char(l_date_seq||':'||l_shift_num)).act_att_hrs :=
950: v_emp_perf_temp(to_char(l_date_seq||':'||l_shift_num)).act_att_hrs+l_act_att_hrs;
951:
952: if (g_logLevel <= wip_constants.trace_logging) then
953: wip_ws_util.trace_log('Dep: '||to_char(employee.department_id)||
954: ' Res: '||to_char(employee.resource_id)||
955: ' Pers: '||to_char(employee.person_id)||
956: ' Date: '||to_char(emp_act_avl_hrs.actual_date,WIP_CONSTANTS.DATETIME_FMT)||

Line 956: ' Date: '||to_char(emp_act_avl_hrs.actual_date,WIP_CONSTANTS.DATETIME_FMT)||

952: if (g_logLevel <= wip_constants.trace_logging) then
953: wip_ws_util.trace_log('Dep: '||to_char(employee.department_id)||
954: ' Res: '||to_char(employee.resource_id)||
955: ' Pers: '||to_char(employee.person_id)||
956: ' Date: '||to_char(emp_act_avl_hrs.actual_date,WIP_CONSTANTS.DATETIME_FMT)||
957: ' Shift Seq: '||to_char(l_date_seq)||
958: ' Shift Num: '||to_char(l_shift_num)||
959: ' AAH Value: '||to_char(l_act_att_hrs));
960: end if;

Line 968: if (g_logLevel <= wip_constants.trace_logging) then

964: end if; /* if l_act_avl_hrs_required then */
965:
966: if l_sch_avl_hrs_required then /* Calculate scheduled available hours here. */
967: l_stmt_num :=150;
968: if (g_logLevel <= wip_constants.trace_logging) then
969: wip_ws_util.trace_log('Inside Scheduled Available Hours Calculation');
970: end if;
971: /* Add Code for capacity changes and exceptions and factor it on the shift duration. */
972: emp_index := v_emp_perf_temp.first;

Line 984: if (g_logLevel <= wip_constants.trace_logging) then

980: window_start_time,
981: window_end_time)
982: loop
983: l_stmt_num :=170;
984: if (g_logLevel <= wip_constants.trace_logging) then
985: wip_ws_util.trace_log('Record found for Scheduled Available Hours Calculation');
986: end if;
987: is_sah_record_valid :=true;
988: wip_ws_dl_util.get_first_dept_resource_shift

Line 1003: if (g_logLevel <= wip_constants.trace_logging) then

999: l_time_uom_flag := is_time_uom(emp_sch_avl_hrs.uom_code);
1000: l_stmt_num :=180;
1001: -- Modified for bug 6972129.
1002: if l_time_uom_flag = 2 then
1003: if (g_logLevel <= wip_constants.trace_logging) then
1004: fnd_message.set_name('WIP','WIP_LM_TIME_UOM');
1005: fnd_message.set_token('EMP', to_char(employee.person_id));
1006: x_error_msg := fnd_message.get;
1007: wip_ws_util.trace_log(l_proc_name||'( stmt_num: '||l_stmt_num||') '||x_error_msg);

Line 1032: if (g_logLevel <= wip_constants.trace_logging) then

1028: if v_emp_perf_temp.exists(to_char(l_date_seq||':'||l_shift_num)) then
1029: v_emp_perf_temp(to_char(l_date_seq||':'||l_shift_num)).sch_avl_hrs :=
1030: v_emp_perf_temp(to_char(l_date_seq||':'||l_shift_num)).sch_avl_hrs+l_sch_avl_hrs;
1031:
1032: if (g_logLevel <= wip_constants.trace_logging) then
1033: wip_ws_util.trace_log('Dep: '||to_char(employee.department_id)||
1034: ' Res: '||to_char(employee.resource_id)||
1035: ' Pers: '||to_char(employee.person_id)||
1036: ' Date: '||to_char(emp_sch_avl_hrs.actual_date,WIP_CONSTANTS.DATETIME_FMT)||

Line 1036: ' Date: '||to_char(emp_sch_avl_hrs.actual_date,WIP_CONSTANTS.DATETIME_FMT)||

1032: if (g_logLevel <= wip_constants.trace_logging) then
1033: wip_ws_util.trace_log('Dep: '||to_char(employee.department_id)||
1034: ' Res: '||to_char(employee.resource_id)||
1035: ' Pers: '||to_char(employee.person_id)||
1036: ' Date: '||to_char(emp_sch_avl_hrs.actual_date,WIP_CONSTANTS.DATETIME_FMT)||
1037: ' Shift Seq: '||to_char(l_date_seq)||
1038: ' Shift Num: '||to_char(l_shift_num)||
1039: ' SAH Value: '||to_char(l_sch_avl_hrs));
1040: end if;

Line 1048: if (g_logLevel <= wip_constants.trace_logging) then

1044: end if; /* if l_sch_avl_hrs_required then */
1045:
1046: if l_dir_lab_hrs_required then /* Calculate direct labor hours here. */
1047: l_stmt_num :=210;
1048: if (g_logLevel <= wip_constants.trace_logging) then
1049: wip_ws_util.trace_log('Inside Direct Labor Hours Calculation');
1050: end if;
1051: for emp_dir_lab_hrs in dlh_records(p_organization_id,
1052: employee.department_id,

Line 1060: if (g_logLevel <= wip_constants.trace_logging) then

1056: window_start_time,
1057: window_end_time)
1058: loop
1059: l_stmt_num :=220;
1060: if (g_logLevel <= wip_constants.trace_logging) then
1061: wip_ws_util.trace_log('Record found for Direct Labor Hours Calculation');
1062: end if;
1063: is_dlh_record_valid :=true;
1064: wip_ws_dl_util.get_first_dept_resource_shift

Line 1079: if (g_logLevel <= wip_constants.trace_logging) then

1075: l_time_uom_flag := is_time_uom(emp_dir_lab_hrs.uom_code);
1076: l_stmt_num :=230;
1077: -- Modified for bug 6972129.
1078: if l_time_uom_flag = 2 then
1079: if (g_logLevel <= wip_constants.trace_logging) then
1080: fnd_message.set_name('WIP','WIP_LM_TIME_UOM');
1081: fnd_message.set_token('EMP', to_char(employee.person_id));
1082: x_error_msg := fnd_message.get;
1083: wip_ws_util.trace_log(l_proc_name||'( stmt_num: '||l_stmt_num||') '||x_error_msg);

Line 1110: if (g_logLevel <= wip_constants.trace_logging) then

1106: if v_emp_perf_temp.exists(to_char(l_date_seq||':'||l_shift_num)) then
1107: v_emp_perf_temp(to_char(l_date_seq||':'||l_shift_num)).dir_lab_hrs :=
1108: v_emp_perf_temp(to_char(l_date_seq||':'||l_shift_num)).dir_lab_hrs+l_dir_lab_hrs;
1109:
1110: if (g_logLevel <= wip_constants.trace_logging) then
1111: wip_ws_util.trace_log('Dep: '||to_char(employee.department_id)||
1112: ' Res: '||to_char(employee.resource_id)||
1113: ' Inst : '||to_char(employee.instance_id)||
1114: ' Pers: '||to_char(employee.person_id)||

Line 1115: ' Date: '||to_char(emp_dir_lab_hrs.actual_date,WIP_CONSTANTS.DATETIME_FMT)||

1111: wip_ws_util.trace_log('Dep: '||to_char(employee.department_id)||
1112: ' Res: '||to_char(employee.resource_id)||
1113: ' Inst : '||to_char(employee.instance_id)||
1114: ' Pers: '||to_char(employee.person_id)||
1115: ' Date: '||to_char(emp_dir_lab_hrs.actual_date,WIP_CONSTANTS.DATETIME_FMT)||
1116: ' Shift Seq: '||to_char(l_date_seq)||
1117: ' Shift Num: '||to_char(l_shift_num)||
1118: ' DLH Value: '||to_char(l_dir_lab_hrs));
1119: end if;

Line 1131: if (g_logLevel <= wip_constants.trace_logging) then

1127: l_stmt_num :=290;
1128: /* Modified for Bug 7010115. */
1129: -- Fix for Bug 12614160. Consider cases where resource doesn't exist on the job operation.
1130: l_skip_records := 0;
1131: if (g_logLevel <= wip_constants.trace_logging) then
1132: wip_ws_util.trace_log(' Get Clock-In records in for Earned Hours - Instance Id : '||employee.instance_id || ' Person Id : ' || employee.person_id || ' Resource Id : ' || employee.resource_id);
1133: end if;
1134: for emp_clock_rec in clock_in_records(p_organization_id,
1135: employee.department_id,

Line 1142: if (g_logLevel <= wip_constants.trace_logging) then

1138: employee.person_id,
1139: window_start_time,
1140: window_end_time)
1141: loop
1142: if (g_logLevel <= wip_constants.trace_logging) then
1143: wip_ws_util.trace_log(' Clock-In Details Job : '|| emp_clock_rec.wip_entity_id || ' Op : '||emp_clock_rec.operation_seq_num || ' Index : ' ||emp_clock_rec.emp_index);
1144: end if;
1145: for emp_earned_hrs in eh_records(p_organization_id,
1146: window_start_time,

Line 1154: if (g_logLevel <= wip_constants.trace_logging) then

1150: employee.resource_id,
1151: emp_clock_rec.emp_index,
1152: employee.department_id)
1153: loop
1154: if (g_logLevel <= wip_constants.trace_logging) then
1155: wip_ws_util.trace_log(' Earned Hours Move Qty : '|| emp_earned_hrs.moved_qty );
1156: end if;
1157: for earned_hrs_rates in ear_hours_calc(p_organization_id,
1158: emp_clock_rec.wip_entity_id,

Line 1163: if (g_logLevel <= wip_constants.trace_logging) then

1159: emp_clock_rec.operation_seq_num,
1160: employee.resource_id,
1161: emp_earned_hrs.moved_qty)
1162: loop
1163: if (g_logLevel <= wip_constants.trace_logging) then
1164: wip_ws_util.trace_log(' inside ear_hours_calc qty : '|| emp_earned_hrs.moved_qty );
1165: end if;
1166: is_eh_record_valid := true;
1167: --Start of bug 14845207 fix

Line 1187: if (g_logLevel <= wip_constants.trace_logging) then

1183: exception
1184: when others then
1185: l_working_emp_count := 1;
1186: end;
1187: if (g_logLevel <= wip_constants.trace_logging) then
1188: wip_ws_util.trace_log('Labor metric calculation, l_working_emp_count :'|| l_working_emp_count);
1189: end if;
1190:
1191: if earned_hrs_rates.resource_pick = 1 then

Line 1203: if (g_logLevel <= wip_constants.trace_logging) then

1199: l_time_uom_flag := is_time_uom(l_uom_code);
1200: l_stmt_num :=310;
1201: -- Modified for bug 6972129.
1202: if l_time_uom_flag = 2 then
1203: if (g_logLevel <= wip_constants.trace_logging) then
1204: fnd_message.set_name('WIP','WIP_LM_TIME_UOM');
1205: fnd_message.set_token('EMP', to_char(employee.person_id));
1206: x_error_msg := fnd_message.get;
1207: wip_ws_util.trace_log(l_proc_name||'( stmt_num: '||l_stmt_num||') '||x_error_msg);

Line 1213: if (g_logLevel <= wip_constants.trace_logging) then

1209: end if;
1210: is_eh_record_valid := false;
1211: end if;
1212: if earned_hrs_rates.basis_type = 2 then
1213: if (g_logLevel <= wip_constants.trace_logging) then
1214: fnd_message.set_name('WIP','WIP_LM_LOT_BASED_RES');
1215: fnd_message.set_token('EMP', to_char(employee.person_id));
1216: x_error_msg := fnd_message.get;
1217: wip_ws_util.trace_log(l_proc_name||'( stmt_num: '||l_stmt_num||') '||x_error_msg);

Line 1240: if (g_logLevel <= wip_constants.trace_logging) then

1236: if v_emp_perf_temp.exists(emp_clock_rec.emp_index) then
1237: v_emp_perf_temp(emp_clock_rec.emp_index).earned_hrs :=
1238: v_emp_perf_temp(emp_clock_rec.emp_index).earned_hrs+l_earned_hrs;
1239:
1240: if (g_logLevel <= wip_constants.trace_logging) then
1241: wip_ws_util.trace_log('Dep: '||to_char(employee.department_id)||
1242: ' Res: '||to_char(employee.resource_id)||
1243: ' Inst: '||to_char(employee.instance_id)||
1244: ' Pers: '||to_char(employee.person_id)||

Line 1259: if (g_logLevel <= wip_constants.trace_logging) then

1255: end loop;
1256: end if; /* if l_earned_hrs_required then */
1257: l_stmt_num :=350;
1258:
1259: if (g_logLevel <= wip_constants.trace_logging) then
1260: wip_ws_util.trace_log('Performing data transfer');
1261: end if;
1262:
1263: /* transfer data from collection indexed by varchar2 to a collection

Line 1327: if (g_logLevel <= wip_constants.trace_logging) then

1323: emp_index := v_emp_perf_temp.next(emp_index);
1324: end loop;
1325: l_stmt_num :=360;
1326:
1327: if (g_logLevel <= wip_constants.trace_logging) then
1328: wip_ws_util.trace_log(' Calculation Completed for employee Dep: '||to_char(employee.department_id)||
1329: ' Res: '||to_char(employee.resource_id)||
1330: ' Pers: '||to_char(employee.person_id));
1331: end if;

Line 1346: if (g_logLevel <= wip_constants.trace_logging) then

1342: forall cntr in v_wip_lab_perf_rate.first..v_wip_lab_perf_rate.last
1343: INSERT into WIP_LABOR_PERFORMANCE_RATES values v_wip_lab_perf_rate(cntr);
1344:
1345: l_stmt_num :=390;
1346: if (g_logLevel <= wip_constants.trace_logging) then
1347: wip_ws_util.trace_log('Insertion of all calculated records is successful.');
1348: end if;
1349:
1350: /* Since attendance hours is entered for an employee at org level and distributed across all departments

Line 1391: if (g_logLevel <= wip_constants.trace_logging) then

1387: t.date_sequence,
1388: t.shift_num;
1389:
1390: l_stmt_num :=400;
1391: if (g_logLevel <= wip_constants.trace_logging) then
1392: wip_ws_util.trace_log('Computed Org Level Summary Data.');
1393: end if;
1394:
1395: /* Insert into Metrics Table the org level summary data. Use -1 for dept,res and employee */

Line 1448: if (g_logLevel <= wip_constants.trace_logging) then

1444: g_request_id,
1445: 1);
1446:
1447: l_stmt_num :=400;
1448: if (g_logLevel <= wip_constants.trace_logging) then
1449: wip_ws_util.trace_log('Insertion of Org Level Summary Data is successful.');
1450: end if;
1451:
1452: end if; /* l_metric1_required or l_metric2_required or l_metric3_required */