DBA Data[Home] [Help]

APPS.WMS_RULE_PVT dependencies on WMS_ENGINE_PVT

Line 3533: IF p_simulation_mode <> wms_engine_pvt.g_no_simulation THEN

3529: IF NOT(inv_cache.is_pickrelease AND g_debug IS NOT NULL) THEN
3530: g_debug := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
3531: END IF;
3532: l_debug := g_debug;
3533: IF p_simulation_mode <> wms_engine_pvt.g_no_simulation THEN
3534: l_return_value := TRUE;
3535: ELSIF p_simulation_mode = wms_engine_pvt.g_no_simulation THEN
3536: if l_debug = 1 THEN
3537: l_return_value := TRUE;

Line 3535: ELSIF p_simulation_mode = wms_engine_pvt.g_no_simulation THEN

3531: END IF;
3532: l_debug := g_debug;
3533: IF p_simulation_mode <> wms_engine_pvt.g_no_simulation THEN
3534: l_return_value := TRUE;
3535: ELSIF p_simulation_mode = wms_engine_pvt.g_no_simulation THEN
3536: if l_debug = 1 THEN
3537: l_return_value := TRUE;
3538: ELSE
3539: l_return_value := FALSE;

Line 3709: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PICK_NO_ROWS' ;

3705: x_consist_string := NULL;
3706: x_order_by_string := NULL;
3707:
3708:
3709: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PICK_NO_ROWS' ;
3710:
3711: IF l_debug = 1 THEN
3712: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3713: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);

Line 3713: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);

3709: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PICK_NO_ROWS' ;
3710:
3711: IF l_debug = 1 THEN
3712: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3713: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);
3714: END IF;
3715:
3716: END IF;
3717:

Line 3852: --WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';

3848: x_project_id := NULL;
3849: x_task_id := NULL;
3850:
3851: -- Bug # 3185073
3852: --WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3853:
3854: IF l_debug = 1 THEN
3855: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3856: END IF;

Line 3858: IF ( WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = 'WMS_PICK_NO_ROWS' or

3854: IF l_debug = 1 THEN
3855: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3856: END IF;
3857:
3858: IF ( WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = 'WMS_PICK_NO_ROWS' or
3859: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = NULL) then
3860:
3861: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3862: END IF;

Line 3859: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = NULL) then

3855: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || p_rule_id);
3856: END IF;
3857:
3858: IF ( WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = 'WMS_PICK_NO_ROWS' or
3859: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = NULL) then
3860:
3861: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3862: END IF;
3863:

Line 3861: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';

3857:
3858: IF ( WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = 'WMS_PICK_NO_ROWS' or
3859: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE = NULL) then
3860:
3861: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3862: END IF;
3863:
3864: IF l_debug = 1 THEN
3865: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);

Line 3865: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);

3861: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
3862: END IF;
3863:
3864: IF l_debug = 1 THEN
3865: log_event(l_api_name, 'no_rows_found', 'No more rows for rule ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);
3866: END IF;
3867:
3868: END IF;
3869: --x_rows := l_rows;

Line 4065: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;

4061: WHEN INVALID_PKG_STATE THEN
4062: x_result := 0;
4063: wms_rule_pvt.g_rule_list_pick_ctr := wms_rule_gen_pkgs.get_count_no_lock('PICK');
4064:
4065: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
4066: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
4067: fnd_message.set_token('LIST_PKG', l_list_pkg);
4068: fnd_message.set_token('RULE_NAME', l_package_name);
4069: fnd_msg_pub.ADD;

Line 4182: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;

4178: WHEN INVALID_PKG_STATE THEN
4179: x_result := 0;
4180: wms_rule_pvt.g_rule_list_put_ctr := wms_rule_gen_pkgs.get_count_no_lock('PUTAWAY');
4181:
4182: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
4183: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
4184: fnd_message.set_token('LIST_PKG', l_list_pkg);
4185: fnd_message.set_token('RULE_NAME', l_package_name);
4186: fnd_msg_pub.ADD;

Line 4233: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;

4229: WHEN INVALID_PKG_STATE THEN
4230: --x_return_status := 0;
4231: x_return_status := -1 ;
4232: wms_rule_pvt.g_rule_list_op_ctr := wms_rule_gen_pkgs.get_count_no_lock('OPERATION_PLAN');
4233: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
4234: x_return_status := fnd_api.g_ret_sts_unexp_error;
4235: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
4236: fnd_message.set_token('LIST_PKG', l_list_pkg);
4237: fnd_message.set_token('RULE_NAME', l_package_name);

Line 4283: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;

4279: WHEN INVALID_PKG_STATE THEN
4280: --x_return_status := 0;
4281: x_return_status := -1 ;
4282: wms_rule_pvt.g_rule_list_task_ctr := wms_rule_gen_pkgs.get_count_no_lock('TASK');
4283: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
4284: x_return_status := fnd_api.g_ret_sts_unexp_error;
4285: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
4286: fnd_message.set_token('LIST_PKG', l_list_pkg);
4287: fnd_message.set_token('RULE_NAME', l_package_name);

Line 4336: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;

4332: WHEN INVALID_PKG_STATE THEN
4333: --x_return_status := 0;
4334: x_return_status := -1 ;
4335: wms_rule_pvt.g_rule_list_label_ctr := wms_rule_gen_pkgs.get_count_no_lock('LABEL');
4336: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
4337: x_return_status := fnd_api.g_ret_sts_unexp_error;
4338: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
4339: fnd_message.set_token('LIST_PKG', l_list_pkg);
4340: fnd_message.set_token('RULE_NAME', l_package_name);

Line 4379: /* -- WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;

4375: END IF;
4376:
4377: EXCEPTION
4378: WHEN INVALID_PKG_STATE THEN
4379: /* -- WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
4380: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
4381: fnd_message.set_token('LIST_PKG', l_list_pkg);
4382: fnd_message.set_token('RULE_NAME', l_package_name);
4383: fnd_msg_pub.ADD;

Line 4416: /*WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;

4412: END IF;
4413:
4414: EXCEPTION
4415: WHEN INVALID_PKG_STATE THEN
4416: /*WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'Invalid Package, Contact your DBA - '|| l_list_pkg || ' / ' || l_package_name;
4417: fnd_message.set_name('WMS', 'WMS_INVALID_PKG');
4418: fnd_message.set_token('LIST_PKG', l_list_pkg);
4419: fnd_message.set_token('RULE_NAME', l_package_name);
4420: fnd_msg_pub.ADD;

Line 4781: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

4777:
4778: --
4779: -- If alternate qty requested is 0 or -ve, recalculate it from fulfillment UOM qty.
4780: --
4781: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
4782: THEN
4783: IF(l_allocate_lot_flag = 'N') THEN
4784: l_pri_conv_qty := inv_convert.inv_um_convert(
4785: item_id => p_inventory_item_id

Line 4825: ELSIF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_sec_quantity <= 0

4821: IF l_sec_uom_class <> l_pick_uom_class THEN
4822: l_use_pick_uom := FALSE;
4823: END IF;
4824: END IF;
4825: ELSIF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_sec_quantity <= 0
4826: THEN
4827: l_needed_sec_quantity := inv_convert.inv_um_convert(
4828: item_id => p_inventory_item_id
4829: , lot_number => g_locs(p_record_id).lot_number

Line 4866: IF ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')

4862: log_statement(l_api_name, 'validate and insert', 'g_lpns(g_locs(p_record_id).lpn_id).secondary_total_quantity: '
4863: || g_lpns(g_locs(p_record_id).lpn_id).secondary_total_quantity);
4864: END IF;
4865:
4866: IF ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')
4867: AND (g_lpns(g_locs(p_record_id).lpn_id).total_quantity
4868: = g_lpns(g_locs(p_record_id).lpn_id).quantity) )
4869: OR
4870: ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')

Line 4870: ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')

4866: IF ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')
4867: AND (g_lpns(g_locs(p_record_id).lpn_id).total_quantity
4868: = g_lpns(g_locs(p_record_id).lpn_id).quantity) )
4869: OR
4870: ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')
4871: AND (g_lpns(g_locs(p_record_id).lpn_id).secondary_total_quantity
4872: = g_lpns(g_locs(p_record_id).lpn_id).secondary_quantity) ) )
4873: THEN
4874: l_entire_lpn_alloc := 'Y';

Line 4934: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

4930: END IF;
4931:
4932: -- End changes for 14699845 (Flexible lot allocation)
4933:
4934: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
4935: THEN --{ secondary based allocation
4936: -- Adjust primary based on lot conversion, reservation, etc.
4937: IF g_alloc_qty.EXISTS(p_reservation_id) THEN
4938: l_rsv_id := p_reservation_id;

Line 5147: IF wms_engine_pvt.g_sec_qty_round_mode IS NOT NULL THEN --{

5143: IF (l_dual_uom_ctl > 1 AND inv_cache.item_rec.tracking_quantity_ind = 'PS') --{
5144: -- Bug 7587155 - item could be PS but not lot controlled!
5145: -- and nvl(g_locs(p_record_id).lot_number,'-9999') <> '-9999'
5146: THEN
5147: IF wms_engine_pvt.g_sec_qty_round_mode IS NOT NULL THEN --{
5148: IF l_allocation_quantity <= g_locs(p_record_id).quantity THEN --{
5149:
5150: IF (l_lot_control_code = 2 AND l_lot_conv_factor_flag > 0 ) THEN --{
5151: l_lot_sallocation_quantity := inv_convert.inv_um_convert(

Line 5179: IF wms_engine_pvt.g_sec_qty_round_mode = 'R' THEN

5175: RAISE FND_API.G_EXC_ERROR;
5176: END IF;
5177: END IF; --}
5178:
5179: IF wms_engine_pvt.g_sec_qty_round_mode = 'R' THEN
5180: l_sallocation_quantity := ROUND(l_sallocation_quantity);
5181: ELSIF wms_engine_pvt.g_sec_qty_round_mode = 'F' THEN
5182: l_sallocation_quantity := FLOOR(l_sallocation_quantity);
5183: ELSIF wms_engine_pvt.g_sec_qty_round_mode = 'C' THEN

Line 5181: ELSIF wms_engine_pvt.g_sec_qty_round_mode = 'F' THEN

5177: END IF; --}
5178:
5179: IF wms_engine_pvt.g_sec_qty_round_mode = 'R' THEN
5180: l_sallocation_quantity := ROUND(l_sallocation_quantity);
5181: ELSIF wms_engine_pvt.g_sec_qty_round_mode = 'F' THEN
5182: l_sallocation_quantity := FLOOR(l_sallocation_quantity);
5183: ELSIF wms_engine_pvt.g_sec_qty_round_mode = 'C' THEN
5184: l_sallocation_quantity := CEIL(l_sallocation_quantity);
5185: END IF;

Line 5183: ELSIF wms_engine_pvt.g_sec_qty_round_mode = 'C' THEN

5179: IF wms_engine_pvt.g_sec_qty_round_mode = 'R' THEN
5180: l_sallocation_quantity := ROUND(l_sallocation_quantity);
5181: ELSIF wms_engine_pvt.g_sec_qty_round_mode = 'F' THEN
5182: l_sallocation_quantity := FLOOR(l_sallocation_quantity);
5183: ELSIF wms_engine_pvt.g_sec_qty_round_mode = 'C' THEN
5184: l_sallocation_quantity := CEIL(l_sallocation_quantity);
5185: END IF;
5186:
5187: IF l_sallocation_quantity <= 0 THEN

Line 5454: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level

5450: log_statement(l_api_name, 'g_locs(p_record_id).secondary_quantity ', g_locs(p_record_id).secondary_quantity);
5451: END IF;
5452:
5453: /* bug 3972784, remove locator_id if no locator control */
5454: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
5455: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
5456: OR (wms_engine_pvt.g_sub_loc_control = 5
5457: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
5458: )

Line 5455: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level

5451: END IF;
5452:
5453: /* bug 3972784, remove locator_id if no locator control */
5454: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
5455: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
5456: OR (wms_engine_pvt.g_sub_loc_control = 5
5457: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
5458: )
5459: )

Line 5456: OR (wms_engine_pvt.g_sub_loc_control = 5

5452:
5453: /* bug 3972784, remove locator_id if no locator control */
5454: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
5455: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
5456: OR (wms_engine_pvt.g_sub_loc_control = 5
5457: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
5458: )
5459: )
5460: )

Line 5457: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level

5453: /* bug 3972784, remove locator_id if no locator control */
5454: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
5455: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
5456: OR (wms_engine_pvt.g_sub_loc_control = 5
5457: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
5458: )
5459: )
5460: )
5461: THEN

Line 5467: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

5463: log_statement(l_api_name, 'non locator controled',' Non locator controled');
5464: END IF;
5465:
5466: IF l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1
5467: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5468: AND g_locs(p_record_id).quantity <= l_allocation_quantity)
5469: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5470: AND g_locs(p_record_id).secondary_quantity <= l_sallocation_quantity)
5471: )

Line 5469: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

5465:
5466: IF l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1
5467: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5468: AND g_locs(p_record_id).quantity <= l_allocation_quantity)
5469: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5470: AND g_locs(p_record_id).secondary_quantity <= l_sallocation_quantity)
5471: )
5472: THEN -- lot ctl and indivisible
5473: l_allocation_quantity := g_locs(p_record_id).quantity;

Line 5477: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

5473: l_allocation_quantity := g_locs(p_record_id).quantity;
5474: l_sallocation_quantity := g_locs(p_record_id).secondary_quantity;
5475:
5476: -- Added for 14699845 (Flexible lot allocation)
5477: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
5478: IF l_entire_lpn_alloc = 'Y' THEN
5479: l_orig_needed_quantity := g_locs(p_record_id).quantity;
5480: ELSIF (l_orig_needed_sec_qty > 0
5481: AND l_orig_needed_sec_qty <> p_needed_sec_quantity

Line 5497: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

5493: l_orig_needed_sec_qty := LEAST(l_orig_needed_sec_qty, g_locs(p_record_id).secondary_quantity);
5494: END IF;
5495: END IF;
5496: ELSE
5497: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5498: AND l_allocation_quantity > g_locs(p_record_id).quantity)
5499: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5500: AND l_sallocation_quantity >= g_locs(p_record_id).secondary_quantity)
5501: OR l_entire_lpn_alloc = 'Y'

Line 5499: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

