[Home] [Help]
3024:
3025: Debug('NEW ESTIMATE DETAIL ID =' || x_estimate_detail_id,
3026: l_mod_name,
3027: 1);
3028: Debug('Call csd_product_transactions_pkg.insert_row to insert prod txns',
3029: l_mod_name,
3030: 1);
3031:
3032: -- Note (TTRV) at this point I would like to derive values for the new columns, every column is not
3034: -- they need not be filled at the time of creation of product transaction record. Some of the columns
3035: -- are updated by update programs.
3036: -- Please come back and verify that for repair types, Exchange, Advance Exchange, Replacement
3037: -- non-source columns are picked from UI. These comments are added by saupadhy TTRV
3038: Csd_Product_Transactions_Pkg.INSERT_ROW(px_PRODUCT_TRANSACTION_ID => x_product_txn_rec.PRODUCT_TRANSACTION_ID,
3039: p_REPAIR_LINE_ID => x_product_txn_rec.REPAIR_LINE_ID,
3040: p_ESTIMATE_DETAIL_ID => x_estimate_detail_id,
3041: p_ACTION_TYPE => x_product_txn_rec.ACTION_TYPE,
3042: p_ACTION_CODE => x_product_txn_rec.ACTION_CODE,
3209: Debug('process_sales_order failed', l_mod_name, 1);
3210: RAISE CREATE_ORDER;
3211: END IF;
3212:
3213: UPDATE csd_product_transactions
3214: SET prod_txn_status = 'SUBMITTED',
3215: interface_to_om_flag = 'Y'
3216: WHERE product_transaction_id =
3217: x_product_txn_rec.PRODUCT_TRANSACTION_ID;
3561: END IF;
3562: END IF;
3563:
3564: -- -- Update product txn with the status
3565: -- UPDATE csd_product_transactions
3566: -- SET prod_txn_status = 'BOOKED',
3567: -- book_sales_order_flag = 'Y'
3568: -- WHERE product_transaction_id = x_product_txn_rec.PRODUCT_TRANSACTION_ID;
3569: -- IF SQL%NOTFOUND then
3815: -- swai: bug 5931926 - 12.0.2 added 3rd party action type
3816: IF (x_product_txn_rec.ACTION_TYPE IN
3817: ('SHIP', 'WALK_IN_ISSUE', 'SHIP_THIRD_PTY'))
3818: THEN
3819: UPDATE csd_product_transactions
3820: SET prod_txn_status = 'RELEASED',
3821: release_sales_order_flag = 'Y'
3822: WHERE product_transaction_id =
3823: x_product_txn_rec.PRODUCT_TRANSACTION_ID;
3851: -- swai: bug 5931926 - 12.0.2 added 3rd party action type
3852: IF (x_product_txn_rec.ACTION_TYPE IN
3853: ('SHIP', 'WALK_IN_ISSUE', 'SHIP_THIRD_PTY'))
3854: THEN
3855: UPDATE csd_product_transactions
3856: SET prod_txn_status = 'BOOKED'
3857: WHERE product_transaction_id =
3858: x_product_txn_rec.PRODUCT_TRANSACTION_ID;
3859: IF SQL%NOTFOUND
3956: -- swai: bug 5931926 - 12.0.2 added 3rd party action type
3957: IF (x_product_txn_rec.ACTION_TYPE IN
3958: ('SHIP', 'WALK_IN_ISSUE', 'SHIP_THIRD_PTY'))
3959: THEN
3960: UPDATE csd_product_transactions
3961: SET prod_txn_status = 'SHIPPED',
3962: ship_sales_order_flag = 'Y'
3963: WHERE product_transaction_id =
3964: x_product_txn_rec.PRODUCT_TRANSACTION_ID;
4017: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
4018: ROLLBACK TO create_sales_order;
4019: -- update the prod txn as the charge
4020: -- line was not interfaced
4021: UPDATE csd_product_transactions
4022: SET interface_to_om_flag = 'N',
4023: book_sales_order_flag = 'N',
4024: release_sales_order_flag = 'N',
4025: ship_sales_order_flag = 'N'
4040: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
4041: ROLLBACK TO book_sales_order;
4042: -- update the prod txn as the order
4043: -- line was not booked
4044: UPDATE csd_product_transactions
4045: SET book_sales_order_flag = 'N',
4046: release_sales_order_flag = 'N',
4047: ship_sales_order_flag = 'N'
4048: WHERE product_transaction_id =
4062: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
4063: ROLLBACK TO release_sales_order;
4064: -- update the prod txn as the order
4065: -- line was not booked
4066: UPDATE csd_product_transactions
4067: SET release_sales_order_flag = 'N',
4068: ship_sales_order_flag = 'N'
4069: WHERE product_transaction_id =
4070: x_product_txn_rec.PRODUCT_TRANSACTION_ID;
4074: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
4075: ROLLBACK TO ship_sales_order;
4076: -- update the prod txn as the order
4077: -- line was not booked
4078: UPDATE csd_product_transactions
4079: SET ship_sales_order_flag = 'N'
4080: WHERE product_transaction_id =
4081: x_product_txn_rec.PRODUCT_TRANSACTION_ID;
4082: Fnd_Msg_Pub.Count_And_Get(p_count => x_msg_count,
4537: x_product_txn_rec.currency_code := l_curr_code;
4538: x_product_txn_rec.line_category_code := l_line_category_code;
4539: x_estimate_detail_id := x_product_txn_rec.estimate_detail_id;
4540:
4541: Csd_Gen_Utility_Pvt.ADD('Call csd_product_transactions_pkg.insert_row to insert prod txns');
4542:
4543: Csd_Product_Transactions_Pkg.INSERT_ROW(px_PRODUCT_TRANSACTION_ID => x_product_txn_rec.PRODUCT_TRANSACTION_ID,
4544: p_REPAIR_LINE_ID => x_product_txn_rec.REPAIR_LINE_ID,
4545: p_ESTIMATE_DETAIL_ID => x_estimate_detail_id,
4539: x_estimate_detail_id := x_product_txn_rec.estimate_detail_id;
4540:
4541: Csd_Gen_Utility_Pvt.ADD('Call csd_product_transactions_pkg.insert_row to insert prod txns');
4542:
4543: Csd_Product_Transactions_Pkg.INSERT_ROW(px_PRODUCT_TRANSACTION_ID => x_product_txn_rec.PRODUCT_TRANSACTION_ID,
4544: p_REPAIR_LINE_ID => x_product_txn_rec.REPAIR_LINE_ID,
4545: p_ESTIMATE_DETAIL_ID => x_estimate_detail_id,
4546: p_ACTION_TYPE => x_product_txn_rec.ACTION_TYPE,
4547: p_ACTION_CODE => x_product_txn_rec.ACTION_CODE,
4930: ROLLBACK TO UPDATE_PRODUCT_TXN_PVT;
4931:
4932: -- update the prod txn as the charge
4933: -- line was not interfaced
4934: UPDATE csd_product_transactions
4935: SET interface_to_om_flag = 'N',
4936: book_sales_order_flag = 'N',
4937: release_sales_order_flag = 'N',
4938: ship_sales_order_flag = 'N'
4944: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
4945: ROLLBACK TO book_sales_order;
4946: -- update the prod txn as the order
4947: -- line was not booked
4948: UPDATE csd_product_transactions
4949: SET book_sales_order_flag = 'N',
4950: release_sales_order_flag = 'N',
4951: ship_sales_order_flag = 'N'
4952: WHERE product_transaction_id =
4957: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
4958: ROLLBACK TO release_sales_order;
4959: -- update the prod txn as the order
4960: -- line was not booked
4961: UPDATE csd_product_transactions
4962: SET release_sales_order_flag = 'N',
4963: ship_sales_order_flag = 'N'
4964: WHERE product_transaction_id =
4965: x_product_txn_rec.PRODUCT_TRANSACTION_ID;
4969: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
4970: ROLLBACK TO ship_sales_order;
4971: -- update the prod txn as the order
4972: -- line was not booked
4973: UPDATE csd_product_transactions
4974: SET ship_sales_order_flag = 'N'
4975: WHERE product_transaction_id =
4976: x_product_txn_rec.PRODUCT_TRANSACTION_ID;
4977: Fnd_Msg_Pub.Count_And_Get(p_count => x_msg_count,
5111: -- only if it is not interfaced
5112: BEGIN
5113: SELECT a.estimate_detail_id
5114: INTO l_est_detail_id
5115: FROM csd_product_transactions a, cs_estimate_details b
5116: WHERE a.estimate_detail_id = b.estimate_detail_id
5117: AND a.product_transaction_id = p_product_txn_id
5118: AND b.order_header_id IS NULL;
5119:
5169: END IF;
5170:
5171: IF (g_debug > 0)
5172: THEN
5173: Csd_Gen_Utility_Pvt.ADD('Call csd_product_transactions_pkg.Delete_Row');
5174: END IF;
5175:
5176: Csd_Product_Transactions_Pkg.Delete_Row(p_PRODUCT_TRANSACTION_ID => p_product_txn_id);
5177: END IF; --end of delete
5172: THEN
5173: Csd_Gen_Utility_Pvt.ADD('Call csd_product_transactions_pkg.Delete_Row');
5174: END IF;
5175:
5176: Csd_Product_Transactions_Pkg.Delete_Row(p_PRODUCT_TRANSACTION_ID => p_product_txn_id);
5177: END IF; --end of delete
5178:
5179: -- Api body ends here
5180:
8276: book_sales_order_flag,
8277: release_sales_order_flag,
8278: ship_sales_order_flag,
8279: object_version_number
8280: FROM csd_product_transactions
8281: WHERE product_transaction_id = p_prod_txn_id;
8282:
8283: CURSOR released_lines_cur(p_order_header_id IN NUMBER, p_Order_Line_id IN NUMBER) IS
8284: SELECT source_header_id, source_line_id, released_status
8449: l_module_name || '.check_in_parameters',
8450: 'product txn id is valid');
8451: END IF;
8452:
8453: -- validate the prod_txn_id if it exists in csd_product_transactions
8454: IF NOT
8455: (Csd_Process_Util.validate_prod_txn_id(p_prod_txn_id => x_product_txn_rec.product_transaction_id))
8456: THEN
8457: IF l_exception_level >= l_debug_level
8794: FOR released_line_rec IN released_lines_cur(x_product_txn_rec.order_header_id,
8795: x_product_txn_rec.order_line_id)
8796: LOOP
8797: -- update product transaction tables
8798: UPDATE csd_product_transactions
8799: SET prod_txn_status = C_Status_Released,
8800: release_sales_order_flag = C_Yes,
8801: object_version_number = Object_Version_Number + 1,
8802: Last_Update_Date = SYSDATE,
8981: FOR Shipped_line_rec IN Shipped_lines_cur(x_product_txn_rec.order_header_id,
8982: x_product_txn_rec.Order_line_id)
8983: LOOP
8984: -- update product transaction tables
8985: UPDATE csd_product_transactions
8986: SET -- prod_txn_status = C_Status_Shipped ,
8987: release_sales_order_flag = C_Yes,
8988: ship_sales_order_flag = C_Yes,
8989: object_version_number = Object_Version_Number + 1,
9158: SELECT cpt.product_Transaction_Id,
9159: ced.Estimate_Detail_Id,
9160: ced.order_header_Id,
9161: ced.order_Line_Id
9162: FROM csd_product_Transactions cpt, cs_estimate_Details ced
9163: WHERE cpt.repair_line_id = p_Repair_Line_Id
9164: AND cpt.estimate_detail_id = ced.estimate_detail_id;
9165: BEGIN
9166: -- Standard call to check for call compatibility.
9299: -- CHeck if there are any product txn lines for a given repair line id
9300: BEGIN
9301: SELECT COUNT(Product_Transaction_Id)
9302: INTO l_Prod_Txn_Lines_Count
9303: FROM csd_product_Transactions
9304: WHERE Repair_Line_id = p_Repair_Line_Id;
9305: IF l_Prod_Txn_Lines_Count > 0
9306: THEN
9307: -- Default product transaction lines are not created as product transaction lines exist