3176: IF NOT(inv_cache.is_pickrelease AND g_debug IS NOT NULL) THEN
3177: g_debug := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
3178: END IF;
3179: l_debug := g_debug;
3180: IF p_simulation_mode <> wms_engine_pvt.g_no_simulation THEN
3181: l_return_value := TRUE;
3182: ELSIF p_simulation_mode = wms_engine_pvt.g_no_simulation THEN
3183: if l_debug = 1 THEN
3184: l_return_value := TRUE;
3178: END IF;
3179: l_debug := g_debug;
3180: IF p_simulation_mode <> wms_engine_pvt.g_no_simulation THEN
3181: l_return_value := TRUE;
3182: ELSIF p_simulation_mode = wms_engine_pvt.g_no_simulation THEN
3183: if l_debug = 1 THEN
3184: l_return_value := TRUE;
3185: ELSE
3186: l_return_value := FALSE;
3352: x_consist_string := NULL;
3353: x_order_by_string := NULL;
3354:
3355:
3356: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PICK_NO_ROWS' ;
3357:
3358: IF l_debug = 1 THEN
3359: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3360: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);
3356: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PICK_NO_ROWS' ;
3357:
3358: IF l_debug = 1 THEN
3359: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3360: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);
3361: END IF;
3362:
3363: END IF;
3364:
3495: x_project_id := NULL;
3496: x_task_id := NULL;
3497:
3498: -- Bug # 3185073
3499: --WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3500:
3501: IF l_debug = 1 THEN
3502: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3503: END IF;
3501: IF l_debug = 1 THEN
3502: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3503: END IF;
3504:
3505: IF ( WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = 'WMS_PICK_NO_ROWS' or
3506: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = NULL) then
3507:
3508: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3509: END IF;
3502: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3503: END IF;
3504:
3505: IF ( WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = 'WMS_PICK_NO_ROWS' or
3506: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = NULL) then
3507:
3508: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3509: END IF;
3510:
3504:
3505: IF ( WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = 'WMS_PICK_NO_ROWS' or
3506: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = NULL) then
3507:
3508: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3509: END IF;
3510:
3511: IF l_debug = 1 THEN
3512: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);
3508: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3509: END IF;
3510:
3511: IF l_debug = 1 THEN
3512: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);
3513: END IF;
3514:
3515: END IF;
3516: --x_rows := l_rows;
3708: WHEN INVALID_PKG_STATE THEN
3709: x_result := 0;
3710: wms_rule_pvt.g_rule_list_pick_ctr := wms_rule_gen_pkgs.get_count_no_lock('PICK');
3711:
3712: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
3713: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
3714: fnd_message.set_token('LIST_PKG', l_list_pkg);
3715: fnd_message.set_token('RULE_NAME', l_package_name);
3716: fnd_msg_pub.ADD;
3825: WHEN INVALID_PKG_STATE THEN
3826: x_result := 0;
3827: wms_rule_pvt.g_rule_list_put_ctr := wms_rule_gen_pkgs.get_count_no_lock('PUTAWAY');
3828:
3829: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
3830: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
3831: fnd_message.set_token('LIST_PKG', l_list_pkg);
3832: fnd_message.set_token('RULE_NAME', l_package_name);
3833: fnd_msg_pub.ADD;
3876: WHEN INVALID_PKG_STATE THEN
3877: --x_return_status := 0;
3878: x_return_status := -1 ;
3879: wms_rule_pvt.g_rule_list_op_ctr := wms_rule_gen_pkgs.get_count_no_lock('OPERATION_PLAN');
3880: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
3881: x_return_status := fnd_api.g_ret_sts_unexp_error;
3882: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
3883: fnd_message.set_token('LIST_PKG', l_list_pkg);
3884: fnd_message.set_token('RULE_NAME', l_package_name);
3926: WHEN INVALID_PKG_STATE THEN
3927: --x_return_status := 0;
3928: x_return_status := -1 ;
3929: wms_rule_pvt.g_rule_list_task_ctr := wms_rule_gen_pkgs.get_count_no_lock('TASK');
3930: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
3931: x_return_status := fnd_api.g_ret_sts_unexp_error;
3932: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
3933: fnd_message.set_token('LIST_PKG', l_list_pkg);
3934: fnd_message.set_token('RULE_NAME', l_package_name);
3979: WHEN INVALID_PKG_STATE THEN
3980: --x_return_status := 0;
3981: x_return_status := -1 ;
3982: wms_rule_pvt.g_rule_list_label_ctr := wms_rule_gen_pkgs.get_count_no_lock('LABEL');
3983: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
3984: x_return_status := fnd_api.g_ret_sts_unexp_error;
3985: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
3986: fnd_message.set_token('LIST_PKG', l_list_pkg);
3987: fnd_message.set_token('RULE_NAME', l_package_name);
4022: END IF;
4023:
4024: EXCEPTION
4025: WHEN INVALID_PKG_STATE THEN
4026: /* -- WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
4027: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
4028: fnd_message.set_token('LIST_PKG', l_list_pkg);
4029: fnd_message.set_token('RULE_NAME', l_package_name);
4030: fnd_msg_pub.ADD;
4059: END IF;
4060:
4061: EXCEPTION
4062: WHEN INVALID_PKG_STATE THEN
4063: /*WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
4064: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
4065: fnd_message.set_token('LIST_PKG', l_list_pkg);
4066: fnd_message.set_token('RULE_NAME', l_package_name);
4067: fnd_msg_pub.ADD;
4363: log_statement(l_api_name, 'validate and insert', 'sec_needed quantity: ' || p_needed_sec_quantity);
4364: log_statement(l_api_name, 'validate and insert', 'p_record_id: ' || p_record_id);
4365: END IF;
4366: /* bug 3972784, remove locator_id if no locator control */
4367: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
4368: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
4369: OR (wms_engine_pvt.g_sub_loc_control = 5
4370: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
4371: )
4364: log_statement(l_api_name, 'validate and insert', 'p_record_id: ' || p_record_id);
4365: END IF;
4366: /* bug 3972784, remove locator_id if no locator control */
4367: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
4368: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
4369: OR (wms_engine_pvt.g_sub_loc_control = 5
4370: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
4371: )
4372: )
4365: END IF;
4366: /* bug 3972784, remove locator_id if no locator control */
4367: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
4368: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
4369: OR (wms_engine_pvt.g_sub_loc_control = 5
4370: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
4371: )
4372: )
4373: )
4366: /* bug 3972784, remove locator_id if no locator control */
4367: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
4368: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
4369: OR (wms_engine_pvt.g_sub_loc_control = 5
4370: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
4371: )
4372: )
4373: )
4374: THEN
7235: and p_type_code = 2
7236: and l_reservation_id is null THEN
7237: l_max_tolerance := g_max_tolerance ;
7238: l_needed_quantity := l_needed_quantity + l_max_tolerance;
7239: ELSIF p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
7240: IF g_max_tolerance < 0 THEN
7241: l_max_tolerance := g_max_tolerance;
7242: l_needed_quantity := l_needed_quantity + l_max_tolerance;
7243: ELSIF l_allocation_mode in (1, 5) THEN
7258: --always use the locator specified on the move order line, even
7259: --if that locator is from common stock (not project)
7260: --Bug 2666620: BackFlush MO Type Removed. It is now 5. Moreover Txn Action ID is 2 which is
7261: --already handled.
7262: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND wms_engine_pvt.g_transaction_action_id = 2) THEN
7263: IF l_debug = 1 THEN
7264: log_statement(l_api_name, 'do_project1', 'Calling do project check');
7265: END IF;
7266: IF doprojectcheck(l_return_status, l_to_locator_id, p_project_id, p_task_id, l_to_locator_id, l_dummy_loc) THEN
7361: log_statement(l_api_name,'detailed', 'Rule Override flag is set ');
7362: END IF;
7363: -- Validate the txn detail
7364: l_reservation_is_detailed := 'Y';
7365: IF (wms_engine_pvt.g_org_loc_control IN (2, 3) -- org level
7366: OR wms_engine_pvt.g_sub_loc_control IN (2, 3) -- sub level
7367: OR (wms_engine_pvt.g_sub_loc_control = 5 -- item level
7368: AND wms_engine_pvt.g_item_loc_control IN (2, 3)
7369: )
7362: END IF;
7363: -- Validate the txn detail
7364: l_reservation_is_detailed := 'Y';
7365: IF (wms_engine_pvt.g_org_loc_control IN (2, 3) -- org level
7366: OR wms_engine_pvt.g_sub_loc_control IN (2, 3) -- sub level
7367: OR (wms_engine_pvt.g_sub_loc_control = 5 -- item level
7368: AND wms_engine_pvt.g_item_loc_control IN (2, 3)
7369: )
7370: )
7363: -- Validate the txn detail
7364: l_reservation_is_detailed := 'Y';
7365: IF (wms_engine_pvt.g_org_loc_control IN (2, 3) -- org level
7366: OR wms_engine_pvt.g_sub_loc_control IN (2, 3) -- sub level
7367: OR (wms_engine_pvt.g_sub_loc_control = 5 -- item level
7368: AND wms_engine_pvt.g_item_loc_control IN (2, 3)
7369: )
7370: )
7371: THEN
7364: l_reservation_is_detailed := 'Y';
7365: IF (wms_engine_pvt.g_org_loc_control IN (2, 3) -- org level
7366: OR wms_engine_pvt.g_sub_loc_control IN (2, 3) -- sub level
7367: OR (wms_engine_pvt.g_sub_loc_control = 5 -- item level
7368: AND wms_engine_pvt.g_item_loc_control IN (2, 3)
7369: )
7370: )
7371: THEN
7372: IF l_debug = 1 THEN
7858: LOOP
7859: --EXIT WHEN l_needed_quantity <= 0;
7860: IF g_over_allocation = 'N'
7861: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
7862: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
7863: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
7864: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
7865: IF l_max_tolerance >= 0 THEN
7866: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
7860: IF g_over_allocation = 'N'
7861: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
7862: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
7863: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
7864: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
7865: IF l_max_tolerance >= 0 THEN
7866: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
7867: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
7868: ELSE
7993:
7994: --EXIT WHEN l_needed_quantity <= 0; -- consist loop
7995: IF g_over_allocation = 'N'
7996: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
7997: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
7998: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
7999: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8000: IF l_max_tolerance >= 0 THEN
8001: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
7995: IF g_over_allocation = 'N'
7996: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
7997: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
7998: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
7999: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8000: IF l_max_tolerance >= 0 THEN
8001: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8002: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
8003: ELSE
8016: -- if no more quantity needed, exit LPN loop
8017: --EXIT WHEN l_needed_quantity <= 0; -- consist loop
8018: IF g_over_allocation = 'N'
8019: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8020: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8021: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8022: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8023: IF l_max_tolerance >= 0 THEN
8024: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8018: IF g_over_allocation = 'N'
8019: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8020: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8021: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8022: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8023: IF l_max_tolerance >= 0 THEN
8024: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8025: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
8026: ELSE
8055: LOOP
8056: --EXIT WHEN l_needed_quantity <= 0;
8057: IF g_over_allocation = 'N'
8058: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8059: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8060: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8061: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8062: IF l_max_tolerance >= 0 THEN
8063: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8057: IF g_over_allocation = 'N'
8058: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8059: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8060: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8061: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8062: IF l_max_tolerance >= 0 THEN
8063: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8064: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
8065: ELSE
8188:
8189: --EXIT WHEN l_needed_quantity <= 0;
8190: IF g_over_allocation = 'N'
8191: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8192: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8193: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8194: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8195: IF l_max_tolerance >= 0 THEN
8196: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8190: IF g_over_allocation = 'N'
8191: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8192: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8193: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8194: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8195: IF l_max_tolerance >= 0 THEN
8196: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8197: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
8198: ELSE
8207: -- if no more quantity needed, exit LPN loop
8208: --EXIT WHEN l_needed_quantity <= 0;
8209: IF g_over_allocation = 'N'
8210: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8211: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8212: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8213: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8214: IF l_max_tolerance >= 0 THEN
8215: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8209: IF g_over_allocation = 'N'
8210: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8211: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8212: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8213: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8214: IF l_max_tolerance >= 0 THEN
8215: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8216: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
8217: ELSE
8422: --next, check to see if sub and item are locator controlled;
8423: --if loc control, go to next record only if src loc = dest loc;
8424: --if not loc control, go to next records (since subs are equal);
8425: --all of the global variables are set in
8426: --wms_engine_pvt.create_suggestions
8427: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
8428: AND v_current_row.subinventory_code = l_to_subinventory_code
8429: ) THEN
8430: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
8423: --if loc control, go to next record only if src loc = dest loc;
8424: --if not loc control, go to next records (since subs are equal);
8425: --all of the global variables are set in
8426: --wms_engine_pvt.create_suggestions
8427: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
8428: AND v_current_row.subinventory_code = l_to_subinventory_code
8429: ) THEN
8430: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
8431: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
8426: --wms_engine_pvt.create_suggestions
8427: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
8428: AND v_current_row.subinventory_code = l_to_subinventory_code
8429: ) THEN
8430: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
8431: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
8432: OR (wms_engine_pvt.g_sub_loc_control = 5
8433: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
8434: )
8427: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
8428: AND v_current_row.subinventory_code = l_to_subinventory_code
8429: ) THEN
8430: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
8431: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
8432: OR (wms_engine_pvt.g_sub_loc_control = 5
8433: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
8434: )
8435: ) THEN
8428: AND v_current_row.subinventory_code = l_to_subinventory_code
8429: ) THEN
8430: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
8431: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
8432: OR (wms_engine_pvt.g_sub_loc_control = 5
8433: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
8434: )
8435: ) THEN
8436: IF (v_current_row.locator_id = l_to_locator_id) THEN
8429: ) THEN
8430: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
8431: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
8432: OR (wms_engine_pvt.g_sub_loc_control = 5
8433: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
8434: )
8435: ) THEN
8436: IF (v_current_row.locator_id = l_to_locator_id) THEN
8437:
8837:
8838: --EXIT WHEN l_needed_quantity = 0;
8839: IF g_over_allocation = 'N'
8840: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8841: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8842: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8843: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8844: IF l_max_tolerance >= 0 THEN
8845: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8839: IF g_over_allocation = 'N'
8840: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8841: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8842: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8843: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8844: IF l_max_tolerance >= 0 THEN
8845: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8846: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
8847: ELSE
8861:
8862: -- EXIT WHEN l_needed_quantity <= 0;
8863: IF g_over_allocation = 'N'
8864: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8865: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8866: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8867: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8868: IF l_max_tolerance >= 0 THEN
8869: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8863: IF g_over_allocation = 'N'
8864: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
8865: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
8866: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
8867: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
8868: IF l_max_tolerance >= 0 THEN
8869: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
8870: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
8871: ELSE
9190: --exit pick UOM loop when needed qty = 0
9191: --EXIT WHEN l_needed_quantity = 0;
9192: IF g_over_allocation = 'N'
9193: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
9194: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
9195: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
9196: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
9197: IF l_max_tolerance >= 0 THEN
9198: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
9192: IF g_over_allocation = 'N'
9193: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
9194: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
9195: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
9196: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
9197: IF l_max_tolerance >= 0 THEN
9198: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
9199: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
9200: ELSE
9208: --if needed qty = 0, exit outer loop
9209: --EXIT WHEN l_needed_quantity = 0;
9210: IF g_over_allocation = 'N'
9211: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
9212: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
9213: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
9214: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
9215: IF l_max_tolerance >= 0 THEN
9216: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
9210: IF g_over_allocation = 'N'
9211: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
9212: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
9213: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
9214: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
9215: IF l_max_tolerance >= 0 THEN
9216: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
9217: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
9218: ELSE
9455: --exit pick UOM loop when needed qty = 0
9456: --EXIT WHEN l_needed_quantity = 0;
9457: IF g_over_allocation = 'N'
9458: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
9459: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
9460: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
9461: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
9462: IF l_max_tolerance >= 0 THEN
9463: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
9457: IF g_over_allocation = 'N'
9458: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
9459: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
9460: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
9461: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
9462: IF l_max_tolerance >= 0 THEN
9463: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
9464: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
9465: ELSE
9481:
9482: --EXIT WHEN l_needed_quantity = 0;
9483: IF g_over_allocation = 'N'
9484: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
9485: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
9486: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
9487: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
9488: IF l_max_tolerance >= 0 THEN
9489: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
9483: IF g_over_allocation = 'N'
9484: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
9485: OR WMS_Engine_PVT.g_move_order_type <> 3 THEN
9486: EXIT WHEN l_needed_quantity <= 0 or l_needed_quantity <= l_max_tolerance;
9487: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
9488: IF l_max_tolerance >= 0 THEN
9489: EXIT WHEN (l_needed_quantity <= l_max_tolerance)
9490: OR (l_initial_pri_quantity - l_needed_quantity >= WMS_RULE_PVT.g_min_qty_to_allocate);
9491: ELSE
9573: --next, check to see if sub and item are locator controlled;
9574: --if loc control, go to next record only if src loc = dest loc;
9575: --if not loc control, go to next records (since subs are equal);
9576: --all of the global variables are set in
9577: --wms_engine_pvt.create_suggestions
9578: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
9579: AND v_current_row.subinventory_code = l_to_subinventory_code
9580: ) THEN
9581: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
9574: --if loc control, go to next record only if src loc = dest loc;
9575: --if not loc control, go to next records (since subs are equal);
9576: --all of the global variables are set in
9577: --wms_engine_pvt.create_suggestions
9578: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
9579: AND v_current_row.subinventory_code = l_to_subinventory_code
9580: ) THEN
9581: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
9582: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
9577: --wms_engine_pvt.create_suggestions
9578: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
9579: AND v_current_row.subinventory_code = l_to_subinventory_code
9580: ) THEN
9581: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
9582: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
9583: OR (wms_engine_pvt.g_sub_loc_control = 5
9584: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
9585: )
9578: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
9579: AND v_current_row.subinventory_code = l_to_subinventory_code
9580: ) THEN
9581: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
9582: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
9583: OR (wms_engine_pvt.g_sub_loc_control = 5
9584: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
9585: )
9586: ) THEN
9579: AND v_current_row.subinventory_code = l_to_subinventory_code
9580: ) THEN
9581: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
9582: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
9583: OR (wms_engine_pvt.g_sub_loc_control = 5
9584: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
9585: )
9586: ) THEN
9587: IF (v_current_row.locator_id = l_to_locator_id) THEN
9580: ) THEN
9581: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
9582: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
9583: OR (wms_engine_pvt.g_sub_loc_control = 5
9584: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
9585: )
9586: ) THEN
9587: IF (v_current_row.locator_id = l_to_locator_id) THEN
9588:
9918:
9919: --Loop through each record from the Rule cursor
9920: WHILE TRUE LOOP
9921: IF l_debug = 1 THEN
9922: log_event(l_api_name, 'Loop through each record putaway from the Rule cursor ', 'Start ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);
9923: END IF;
9924: --l_locs_index := l_locs_index + 1; --bug3673962 moving this assignment as when no rows are returned by fetchputaway
9925: --the index gets incremented unncessarily and fails in WMSSOGBB.pls
9926: fetchputaway(
9952: -- Exit if no more records from rule cursor
9953: EXIT WHEN nvl(l_rows, 0) = 0 ; -- [ Added to to exit , if the rule is not returning any rows
9954:
9955: l_locs_index := l_locs_index + 1; --bug3673962
9956: log_statement(l_api_name, 'org_loc_ctl ', 'org: ' ||wms_engine_pvt.g_org_loc_control);
9957: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
9958: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
9959: /* bug 3972784, remove locator_id if no locator control */
9960: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
9953: EXIT WHEN nvl(l_rows, 0) = 0 ; -- [ Added to to exit , if the rule is not returning any rows
9954:
9955: l_locs_index := l_locs_index + 1; --bug3673962
9956: log_statement(l_api_name, 'org_loc_ctl ', 'org: ' ||wms_engine_pvt.g_org_loc_control);
9957: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
9958: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
9959: /* bug 3972784, remove locator_id if no locator control */
9960: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
9961: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
9954:
9955: l_locs_index := l_locs_index + 1; --bug3673962
9956: log_statement(l_api_name, 'org_loc_ctl ', 'org: ' ||wms_engine_pvt.g_org_loc_control);
9957: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
9958: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
9959: /* bug 3972784, remove locator_id if no locator control */
9960: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
9961: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
9962: OR (wms_engine_pvt.g_sub_loc_control = 5
9956: log_statement(l_api_name, 'org_loc_ctl ', 'org: ' ||wms_engine_pvt.g_org_loc_control);
9957: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
9958: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
9959: /* bug 3972784, remove locator_id if no locator control */
9960: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
9961: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
9962: OR (wms_engine_pvt.g_sub_loc_control = 5
9963: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
9964: )
9957: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
9958: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
9959: /* bug 3972784, remove locator_id if no locator control */
9960: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
9961: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
9962: OR (wms_engine_pvt.g_sub_loc_control = 5
9963: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
9964: )
9965: )
9958: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
9959: /* bug 3972784, remove locator_id if no locator control */
9960: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
9961: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
9962: OR (wms_engine_pvt.g_sub_loc_control = 5
9963: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
9964: )
9965: )
9966: )
9959: /* bug 3972784, remove locator_id if no locator control */
9960: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
9961: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
9962: OR (wms_engine_pvt.g_sub_loc_control = 5
9963: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
9964: )
9965: )
9966: )
9967: THEN
9996: --if reservation exists for WIP assembly completion, put away
9997: -- to reservable sub only;
9998: --we know if sub has to be reservable based on global value set in
9999: -- create_suggestions
10000: IF wms_engine_pvt.g_reservable_putaway_sub_only THEN
10001: OPEN c_subinventory;
10002: FETCH c_subinventory INTO l_lpn_controlled_flag,
10003: l_sub_rsv_type;
10004: If c_subinventory%NOTFOUND or l_sub_rsv_type IS NULL Then
10035: --always use the locator specified on the move order line, even
10036: --if that locator is from common stock (not project)
10037: -- Bug 2666620: BackFlush MO Type Removed. It is now 5.
10038: -- Moreover Txn Action ID is 2 which is already handled.
10039: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND
10040: wms_engine_pvt.g_transaction_action_id = 2) THEN
10041: IF l_debug = 1 THEN
10042: log_statement(l_api_name, 'do_project2', 'Calling do project check');
10043: END IF;
10036: --if that locator is from common stock (not project)
10037: -- Bug 2666620: BackFlush MO Type Removed. It is now 5.
10038: -- Moreover Txn Action ID is 2 which is already handled.
10039: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND
10040: wms_engine_pvt.g_transaction_action_id = 2) THEN
10041: IF l_debug = 1 THEN
10042: log_statement(l_api_name, 'do_project2', 'Calling do project check');
10043: END IF;
10044: IF doprojectcheck(l_return_status,
10158:
10159: --bug 2778814
10160: --For serial controlled items, we should not suggest the putaway
10161: -- of decimal quantities
10162: IF wms_engine_pvt.g_serial_number_control_code > 1 THEN
10163: l_possible_quantity := floor(l_possible_quantity);
10164: IF l_debug = 1 THEN
10165: log_statement(l_api_name, 'no_decimals',
10166: 'Cannot putaway a decimal quantity on a serial controlled item.'||
10196: log_event(l_api_name, 'no_rec_qty_put', 'No available capacity in putaway location');
10197: END IF;
10198: --
10199: -- Patchset 'J' error_message
10200: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_LOC_CAPACITY_FULL' ;
10201: --
10202: --
10203: GOTO nextoutputrecord;
10204: END IF;
10213: --next, check to see if sub and item are locator controlled;
10214: --if loc control, go to next record only if src loc = dest loc
10215: --if not loc control, go to next records (since subs are equal)
10216: --all of the global variables are set in
10217: --wms_engine_pvt.create_suggestions
10218: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
10219: AND l_osubinventory_code = l_from_subinventory_code
10220: ) THEN
10221: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10214: --if loc control, go to next record only if src loc = dest loc
10215: --if not loc control, go to next records (since subs are equal)
10216: --all of the global variables are set in
10217: --wms_engine_pvt.create_suggestions
10218: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
10219: AND l_osubinventory_code = l_from_subinventory_code
10220: ) THEN
10221: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10222: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
10217: --wms_engine_pvt.create_suggestions
10218: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
10219: AND l_osubinventory_code = l_from_subinventory_code
10220: ) THEN
10221: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10222: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
10223: OR (wms_engine_pvt.g_sub_loc_control = 5
10224: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
10225: )
10218: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
10219: AND l_osubinventory_code = l_from_subinventory_code
10220: ) THEN
10221: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10222: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
10223: OR (wms_engine_pvt.g_sub_loc_control = 5
10224: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
10225: )
10226: ) THEN
10219: AND l_osubinventory_code = l_from_subinventory_code
10220: ) THEN
10221: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10222: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
10223: OR (wms_engine_pvt.g_sub_loc_control = 5
10224: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
10225: )
10226: ) THEN
10227: IF (l_olocator_id = l_from_locator_id) THEN
10220: ) THEN
10221: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10222: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
10223: OR (wms_engine_pvt.g_sub_loc_control = 5
10224: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
10225: )
10226: ) THEN
10227: IF (l_olocator_id = l_from_locator_id) THEN
10228:
10242: END IF;
10243:
10244: --
10245: -- Patchset 'J' error_message
10246: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_SAME_SUB_LOC' ;
10247: --
10248: --
10249: GOTO nextoutputrecord;
10250: END IF; -- from loc = to loc
10304: g_trace_recs(l_locs_index).material_status_flag := 'N';
10305: END IF;
10306: --
10307: -- Patchset 'J' error_message
10308: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_MAT_STATUS_NOT_ALLOWED' ;
10309: --
10310: --
10311: GOTO nextoutputrecord;
10312: END IF;
10439: g_trace_recs(l_locs_index).cg_comingle_flag := 'N';
10440: END IF;
10441: --
10442: -- Patchset 'J' error_message
10443: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_COST_GROUP_COMINGLE' ;
10444: GOTO nextoutputrecord;
10445: END IF;
10446:
10447: IF l_debug_on THEN
10597: END IF;
10598:
10599: IF ((g_over_allocation = 'N'
10600: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
10601: OR WMS_Engine_PVT.g_move_order_type <> 3 or p_type_code <> 2)
10602: AND (l_needed_quantity > 0 OR l_needed_quantity > l_max_tolerance)
10603: )
10604: OR
10605: (g_over_allocation = 'Y' AND NOT (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
10602: AND (l_needed_quantity > 0 OR l_needed_quantity > l_max_tolerance)
10603: )
10604: OR
10605: (g_over_allocation = 'Y' AND NOT (p_type_code = 2 AND l_lot_divisible_flag = 'N' and l_lot_control_code <> 1)
10606: AND WMS_Engine_PVT.g_move_order_type = 3 and p_type_code = 2
10607: AND ((l_max_tolerance >= 0 AND (l_needed_quantity > l_max_tolerance)
10608: AND (l_initial_pri_quantity - l_needed_quantity < WMS_RULE_PVT.g_min_qty_to_allocate))
10609: OR (l_max_tolerance < 0
10610: AND l_initial_pri_quantity - l_needed_quantity < WMS_RULE_PVT.g_min_qty_to_allocate)
10615: x_finished := fnd_api.g_false;
10616:
10617: IF l_needed_quantity = l_initial_pri_quantity THEN
10618: -- Bug #3396532
10619: IF WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE IS NULL THEN
10620: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
10621: END IF;
10622: IF l_debug = 1 THEN
10623: log_event(l_api_name, 'no_success', 'Found no locations for this rule');
10616:
10617: IF l_needed_quantity = l_initial_pri_quantity THEN
10618: -- Bug #3396532
10619: IF WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE IS NULL THEN
10620: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
10621: END IF;
10622: IF l_debug = 1 THEN
10623: log_event(l_api_name, 'no_success', 'Found no locations for this rule');
10624: END IF;
10785: , p_validation_level => fnd_api.g_valid_level_full
10786: , x_return_status => l_return_status
10787: , x_msg_count => x_msg_count
10788: , x_msg_data => x_msg_data
10789: , p_header_id => wms_engine_pvt.g_trace_header_id
10790: , p_rule_id => l_rule_id
10791: , p_pre_suggestions => g_trace_recs
10792: );
10793: END IF;
10833: , p_validation_level => fnd_api.g_valid_level_full
10834: , x_return_status => l_return_status
10835: , x_msg_count => x_msg_count
10836: , x_msg_data => x_msg_data
10837: , p_header_id => wms_engine_pvt.g_trace_header_id
10838: , p_rule_id => l_rule_id
10839: , p_pre_suggestions => g_trace_recs
10840: );
10841: END IF;
11697:
11698: --bug 2400549 - for WIP backflush transfer putaway,
11699: --always use the locator specified on the move order line, even
11700: --if that locator is from common stock (not project)
11701: IF NOT(wms_engine_pvt.g_move_order_type = 7 and
11702: wms_engine_pvt.g_transaction_action_id = 2) THEN
11703: If (l_debug = 1) then
11704: log_statement(l_api_name, 'do_project2',
11705: 'Calling do project check');
11698: --bug 2400549 - for WIP backflush transfer putaway,
11699: --always use the locator specified on the move order line, even
11700: --if that locator is from common stock (not project)
11701: IF NOT(wms_engine_pvt.g_move_order_type = 7 and
11702: wms_engine_pvt.g_transaction_action_id = 2) THEN
11703: If (l_debug = 1) then
11704: log_statement(l_api_name, 'do_project2',
11705: 'Calling do project check');
11706: End if;
12084: ,p_validation_level => fnd_api.g_valid_level_full
12085: ,x_return_status => l_return_status
12086: ,x_msg_count => x_msg_count
12087: ,x_msg_data => x_msg_data
12088: ,p_header_id => wms_engine_pvt.g_trace_header_id
12089: ,p_rule_id => null
12090: ,p_pre_suggestions => g_trace_recs
12091: );
12092: END IF;
15336: , p_subinventory_code => l_from_subinventory_code
15337: , p_locator_id => l_from_locator_id
15338: , p_lot_number => l_lot_number );
15339: IF ( l_allowed = 'N') then
15340: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_ATT_SUB_STATUS_NA';
15341: fnd_message.set_name('WMS', 'WMS_ATT_SUB_STATUS_NA');
15342: fnd_msg_pub.ADD;
15343: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
15344: IF l_debug = 1 THEN
15363: log_statement(l_api_name, 'l_onhand_status_trx_allowed ', l_onhand_status_trx_allowed);
15364: END IF;
15365:
15366: IF (l_onhand_status_trx_allowed = 'N') then
15367: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_DISALLOW_TRANSACTION';
15368: fnd_message.set_name('WMS', 'WMS_DISALLOW_TRANSACTION');
15369: fnd_msg_pub.ADD;
15370: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
15371: IF l_debug = 1 THEN
15553: IF l_debug = 1 THEN
15554: log_error_msg(l_api_name, x_msg_data);
15555: END IF;
15556:
15557: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_LPN_UNAVAILABLE';
15558: IF p_tree_id IS NOT NULL THEN -- Bug# 4006426
15559:
15560: IF l_debug = 1 THEN
15561: log_statement(l_api_name, 'insert_failed', 'Record failed to allocation. Rolling back and ' || 'invalidating LPN');
15578: END IF;
15579: ELSE
15580:
15581: IF ( l_allowed = 'N') then
15582: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_ATT_SUB_STATUS_NA';
15583: fnd_message.set_name('WMS', 'WMS_ATT_SUB_STATUS_NA');
15584: fnd_msg_pub.ADD;
15585:
15586: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
15588: log_error_msg(l_api_name, x_msg_data);
15589: END IF;
15590:
15591: ELSIF l_serial_allowed = 'N' then
15592: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_ATT_SERIAL_STATUS_NA' ;
15593: fnd_message.set_name('WMS', 'WMS_ATT_SUB_STATUS_NA');
15594: fnd_msg_pub.ADD;
15595: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
15596:
16260: --always use the locator specified on the move order line, even
16261: --if that locator is from common stock (not project)
16262: -- Bug 2666620: BackFlush MO Type Removed. It is now 5. Moreover Txn Action ID is 2 which is
16263: -- already handled.
16264: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND wms_engine_pvt.g_transaction_action_id = 2) THEN
16265:
16266: IF l_debug = 1 THEN
16267: log_statement(l_api_name, 'do_project1', 'Calling do project check');
16268: END IF;