5495: END IF;
5496: ELSE
5497: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5498: AND l_allocation_quantity > g_locs(p_record_id).quantity)
5499: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5500: AND l_sallocation_quantity >= g_locs(p_record_id).secondary_quantity)
5501: OR l_entire_lpn_alloc = 'Y'
5502: )
5503: THEN

Line 5504: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

5500: AND l_sallocation_quantity >= g_locs(p_record_id).secondary_quantity)
5501: OR l_entire_lpn_alloc = 'Y'
5502: )
5503: THEN
5504: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
5505: l_sallocation_quantity := g_locs(p_record_id).secondary_quantity;
5506: l_pri_conv_qty := inv_convert.inv_um_convert(
5507: item_id => p_inventory_item_id
5508: , lot_number => g_locs(p_record_id).lot_number

Line 5677: ELSIF wms_engine_pvt.g_sec_qty_round_mode IS NOT NULL

5673: l_satt := (l_satt/l_att) * l_floored_att;
5674: l_satt := ROUND(l_satt,5);
5675: END IF;
5676: l_att := l_floored_att;
5677: ELSIF wms_engine_pvt.g_sec_qty_round_mode IS NOT NULL
5678: AND NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5679: THEN
5680: l_floored_satt := FLOOR(l_satt);
5681: -- Scale the primary quantity

Line 5678: AND NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

5674: l_satt := ROUND(l_satt,5);
5675: END IF;
5676: l_att := l_floored_att;
5677: ELSIF wms_engine_pvt.g_sec_qty_round_mode IS NOT NULL
5678: AND NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5679: THEN
5680: l_floored_satt := FLOOR(l_satt);
5681: -- Scale the primary quantity
5682: IF inv_cache.item_rec.secondary_default_ind = 'F'

Line 5706: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

5702: -- The pre suggestions record will be skipped, if any of the above condition is false
5703: -- and fetch the next rec
5704: -- ]
5705: IF l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1
5706: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5707: AND g_locs(p_record_id).quantity <= l_allocation_quantity)
5708: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5709: AND g_locs(p_record_id).secondary_quantity <= l_sallocation_quantity)
5710: )

Line 5708: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

5704: -- ]
5705: IF l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1
5706: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5707: AND g_locs(p_record_id).quantity <= l_allocation_quantity)
5708: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5709: AND g_locs(p_record_id).secondary_quantity <= l_sallocation_quantity)
5710: )
5711: THEN
5712: --

Line 5716: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

5712: --
5713: -- lot ctl and indivisible
5714: -- For allocation based on secondary, do not allow primary to go -ve
5715: --
5716: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5717: AND l_att = g_locs(p_record_id).quantity AND l_qoh = l_att)
5718: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5719: AND l_satt = g_locs(p_record_id).secondary_quantity AND l_sqoh = l_satt AND l_att > 0)
5720: )

Line 5718: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

5714: -- For allocation based on secondary, do not allow primary to go -ve
5715: --
5716: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5717: AND l_att = g_locs(p_record_id).quantity AND l_qoh = l_att)
5718: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5719: AND l_satt = g_locs(p_record_id).secondary_quantity AND l_sqoh = l_satt AND l_att > 0)
5720: )
5721: THEN
5722: l_indiv_lot_allowed := 'Y';

Line 5737: IF ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

5733: -- update record quantity
5734: IF l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1 THEN --{ lot ctl and indivisible
5735: IF l_indiv_lot_allowed = 'Y' THEN
5736: -- Start changes for 14699845 (Flexible lot allocation)
5737: IF ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5738: AND l_orig_needed_quantity > 0 AND l_orig_needed_quantity <> p_needed_quantity)
5739: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5740: AND l_orig_needed_sec_qty > 0 AND l_orig_needed_sec_qty <> p_needed_sec_quantity)
5741: )

Line 5739: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

5735: IF l_indiv_lot_allowed = 'Y' THEN
5736: -- Start changes for 14699845 (Flexible lot allocation)
5737: IF ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5738: AND l_orig_needed_quantity > 0 AND l_orig_needed_quantity <> p_needed_quantity)
5739: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
5740: AND l_orig_needed_sec_qty > 0 AND l_orig_needed_sec_qty <> p_needed_sec_quantity)
5741: )
5742: AND l_allocate_lot_flag = 'N')
5743: THEN

Line 5749: ELSIF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_orig_needed_sec_qty > 0

5745: g_locs(p_record_id).secondary_quantity := LEAST(l_satt, l_orig_needed_sec_qty);
5746: -- update possible allocate quantity
5747: l_allocation_quantity := LEAST(l_att, l_orig_needed_quantity);
5748: l_sallocation_quantity := LEAST(l_satt, l_orig_needed_sec_qty);
5749: ELSIF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_orig_needed_sec_qty > 0
5750: AND l_allocate_lot_flag = 'N')
5751: THEN
5752: g_locs(p_record_id).quantity := l_att;
5753: g_locs(p_record_id).secondary_quantity := LEAST(l_satt, l_orig_needed_sec_qty);

Line 5757: ELSIF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_orig_needed_quantity > 0

5753: g_locs(p_record_id).secondary_quantity := LEAST(l_satt, l_orig_needed_sec_qty);
5754: -- update possible allocate quantity
5755: l_allocation_quantity := l_att;
5756: l_sallocation_quantity := LEAST(l_satt, l_orig_needed_sec_qty);
5757: ELSIF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_orig_needed_quantity > 0
5758: AND l_allocate_lot_flag = 'N')
5759: THEN
5760: g_locs(p_record_id).quantity := LEAST(l_att, l_orig_needed_quantity);
5761: g_locs(p_record_id).secondary_quantity := l_satt;

Line 5786: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att < g_locs(p_record_id).quantity)

5782: log_statement(l_api_name, 'Lot Indiv', 'New possible sec qty: ' || l_sallocation_quantity);
5783: END IF;
5784: --}
5785: ELSE --{
5786: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att < g_locs(p_record_id).quantity)
5787: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND ( (l_satt < g_locs(p_record_id).secondary_quantity)
5788: OR (l_att < g_locs(p_record_id).quantity) ) )
5789: )
5790: THEN

Line 5787: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND ( (l_satt < g_locs(p_record_id).secondary_quantity)

5783: END IF;
5784: --}
5785: ELSE --{
5786: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att < g_locs(p_record_id).quantity)
5787: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND ( (l_satt < g_locs(p_record_id).secondary_quantity)
5788: OR (l_att < g_locs(p_record_id).quantity) ) )
5789: )
5790: THEN
5791: g_locs(p_record_id).quantity := l_att;

Line 5798: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

5794: END IF;
5795: -- update possible allocate quantity
5796: IF ( (l_att < l_allocation_quantity) OR (l_satt < l_sallocation_quantity) )
5797: THEN --{
5798: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5799: AND wms_engine_pvt.g_sec_qty_round_mode IS NOT NULL
5800: THEN --{
5801: l_sallocation_quantity := inv_convert.inv_um_convert(
5802: item_id => p_inventory_item_id

Line 5799: AND wms_engine_pvt.g_sec_qty_round_mode IS NOT NULL

5795: -- update possible allocate quantity
5796: IF ( (l_att < l_allocation_quantity) OR (l_satt < l_sallocation_quantity) )
5797: THEN --{
5798: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
5799: AND wms_engine_pvt.g_sec_qty_round_mode IS NOT NULL
5800: THEN --{
5801: l_sallocation_quantity := inv_convert.inv_um_convert(
5802: item_id => p_inventory_item_id
5803: , lot_number => (CASE WHEN l_lot_conv_factor_flag = 0 THEN

Line 5879: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocation_quantity > 0)

5875: log_statement(l_api_name, 'tree_qty', 'New possible sec qty: ' || g_locs(p_record_id).secondary_quantity);
5876: END IF;
5877:
5878: /*Bug13361151 -Added following custom hook call for customer to validate the LPN being picked.*/
5879: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocation_quantity > 0)
5880: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sallocation_quantity > 0 AND l_allocation_quantity > 0)
5881: )
5882: AND p_type_code = 2 AND NVL(g_locs(p_record_id).lpn_id,0) > 0
5883: THEN --{

Line 5880: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sallocation_quantity > 0 AND l_allocation_quantity > 0)

5876: END IF;
5877:
5878: /*Bug13361151 -Added following custom hook call for customer to validate the LPN being picked.*/
5879: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocation_quantity > 0)
5880: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sallocation_quantity > 0 AND l_allocation_quantity > 0)
5881: )
5882: AND p_type_code = 2 AND NVL(g_locs(p_record_id).lpn_id,0) > 0
5883: THEN --{
5884: l_already_allocated_pri_qty := 0;

Line 5949: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocation_quantity <= 0)

5945: END IF;
5946: END IF; --} End of 13361151
5947:
5948: -- if no available quantity, return
5949: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocation_quantity <= 0)
5950: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sallocation_quantity <= 0 OR l_allocation_quantity <= 0))
5951: THEN
5952: -- if reading from table, go to next record
5953: IF l_debug = 1 THEN

Line 5950: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sallocation_quantity <= 0 OR l_allocation_quantity <= 0))

5946: END IF; --} End of 13361151
5947:
5948: -- if no available quantity, return
5949: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocation_quantity <= 0)
5950: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sallocation_quantity <= 0 OR l_allocation_quantity <= 0))
5951: THEN
5952: -- if reading from table, go to next record
5953: IF l_debug = 1 THEN
5954: log_event(l_api_name, 'zero_tree_qty', 'Available quantity ' || 'returned from quantity tree is zero');

Line 6038: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND g_locs(p_record_id).uom_code <> p_primary_uom)

6034: l_sorig_allocation_quantity := l_sallocation_quantity;
6035:
6036: IF l_use_pick_uom
6037: AND g_locs(p_record_id).uom_code IS NOT NULL
6038: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND g_locs(p_record_id).uom_code <> p_primary_uom)
6039: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND g_locs(p_record_id).uom_code <> p_secondary_uom) )
6040: THEN --{
6041: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN --{
6042: -- convert from secondary uom to pick uom

Line 6039: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND g_locs(p_record_id).uom_code <> p_secondary_uom) )

6035:
6036: IF l_use_pick_uom
6037: AND g_locs(p_record_id).uom_code IS NOT NULL
6038: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND g_locs(p_record_id).uom_code <> p_primary_uom)
6039: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND g_locs(p_record_id).uom_code <> p_secondary_uom) )
6040: THEN --{
6041: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN --{
6042: -- convert from secondary uom to pick uom
6043: l_possible_uom_qty := inv_convert.inv_um_convert(

Line 6041: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN --{

6037: AND g_locs(p_record_id).uom_code IS NOT NULL
6038: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND g_locs(p_record_id).uom_code <> p_primary_uom)
6039: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND g_locs(p_record_id).uom_code <> p_secondary_uom) )
6040: THEN --{
6041: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN --{
6042: -- convert from secondary uom to pick uom
6043: l_possible_uom_qty := inv_convert.inv_um_convert(
6044: item_id => p_inventory_item_id
6045: , lot_number => (CASE WHEN l_lot_conv_factor_flag = 0 THEN

Line 6098: IF (wms_engine_pvt.g_sec_qty_round_mode IS NULL

6094: ELSE --{
6095: -- fulfillment base is primary
6096: -- convert from primary uom to pick uom
6097: -- 8809951 calling uom_convert from wms_cache
6098: IF (wms_engine_pvt.g_sec_qty_round_mode IS NULL
6099: OR (g_locs(p_record_id).uom_code <> p_secondary_uom))
6100: THEN --{
6101: l_possible_uom_qty := inv_convert.inv_um_convert(
6102: item_id => p_inventory_item_id

Line 6164: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocation_quantity <= 0)

6160: log_statement(l_api_name, 'rem_qty', 'remaining quantity : ' || x_remaining_quantity);
6161: log_statement(l_api_name, 'rem_qty', 'remaining sec qty : ' || x_sec_remaining_quantity);
6162: END IF;
6163:
6164: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocation_quantity <= 0)
6165: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sallocation_quantity <= 0)
6166: THEN
6167: IF l_debug = 1 THEN
6168: log_statement(l_api_name, 'no_alloc_qty', 'Quantity remaining to allocate. Exiting.');

Line 6165: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sallocation_quantity <= 0)

6161: log_statement(l_api_name, 'rem_qty', 'remaining sec qty : ' || x_sec_remaining_quantity);
6162: END IF;
6163:
6164: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocation_quantity <= 0)
6165: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sallocation_quantity <= 0)
6166: THEN
6167: IF l_debug = 1 THEN
6168: log_statement(l_api_name, 'no_alloc_qty', 'Quantity remaining to allocate. Exiting.');
6169: END IF;

Line 6265: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

6261: l_possible_trx_qty := l_allocation_quantity;
6262: ELSIF p_transaction_uom = p_secondary_uom THEN
6263: l_possible_trx_qty := l_sallocation_quantity;
6264: ELSE
6265: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
6266: l_possible_trx_qty := inv_convert.inv_um_convert(
6267: item_id => p_inventory_item_id
6268: , lot_number => (CASE WHEN l_lot_conv_factor_flag = 0 THEN
6269: NULL

Line 6307: OR p_simulation_mode = wms_engine_pvt.g_no_simulation

6303:
6304: -- Added for 14699845 (Flexible lot allocation)
6305: IF l_allocate_lot_flag = 'Y'
6306: OR l_lot_control_code = 1
6307: OR p_simulation_mode = wms_engine_pvt.g_no_simulation
6308: THEN
6309: -- insert temporary suggestion
6310: INSERT INTO wms_transactions_temp
6311: ( pp_transaction_temp_id

Line 6558: , p_simulation_mode => wms_engine_pvt.g_no_simulation

6554: , p_secondary_uom => p_secondary_uom
6555: , p_grade_code => p_grade_code
6556: , p_orig_needed_quantity => p_needed_quantity
6557: , p_orig_needed_sec_qty => p_needed_sec_quantity
6558: , p_simulation_mode => wms_engine_pvt.g_no_simulation
6559: , x_inserted_record => x_inserted_record
6560: , x_allocated_quantity => x_allocated_quantity
6561: , x_remaining_quantity => x_remaining_quantity
6562: , x_sec_allocated_quantity => x_sec_allocated_quantity

Line 7381: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity_wo_tol < l_expected_quantity)

7377: l_expected_quantity := g_locs(l_uom_loc_id).quantity;
7378: l_sec_expected_quantity := g_locs(l_uom_loc_id).secondary_quantity;
7379:
7380: -- validate_and_insert will allocation no more than needed quantity
7381: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity_wo_tol < l_expected_quantity)
7382: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_needed_sec_qty_wo_tol < l_sec_expected_quantity)
7383: THEN
7384: l_expected_quantity := l_needed_quantity;
7385: l_sec_expected_quantity := l_sec_needed_quantity;

Line 7382: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_needed_sec_qty_wo_tol < l_sec_expected_quantity)

7378: l_sec_expected_quantity := g_locs(l_uom_loc_id).secondary_quantity;
7379:
7380: -- validate_and_insert will allocation no more than needed quantity
7381: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity_wo_tol < l_expected_quantity)
7382: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_needed_sec_qty_wo_tol < l_sec_expected_quantity)
7383: THEN
7384: l_expected_quantity := l_needed_quantity;
7385: l_sec_expected_quantity := l_sec_needed_quantity;
7386: END IF;

