97: SELECT 'is there a valid job'
98: FROM WIP_DISCRETE_JOBS
99: WHERE WIP_ENTITY_ID = P_wip_entity_id
100: AND ORGANIZATION_ID = P_organization_id
101: AND STATUS_TYPE IN (WIP_CONSTANTS.UNRELEASED, WIP_CONSTANTS.RELEASED,
102: WIP_CONSTANTS.COMP_CHRG, WIP_CONSTANTS.HOLD);
103:
104: CURSOR rep_info IS
105: SELECT 'is there a valid schedule'
98: FROM WIP_DISCRETE_JOBS
99: WHERE WIP_ENTITY_ID = P_wip_entity_id
100: AND ORGANIZATION_ID = P_organization_id
101: AND STATUS_TYPE IN (WIP_CONSTANTS.UNRELEASED, WIP_CONSTANTS.RELEASED,
102: WIP_CONSTANTS.COMP_CHRG, WIP_CONSTANTS.HOLD);
103:
104: CURSOR rep_info IS
105: SELECT 'is there a valid schedule'
106: FROM WIP_FIRST_OPEN_SCHEDULE_V
112: SELECT 'is the step enabled'
113: FROM wip_valid_intraoperation_steps
114: WHERE organization_id = P_organization_id
115: AND step_lookup_type = P_intraoperation_step_type
116: AND ((P_intraoperation_step_type = WIP_CONSTANTS.TOMOVE AND
117: record_creator = 'USER')
118: OR
119: (P_intraoperation_step_type <> WIP_CONSTANTS.TOMOVE));
120:
115: AND step_lookup_type = P_intraoperation_step_type
116: AND ((P_intraoperation_step_type = WIP_CONSTANTS.TOMOVE AND
117: record_creator = 'USER')
118: OR
119: (P_intraoperation_step_type <> WIP_CONSTANTS.TOMOVE));
120:
121: CURSOR status_info IS
122: SELECT 'is the status valid'
123: FROM WIP_SHOP_FLOOR_STATUS_CODES
210: FROM wip_operation_resources wo
211: WHERE wo.wip_entity_id = p_wip_entity_id
212: AND wo.organization_id = p_org_id
213: AND nvl (wo.repetitive_schedule_id, -1) = nvl(p_repetitive_sched_id,-1)
214: AND wo.autocharge_type = WIP_CONSTANTS.PO_MOVE;
215:
216: BEGIN
217: l_osp_shop_floor_status := GetOSPStatus (p_org_id);
218: l_line_id := wip_repetitive_utilities.get_line_id
224: P_wip_entity_id => p_wip_entity_id,
225: P_organization_id => p_org_id,
226: P_line_id => l_line_id,
227: P_operation_seq_num => cwop_rec.operation_seq_num,
228: P_intraoperation_step_type => WIP_CONSTANTS.QUEUE,
229: P_shop_floor_status => l_osp_shop_floor_status);
230: END LOOP;
231: else
232: INSERT_STATUS (
233: P_wip_entity_id => p_wip_entity_id,
234: P_organization_id => p_org_id,
235: P_line_id => l_line_id,
236: P_operation_seq_num => p_operation_seq_num,
237: P_intraoperation_step_type => WIP_CONSTANTS.QUEUE,
238: P_shop_floor_status => l_osp_shop_floor_status);
239:
240: end if;
241: END CREATE_OSP_STATUS;
255: FROM wip_operation_resources wo
256: WHERE wo.wip_entity_id = p_wip_entity_id
257: AND wo.organization_id = p_org_id
258: AND nvl (wo.repetitive_schedule_id, -1) = nvl(p_repetitive_sched_id,-1)
259: AND wo.autocharge_type = WIP_CONSTANTS.PO_MOVE;
260:
261: BEGIN
262:
263: l_osp_shop_floor_status := GetOSPStatus (p_org_id);
270: p_wip_entity_id => p_wip_entity_id,
271: p_organization_id => p_org_id,
272: p_line_id => l_line_id,
273: p_operation_seq_num => cwop_rec.operation_seq_num,
274: p_intraoperation_step_type => WIP_CONSTANTS.QUEUE,
275: p_shop_floor_status => l_osp_shop_floor_status);
276: END LOOP;
277:
278: else
280: p_wip_entity_id => p_wip_entity_id,
281: p_organization_id => p_org_id,
282: p_line_id => l_line_id,
283: p_operation_seq_num => p_operation_seq_num,
284: p_intraoperation_step_type => WIP_CONSTANTS.QUEUE,
285: p_shop_floor_status => l_osp_shop_floor_status);
286: end if;
287:
288: END REMOVE_OSP_STATUS;
421: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
422: l_no_move_count NUMBER := 0;
423: BEGIN
424: -- write parameter value to log file
425: IF (l_logLevel <= wip_constants.trace_logging) THEN
426: l_params(1).paramName := 'p_org_id';
427: l_params(1).paramValue := p_org_id;
428: l_params(2).paramName := 'p_wip_id';
429: l_params(2).paramValue := p_wip_id;
447: (SELECT max(wo2.operation_seq_num)
448: FROM wip_operations wo2
449: WHERE wo2.organization_id = wo1.organization_id
450: AND wo2.wip_entity_id = wo1.wip_entity_id)
451: AND ws.intraoperation_step_type = WIP_CONSTANTS.TOMOVE
452: AND ws.shop_floor_status_code = wsc.shop_floor_status_code
453: AND wsc.status_move_flag = WIP_CONSTANTS.NO
454: AND NVL(wsc.disable_date, SYSDATE + 1) > SYSDATE;
455:
449: WHERE wo2.organization_id = wo1.organization_id
450: AND wo2.wip_entity_id = wo1.wip_entity_id)
451: AND ws.intraoperation_step_type = WIP_CONSTANTS.TOMOVE
452: AND ws.shop_floor_status_code = wsc.shop_floor_status_code
453: AND wsc.status_move_flag = WIP_CONSTANTS.NO
454: AND NVL(wsc.disable_date, SYSDATE + 1) > SYSDATE;
455:
456: IF (l_logLevel <= wip_constants.trace_logging) THEN
457: wip_logger.exitPoint(p_procName => 'wip_sf_status.count_no_move_last_step',
452: AND ws.shop_floor_status_code = wsc.shop_floor_status_code
453: AND wsc.status_move_flag = WIP_CONSTANTS.NO
454: AND NVL(wsc.disable_date, SYSDATE + 1) > SYSDATE;
455:
456: IF (l_logLevel <= wip_constants.trace_logging) THEN
457: wip_logger.exitPoint(p_procName => 'wip_sf_status.count_no_move_last_step',
458: p_procReturnStatus => fnd_api.g_ret_sts_success,
459: p_msg => 'procedure complete',
460: x_returnStatus => l_returnStatus);
461: END IF;
462: RETURN l_no_move_count;
463: EXCEPTION
464: WHEN others THEN
465: IF (l_logLevel <= wip_constants.trace_logging) THEN
466: wip_logger.exitPoint(p_procName => 'wip_sf_status.count_no_move_last_step',
467: p_procReturnStatus => fnd_api.g_ret_sts_unexp_error,
468: p_msg => 'Unexpected Errors: ' || SQLERRM,
469: x_returnStatus => l_returnStatus);