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;
433: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
434: l_no_move_count NUMBER := 0;
435: BEGIN
436: -- write parameter value to log file
437: IF (l_logLevel <= wip_constants.trace_logging) THEN
438: l_params(1).paramName := 'p_org_id';
439: l_params(1).paramValue := p_org_id;
440: l_params(2).paramName := 'p_wip_id';
441: l_params(2).paramValue := p_wip_id;
459: (SELECT max(wo2.operation_seq_num)
460: FROM wip_operations wo2
461: WHERE wo2.organization_id = wo1.organization_id
462: AND wo2.wip_entity_id = wo1.wip_entity_id)
463: AND ws.intraoperation_step_type = WIP_CONSTANTS.TOMOVE
464: AND ws.shop_floor_status_code = wsc.shop_floor_status_code
465: AND wsc.status_move_flag = WIP_CONSTANTS.NO
466: AND NVL(wsc.disable_date, SYSDATE + 1) > SYSDATE;
467:
461: WHERE wo2.organization_id = wo1.organization_id
462: AND wo2.wip_entity_id = wo1.wip_entity_id)
463: AND ws.intraoperation_step_type = WIP_CONSTANTS.TOMOVE
464: AND ws.shop_floor_status_code = wsc.shop_floor_status_code
465: AND wsc.status_move_flag = WIP_CONSTANTS.NO
466: AND NVL(wsc.disable_date, SYSDATE + 1) > SYSDATE;
467:
468: IF (l_logLevel <= wip_constants.trace_logging) THEN
469: wip_logger.exitPoint(p_procName => 'wip_sf_status.count_no_move_last_step',
464: AND ws.shop_floor_status_code = wsc.shop_floor_status_code
465: AND wsc.status_move_flag = WIP_CONSTANTS.NO
466: AND NVL(wsc.disable_date, SYSDATE + 1) > SYSDATE;
467:
468: IF (l_logLevel <= wip_constants.trace_logging) THEN
469: wip_logger.exitPoint(p_procName => 'wip_sf_status.count_no_move_last_step',
470: p_procReturnStatus => fnd_api.g_ret_sts_success,
471: p_msg => 'procedure complete',
472: x_returnStatus => l_returnStatus);
473: END IF;
474: RETURN l_no_move_count;
475: EXCEPTION
476: WHEN others THEN
477: IF (l_logLevel <= wip_constants.trace_logging) THEN
478: wip_logger.exitPoint(p_procName => 'wip_sf_status.count_no_move_last_step',
479: p_procReturnStatus => fnd_api.g_ret_sts_unexp_error,
480: p_msg => 'Unexpected Errors: ' || SQLERRM,
481: x_returnStatus => l_returnStatus);