Line 7440: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_expected_quantity > l_allocated_quantity)

7436: RAISE fnd_api.g_exc_error;
7437: END IF;
7438:
7439: -- If function did not insert full quantity, decrease group qty
7440: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_expected_quantity > l_allocated_quantity)
7441: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_expected_quantity > l_sec_allocated_quantity)
7442: THEN --{
7443: IF l_debug = 1 THEN
7444: log_statement(l_api_name, 'did_not_alloc_full', 'Not all of the expected quantity was allocated');

Line 7441: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_expected_quantity > l_sec_allocated_quantity)

7437: END IF;
7438:
7439: -- If function did not insert full quantity, decrease group qty
7440: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_expected_quantity > l_allocated_quantity)
7441: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_expected_quantity > l_sec_allocated_quantity)
7442: THEN --{
7443: IF l_debug = 1 THEN
7444: log_statement(l_api_name, 'did_not_alloc_full', 'Not all of the expected quantity was allocated');
7445: END IF;

Line 7458: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

7454: g_locs(l_uom_loc_id).quantity := l_allocated_quantity;
7455: g_locs(l_uom_loc_id).secondary_quantity := l_sec_allocated_quantity;
7456:
7457: -- If group qty is now less than needed qty, rollback and return
7458: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
7459: AND g_consists(p_group_id).quantity < l_original_needed_quantity)
7460: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
7461: AND g_consists(p_group_id).secondary_quantity < l_original_needed_sec_qty)
7462: THEN --{

Line 7460: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

7456:
7457: -- If group qty is now less than needed qty, rollback and return
7458: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
7459: AND g_consists(p_group_id).quantity < l_original_needed_quantity)
7460: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
7461: AND g_consists(p_group_id).secondary_quantity < l_original_needed_sec_qty)
7462: THEN --{
7463: IF l_debug = 1 THEN
7464: log_statement(l_api_name, 'rollback_consist', 'Not enough quantity in consist group. Calling '

Line 7514: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND (l_needed_quantity <= 0 OR l_needed_quantity_wo_tol <= 0))

7510: l_needed_quantity_wo_tol := l_needed_quantity_wo_tol - l_allocated_quantity;
7511: l_needed_sec_qty_wo_tol := l_needed_sec_qty_wo_tol - l_sec_allocated_quantity;
7512:
7513: -- if no qty left to detail, exit pick UOM loop
7514: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND (l_needed_quantity <= 0 OR l_needed_quantity_wo_tol <= 0))
7515: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sec_needed_quantity <= 0 OR l_needed_sec_qty_wo_tol <= 0))
7516: THEN
7517: IF l_debug = 1 THEN
7518: log_statement(l_api_name, 'no_more_qty', 'Allocated all the needed quantity. Exiting.');

Line 7515: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sec_needed_quantity <= 0 OR l_needed_sec_qty_wo_tol <= 0))

7511: l_needed_sec_qty_wo_tol := l_needed_sec_qty_wo_tol - l_sec_allocated_quantity;
7512:
7513: -- if no qty left to detail, exit pick UOM loop
7514: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND (l_needed_quantity <= 0 OR l_needed_quantity_wo_tol <= 0))
7515: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sec_needed_quantity <= 0 OR l_needed_sec_qty_wo_tol <= 0))
7516: THEN
7517: IF l_debug = 1 THEN
7518: log_statement(l_api_name, 'no_more_qty', 'Allocated all the needed quantity. Exiting.');
7519: END IF;

Line 7544: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity_wo_tol < l_expected_quantity)

7540: l_expected_quantity := g_locs(l_loc_id).quantity;
7541: l_sec_expected_quantity := g_locs(l_loc_id).secondary_quantity;
7542:
7543: -- validate_and_insert will allocate no more than needed quantity
7544: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity_wo_tol < l_expected_quantity)
7545: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_needed_sec_qty_wo_tol < l_sec_expected_quantity)
7546: THEN
7547: l_insert := 1; --bug# 8270806
7548: l_expected_quantity := l_needed_quantity_wo_tol;

Line 7545: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_needed_sec_qty_wo_tol < l_sec_expected_quantity)

7541: l_sec_expected_quantity := g_locs(l_loc_id).secondary_quantity;
7542:
7543: -- validate_and_insert will allocate no more than needed quantity
7544: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity_wo_tol < l_expected_quantity)
7545: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_needed_sec_qty_wo_tol < l_sec_expected_quantity)
7546: THEN
7547: l_insert := 1; --bug# 8270806
7548: l_expected_quantity := l_needed_quantity_wo_tol;
7549: l_sec_expected_quantity := l_needed_sec_qty_wo_tol;

Line 7567: IF ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity_wo_tol >= l_expected_quantity)

7563: log_statement(l_api_name, 'val_insert', 'Calling Validate and Insert');
7564: END IF;
7565:
7566: -- Added the following restriction - 5258131
7567: IF ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity_wo_tol >= l_expected_quantity)
7568: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_needed_sec_qty_wo_tol >= l_sec_expected_quantity)
7569: )
7570: AND l_insert = 0 AND p_lot_divisible_flag = 'N'
7571: )

Line 7568: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_needed_sec_qty_wo_tol >= l_sec_expected_quantity)

7564: END IF;
7565:
7566: -- Added the following restriction - 5258131
7567: IF ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity_wo_tol >= l_expected_quantity)
7568: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_needed_sec_qty_wo_tol >= l_sec_expected_quantity)
7569: )
7570: AND l_insert = 0 AND p_lot_divisible_flag = 'N'
7571: )
7572: OR ((NVL(p_lot_divisible_flag, 'Y') = 'Y') OR NVL(l_lot_control_code,1) = 1) -- added for bug7261861

Line 7621: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_expected_quantity > l_allocated_quantity)

7617: END IF;
7618: END IF; --} End of If 5258131
7619:
7620: -- If function did not insert full quantity, decrease group qty
7621: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_expected_quantity > l_allocated_quantity)
7622: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_expected_quantity > l_sec_allocated_quantity)
7623: THEN --{
7624: IF l_debug = 1 THEN
7625: log_statement(l_api_name, 'did_not_alloc_full', 'Not all of the expected quantity was allocated');

Line 7622: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_expected_quantity > l_sec_allocated_quantity)

7618: END IF; --} End of If 5258131
7619:
7620: -- If function did not insert full quantity, decrease group qty
7621: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_expected_quantity > l_allocated_quantity)
7622: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_expected_quantity > l_sec_allocated_quantity)
7623: THEN --{
7624: IF l_debug = 1 THEN
7625: log_statement(l_api_name, 'did_not_alloc_full', 'Not all of the expected quantity was allocated');
7626: END IF;

Line 7638: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

7634: g_locs(l_loc_id).quantity := l_allocated_quantity;
7635: g_locs(l_loc_id).secondary_quantity := l_sec_allocated_quantity;
7636:
7637: -- If group qty is now less than needed qty, rollback and return
7638: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
7639: AND g_consists(p_group_id).quantity < l_original_needed_quantity)
7640: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
7641: AND g_consists(p_group_id).secondary_quantity < l_original_needed_sec_qty)
7642: THEN --{

Line 7640: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

7636:
7637: -- If group qty is now less than needed qty, rollback and return
7638: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
7639: AND g_consists(p_group_id).quantity < l_original_needed_quantity)
7640: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
7641: AND g_consists(p_group_id).secondary_quantity < l_original_needed_sec_qty)
7642: THEN --{
7643: -- out of records with cur_consist_string;
7644: -- rollback the changes we've made

Line 7695: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND (l_needed_quantity <= 0 OR l_needed_quantity_wo_tol <= 0) )

7691: l_needed_quantity_wo_tol := l_needed_quantity_wo_tol - l_allocated_quantity;
7692: l_needed_sec_qty_wo_tol := l_needed_sec_qty_wo_tol - l_sec_allocated_quantity;
7693:
7694: -- if no qty left to detail, exit loop
7695: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND (l_needed_quantity <= 0 OR l_needed_quantity_wo_tol <= 0) )
7696: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sec_needed_quantity <= 0 OR l_needed_sec_qty_wo_tol <= 0) )
7697: THEN
7698: x_success := TRUE;
7699: IF l_debug = 1 THEN

Line 7696: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sec_needed_quantity <= 0 OR l_needed_sec_qty_wo_tol <= 0) )

7692: l_needed_sec_qty_wo_tol := l_needed_sec_qty_wo_tol - l_sec_allocated_quantity;
7693:
7694: -- if no qty left to detail, exit loop
7695: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND (l_needed_quantity <= 0 OR l_needed_quantity_wo_tol <= 0) )
7696: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sec_needed_quantity <= 0 OR l_needed_sec_qty_wo_tol <= 0) )
7697: THEN
7698: x_success := TRUE;
7699: IF l_debug = 1 THEN
7700: log_statement(l_api_name, 'no_more_qty', 'Allocated all the needed quantity. Exiting.');

Line 7713: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_remaining_quantity > 0)

7709: log_statement(l_api_name, 'need_qty', 'New needed quantity without tolerance: ' || l_needed_quantity_wo_tol);
7710: log_statement(l_api_name, 'need_qty', 'New needed sec qty without tolerance: ' || l_needed_sec_qty_wo_tol);
7711: END IF;
7712: -- handle pick UOM
7713: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_remaining_quantity > 0)
7714: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_remaining_quantity > 0)
7715: )
7716: AND p_use_pick_uom
7717: THEN --{

Line 7714: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_remaining_quantity > 0)

7710: log_statement(l_api_name, 'need_qty', 'New needed sec qty without tolerance: ' || l_needed_sec_qty_wo_tol);
7711: END IF;
7712: -- handle pick UOM
7713: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_remaining_quantity > 0)
7714: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_remaining_quantity > 0)
7715: )
7716: AND p_use_pick_uom
7717: THEN --{
7718: IF l_debug = 1 THEN

Line 7725: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_remaining_quantity < g_locs(l_loc_id).quantity)

7721: log_statement(l_api_name, 'create_pick_uom', 'Remaining sec qty:' || l_sec_remaining_quantity);
7722: END IF;
7723:
7724: -- create new record if necessary
7725: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_remaining_quantity < g_locs(l_loc_id).quantity)
7726: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_remaining_quantity < g_locs(l_loc_id).secondary_quantity)
7727: THEN
7728: g_locs_index := g_locs_index + 1;
7729: g_locs(g_locs_index) := g_locs(l_loc_id);

Line 7726: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_remaining_quantity < g_locs(l_loc_id).secondary_quantity)

7722: END IF;
7723:
7724: -- create new record if necessary
7725: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_remaining_quantity < g_locs(l_loc_id).quantity)
7726: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_remaining_quantity < g_locs(l_loc_id).secondary_quantity)
7727: THEN
7728: g_locs_index := g_locs_index + 1;
7729: g_locs(g_locs_index) := g_locs(l_loc_id);
7730: g_locs(g_locs_index).quantity := l_remaining_quantity;

Line 7804: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND (l_needed_quantity <= 0 OR l_needed_quantity_wo_tol <= 0) )

7800:
7801: l_loc_id := g_locs(l_loc_id).next_rec;
7802: END LOOP; --}
7803:
7804: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND (l_needed_quantity <= 0 OR l_needed_quantity_wo_tol <= 0) )
7805: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sec_needed_quantity <= 0 OR l_needed_sec_qty_wo_tol <= 0) )
7806: THEN
7807: x_success := TRUE;
7808: ELSE --{

Line 7805: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sec_needed_quantity <= 0 OR l_needed_sec_qty_wo_tol <= 0) )

7801: l_loc_id := g_locs(l_loc_id).next_rec;
7802: END LOOP; --}
7803:
7804: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND (l_needed_quantity <= 0 OR l_needed_quantity_wo_tol <= 0) )
7805: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND (l_sec_needed_quantity <= 0 OR l_needed_sec_qty_wo_tol <= 0) )
7806: THEN
7807: x_success := TRUE;
7808: ELSE --{
7809: -- some sort of error occurred in our calculations;

Line 7979: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

7975: IF l_debug = 1 THEN
7976: log_statement(l_api_name, 'pick_uom', 'Handle Pick UOM');
7977: END IF;
7978:
7979: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
7980: AND p_needed_quantity < g_locs(p_record_id).quantity)
7981: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
7982: AND p_needed_sec_quantity < g_locs(p_record_id).secondary_quantity)
7983: THEN

Line 7981: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

7977: END IF;
7978:
7979: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
7980: AND p_needed_quantity < g_locs(p_record_id).quantity)
7981: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
7982: AND p_needed_sec_quantity < g_locs(p_record_id).secondary_quantity)
7983: THEN
7984: l_possible_quantity := p_needed_quantity;
7985: l_sec_possible_quantity := p_needed_sec_quantity; -- bug 10228168

Line 7995: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_possible_quantity > l_needed_quantity)

7991: IF g_consists.EXISTS(l_cur_group) THEN
7992: l_needed_quantity := p_needed_quantity - g_consists(l_cur_group).quantity;
7993: l_sec_needed_quantity := p_needed_sec_quantity - g_consists(l_cur_group).secondary_quantity;
7994:
7995: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_possible_quantity > l_needed_quantity)
7996: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_possible_quantity > l_sec_needed_quantity)
7997: THEN
7998: l_possible_quantity := l_needed_quantity;
7999: l_sec_possible_quantity := l_sec_needed_quantity; -- bug 10228168

