8852: --
8853: -- Pre Insert CTO Validation
8854: IF l_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
8855: --
8856: cto_workflow_api_pk.inventory_reservation_check(p_order_line_id => l_rsv_rec.demand_source_line_id, x_return_status => l_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data);
8857:
8858: IF (l_debug = 1) THEN
8859: debug_print('After CTO validation ' || l_return_status);
8860: END IF;
9633: --
9634: -- Post Insert CTO Validation
9635: IF l_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
9636: --
9637: cto_workflow_api_pk.wf_update_after_inv_reserv(p_order_line_id => l_rsv_rec.demand_source_line_id, x_return_status => l_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data);
9638:
9639: IF (l_debug = 1) THEN
9640: debug_print('After post CTO validation ' || l_return_status);
9641: END IF;
11116: debug_print('Pre Update CTO validation');
11117: END IF;
11118:
11119: IF l_orig_rsv_tbl(1).primary_reservation_quantity > l_to_rsv_rec.primary_reservation_quantity THEN
11120: cto_workflow_api_pk.inventory_unreservation_check
11121: (
11122: p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
11123: , p_rsv_quantity => l_orig_rsv_tbl(1).primary_reservation_quantity - l_to_rsv_rec.primary_reservation_quantity
11124: , x_return_status => l_return_status
11126: , x_msg_data => x_msg_data
11127: );
11128:
11129: ELSE --Else Condition Added for Bug#2467387.
11130: cto_workflow_api_pk.inventory_reservation_check
11131: (
11132: p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
11133: ,x_return_status => l_return_status
11134: ,x_msg_count => x_msg_count
11677: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
11678: --
11679: IF l_orig_rsv_tbl(1).primary_reservation_quantity > l_to_rsv_rec.primary_reservation_quantity THEN
11680: IF (l_debug = 1) THEN
11681: debug_print('Calling cto_workflow_api_pk.wf_update_after_inv_unreserv');
11682: END IF;
11683: cto_workflow_api_pk.wf_update_after_inv_unreserv
11684: (
11685: p_order_line_id => l_to_rsv_rec.demand_source_line_id
11679: IF l_orig_rsv_tbl(1).primary_reservation_quantity > l_to_rsv_rec.primary_reservation_quantity THEN
11680: IF (l_debug = 1) THEN
11681: debug_print('Calling cto_workflow_api_pk.wf_update_after_inv_unreserv');
11682: END IF;
11683: cto_workflow_api_pk.wf_update_after_inv_unreserv
11684: (
11685: p_order_line_id => l_to_rsv_rec.demand_source_line_id
11686: , x_return_status => l_return_status
11687: , x_msg_count => x_msg_count
11688: , x_msg_data => x_msg_data
11689: );
11690: ELSE --Else Condition Added for Bug#2467387.
11691: IF (l_debug = 1) THEN
11692: debug_print('Calling cto_workflow_api_pk.wf_update_after_inv_reserv');
11693: END IF;
11694: cto_workflow_api_pk.wf_update_after_inv_reserv
11695: (
11696: p_order_line_id => l_to_rsv_rec.demand_source_line_id
11690: ELSE --Else Condition Added for Bug#2467387.
11691: IF (l_debug = 1) THEN
11692: debug_print('Calling cto_workflow_api_pk.wf_update_after_inv_reserv');
11693: END IF;
11694: cto_workflow_api_pk.wf_update_after_inv_reserv
11695: (
11696: p_order_line_id => l_to_rsv_rec.demand_source_line_id
11697: ,x_return_status => l_return_status
11698: ,x_msg_count => x_msg_count
12843:
12844: -- Pre Delete CTO Validation
12845: IF l_tmp_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
12846: --
12847: cto_workflow_api_pk.inventory_unreservation_check(
12848: p_order_line_id => l_tmp_rsv_tbl(1).demand_source_line_id
12849: , p_rsv_quantity => l_tmp_rsv_tbl(1).primary_reservation_quantity
12850: , x_return_status => l_return_status
12851: , x_msg_count => x_msg_count
12906:
12907: -- Post Delete CTO Validation
12908: IF l_tmp_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
12909: --
12910: cto_workflow_api_pk.wf_update_after_inv_unreserv(
12911: p_order_line_id => l_tmp_rsv_tbl(1).demand_source_line_id
12912: , x_return_status => l_return_status
12913: , x_msg_count => x_msg_count
12914: , x_msg_data => x_msg_data
14204: --
14205: IF (l_debug = 1) THEN
14206: debug_print('Before calling cto work flow unresv check');
14207: END IF;
14208: cto_workflow_api_pk.inventory_unreservation_check(
14209: p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
14210: , p_rsv_quantity => l_to_rsv_rec.primary_reservation_quantity
14211: , x_return_status => l_return_status
14212: , x_msg_count => x_msg_count
14531: * inv_reservation_global.g_source_type_oe
14532: * ,inv_reservation_global.g_source_type_internal_ord
14533: * ,inv_reservation_global.g_source_type_rma) THEN
14534: * --
14535: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
14536: * p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
14537: * , x_return_status => l_return_status
14538: * , x_msg_count => x_msg_count
14539: * , x_msg_data => x_msg_data
14555: END IF;
14556: -- Pre Delete CTO Validation
14557: IF l_orig_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
14558: --
14559: cto_workflow_api_pk.inventory_unreservation_check(
14560: p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
14561: , p_rsv_quantity => l_to_rsv_rec.primary_reservation_quantity
14562: , x_return_status => l_return_status
14563: , x_msg_count => x_msg_count
14603: * inv_reservation_global.g_source_type_oe
14604: * ,inv_reservation_global.g_source_type_internal_ord
14605: * ,inv_reservation_global.g_source_type_rma) THEN
14606: * --
14607: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
14608: * p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
14609: * , x_return_status => l_return_status
14610: * , x_msg_count => x_msg_count
14611: * , x_msg_data => x_msg_data
14627: END IF;
14628: -- Pre Update CTO Validation
14629: IF l_orig_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
14630: --
14631: cto_workflow_api_pk.inventory_unreservation_check(
14632: p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
14633: , p_rsv_quantity => l_orig_rsv_tbl(1).primary_reservation_quantity
14634: , x_return_status => l_return_status
14635: , x_msg_count => x_msg_count
14655: inv_reservation_global.g_source_type_internal_ord,
14656: inv_reservation_global.g_source_type_rma) THEN
14657:
14658: --
14659: cto_workflow_api_pk.inventory_reservation_check(
14660: p_order_line_id => l_to_rsv_rec.demand_source_line_id
14661: , x_return_status => l_return_status
14662: , x_msg_count => x_msg_count
14663: , x_msg_data => x_msg_data
14830:
14831: IF l_orig_rsv_tbl(1).demand_source_type_id = 2 -- Bug 6195783 : Begin
14832: AND l_to_rsv_rec.demand_source_type_id = 9
14833: AND l_orig_rsv_tbl(1).primary_reservation_quantity = l_to_rsv_rec.primary_reservation_quantity THEN
14834: cto_workflow_api_pk.wf_update_after_inv_unreserv(
14835: p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
14836: , x_return_status => l_return_status
14837: , x_msg_count => x_msg_count
14838: , x_msg_data => x_msg_data
14850: * inv_reservation_global.g_source_type_oe
14851: * ,inv_reservation_global.g_source_type_internal_ord
14852: * ,inv_reservation_global.g_source_type_rma) THEN
14853: * --
14854: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
14855: * p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
14856: * , x_return_status => l_return_status
14857: * , x_msg_count => x_msg_count
14858: * , x_msg_data => x_msg_data
14881: issue has been reported in bug 2458523
14882: -- Pre Update CTO Validation
14883: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
14884: --
14885: cto_workflow_api_pk.inventory_unreservation_check(
14886: p_order_line_id => l_to_rsv_rec.demand_source_line_id
14887: , p_rsv_quantity => l_to_rsv_rec.primary_reservation_quantity
14888: , x_return_status => l_return_status
14889: , x_msg_count => x_msg_count
14910: inv_reservation_global.g_source_type_internal_ord,
14911: inv_reservation_global.g_source_type_rma) THEN
14912:
14913: --
14914: cto_workflow_api_pk.inventory_reservation_check(
14915: p_order_line_id => l_to_rsv_rec.demand_source_line_id
14916: , x_return_status => l_return_status
14917: , x_msg_count => x_msg_count
14918: , x_msg_data => x_msg_data
15024: * inv_reservation_global.g_source_type_oe
15025: * ,inv_reservation_global.g_source_type_internal_ord
15026: * ,inv_reservation_global.g_source_type_rma) THEN
15027: * --
15028: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
15029: * p_order_line_id => l_to_rsv_rec.demand_source_line_id
15030: * , x_return_status => l_return_status
15031: * , x_msg_count => x_msg_count
15032: * , x_msg_data => x_msg_data
15048: END IF;
15049: -- Pre Insert CTO Validation
15050: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
15051: --
15052: cto_workflow_api_pk.inventory_reservation_check(
15053: p_order_line_id => l_to_rsv_rec.demand_source_line_id
15054: , x_return_status => l_return_status
15055: , x_msg_count => x_msg_count
15056: , x_msg_data => x_msg_data
15286: -- transfer_reservation is called
15287: -- Post Insert CTO Validation
15288: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
15289: --
15290: cto_workflow_api_pk.wf_update_after_inv_reserv(p_order_line_id => l_to_rsv_rec.demand_source_line_id, x_return_status => l_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data);
15291:
15292: debug_print(' After CTO API' || l_return_status);
15293: --
15294: IF l_return_status = fnd_api.g_ret_sts_error THEN