[Home] [Help]
2675: l_dual_control := TRUE;
2676: END IF;
2677:
2678: -- INVCONV Include secondary parameters below
2679: inv_quantity_tree_pvt.query_tree(
2680: p_api_version_number => 1.0
2681: , p_init_msg_lst => fnd_api.g_true
2682: , x_return_status => l_return_status
2683: , x_msg_count => l_msg_count
2800: l_secondary_net_qty := l_satr; -- INVCONV
2801: END IF; -- INVCONV
2802: END IF;
2803:
2804: l_quantity_type := inv_quantity_tree_pvt.g_qr_same_demand;
2805: --
2806: inv_quantity_tree_pvt.update_quantities(
2807: p_api_version_number => 1.0
2808: , p_init_msg_lst => fnd_api.g_true
2802: END IF;
2803:
2804: l_quantity_type := inv_quantity_tree_pvt.g_qr_same_demand;
2805: --
2806: inv_quantity_tree_pvt.update_quantities(
2807: p_api_version_number => 1.0
2808: , p_init_msg_lst => fnd_api.g_true
2809: , x_return_status => l_return_status
2810: , x_msg_count => l_msg_count
2967: END IF; -- INVCONV
2968: --
2969: IF p_from_supply_source_type_id = inv_reservation_global.g_source_type_inv THEN
2970: -- INVCONV - Incorporate secondaries
2971: inv_quantity_tree_pvt.update_quantities(
2972: p_api_version_number => 1.0
2973: , p_init_msg_lst => fnd_api.g_true
2974: , x_return_status => l_return_status
2975: , x_msg_count => l_msg_count
2980: , p_subinventory_code => p_from_subinventory_code
2981: , p_locator_id => p_from_locator_id
2982: , p_primary_quantity => l_net_qty1
2983: , p_secondary_quantity => l_secondary_net_qty1
2984: , p_quantity_type => inv_quantity_tree_pvt.g_qr_other_demand
2985: , x_qoh => l_qoh
2986: , x_rqoh => l_rqoh
2987: , x_qr => l_qr
2988: , x_qs => l_qs
3039: END IF;
3040:
3041: --
3042: -- INVCONV - Incorporate secondaries into call
3043: inv_quantity_tree_pvt.update_quantities(
3044: p_api_version_number => 1.0
3045: , p_init_msg_lst => fnd_api.g_true
3046: , x_return_status => l_return_status
3047: , x_msg_count => l_msg_count
3052: , p_subinventory_code => p_from_subinventory_code
3053: , p_locator_id => p_from_locator_id
3054: , p_primary_quantity => l_net_qty1
3055: , p_secondary_quantity => l_secondary_net_qty1
3056: , p_quantity_type => inv_quantity_tree_pvt.g_qr_other_demand
3057: , x_qoh => l_qoh
3058: , x_rqoh => l_rqoh
3059: , x_qr => l_qr
3060: , x_qs => l_qs
3073: IF l_return_status = fnd_api.g_ret_sts_error THEN
3074: -- fail to modify in tree2
3075: -- undo the modification in tree1
3076: -- INVCONV - Incorporate secondaries into call
3077: inv_quantity_tree_pvt.update_quantities(
3078: p_api_version_number => 1.0
3079: , p_init_msg_lst => fnd_api.g_true
3080: , x_return_status => l_return_status
3081: , x_msg_count => l_msg_count
3086: , p_subinventory_code => p_from_subinventory_code
3087: , p_locator_id => p_from_locator_id
3088: , p_primary_quantity => -l_net_qty1
3089: , p_secondary_quantity => -l_secondary_net_qty1
3090: , p_quantity_type => inv_quantity_tree_pvt.g_qr_same_demand
3091: , x_qoh => l_qoh
3092: , x_rqoh => l_rqoh
3093: , x_qr => l_qr
3094: , x_qs => l_qs
3133: debug_print('Validate Qty :Action Update');
3134: END IF;
3135:
3136: -- INVCONV - Incorporate secondaries into call
3137: inv_quantity_tree_pvt.query_tree(
3138: p_api_version_number => 1.0
3139: , p_init_msg_lst => fnd_api.g_true
3140: , x_return_status => l_return_status
3141: , x_msg_count => l_msg_count
3206: AND p_check_availability = fnd_api.g_true )THEN
3207: --rollback quantity tree changes .
3208: IF l_modify_tree1 THEN
3209: -- INVCONV Incorporate secondaries
3210: inv_quantity_tree_pvt.update_quantities(
3211: p_api_version_number => 1.0
3212: , p_init_msg_lst => fnd_api.g_true
3213: , x_return_status => l_return_status
3214: , x_msg_count => l_msg_count
3219: , p_subinventory_code => p_from_subinventory_code
3220: , p_locator_id => p_from_locator_id
3221: , p_primary_quantity => -l_net_qty1
3222: , p_secondary_quantity => -l_secondary_net_qty1
3223: , p_quantity_type => inv_quantity_tree_pvt.g_qr_same_demand
3224: , x_qoh => l_qoh
3225: , x_rqoh => l_rqoh
3226: , x_qr => l_qr
3227: , x_qs => l_qs
3263: -- The from tree must also be updated with the quantity, since the
3264: -- from tree and the to tree are for the same organization and item
3265:
3266: -- INVCONV Incorporate Secondaries in call
3267: inv_quantity_tree_pvt.update_quantities(
3268: p_api_version_number => 1.0
3269: , p_init_msg_lst => fnd_api.g_true
3270: , x_return_status => l_return_status
3271: , x_msg_count => l_msg_count
3276: , p_subinventory_code => p_from_subinventory_code
3277: , p_locator_id => p_from_locator_id
3278: , p_primary_quantity => l_net_qty2
3279: , p_secondary_quantity => l_secondary_net_qty2
3280: , p_quantity_type => inv_quantity_tree_pvt.g_qr_other_demand
3281: , x_qoh => l_qoh
3282: , x_rqoh => l_rqoh
3283: , x_qr => l_qr
3284: , x_qs => l_qs
3296: IF l_return_status = fnd_api.g_ret_sts_success
3297: AND l_modify_tree2 THEN
3298:
3299: -- INVCONV Incorporate Secondaries in call
3300: inv_quantity_tree_pvt.update_quantities(
3301: p_api_version_number => 1.0
3302: , p_init_msg_lst => fnd_api.g_true
3303: , x_return_status => l_return_status
3304: , x_msg_count => l_msg_count
3309: , p_subinventory_code => p_to_subinventory_code
3310: , p_locator_id => p_to_locator_id
3311: , p_primary_quantity => l_net_qty2
3312: , p_secondary_quantity => l_secondary_net_qty2
3313: , p_quantity_type => inv_quantity_tree_pvt.g_qr_same_demand
3314: , x_qoh => l_qoh
3315: , x_rqoh => l_rqoh
3316: , x_qr => l_qr
3317: , x_qs => l_qs
3331: -- fail to modify in tree2
3332: -- undo the modification in tree1 if l_modify_tree1 is true
3333: IF l_modify_tree1 THEN
3334: -- INVCONV - Incorporate secondaries
3335: inv_quantity_tree_pvt.update_quantities(
3336: p_api_version_number => 1.0
3337: , p_init_msg_lst => fnd_api.g_true
3338: , x_return_status => l_return_status
3339: , x_msg_count => l_msg_count
3344: , p_subinventory_code => p_from_subinventory_code
3345: , p_locator_id => p_from_locator_id
3346: , p_primary_quantity => -l_net_qty1
3347: , p_secondary_quantity => -l_secondary_net_qty1
3348: , p_quantity_type => inv_quantity_tree_pvt.g_qr_same_demand
3349: , x_qoh => l_qoh
3350: , x_rqoh => l_rqoh
3351: , x_qr => l_qr
3352: , x_qs => l_qs
3374:
3375: --
3376: IF l_modify_tree2 THEN
3377: -- INVCONV - Incorporate secondaries
3378: inv_quantity_tree_pvt.update_quantities(
3379: p_api_version_number => 1.0
3380: , p_init_msg_lst => fnd_api.g_true
3381: , x_return_status => l_return_status
3382: , x_msg_count => l_msg_count
3387: , p_subinventory_code => p_from_subinventory_code
3388: , p_locator_id => p_from_locator_id
3389: , p_primary_quantity => -l_net_qty1
3390: , p_secondary_quantity => -l_secondary_net_qty1
3391: , p_quantity_type => inv_quantity_tree_pvt.g_qr_other_demand
3392: , x_qoh => l_qoh
3393: , x_rqoh => l_rqoh
3394: , x_qr => l_qr
3395: , x_qs => l_qs
8407: -- Bug 2354735: Proceed with Trees only if p_validation_flag = 'T'
8408: IF p_force_reservation_flag <> fnd_api.g_true
8409: AND p_validation_flag = fnd_api.g_true
8410: AND l_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_inv THEN
8411: inv_quantity_tree_pvt.create_tree
8412: (
8413: p_api_version_number => 1.0
8414: , p_init_msg_lst => fnd_api.g_true
8415: , x_return_status => l_return_status
8416: , x_msg_count => x_msg_count
8417: , x_msg_data => x_msg_data
8418: , p_organization_id => l_rsv_rec.organization_id
8419: , p_inventory_item_id => l_rsv_rec.inventory_item_id
8420: , p_tree_mode => inv_quantity_tree_pvt.g_reservation_mode
8421: , p_is_revision_control => is_revision_control(l_orig_item_cache_index)
8422: , p_is_lot_control => is_lot_control(l_orig_item_cache_index)
8423: , p_is_serial_control => is_serial_control(l_orig_item_cache_index)
8424: , p_asset_sub_only => FALSE
9965: (p_validation_flag = 'Q')) AND l_to_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_inv)
9966: THEN
9967: /*** End R12 ***/
9968:
9969: inv_quantity_tree_pvt.create_tree
9970: (
9971: p_api_version_number => 1.0
9972: , p_init_msg_lst => fnd_api.g_true
9973: , x_return_status => l_return_status
9974: , x_msg_count => x_msg_count
9975: , x_msg_data => x_msg_data
9976: , p_organization_id => l_orig_rsv_tbl(1).organization_id
9977: , p_inventory_item_id => l_orig_rsv_tbl(1).inventory_item_id
9978: , p_tree_mode => inv_quantity_tree_pvt.g_reservation_mode
9979: , p_is_revision_control => is_revision_control(l_orig_item_cache_index)
9980: , p_is_lot_control => is_lot_control(l_orig_item_cache_index)
9981: , p_is_serial_control => is_serial_control(l_orig_item_cache_index)
9982: , p_asset_sub_only => FALSE
10013: * above and this tree would actually be the same tree, but would
10014: * would have different tree_ids. We don't need to update the same
10015: * tree twice, so we don't need to create the same tree twice.
10016: * Instead, pass NULL to the modify_tree procedure.
10017: *inv_quantity_tree_pvt.create_tree
10018: * (
10019: * p_api_version_number => 1.0
10020: * , p_init_msg_lst => fnd_api.g_true
10021: * , x_return_status => l_return_status
10022: * , x_msg_count => x_msg_count
10023: * , x_msg_data => x_msg_data
10024: * , p_organization_id => l_to_rsv_rec.organization_id
10025: * , p_inventory_item_id => l_to_rsv_rec.inventory_item_id
10026: * , p_tree_mode => inv_quantity_tree_pvt.g_reservation_mode
10027: * , p_is_revision_control => is_revision_control(l_to_item_cache_index)
10028: * , p_is_lot_control => is_lot_control(l_to_item_cache_index)
10029: * , p_is_serial_control => is_serial_control(l_to_item_cache_index)
10030: * , p_asset_sub_only => FALSE
11316: -- call quantity processor to
11317: -- modify the tree so that the quantity tree
11318: -- reflect the deletion
11319: IF (l_debug = 1) THEN
11320: debug_print('calling inv_quantity_tree_pvt.create_tree');
11321: END IF;
11322: inv_quantity_tree_pvt.create_tree(
11323: p_api_version_number => 1.0
11324: , p_init_msg_lst => fnd_api.g_true
11318: -- reflect the deletion
11319: IF (l_debug = 1) THEN
11320: debug_print('calling inv_quantity_tree_pvt.create_tree');
11321: END IF;
11322: inv_quantity_tree_pvt.create_tree(
11323: p_api_version_number => 1.0
11324: , p_init_msg_lst => fnd_api.g_true
11325: , x_return_status => l_return_status
11326: , x_msg_count => x_msg_count
11326: , x_msg_count => x_msg_count
11327: , x_msg_data => x_msg_data
11328: , p_organization_id => l_tmp_rsv_tbl(1).organization_id
11329: , p_inventory_item_id => l_tmp_rsv_tbl(1).inventory_item_id
11330: , p_tree_mode => inv_quantity_tree_pvt.g_reservation_mode
11331: , p_is_revision_control => is_revision_control(l_orig_item_cache_index)
11332: , p_is_lot_control => is_lot_control(l_orig_item_cache_index)
11333: , p_is_serial_control => is_serial_control(l_orig_item_cache_index)
11334: , p_asset_sub_only => FALSE
11343: );
11344:
11345: IF l_return_status = fnd_api.g_ret_sts_error THEN
11346: IF (l_debug = 1) THEN
11347: debug_print('error calling inv_quantity_tree_pvt.create_tree');
11348: END IF;
11349: RAISE fnd_api.g_exc_error;
11350: END IF;
11351:
11351:
11352: --
11353: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
11354: IF (l_debug = 1) THEN
11355: debug_print('unexpected error calling inv_quantity_tree_pvt.create_tree');
11356: END IF;
11357: RAISE fnd_api.g_exc_unexpected_error;
11358: END IF;
11359:
11996: AND p_validation_flag = fnd_api.g_true THEN
11997: -- call quantity processor to
11998: -- modify the tree so that the quantity tree
11999: -- reflect the deletion
12000: inv_quantity_tree_pvt.create_tree(
12001: p_api_version_number => 1.0
12002: , p_init_msg_lst => fnd_api.g_true
12003: , x_return_status => l_return_status
12004: , x_msg_count => x_msg_count
12004: , x_msg_count => x_msg_count
12005: , x_msg_data => x_msg_data
12006: , p_organization_id => l_tmp_rsv_tbl(1).organization_id
12007: , p_inventory_item_id => l_tmp_rsv_tbl(1).inventory_item_id
12008: , p_tree_mode => inv_quantity_tree_pvt.g_reservation_mode
12009: , p_is_revision_control => is_revision_control(l_orig_item_cache_index)
12010: , p_is_lot_control => is_lot_control(l_orig_item_cache_index)
12011: , p_is_serial_control => is_serial_control(l_orig_item_cache_index)
12012: , p_asset_sub_only => FALSE
12924: END IF;
12925: END IF;
12926: -- INVCONV END
12927:
12928: inv_quantity_tree_pvt.create_tree
12929: (
12930: p_api_version_number => 1.0
12931: , p_init_msg_lst => fnd_api.g_true
12932: , x_return_status => l_return_status
12933: , x_msg_count => x_msg_count
12934: , x_msg_data => x_msg_data
12935: , p_organization_id => l_orig_rsv_tbl(1).organization_id
12936: , p_inventory_item_id => l_orig_rsv_tbl(1).inventory_item_id
12937: , p_tree_mode => inv_quantity_tree_pvt.g_reservation_mode
12938: , p_is_revision_control => is_revision_control(l_orig_item_cache_index)
12939: , p_is_lot_control => is_lot_control(l_orig_item_cache_index)
12940: , p_is_serial_control => is_serial_control(l_orig_item_cache_index)
12941: , p_asset_sub_only => FALSE
12959: RAISE fnd_api.g_exc_unexpected_error;
12960: END IF;
12961:
12962: --
12963: inv_quantity_tree_pvt.create_tree
12964: (
12965: p_api_version_number => 1.0
12966: , p_init_msg_lst => fnd_api.g_true
12967: , x_return_status => l_return_status
12968: , x_msg_count => x_msg_count
12969: , x_msg_data => x_msg_data
12970: , p_organization_id => l_to_rsv_rec.organization_id
12971: , p_inventory_item_id => l_to_rsv_rec.inventory_item_id
12972: , p_tree_mode => inv_quantity_tree_pvt.g_reservation_mode
12973: , p_is_revision_control => is_revision_control(l_to_item_cache_index)
12974: , p_is_lot_control => is_lot_control(l_to_item_cache_index)
12975: , p_is_serial_control => is_serial_control(l_to_item_cache_index)
12976: , p_asset_sub_only => FALSE
17072: IF (l_debug = 1) THEN
17073: debug_print('Calling do_check for tree_id = '||tree_rec.p_tree_id);
17074: END IF;
17075:
17076: inv_quantity_tree_pvt.do_check(p_api_version_number, p_init_msg_lst, l_return_status, x_msg_count, x_msg_data, tree_rec.p_tree_id, l_no_violation);
17077:
17078: IF l_return_status = fnd_api.g_ret_sts_error THEN
17079: RAISE fnd_api.g_exc_error;
17080: END IF;