Line 7996: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_possible_quantity > l_sec_needed_quantity)

7992: l_needed_quantity := p_needed_quantity - g_consists(l_cur_group).quantity;
7993: l_sec_needed_quantity := p_needed_sec_quantity - g_consists(l_cur_group).secondary_quantity;
7994:
7995: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_possible_quantity > l_needed_quantity)
7996: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_possible_quantity > l_sec_needed_quantity)
7997: THEN
7998: l_possible_quantity := l_needed_quantity;
7999: l_sec_possible_quantity := l_sec_needed_quantity; -- bug 10228168
8000: END IF;

Line 8003: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN --{

7999: l_sec_possible_quantity := l_sec_needed_quantity; -- bug 10228168
8000: END IF;
8001: END IF;
8002:
8003: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN --{
8004: IF NVL(g_locs(p_record_id).uom_code, p_secondary_uom) <> p_secondary_uom THEN --{
8005: IF g_locs(p_record_id).uom_code = p_primary_uom THEN
8006: l_possible_uom_qty := l_possible_quantity;
8007: l_orig_poss_uom_qty := l_possible_uom_qty;

Line 8135: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_possible_quantity <= 0)

8131: log_statement(l_api_name, 'in else of p_use_pick_uom >> ', 'l_sec_possible_quantity: '||l_sec_possible_quantity);
8132: END IF;
8133: END IF;
8134:
8135: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_possible_quantity <= 0)
8136: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_possible_quantity <= 0)
8137: THEN
8138: x_finished := FALSE;
8139: RETURN;

Line 8136: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_possible_quantity <= 0)

8132: END IF;
8133: END IF;
8134:
8135: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_possible_quantity <= 0)
8136: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_possible_quantity <= 0)
8137: THEN
8138: x_finished := FALSE;
8139: RETURN;
8140: END IF;

Line 8184: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

8180: END IF;
8181:
8182: -- If group quantity >= needed qty and the consist group in the first
8183: -- set of records by sort criteria
8184: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
8185: AND g_consists(l_cur_group).quantity >= p_needed_quantity)
8186: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
8187: AND g_consists(l_cur_group).secondary_quantity >= p_needed_sec_quantity)
8188: ) AND g_consists(l_cur_group).order_by_rank = g_first_order_by_rank

Line 8186: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

8182: -- If group quantity >= needed qty and the consist group in the first
8183: -- set of records by sort criteria
8184: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
8185: AND g_consists(l_cur_group).quantity >= p_needed_quantity)
8186: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
8187: AND g_consists(l_cur_group).secondary_quantity >= p_needed_sec_quantity)
8188: ) AND g_consists(l_cur_group).order_by_rank = g_first_order_by_rank
8189: THEN --{
8190: IF l_debug = 1 THEN

Line 9126: log_statement(l_api_name, 'input_qty', 'WMS_Engine_PVT.g_move_order_type:' || WMS_Engine_PVT.g_move_order_type);

9122: log_statement(l_api_name, 'input_tcg', 'tcg:' || l_to_cost_group_id);
9123: log_statement(l_api_name, 'input_lpn', 'lpn:' || l_lpn_id);
9124: log_statement(l_api_name, 'input_qty', 'qty:' || l_needed_quantity);
9125: log_statement(l_api_name, 'input_sec_qty', 'sec_qty:' || l_sec_needed_quantity);
9126: log_statement(l_api_name, 'input_qty', 'WMS_Engine_PVT.g_move_order_type:' || WMS_Engine_PVT.g_move_order_type);
9127: log_statement(l_api_name, 'input_qty', 'WMS_Engine_PVT.g_wip_entity_type:' || WMS_Engine_PVT.g_wip_entity_type);
9128: -- Added for 14699845 (Flexible lot allocation)
9129: log_statement(l_api_name, 'input_qty', 'l_orig_needed_quantity: ' || l_orig_needed_quantity);
9130: log_statement(l_api_name, 'input_qty', 'l_orig_needed_sec_qty: ' || l_orig_needed_sec_qty);

Line 9127: log_statement(l_api_name, 'input_qty', 'WMS_Engine_PVT.g_wip_entity_type:' || WMS_Engine_PVT.g_wip_entity_type);

9123: log_statement(l_api_name, 'input_lpn', 'lpn:' || l_lpn_id);
9124: log_statement(l_api_name, 'input_qty', 'qty:' || l_needed_quantity);
9125: log_statement(l_api_name, 'input_sec_qty', 'sec_qty:' || l_sec_needed_quantity);
9126: log_statement(l_api_name, 'input_qty', 'WMS_Engine_PVT.g_move_order_type:' || WMS_Engine_PVT.g_move_order_type);
9127: log_statement(l_api_name, 'input_qty', 'WMS_Engine_PVT.g_wip_entity_type:' || WMS_Engine_PVT.g_wip_entity_type);
9128: -- Added for 14699845 (Flexible lot allocation)
9129: log_statement(l_api_name, 'input_qty', 'l_orig_needed_quantity: ' || l_orig_needed_quantity);
9130: log_statement(l_api_name, 'input_qty', 'l_orig_needed_sec_qty: ' || l_orig_needed_sec_qty);
9131: END IF;

Line 9139: AND WMS_Engine_PVT.g_move_order_type = 3

9135: -- If the tol qty is zero, then the l_needed qty remains unchanged. ]
9136: IF l_lot_divisible_flag = 'N'
9137: AND l_lot_control_code <> 1
9138: AND p_type_code = 2
9139: AND WMS_Engine_PVT.g_move_order_type = 3
9140: -- and l_reservation_id is null -- Commented code to account for manual reservations
9141: THEN
9142: l_max_tolerance := NVL(g_max_tolerance,0); -- Added NVL for Bug 13612884
9143: l_orig_needed_quantity := l_needed_quantity; -- Added for 14699845 (Flexible lot allocation)

Line 9145: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

9141: THEN
9142: l_max_tolerance := NVL(g_max_tolerance,0); -- Added NVL for Bug 13612884
9143: l_orig_needed_quantity := l_needed_quantity; -- Added for 14699845 (Flexible lot allocation)
9144: l_needed_quantity := l_needed_quantity + l_max_tolerance;
9145: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
9146: l_max_sec_tolerance := NVL(g_max_sec_tolerance,0);
9147: l_orig_needed_sec_qty := l_sec_needed_quantity; -- Added for 14699845 (Flexible lot allocation)
9148: l_sec_needed_quantity := l_sec_needed_quantity + l_max_sec_tolerance;
9149: END IF;

Line 9151: AND (WMS_Engine_PVT.g_move_order_type IN (2,3) --Added mover order type 2 for Over Allocation to be honored for replenishment type move orders bug#9656966

9147: l_orig_needed_sec_qty := l_sec_needed_quantity; -- Added for 14699845 (Flexible lot allocation)
9148: l_sec_needed_quantity := l_sec_needed_quantity + l_max_sec_tolerance;
9149: END IF;
9150: ELSIF p_type_code = 2
9151: AND (WMS_Engine_PVT.g_move_order_type IN (2,3) --Added mover order type 2 for Over Allocation to be honored for replenishment type move orders bug#9656966
9152: OR (WMS_Engine_PVT.g_move_order_type IN (5,8) AND WMS_Engine_PVT.g_wip_entity_type IN (9,10)) ) THEN --BUG14517947
9153: IF g_max_tolerance < 0 THEN
9154: l_max_tolerance := NVL(g_max_tolerance,0); -- Added NVL for Bug 13612884
9155: l_needed_quantity := l_needed_quantity + l_max_tolerance;

Line 9152: OR (WMS_Engine_PVT.g_move_order_type IN (5,8) AND WMS_Engine_PVT.g_wip_entity_type IN (9,10)) ) THEN --BUG14517947

9148: l_sec_needed_quantity := l_sec_needed_quantity + l_max_sec_tolerance;
9149: END IF;
9150: ELSIF p_type_code = 2
9151: AND (WMS_Engine_PVT.g_move_order_type IN (2,3) --Added mover order type 2 for Over Allocation to be honored for replenishment type move orders bug#9656966
9152: OR (WMS_Engine_PVT.g_move_order_type IN (5,8) AND WMS_Engine_PVT.g_wip_entity_type IN (9,10)) ) THEN --BUG14517947
9153: IF g_max_tolerance < 0 THEN
9154: l_max_tolerance := NVL(g_max_tolerance,0); -- Added NVL for Bug 13612884
9155: l_needed_quantity := l_needed_quantity + l_max_tolerance;
9156: ELSIF l_allocation_mode IN (1, 5) THEN

Line 9163: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

9159: ELSE
9160: l_max_tolerance := 0;
9161: END IF;
9162:
9163: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
9164: IF g_max_sec_tolerance < 0 THEN
9165: l_max_sec_tolerance := NVL(g_max_sec_tolerance,0);
9166: l_sec_needed_quantity := l_sec_needed_quantity + l_max_sec_tolerance;
9167: ELSIF l_allocation_mode IN (1, 5) THEN

Line 9176: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

9172: END IF;
9173: END IF;
9174: ELSE
9175: l_max_tolerance := 0;
9176: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
9177: l_max_sec_tolerance := 0;
9178: END IF;
9179: END IF;
9180:

Line 9195: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND wms_engine_pvt.g_transaction_action_id = 2) THEN

9191: -- always use the locator specified on the move order line, even
9192: -- if that locator is from common stock (not project)
9193: -- Bug 2666620: BackFlush MO Type Removed. It is now 5. Moreover Txn Action ID is 2 which is
9194: -- already handled.
9195: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND wms_engine_pvt.g_transaction_action_id = 2) THEN
9196: IF l_debug = 1 THEN
9197: log_statement(l_api_name, 'do_project1', 'Calling do project check');
9198: END IF;
9199: IF doprojectcheck(l_return_status, l_to_locator_id, p_project_id, p_task_id, l_to_locator_id, l_dummy_loc) THEN

Line 9210: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

9206: END IF;
9207:
9208: -- Save the initial input qty for later usage
9209: l_initial_pri_quantity := l_needed_quantity;
9210: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
9211: l_initial_sec_quantity := l_sec_needed_quantity;
9212: END IF;
9213:
9214: l_input_lpn_id := l_lpn_id;

Line 9311: IF (wms_engine_pvt.g_org_loc_control IN (2, 3) -- org level

9307: IF NVL(l_subinventory_code, '-9999') = '-9999' THEN
9308: l_reservation_is_detailed := 'N';
9309: END IF;
9310:
9311: IF (wms_engine_pvt.g_org_loc_control IN (2, 3) -- org level
9312: OR wms_engine_pvt.g_sub_loc_control IN (2, 3) -- sub level
9313: OR (wms_engine_pvt.g_sub_loc_control = 5 -- item level
9314: AND wms_engine_pvt.g_item_loc_control IN (2, 3)
9315: )

Line 9312: OR wms_engine_pvt.g_sub_loc_control IN (2, 3) -- sub level

9308: l_reservation_is_detailed := 'N';
9309: END IF;
9310:
9311: IF (wms_engine_pvt.g_org_loc_control IN (2, 3) -- org level
9312: OR wms_engine_pvt.g_sub_loc_control IN (2, 3) -- sub level
9313: OR (wms_engine_pvt.g_sub_loc_control = 5 -- item level
9314: AND wms_engine_pvt.g_item_loc_control IN (2, 3)
9315: )
9316: )

Line 9313: OR (wms_engine_pvt.g_sub_loc_control = 5 -- item level

9309: END IF;
9310:
9311: IF (wms_engine_pvt.g_org_loc_control IN (2, 3) -- org level
9312: OR wms_engine_pvt.g_sub_loc_control IN (2, 3) -- sub level
9313: OR (wms_engine_pvt.g_sub_loc_control = 5 -- item level
9314: AND wms_engine_pvt.g_item_loc_control IN (2, 3)
9315: )
9316: )
9317: THEN

Line 9314: AND wms_engine_pvt.g_item_loc_control IN (2, 3)

9310:
9311: IF (wms_engine_pvt.g_org_loc_control IN (2, 3) -- org level
9312: OR wms_engine_pvt.g_sub_loc_control IN (2, 3) -- sub level
9313: OR (wms_engine_pvt.g_sub_loc_control = 5 -- item level
9314: AND wms_engine_pvt.g_item_loc_control IN (2, 3)
9315: )
9316: )
9317: THEN
9318: IF l_debug = 1 THEN

Line 9882: OR WMS_Engine_PVT.g_move_order_type <> 3

9878: END IF;
9879: LOOP --{
9880: IF g_over_allocation = 'N'
9881: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
9882: OR WMS_Engine_PVT.g_move_order_type <> 3
9883: THEN
9884: EXIT WHEN ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')
9885: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
9886: )

Line 9884: EXIT WHEN ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')

9880: IF g_over_allocation = 'N'
9881: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
9882: OR WMS_Engine_PVT.g_move_order_type <> 3
9883: THEN
9884: EXIT WHEN ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')
9885: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
9886: )
9887: OR ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')
9888: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)

Line 9887: OR ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')

9883: THEN
9884: EXIT WHEN ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')
9885: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
9886: )
9887: OR ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')
9888: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
9889: )
9890: );
9891: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3

Line 9891: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3

9887: OR ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')
9888: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
9889: )
9890: );
9891: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
9892: THEN
9893: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
9894: IF l_max_sec_tolerance >= 0 THEN
9895: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)

Line 9893: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

9889: )
9890: );
9891: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
9892: THEN
9893: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
9894: IF l_max_sec_tolerance >= 0 THEN
9895: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
9896: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
9897: ELSE

Line 9912: IF ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

9908: END IF;
9909:
9910: EXIT WHEN l_cur_consist_group = 0;
9911:
9912: IF ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
9913: AND (g_consists(l_cur_consist_group).quantity
9914: BETWEEN (l_needed_quantity - l_max_tolerance) AND l_needed_quantity)
9915: )
9916: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

Line 9916: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

9912: IF ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
9913: AND (g_consists(l_cur_consist_group).quantity
9914: BETWEEN (l_needed_quantity - l_max_tolerance) AND l_needed_quantity)
9915: )
9916: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
9917: AND (g_consists(l_cur_consist_group).secondary_quantity
9918: BETWEEN (l_sec_needed_quantity - l_max_sec_tolerance) AND l_sec_needed_quantity)
9919: )
9920: )

Line 9941: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

9937: EXIT WHEN l_cur_lpn_rec = 0;
9938: g_trace_recs(l_cur_lpn_rec).entire_lpn_flag := 'Y';
9939: -- call validate and insert
9940: l_expected_quantity := g_locs(l_cur_lpn_rec).quantity;
9941: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
9942: l_sec_expected_quantity := g_locs(l_cur_lpn_rec).secondary_quantity;
9943: END IF;
9944:
9945: validate_and_insert(

Line 9992: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocated_quantity < l_expected_quantity)

9988: END IF;
9989:
9990: -- if returns false
9991: IF l_inserted_record = FALSE
9992: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocated_quantity < l_expected_quantity)
9993: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_allocated_quantity < l_sec_expected_quantity)
9994: THEN
9995: IF l_debug = 1 THEN
9996: log_statement(l_api_name, 'insert_failed', 'Record failed to allocation. Rolling back and '

Line 9993: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_allocated_quantity < l_sec_expected_quantity)

9989:
9990: -- if returns false
9991: IF l_inserted_record = FALSE
9992: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocated_quantity < l_expected_quantity)
9993: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_allocated_quantity < l_sec_expected_quantity)
9994: THEN
9995: IF l_debug = 1 THEN
9996: log_statement(l_api_name, 'insert_failed', 'Record failed to allocation. Rolling back and '
9997: || 'invalidating LPN');

Line 10024: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'THEN

10020: l_cur_rec := g_lpns(l_cur_lpn_group).first_rec;
10021: LOOP
10022: g_trace_recs(l_cur_rec).entire_lpn_flag := 'N';
10023: g_trace_recs(l_cur_rec).suggested_qty := 0;
10024: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'THEN
10025: g_trace_recs(l_cur_rec).secondary_qty := 0;
10026: END IF;
10027: EXIT WHEN l_cur_rec = l_cur_lpn_rec;
10028: l_cur_rec := g_locs(l_cur_rec).next_rec;

Line 10075: OR WMS_Engine_PVT.g_move_order_type <> 3

10071: END IF;
10072:
10073: IF g_over_allocation = 'N'
10074: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10075: OR WMS_Engine_PVT.g_move_order_type <> 3
10076: THEN
10077: EXIT WHEN ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')
10078: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10079: )

Line 10077: EXIT WHEN ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')

10073: IF g_over_allocation = 'N'
10074: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10075: OR WMS_Engine_PVT.g_move_order_type <> 3
10076: THEN
10077: EXIT WHEN ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')
10078: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10079: )
10080: OR ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')
10081: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)

Line 10080: OR ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')

10076: THEN
10077: EXIT WHEN ( ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P')
10078: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10079: )
10080: OR ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')
10081: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10082: )
10083: );
10084: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

Line 10084: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

10080: OR ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S')
10081: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10082: )
10083: );
10084: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
10085: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10086: IF l_max_sec_tolerance >= 0 THEN
10087: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
10088: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);

Line 10085: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

10081: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10082: )
10083: );
10084: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
10085: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10086: IF l_max_sec_tolerance >= 0 THEN
10087: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
10088: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
10089: ELSE

Line 10114: OR WMS_Engine_PVT.g_move_order_type <> 3

10110:
10111: -- if no more quantity needed, exit LPN loop
10112: IF g_over_allocation = 'N'
10113: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10114: OR WMS_Engine_PVT.g_move_order_type <> 3
10115: THEN
10116: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10117: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10118: )

Line 10116: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10112: IF g_over_allocation = 'N'
10113: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10114: OR WMS_Engine_PVT.g_move_order_type <> 3
10115: THEN
10116: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10117: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10118: )
10119: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10120: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)

Line 10119: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10115: THEN
10116: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10117: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10118: )
10119: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10120: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10121: )
10122: );
10123: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

Line 10123: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

10119: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10120: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10121: )
10122: );
10123: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
10124: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10125: IF l_max_sec_tolerance >= 0 THEN
10126: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
10127: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);

Line 10124: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

10120: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10121: )
10122: );
10123: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
10124: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10125: IF l_max_sec_tolerance >= 0 THEN
10126: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
10127: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
10128: ELSE

Line 10168: OR WMS_Engine_PVT.g_move_order_type <> 3

10164:
10165: LOOP --{
10166: IF g_over_allocation = 'N'
10167: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10168: OR WMS_Engine_PVT.g_move_order_type <> 3
10169: THEN
10170: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10171: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10172: )

Line 10170: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10166: IF g_over_allocation = 'N'
10167: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10168: OR WMS_Engine_PVT.g_move_order_type <> 3
10169: THEN
10170: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10171: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10172: )
10173: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10174: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)

Line 10173: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10169: THEN
10170: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10171: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10172: )
10173: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10174: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10175: )
10176: );
10177: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

Line 10177: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

10173: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10174: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10175: )
10176: );
10177: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
10178: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10179: IF l_max_sec_tolerance >= 0 THEN
10180: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
10181: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);

Line 10178: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

10174: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10175: )
10176: );
10177: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
10178: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10179: IF l_max_sec_tolerance >= 0 THEN
10180: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
10181: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
10182: ELSE

Line 10198: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10194: EXIT WHEN l_cur_lpn_group = 0;
10195:
10196: -- if lpn quantity is less than or equal to the needed quantity
10197: -- and the LPN has been entirely allocated, use it
10198: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10199: AND g_lpns(l_cur_lpn_group).quantity <= l_needed_quantity
10200: AND g_lpns(l_cur_lpn_group).total_quantity <> -1
10201: AND g_lpns(l_cur_lpn_group).quantity = g_lpns(l_cur_lpn_group).total_quantity
10202: )

Line 10204: (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10200: AND g_lpns(l_cur_lpn_group).total_quantity <> -1
10201: AND g_lpns(l_cur_lpn_group).quantity = g_lpns(l_cur_lpn_group).total_quantity
10202: )
10203: OR
10204: (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10205: AND g_lpns(l_cur_lpn_group).secondary_quantity <= l_sec_needed_quantity
10206: AND g_lpns(l_cur_lpn_group).secondary_total_quantity <> -1
10207: AND g_lpns(l_cur_lpn_group).secondary_quantity = g_lpns(l_cur_lpn_group).secondary_total_quantity
10208: )

Line 10222: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

10218: EXIT WHEN l_cur_lpn_rec = 0;
10219: g_trace_recs(l_cur_lpn_rec).entire_lpn_flag := 'Y';
10220: -- call validate and insert
10221: l_expected_quantity := g_locs(l_cur_lpn_rec).quantity;
10222: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10223: l_sec_expected_quantity := g_locs(l_cur_lpn_rec).secondary_quantity;
10224: END IF;
10225:
10226: validate_and_insert(

Line 10273: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocated_quantity < l_expected_quantity)

10269: END IF;
10270:
10271: -- if returns false
10272: IF l_inserted_record = FALSE
10273: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocated_quantity < l_expected_quantity)
10274: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_allocated_quantity < l_sec_expected_quantity)
10275: THEN --{
10276: IF l_debug = 1 THEN
10277: log_statement(l_api_name, 'insert_failed', 'Record failed to allocation. Rolling back and '

Line 10274: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_allocated_quantity < l_sec_expected_quantity)

10270:
10271: -- if returns false
10272: IF l_inserted_record = FALSE
10273: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_allocated_quantity < l_expected_quantity)
10274: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_allocated_quantity < l_sec_expected_quantity)
10275: THEN --{
10276: IF l_debug = 1 THEN
10277: log_statement(l_api_name, 'insert_failed', 'Record failed to allocation. Rolling back and '
10278: || 'invalidating LPN');

Line 10311: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

10307: l_cur_rec := g_lpns(l_cur_lpn_group).first_rec;
10308: LOOP
10309: g_trace_recs(l_cur_rec).entire_lpn_flag := 'N';
10310: g_trace_recs(l_cur_rec).suggested_qty := 0;
10311: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10312: g_trace_recs(l_cur_rec).secondary_qty := 0;
10313: END IF;
10314: EXIT WHEN l_cur_rec = l_cur_lpn_rec;
10315: l_cur_rec := g_locs(l_cur_rec).next_rec;

Line 10346: OR WMS_Engine_PVT.g_move_order_type <> 3

10342: END IF;
10343:
10344: IF g_over_allocation = 'N'
10345: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10346: OR WMS_Engine_PVT.g_move_order_type <> 3
10347: THEN
10348: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10349: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10350: )

Line 10348: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10344: IF g_over_allocation = 'N'
10345: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10346: OR WMS_Engine_PVT.g_move_order_type <> 3
10347: THEN
10348: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10349: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10350: )
10351: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10352: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)

Line 10351: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10347: THEN
10348: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10349: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10350: )
10351: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10352: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10353: )
10354: );
10355: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3

Line 10355: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3

10351: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10352: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10353: )
10354: );
10355: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
10356: THEN
10357: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10358: IF l_max_sec_tolerance >= 0 THEN
10359: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)

Line 10357: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

10353: )
10354: );
10355: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
10356: THEN
10357: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10358: IF l_max_sec_tolerance >= 0 THEN
10359: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
10360: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
10361: ELSE

Line 10382: OR WMS_Engine_PVT.g_move_order_type <> 3

10378: -- if no more quantity needed, exit LPN loop
10379: -- EXIT WHEN l_needed_quantity <= 0;
10380: IF g_over_allocation = 'N'
10381: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10382: OR WMS_Engine_PVT.g_move_order_type <> 3
10383: THEN
10384: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10385: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10386: )

Line 10384: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10380: IF g_over_allocation = 'N'
10381: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
10382: OR WMS_Engine_PVT.g_move_order_type <> 3
10383: THEN
10384: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10385: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10386: )
10387: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10388: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)

Line 10387: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10383: THEN
10384: EXIT WHEN ( ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10385: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance)
10386: )
10387: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10388: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10389: )
10390: );
10391: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3

Line 10391: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3

10387: OR ( NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10388: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance)
10389: )
10390: );
10391: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
10392: THEN
10393: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10394: IF l_max_sec_tolerance >= 0 THEN
10395: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)

Line 10393: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

10389: )
10390: );
10391: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
10392: THEN
10393: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10394: IF l_max_sec_tolerance >= 0 THEN
10395: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
10396: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
10397: ELSE

Line 10484: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND g_lpns(v_current_row.lpn_id).total_quantity < 0)

10480: log_statement(l_api_name, 'lpn_exists', 'This LPN group already exists');
10481: END IF;
10482: -- if lpn consist string is different than rec's consist string,
10483: -- this LPN will never be allocated entirely. Remove LPN from list.
10484: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND g_lpns(v_current_row.lpn_id).total_quantity < 0)
10485: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND g_lpns(v_current_row.lpn_id).secondary_total_quantity < 0)
10486: THEN
10487: IF l_debug = 1 THEN
10488: log_statement(l_api_name, 'invalid_lpn', 'This LPN is invalid');

Line 10485: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND g_lpns(v_current_row.lpn_id).secondary_total_quantity < 0)

10481: END IF;
10482: -- if lpn consist string is different than rec's consist string,
10483: -- this LPN will never be allocated entirely. Remove LPN from list.
10484: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND g_lpns(v_current_row.lpn_id).total_quantity < 0)
10485: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND g_lpns(v_current_row.lpn_id).secondary_total_quantity < 0)
10486: THEN
10487: IF l_debug = 1 THEN
10488: log_statement(l_api_name, 'invalid_lpn', 'This LPN is invalid');
10489: END IF;

Line 10515: ELSIF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10511:
10512: GOTO nextoutputrecord;
10513: -- bug 2356370 - need to recheck the LPN total quantity to make
10514: -- sure it doesn't exceed the needed quantity.
10515: ELSIF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10516: AND g_lpns(v_current_row.lpn_id).total_quantity > l_needed_quantity)
10517: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10518: AND g_lpns(v_current_row.lpn_id).secondary_total_quantity > l_sec_needed_quantity)
10519: THEN

Line 10517: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10513: -- bug 2356370 - need to recheck the LPN total quantity to make
10514: -- sure it doesn't exceed the needed quantity.
10515: ELSIF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10516: AND g_lpns(v_current_row.lpn_id).total_quantity > l_needed_quantity)
10517: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10518: AND g_lpns(v_current_row.lpn_id).secondary_total_quantity > l_sec_needed_quantity)
10519: THEN
10520: IF l_debug = 1 THEN
10521: log_statement(l_api_name, 'bad_tot_qty2', 'The total quantity for'

Line 10569: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10565: || g_lpns(v_current_row.lpn_id).secondary_total_quantity);
10566: END IF;
10567:
10568: IF c_lpn_quantity%NOTFOUND
10569: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10570: AND (g_lpns(v_current_row.lpn_id).total_quantity IS NULL
10571: OR g_lpns(v_current_row.lpn_id).total_quantity <= 0
10572: OR g_lpns(v_current_row.lpn_id).total_quantity > l_needed_quantity))
10573: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

Line 10573: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10569: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10570: AND (g_lpns(v_current_row.lpn_id).total_quantity IS NULL
10571: OR g_lpns(v_current_row.lpn_id).total_quantity <= 0
10572: OR g_lpns(v_current_row.lpn_id).total_quantity > l_needed_quantity))
10573: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10574: AND (g_lpns(v_current_row.lpn_id).secondary_total_quantity IS NULL
10575: OR g_lpns(v_current_row.lpn_id).secondary_total_quantity <= 0
10576: OR g_lpns(v_current_row.lpn_id).secondary_total_quantity > l_sec_needed_quantity))
10577: THEN

Line 10623: -- wms_engine_pvt.create_suggestions

10619: -- next, check to see if sub and item are locator controlled;
10620: -- if loc control, go to next record only if src loc = dest loc;
10621: -- if not loc control, go to next records (since subs are equal);
10622: -- all of the global variables are set in
10623: -- wms_engine_pvt.create_suggestions
10624: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
10625: AND v_current_row.subinventory_code = l_to_subinventory_code)
10626: THEN
10627: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)

Line 10624: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0

10620: -- if loc control, go to next record only if src loc = dest loc;
10621: -- if not loc control, go to next records (since subs are equal);
10622: -- all of the global variables are set in
10623: -- wms_engine_pvt.create_suggestions
10624: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
10625: AND v_current_row.subinventory_code = l_to_subinventory_code)
10626: THEN
10627: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10628: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)

Line 10627: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)

10623: -- wms_engine_pvt.create_suggestions
10624: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
10625: AND v_current_row.subinventory_code = l_to_subinventory_code)
10626: THEN
10627: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10628: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
10629: OR (wms_engine_pvt.g_sub_loc_control = 5
10630: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
10631: )

Line 10628: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)

10624: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
10625: AND v_current_row.subinventory_code = l_to_subinventory_code)
10626: THEN
10627: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10628: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
10629: OR (wms_engine_pvt.g_sub_loc_control = 5
10630: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
10631: )
10632: ) THEN

Line 10629: OR (wms_engine_pvt.g_sub_loc_control = 5

10625: AND v_current_row.subinventory_code = l_to_subinventory_code)
10626: THEN
10627: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10628: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
10629: OR (wms_engine_pvt.g_sub_loc_control = 5
10630: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
10631: )
10632: ) THEN
10633: IF (v_current_row.locator_id = l_to_locator_id) THEN

Line 10630: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))

10626: THEN
10627: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
10628: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
10629: OR (wms_engine_pvt.g_sub_loc_control = 5
10630: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
10631: )
10632: ) THEN
10633: IF (v_current_row.locator_id = l_to_locator_id) THEN
10634: IF l_debug = 1 THEN

Line 10725: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att < v_current_row.quantity)

10721: END IF;
10722:
10723: -- If not all of the record is available, then we can't allocate
10724: -- the entire LPN
10725: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att < v_current_row.quantity)
10726: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_satt < v_current_row.secondary_quantity)
10727: THEN
10728: IF l_debug = 1 THEN
10729: log_statement(l_api_name, 'not_enough_att', 'Not all the material is available for this rec. Skipping this LPN');

Line 10726: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_satt < v_current_row.secondary_quantity)

10722:
10723: -- If not all of the record is available, then we can't allocate
10724: -- the entire LPN
10725: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att < v_current_row.quantity)
10726: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_satt < v_current_row.secondary_quantity)
10727: THEN
10728: IF l_debug = 1 THEN
10729: log_statement(l_api_name, 'not_enough_att', 'Not all the material is available for this rec. Skipping this LPN');
10730: END IF;

Line 10748: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10744: END IF;
10745:
10746: -- If LPN is not in first order by group OR
10747: -- goto next output record
10748: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10749: AND g_lpns(v_current_row.lpn_id).quantity < g_lpns(v_current_row.lpn_id).total_quantity)
10750: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10751: AND g_lpns(v_current_row.lpn_id).secondary_quantity < g_lpns(v_current_row.lpn_id).secondary_total_quantity)
10752: )

Line 10750: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10746: -- If LPN is not in first order by group OR
10747: -- goto next output record
10748: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10749: AND g_lpns(v_current_row.lpn_id).quantity < g_lpns(v_current_row.lpn_id).total_quantity)
10750: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10751: AND g_lpns(v_current_row.lpn_id).secondary_quantity < g_lpns(v_current_row.lpn_id).secondary_total_quantity)
10752: )
10753: THEN
10754: IF l_debug = 1 THEN

Line 10797: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10793: log_statement(l_api_name, 'group_exists', 'The consist group already exists');
10794: END IF;
10795:
10796: -- if lpn quantity would exceed needed quantity, invalidate lpn
10797: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10798: AND (g_consists(l_cur_consist_group).quantity
10799: + g_lpns(v_current_row.lpn_id).quantity) > l_needed_quantity)
10800: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10801: AND (g_consists(l_cur_consist_group).secondary_quantity

Line 10800: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10796: -- if lpn quantity would exceed needed quantity, invalidate lpn
10797: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10798: AND (g_consists(l_cur_consist_group).quantity
10799: + g_lpns(v_current_row.lpn_id).quantity) > l_needed_quantity)
10800: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10801: AND (g_consists(l_cur_consist_group).secondary_quantity
10802: + g_lpns(v_current_row.lpn_id).secondary_quantity) > l_sec_needed_quantity)
10803: )
10804: THEN

Line 10820: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

10816: g_consists(l_cur_consist_group).last_rec := v_current_row.lpn_id;
10817: -- increase group quantity
10818: g_consists(l_cur_consist_group).quantity := g_consists(l_cur_consist_group).quantity
10819: + g_lpns(v_current_row.lpn_id).quantity;
10820: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
10821: g_consists(l_cur_consist_group).secondary_quantity := g_consists(l_cur_consist_group).secondary_quantity
10822: + g_lpns(v_current_row.lpn_id).secondary_quantity;
10823: END IF;
10824: ELSE

Line 10851: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10847:
10848: g_lpns(v_current_row.lpn_id).parent_consist_group := l_cur_consist_group;
10849:
10850: -- only allocate a consist group if the quantity = needed quantity exactly
10851: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10852: AND g_consists(l_cur_consist_group).quantity < (l_needed_quantity - l_max_tolerance))
10853: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10854: AND g_consists(l_cur_consist_group).secondary_quantity < (l_sec_needed_quantity - l_max_sec_tolerance))
10855: )

Line 10853: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10849:
10850: -- only allocate a consist group if the quantity = needed quantity exactly
10851: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10852: AND g_consists(l_cur_consist_group).quantity < (l_needed_quantity - l_max_tolerance))
10853: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10854: AND g_consists(l_cur_consist_group).secondary_quantity < (l_sec_needed_quantity - l_max_sec_tolerance))
10855: )
10856: THEN
10857: IF l_debug = 1 THEN

Line 10960: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

10956: END IF;
10957:
10958: -- If this fails
10959: IF l_inserted_record = FALSE
10960: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10961: AND l_allocated_quantity < g_locs(l_cur_lpn_rec).quantity)
10962: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10963: AND l_sec_allocated_quantity < g_locs(l_cur_lpn_rec).secondary_quantity)
10964: THEN --{

Line 10962: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

10958: -- If this fails
10959: IF l_inserted_record = FALSE
10960: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
10961: AND l_allocated_quantity < g_locs(l_cur_lpn_rec).quantity)
10962: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
10963: AND l_sec_allocated_quantity < g_locs(l_cur_lpn_rec).secondary_quantity)
10964: THEN --{
10965: IF l_debug = 1 THEN
10966: log_statement(l_api_name, 'insert_fail', 'Record failed to insert.' || 'Invalidating LPN');

Line 11024: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

11020: l_cur_rec := g_lpns(l_lpn_id).first_rec;
11021: LOOP
11022: g_trace_recs(l_cur_rec).entire_lpn_flag := 'N';
11023: g_trace_recs(l_cur_rec).suggested_qty := 0;
11024: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11025: g_trace_recs(l_cur_rec).secondary_qty := 0;
11026: END IF;
11027: EXIT WHEN l_cur_rec = l_cur_lpn_rec;
11028: l_cur_rec := g_locs(l_cur_rec).next_rec;

Line 11063: OR WMS_Engine_PVT.g_move_order_type <> 3

11059: END IF;
11060:
11061: IF g_over_allocation = 'N'
11062: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11063: OR WMS_Engine_PVT.g_move_order_type <> 3
11064: THEN
11065: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11066: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11067: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

Line 11065: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

11061: IF g_over_allocation = 'N'
11062: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11063: OR WMS_Engine_PVT.g_move_order_type <> 3
11064: THEN
11065: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11066: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11067: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11068: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11069: );

Line 11067: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

11063: OR WMS_Engine_PVT.g_move_order_type <> 3
11064: THEN
11065: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11066: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11067: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11068: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11069: );
11070: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11071: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

Line 11070: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

11066: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11067: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11068: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11069: );
11070: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11071: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11072: IF l_max_sec_tolerance >= 0 THEN
11073: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11074: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);

Line 11071: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

11067: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11068: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11069: );
11070: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11071: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11072: IF l_max_sec_tolerance >= 0 THEN
11073: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11074: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
11075: ELSE

Line 11100: OR WMS_Engine_PVT.g_move_order_type <> 3

11096: END LOOP; --} loop through LPNS
11097:
11098: IF g_over_allocation = 'N'
11099: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11100: OR WMS_Engine_PVT.g_move_order_type <> 3
11101: THEN
11102: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11103: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11104: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

Line 11102: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

11098: IF g_over_allocation = 'N'
11099: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11100: OR WMS_Engine_PVT.g_move_order_type <> 3
11101: THEN
11102: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11103: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11104: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11105: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11106: );

Line 11104: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

11100: OR WMS_Engine_PVT.g_move_order_type <> 3
11101: THEN
11102: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11103: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11104: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11105: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11106: );
11107: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11108: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

Line 11107: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

11103: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11104: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11105: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11106: );
11107: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11108: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11109: IF l_max_sec_tolerance >= 0 THEN
11110: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11111: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);

Line 11108: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

11104: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11105: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11106: );
11107: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11108: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11109: IF l_max_sec_tolerance >= 0 THEN
11110: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11111: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
11112: ELSE

Line 11384: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_orig_needed_quantity > 0)

11380: -- is only available in R12 Main Line code and the logic in contained WITH value = here
11381:
11382: -- if allocation mode = 5
11383: IF l_allocation_mode = 5 AND l_first_uom_rec <> 0
11384: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_orig_needed_quantity > 0)
11385: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_orig_needed_sec_qty > 0)
11386: )
11387: THEN
11388: -- After all location-based records (from where there was possibility of getting allocation in the

Line 11385: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_orig_needed_sec_qty > 0)

11381:
11382: -- if allocation mode = 5
11383: IF l_allocation_mode = 5 AND l_first_uom_rec <> 0
11384: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_orig_needed_quantity > 0)
11385: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_orig_needed_sec_qty > 0)
11386: )
11387: THEN
11388: -- After all location-based records (from where there was possibility of getting allocation in the
11389: -- first round of scan) gets exhausted, it comes here for the second round of scan. At that point,

Line 11555: OR WMS_Engine_PVT.g_move_order_type <> 3

11551:
11552: -- exit pick UOM loop when needed qty = 0
11553: IF g_over_allocation = 'N'
11554: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11555: OR WMS_Engine_PVT.g_move_order_type <> 3
11556: THEN
11557: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11558: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11559: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

Line 11557: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

11553: IF g_over_allocation = 'N'
11554: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11555: OR WMS_Engine_PVT.g_move_order_type <> 3
11556: THEN
11557: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11558: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11559: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11560: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11561: );

Line 11559: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

11555: OR WMS_Engine_PVT.g_move_order_type <> 3
11556: THEN
11557: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11558: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11559: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11560: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11561: );
11562: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
11563: THEN

Line 11562: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3

11558: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11559: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11560: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11561: );
11562: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
11563: THEN
11564: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11565: IF l_max_sec_tolerance >= 0 THEN
11566: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)

Line 11564: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

11560: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11561: );
11562: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
11563: THEN
11564: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11565: IF l_max_sec_tolerance >= 0 THEN
11566: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11567: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
11568: ELSE

Line 11587: OR WMS_Engine_PVT.g_move_order_type <> 3

11583:
11584: -- if needed qty = 0, exit outer loop
11585: IF g_over_allocation = 'N'
11586: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11587: OR WMS_Engine_PVT.g_move_order_type <> 3
11588: THEN
11589: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11590: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11591: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

Line 11589: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

11585: IF g_over_allocation = 'N'
11586: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11587: OR WMS_Engine_PVT.g_move_order_type <> 3
11588: THEN
11589: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11590: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11591: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11592: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11593: );

Line 11591: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

11587: OR WMS_Engine_PVT.g_move_order_type <> 3
11588: THEN
11589: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11590: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11591: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11592: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11593: );
11594: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
11595: THEN

Line 11594: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3

11590: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11591: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11592: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11593: );
11594: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
11595: THEN
11596: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11597: IF l_max_sec_tolerance >= 0 THEN
11598: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)

Line 11596: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

11592: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11593: );
11594: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3
11595: THEN
11596: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11597: IF l_max_sec_tolerance >= 0 THEN
11598: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11599: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
11600: ELSE

Line 11631: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

11627: LOOP --{
11628: EXIT WHEN l_cur_consist_group = 0;
11629:
11630: -- if group alloc qty > needed qty
11631: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11632: AND g_consists(l_cur_consist_group).quantity >= l_orig_needed_quantity)
11633: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11634: AND g_consists(l_cur_consist_group).secondary_quantity >= l_orig_needed_sec_qty)
11635: )

Line 11633: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

11629:
11630: -- if group alloc qty > needed qty
11631: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11632: AND g_consists(l_cur_consist_group).quantity >= l_orig_needed_quantity)
11633: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11634: AND g_consists(l_cur_consist_group).secondary_quantity >= l_orig_needed_sec_qty)
11635: )
11636: THEN --{
11637: IF l_debug = 1 THEN

Line 11878: OR WMS_Engine_PVT.g_move_order_type <> 3

11874:
11875: -- exit pick UOM loop when needed qty = 0
11876: IF g_over_allocation = 'N'
11877: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11878: OR WMS_Engine_PVT.g_move_order_type <> 3
11879: THEN
11880: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11881: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11882: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

Line 11880: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

11876: IF g_over_allocation = 'N'
11877: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11878: OR WMS_Engine_PVT.g_move_order_type <> 3
11879: THEN
11880: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11881: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11882: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11883: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11884: );

Line 11882: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

11878: OR WMS_Engine_PVT.g_move_order_type <> 3
11879: THEN
11880: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11881: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11882: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11883: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11884: );
11885: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11886: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

Line 11885: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

11881: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11882: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11883: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11884: );
11885: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11886: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11887: IF l_max_sec_tolerance >= 0 THEN
11888: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11889: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);

Line 11886: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

11882: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11883: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11884: );
11885: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11886: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11887: IF l_max_sec_tolerance >= 0 THEN
11888: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11889: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
11890: ELSE

Line 11917: OR WMS_Engine_PVT.g_move_order_type <> 3

11913: END IF; --}
11914:
11915: IF g_over_allocation = 'N'
11916: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11917: OR WMS_Engine_PVT.g_move_order_type <> 3
11918: THEN
11919: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11920: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11921: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

Line 11919: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

11915: IF g_over_allocation = 'N'
11916: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
11917: OR WMS_Engine_PVT.g_move_order_type <> 3
11918: THEN
11919: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11920: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11921: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11922: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11923: );

Line 11921: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

11917: OR WMS_Engine_PVT.g_move_order_type <> 3
11918: THEN
11919: EXIT WHEN ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
11920: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11921: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11922: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11923: );
11924: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11925: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

Line 11924: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN

11920: AND (l_needed_quantity <= 0 OR l_needed_quantity <= l_max_tolerance))
11921: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11922: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11923: );
11924: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11925: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11926: IF l_max_sec_tolerance >= 0 THEN
11927: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11928: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);

Line 11925: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN

11921: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
11922: AND (l_sec_needed_quantity <= 0 OR l_sec_needed_quantity <= l_max_sec_tolerance))
11923: );
11924: ELSIF g_over_allocation = 'Y' AND p_type_code = 2 AND WMS_Engine_PVT.g_move_order_type = 3 THEN
11925: IF NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' THEN
11926: IF l_max_sec_tolerance >= 0 THEN
11927: EXIT WHEN (l_sec_needed_quantity <= l_max_sec_tolerance)
11928: OR (l_initial_sec_quantity - l_sec_needed_quantity >= WMS_RULE_PVT.g_min_sec_qty_to_alloc);
11929: ELSE

Line 12020: -- wms_engine_pvt.create_suggestions

12016: -- next, check to see if sub and item are locator controlled;
12017: -- if loc control, go to next record only if src loc = dest loc;
12018: -- if not loc control, go to next records (since subs are equal);
12019: -- all of the global variables are set in
12020: -- wms_engine_pvt.create_suggestions
12021: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
12022: AND v_current_row.subinventory_code = l_to_subinventory_code
12023: ) THEN
12024: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)

Line 12021: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0

12017: -- if loc control, go to next record only if src loc = dest loc;
12018: -- if not loc control, go to next records (since subs are equal);
12019: -- all of the global variables are set in
12020: -- wms_engine_pvt.create_suggestions
12021: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
12022: AND v_current_row.subinventory_code = l_to_subinventory_code
12023: ) THEN
12024: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12025: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)

Line 12024: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)

12020: -- wms_engine_pvt.create_suggestions
12021: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
12022: AND v_current_row.subinventory_code = l_to_subinventory_code
12023: ) THEN
12024: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12025: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
12026: OR (wms_engine_pvt.g_sub_loc_control = 5
12027: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
12028: )

Line 12025: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)

12021: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
12022: AND v_current_row.subinventory_code = l_to_subinventory_code
12023: ) THEN
12024: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12025: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
12026: OR (wms_engine_pvt.g_sub_loc_control = 5
12027: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
12028: )
12029: )

Line 12026: OR (wms_engine_pvt.g_sub_loc_control = 5

12022: AND v_current_row.subinventory_code = l_to_subinventory_code
12023: ) THEN
12024: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12025: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
12026: OR (wms_engine_pvt.g_sub_loc_control = 5
12027: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
12028: )
12029: )
12030: THEN

Line 12027: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))

12023: ) THEN
12024: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12025: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
12026: OR (wms_engine_pvt.g_sub_loc_control = 5
12027: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
12028: )
12029: )
12030: THEN
12031: IF (v_current_row.locator_id = l_to_locator_id) THEN

Line 12116: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att <= 0)

12112: log_statement(l_api_name, 'att', 'ATT : ' || l_att ||'SATT is:'|| l_satt); --9915228
12113: END IF;
12114:
12115: -- If att<=0, goto next output rec
12116: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att <= 0)
12117: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_satt <= 0)
12118: THEN
12119: IF l_debug = 1 THEN
12120: log_statement(l_api_name, 'no_att', 'No ATT for this record. ' || 'Getting next record');

Line 12117: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_satt <= 0)

12113: END IF;
12114:
12115: -- If att<=0, goto next output rec
12116: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att <= 0)
12117: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_satt <= 0)
12118: THEN
12119: IF l_debug = 1 THEN
12120: log_statement(l_api_name, 'no_att', 'No ATT for this record. ' || 'Getting next record');
12121: END IF;

Line 12138: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att < v_current_row.quantity)

12134: g_trace_recs(g_locs_index).secondary_att_qty := l_satt;
12135: g_trace_recs(g_locs_index).att_qty_flag := 'Y';
12136: END IF;
12137:
12138: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att < v_current_row.quantity)
12139: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_satt < v_current_row.secondary_quantity)
12140: THEN
12141: IF l_debug = 1 THEN
12142: log_statement(l_api_name, 'less_att', 'ATT is less than onhand ' || 'quantity. Reducing quantity');

Line 12139: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_satt < v_current_row.secondary_quantity)

12135: g_trace_recs(g_locs_index).att_qty_flag := 'Y';
12136: END IF;
12137:
12138: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_att < v_current_row.quantity)
12139: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_satt < v_current_row.secondary_quantity)
12140: THEN
12141: IF l_debug = 1 THEN
12142: log_statement(l_api_name, 'less_att', 'ATT is less than onhand ' || 'quantity. Reducing quantity');
12143: END IF;

Line 12296: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_remaining_quantity > 0)

12292:
12293:
12294: -- If remaining qty > 0 and allocation mode in 3,4
12295: IF l_allocation_mode IN (3, 4)
12296: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_remaining_quantity > 0)
12297: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_remaining_quantity > 0)
12298: )
12299: THEN --{
12300: IF l_debug = 1 THEN

Line 12297: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_remaining_quantity > 0)

12293:
12294: -- If remaining qty > 0 and allocation mode in 3,4
12295: IF l_allocation_mode IN (3, 4)
12296: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_remaining_quantity > 0)
12297: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_remaining_quantity > 0)
12298: )
12299: THEN --{
12300: IF l_debug = 1 THEN
12301: log_statement(l_api_name, 'remain_qty', 'Remaining quantity: ' || l_remaining_quantity);

Line 12307: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

12303: log_statement(l_api_name, 'remain_qty', 'Creating pick UOM rec');
12304: END IF;
12305: l_cur_rec := g_locs_index;
12306:
12307: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
12308: AND l_remaining_quantity < g_locs(g_locs_index).quantity)
12309: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
12310: AND l_sec_remaining_quantity < g_locs(g_locs_index).secondary_quantity)
12311: )

Line 12309: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

12305: l_cur_rec := g_locs_index;
12306:
12307: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
12308: AND l_remaining_quantity < g_locs(g_locs_index).quantity)
12309: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
12310: AND l_sec_remaining_quantity < g_locs(g_locs_index).secondary_quantity)
12311: )
12312: THEN
12313: -- create new location record for remaining quantity

Line 12383: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

12379: END IF;
12380: END IF; -- allocation mode in 3,4
12381:
12382: -- if needed qty = 0 , exit outermost loop
12383: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
12384: AND (l_needed_quantity >= 0 AND l_needed_quantity <= l_max_tolerance))
12385: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
12386: AND (l_sec_needed_quantity >= 0 AND l_sec_needed_quantity <= l_max_sec_tolerance))
12387: )

Line 12385: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

12381:
12382: -- if needed qty = 0 , exit outermost loop
12383: IF ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
12384: AND (l_needed_quantity >= 0 AND l_needed_quantity <= l_max_tolerance))
12385: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
12386: AND (l_sec_needed_quantity >= 0 AND l_sec_needed_quantity <= l_max_sec_tolerance))
12387: )
12388: THEN
12389: IF l_debug = 1 THEN

Line 12407: log_event(l_api_name, 'Loop through each record putaway from the Rule cursor ', 'Start ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);

12403:
12404: --Loop through each record from the Rule cursor
12405: WHILE TRUE LOOP --{
12406: IF l_debug = 1 THEN
12407: log_event(l_api_name, 'Loop through each record putaway from the Rule cursor ', 'Start ' || WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE);
12408: END IF;
12409: --l_locs_index := l_locs_index + 1; --bug3673962 moving this assignment as when no rows are returned by fetchputaway
12410: --the index gets incremented unncessarily and fails in WMSSOGBB.pls
12411: fetchputaway(

Line 12441: log_statement(l_api_name, 'org_loc_ctl ', 'org: ' ||wms_engine_pvt.g_org_loc_control);

12437: -- Exit if no more records from rule cursor
12438: EXIT WHEN nvl(l_rows, 0) = 0 ; -- [ Added to to exit , if the rule is not returning any rows
12439:
12440: l_locs_index := l_locs_index + 1; --bug3673962
12441: log_statement(l_api_name, 'org_loc_ctl ', 'org: ' ||wms_engine_pvt.g_org_loc_control);
12442: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
12443: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
12444: /* bug 3972784, remove locator_id if no locator control */
12445: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level

Line 12442: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);

12438: EXIT WHEN nvl(l_rows, 0) = 0 ; -- [ Added to to exit , if the rule is not returning any rows
12439:
12440: l_locs_index := l_locs_index + 1; --bug3673962
12441: log_statement(l_api_name, 'org_loc_ctl ', 'org: ' ||wms_engine_pvt.g_org_loc_control);
12442: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
12443: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
12444: /* bug 3972784, remove locator_id if no locator control */
12445: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
12446: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level

Line 12443: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);

12439:
12440: l_locs_index := l_locs_index + 1; --bug3673962
12441: log_statement(l_api_name, 'org_loc_ctl ', 'org: ' ||wms_engine_pvt.g_org_loc_control);
12442: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
12443: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
12444: /* bug 3972784, remove locator_id if no locator control */
12445: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
12446: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
12447: OR (wms_engine_pvt.g_sub_loc_control = 5

Line 12445: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level

12441: log_statement(l_api_name, 'org_loc_ctl ', 'org: ' ||wms_engine_pvt.g_org_loc_control);
12442: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
12443: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
12444: /* bug 3972784, remove locator_id if no locator control */
12445: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
12446: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
12447: OR (wms_engine_pvt.g_sub_loc_control = 5
12448: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
12449: )

Line 12446: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level

12442: log_statement(l_api_name, 'sub_loc_ctl ', 'org: ' ||wms_engine_pvt.g_sub_loc_control);
12443: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
12444: /* bug 3972784, remove locator_id if no locator control */
12445: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
12446: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
12447: OR (wms_engine_pvt.g_sub_loc_control = 5
12448: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
12449: )
12450: )

Line 12447: OR (wms_engine_pvt.g_sub_loc_control = 5

12443: log_statement(l_api_name, 'itm_loc_ctl ', 'org: ' ||wms_engine_pvt.g_item_loc_control);
12444: /* bug 3972784, remove locator_id if no locator control */
12445: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
12446: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
12447: OR (wms_engine_pvt.g_sub_loc_control = 5
12448: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
12449: )
12450: )
12451: )

Line 12448: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level

12444: /* bug 3972784, remove locator_id if no locator control */
12445: IF ( wms_engine_pvt.g_org_loc_control in (1,4) -- no loc ctl org level
12446: AND ( wms_engine_pvt.g_sub_loc_control = 1 -- no loc ctl sub level
12447: OR (wms_engine_pvt.g_sub_loc_control = 5
12448: AND wms_engine_pvt.g_item_loc_control = 1 -- no loc ctl item level
12449: )
12450: )
12451: )
12452: THEN

Line 12485: IF wms_engine_pvt.g_reservable_putaway_sub_only THEN

12481: --if reservation exists for WIP assembly completion, put away
12482: -- to reservable sub only;
12483: --we know if sub has to be reservable based on global value set in
12484: -- create_suggestions
12485: IF wms_engine_pvt.g_reservable_putaway_sub_only THEN
12486: -- 8809951 removed curosr and using INV CACHE
12487: IF (inv_cache. set_tosub_rec(p_organization_id, l_osubinventory_code) ) THEN
12488: l_lpn_controlled_flag := inv_cache.tosub_rec.lpn_controlled_flag;
12489: l_sub_rsv_type := inv_cache.tosub_rec.reservable_type;

Line 12521: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND

12517: --always use the locator specified on the move order line, even
12518: --if that locator is from common stock (not project)
12519: -- Bug 2666620: BackFlush MO Type Removed. It is now 5.
12520: -- Moreover Txn Action ID is 2 which is already handled.
12521: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND
12522: wms_engine_pvt.g_transaction_action_id = 2) THEN
12523: IF l_debug = 1 THEN
12524: log_statement(l_api_name, 'do_project2', 'Calling do project check');
12525: END IF;

Line 12522: wms_engine_pvt.g_transaction_action_id = 2) THEN

12518: --if that locator is from common stock (not project)
12519: -- Bug 2666620: BackFlush MO Type Removed. It is now 5.
12520: -- Moreover Txn Action ID is 2 which is already handled.
12521: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND
12522: wms_engine_pvt.g_transaction_action_id = 2) THEN
12523: IF l_debug = 1 THEN
12524: log_statement(l_api_name, 'do_project2', 'Calling do project check');
12525: END IF;
12526: IF doprojectcheck(l_return_status,

Line 12644: IF wms_engine_pvt.g_serial_number_control_code > 1 THEN

12640:
12641: --bug 2778814
12642: --For serial controlled items, we should not suggest the putaway
12643: -- of decimal quantities
12644: IF wms_engine_pvt.g_serial_number_control_code > 1 THEN
12645: l_possible_quantity := floor(l_possible_quantity);
12646: IF l_debug = 1 THEN
12647: log_statement(l_api_name, 'no_decimals',
12648: 'Cannot putaway a decimal quantity on a serial controlled item.'||

Line 12682: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_LOC_CAPACITY_FULL' ;

12678: log_event(l_api_name, 'no_rec_qty_put', 'No available capacity in putaway location');
12679: END IF;
12680: --
12681: -- Patchset 'J' error_message
12682: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_LOC_CAPACITY_FULL' ;
12683: --
12684: --
12685: GOTO nextoutputrecord;
12686: END IF;

Line 12699: --wms_engine_pvt.create_suggestions

12695: --next, check to see if sub and item are locator controlled;
12696: --if loc control, go to next record only if src loc = dest loc
12697: --if not loc control, go to next records (since subs are equal)
12698: --all of the global variables are set in
12699: --wms_engine_pvt.create_suggestions
12700: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
12701: AND l_osubinventory_code = l_from_subinventory_code
12702: ) THEN
12703: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)

Line 12700: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0

12696: --if loc control, go to next record only if src loc = dest loc
12697: --if not loc control, go to next records (since subs are equal)
12698: --all of the global variables are set in
12699: --wms_engine_pvt.create_suggestions
12700: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
12701: AND l_osubinventory_code = l_from_subinventory_code
12702: ) THEN
12703: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12704: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)

Line 12703: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)

12699: --wms_engine_pvt.create_suggestions
12700: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
12701: AND l_osubinventory_code = l_from_subinventory_code
12702: ) THEN
12703: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12704: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
12705: OR (wms_engine_pvt.g_sub_loc_control = 5
12706: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
12707: )

Line 12704: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)

12700: IF (wms_engine_pvt.g_dest_sub_pick_allowed = 0
12701: AND l_osubinventory_code = l_from_subinventory_code
12702: ) THEN
12703: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12704: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
12705: OR (wms_engine_pvt.g_sub_loc_control = 5
12706: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
12707: )
12708: ) THEN

Line 12705: OR (wms_engine_pvt.g_sub_loc_control = 5

12701: AND l_osubinventory_code = l_from_subinventory_code
12702: ) THEN
12703: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12704: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
12705: OR (wms_engine_pvt.g_sub_loc_control = 5
12706: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
12707: )
12708: ) THEN
12709: IF (l_olocator_id = l_from_locator_id) THEN

Line 12706: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))

12702: ) THEN
12703: IF (wms_engine_pvt.g_org_loc_control IN (2, 3)
12704: OR wms_engine_pvt.g_sub_loc_control IN (2, 3)
12705: OR (wms_engine_pvt.g_sub_loc_control = 5
12706: AND (wms_engine_pvt.g_item_loc_control IN (2, 3))
12707: )
12708: ) THEN
12709: IF (l_olocator_id = l_from_locator_id) THEN
12710:

Line 12728: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_SAME_SUB_LOC' ;

12724: END IF;
12725:
12726: --
12727: -- Patchset 'J' error_message
12728: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_SAME_SUB_LOC' ;
12729: --
12730: --
12731: GOTO nextoutputrecord;
12732: END IF; -- from loc = to loc

Line 12791: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_MAT_STATUS_NOT_ALLOWED' ;

12787: g_trace_recs(l_locs_index).material_status_flag := 'N';
12788: END IF;
12789: --
12790: -- Patchset 'J' error_message
12791: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_MAT_STATUS_NOT_ALLOWED' ;
12792: --
12793: --
12794: GOTO nextoutputrecord;
12795: END IF;

Line 12951: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_COST_GROUP_COMINGLE' ;

12947: g_trace_recs(l_locs_index).cg_comingle_flag := 'N';
12948: END IF;
12949: --
12950: -- Patchset 'J' error_message
12951: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_COST_GROUP_COMINGLE' ;
12952: GOTO nextoutputrecord;
12953: END IF;
12954:
12955: IF l_debug_on THEN

Line 13109: OR WMS_Engine_PVT.g_move_order_type <> 3 OR p_type_code <> 2)

13105: END IF;
13106:
13107: IF ( (g_over_allocation = 'N'
13108: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
13109: OR WMS_Engine_PVT.g_move_order_type <> 3 OR p_type_code <> 2)
13110: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
13111: AND (l_needed_quantity > 0 OR l_needed_quantity > l_max_tolerance))
13112: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
13113: AND (l_sec_needed_quantity > 0 OR l_sec_needed_quantity > l_max_sec_tolerance))

Line 13110: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

13106:
13107: IF ( (g_over_allocation = 'N'
13108: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
13109: OR WMS_Engine_PVT.g_move_order_type <> 3 OR p_type_code <> 2)
13110: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
13111: AND (l_needed_quantity > 0 OR l_needed_quantity > l_max_tolerance))
13112: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
13113: AND (l_sec_needed_quantity > 0 OR l_sec_needed_quantity > l_max_sec_tolerance))
13114: )

Line 13112: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

13108: OR (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
13109: OR WMS_Engine_PVT.g_move_order_type <> 3 OR p_type_code <> 2)
13110: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
13111: AND (l_needed_quantity > 0 OR l_needed_quantity > l_max_tolerance))
13112: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
13113: AND (l_sec_needed_quantity > 0 OR l_sec_needed_quantity > l_max_sec_tolerance))
13114: )
13115: )
13116: OR

Line 13119: AND WMS_Engine_PVT.g_move_order_type = 3 AND p_type_code = 2

13115: )
13116: OR
13117: (g_over_allocation = 'Y'
13118: AND NOT (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
13119: AND WMS_Engine_PVT.g_move_order_type = 3 AND p_type_code = 2
13120: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
13121: AND ( (l_max_tolerance >= 0 AND (l_needed_quantity > l_max_tolerance)
13122: AND (l_initial_pri_quantity - l_needed_quantity < WMS_RULE_PVT.g_min_qty_to_allocate))
13123: OR (l_max_tolerance < 0

Line 13120: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'

13116: OR
13117: (g_over_allocation = 'Y'
13118: AND NOT (p_type_code = 2 AND l_lot_divisible_flag = 'N' AND l_lot_control_code <> 1)
13119: AND WMS_Engine_PVT.g_move_order_type = 3 AND p_type_code = 2
13120: AND ( (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P'
13121: AND ( (l_max_tolerance >= 0 AND (l_needed_quantity > l_max_tolerance)
13122: AND (l_initial_pri_quantity - l_needed_quantity < WMS_RULE_PVT.g_min_qty_to_allocate))
13123: OR (l_max_tolerance < 0
13124: AND (l_initial_pri_quantity - l_needed_quantity < WMS_RULE_PVT.g_min_qty_to_allocate))

Line 13127: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'

13123: OR (l_max_tolerance < 0
13124: AND (l_initial_pri_quantity - l_needed_quantity < WMS_RULE_PVT.g_min_qty_to_allocate))
13125: )
13126: )
13127: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S'
13128: AND ( (l_max_sec_tolerance >= 0 AND (l_sec_needed_quantity > l_max_sec_tolerance)
13129: AND (l_initial_sec_quantity - l_sec_needed_quantity < WMS_RULE_PVT.g_min_sec_qty_to_alloc))
13130: OR (l_max_sec_tolerance < 0
13131: AND (l_initial_sec_quantity - l_sec_needed_quantity < WMS_RULE_PVT.g_min_sec_qty_to_alloc))

Line 13140: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity = l_initial_pri_quantity)

13136: THEN --{
13137: -- notice, that at least one input record couldn't get satisfied
13138: x_finished := fnd_api.g_false;
13139:
13140: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity = l_initial_pri_quantity)
13141: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_needed_quantity = l_initial_sec_quantity)
13142: THEN
13143: -- Bug #3396532
13144: IF WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE IS NULL THEN

Line 13141: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_needed_quantity = l_initial_sec_quantity)

13137: -- notice, that at least one input record couldn't get satisfied
13138: x_finished := fnd_api.g_false;
13139:
13140: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity = l_initial_pri_quantity)
13141: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_needed_quantity = l_initial_sec_quantity)
13142: THEN
13143: -- Bug #3396532
13144: IF WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE IS NULL THEN
13145: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';

Line 13144: IF WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE IS NULL THEN

13140: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity = l_initial_pri_quantity)
13141: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_needed_quantity = l_initial_sec_quantity)
13142: THEN
13143: -- Bug #3396532
13144: IF WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE IS NULL THEN
13145: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
13146: END IF;
13147: IF l_debug = 1 THEN
13148: log_event(l_api_name, 'no_success', 'Found no locations for this rule');

Line 13145: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';

13141: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_needed_quantity = l_initial_sec_quantity)
13142: THEN
13143: -- Bug #3396532
13144: IF WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE IS NULL THEN
13145: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_PUT_NO_ROWS';
13146: END IF;
13147: IF l_debug = 1 THEN
13148: log_event(l_api_name, 'no_success', 'Found no locations for this rule');
13149: END IF;

Line 13324: , p_header_id => wms_engine_pvt.g_trace_header_id

13320: , p_validation_level => fnd_api.g_valid_level_full
13321: , x_return_status => l_return_status
13322: , x_msg_count => x_msg_count
13323: , x_msg_data => x_msg_data
13324: , p_header_id => wms_engine_pvt.g_trace_header_id
13325: , p_rule_id => l_rule_id
13326: , p_pre_suggestions => g_trace_recs
13327: );
13328: END IF;

Line 13335: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity <> l_initial_pri_quantity)

13331: ROLLBACK TO applyrulesp;
13332: EXIT;
13333: --}
13334: ELSE
13335: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity <> l_initial_pri_quantity)
13336: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_needed_quantity <> l_initial_sec_quantity)
13337: THEN
13338: IF l_debug = 1 THEN
13339: log_statement(l_api_name, 'updating_input_rec', 'Updating the input line in WTT and pl/sql table');

Line 13336: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_needed_quantity <> l_initial_sec_quantity)

13332: EXIT;
13333: --}
13334: ELSE
13335: IF (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'P' AND l_needed_quantity <> l_initial_pri_quantity)
13336: OR (NVL(wms_engine_pvt.g_fulfillment_base,'P') = 'S' AND l_sec_needed_quantity <> l_initial_sec_quantity)
13337: THEN
13338: IF l_debug = 1 THEN
13339: log_statement(l_api_name, 'updating_input_rec', 'Updating the input line in WTT and pl/sql table');
13340: END IF;

Line 13420: , p_header_id => wms_engine_pvt.g_trace_header_id

13416: , p_validation_level => fnd_api.g_valid_level_full
13417: , x_return_status => l_return_status
13418: , x_msg_count => x_msg_count
13419: , x_msg_data => x_msg_data
13420: , p_header_id => wms_engine_pvt.g_trace_header_id
13421: , p_rule_id => l_rule_id
13422: , p_pre_suggestions => g_trace_recs
13423: );
13424: END IF;

Line 14293: IF NOT(wms_engine_pvt.g_move_order_type = 7 and

14289:
14290: --bug 2400549 - for WIP backflush transfer putaway,
14291: --always use the locator specified on the move order line, even
14292: --if that locator is from common stock (not project)
14293: IF NOT(wms_engine_pvt.g_move_order_type = 7 and
14294: wms_engine_pvt.g_transaction_action_id = 2) THEN
14295: If (l_debug = 1) then
14296: log_statement(l_api_name, 'do_project2',
14297: 'Calling do project check');

Line 14294: wms_engine_pvt.g_transaction_action_id = 2) THEN

14290: --bug 2400549 - for WIP backflush transfer putaway,
14291: --always use the locator specified on the move order line, even
14292: --if that locator is from common stock (not project)
14293: IF NOT(wms_engine_pvt.g_move_order_type = 7 and
14294: wms_engine_pvt.g_transaction_action_id = 2) THEN
14295: If (l_debug = 1) then
14296: log_statement(l_api_name, 'do_project2',
14297: 'Calling do project check');
14298: End if;

Line 14689: ,p_header_id => wms_engine_pvt.g_trace_header_id

14685: ,p_validation_level => fnd_api.g_valid_level_full
14686: ,x_return_status => l_return_status
14687: ,x_msg_count => x_msg_count
14688: ,x_msg_data => x_msg_data
14689: ,p_header_id => wms_engine_pvt.g_trace_header_id
14690: ,p_rule_id => null
14691: ,p_pre_suggestions => g_trace_recs
14692: );
14693: END IF;

Line 17998: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_ATT_SUB_STATUS_NA';

17994: , p_subinventory_code => l_from_subinventory_code
17995: , p_locator_id => l_from_locator_id
17996: , p_lot_number => l_lot_number );
17997: IF ( l_allowed = 'N') then
17998: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_ATT_SUB_STATUS_NA';
17999: fnd_message.set_name('WMS', 'WMS_ATT_SUB_STATUS_NA');
18000: fnd_msg_pub.ADD;
18001: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
18002: IF l_debug = 1 THEN

Line 18025: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_DISALLOW_TRANSACTION';

18021: log_statement(l_api_name, 'l_onhand_status_trx_allowed ', l_onhand_status_trx_allowed);
18022: END IF;
18023:
18024: IF (l_onhand_status_trx_allowed = 'N') then
18025: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_DISALLOW_TRANSACTION';
18026: fnd_message.set_name('WMS', 'WMS_DISALLOW_TRANSACTION');
18027: fnd_msg_pub.ADD;
18028: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
18029: IF l_debug = 1 THEN

Line 18217: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_LPN_UNAVAILABLE';

18213: IF l_debug = 1 THEN
18214: log_error_msg(l_api_name, x_msg_data);
18215: END IF;
18216:
18217: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_LPN_UNAVAILABLE';
18218: IF p_tree_id IS NOT NULL THEN -- Bug# 4006426
18219:
18220: IF l_debug = 1 THEN
18221: log_statement(l_api_name, 'insert_failed', 'Record failed to allocation. Rolling back and ' || 'invalidating LPN');

Line 18247: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_ATT_SUB_STATUS_NA';

18243: END IF;
18244: ELSE
18245:
18246: IF ( l_allowed = 'N') then
18247: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_ATT_SUB_STATUS_NA';
18248: fnd_message.set_name('WMS', 'WMS_ATT_SUB_STATUS_NA');
18249: fnd_msg_pub.ADD;
18250:
18251: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);

Line 18257: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_ATT_SERIAL_STATUS_NA' ;

18253: log_error_msg(l_api_name, x_msg_data);
18254: END IF;
18255:
18256: ELSIF l_serial_allowed = 'N' then
18257: WMS_ENGINE_PVT.G_SUGG_FAILURE_MESSAGE := 'WMS_ATT_SERIAL_STATUS_NA' ;
18258: fnd_message.set_name('WMS', 'WMS_ATT_SUB_STATUS_NA');
18259: fnd_msg_pub.ADD;
18260: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
18261:

Line 18906: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND wms_engine_pvt.g_transaction_action_id = 2) THEN

18902: --always use the locator specified on the move order line, even
18903: --if that locator is from common stock (not project)
18904: -- Bug 2666620: BackFlush MO Type Removed. It is now 5. Moreover Txn Action ID is 2 which is
18905: -- already handled.
18906: IF NOT (wms_engine_pvt.g_move_order_type = 5 AND wms_engine_pvt.g_transaction_action_id = 2) THEN
18907:
18908: IF l_debug = 1 THEN
18909: log_statement(l_api_name, 'do_project1', 'Calling do project check');
18910: END IF;