DBA Data[Home] [Help]

APPS.AHL_OSP_PO_PVT dependencies on AHL_OSP_ORDERS_B

Line 123: -- This Procedure updates AHL_OSP_ORDERS_B with the Batch Id and Request Id

119: -- TO BE USED FOR DEBUGGING PURPOSE ONLY
120: PROCEDURE Call_PDOI_API(
121: p_batch_id IN NUMBER);
122:
123: -- This Procedure updates AHL_OSP_ORDERS_B with the Batch Id and Request Id
124: PROCEDURE Record_OSP_Submission(
125: p_osp_order_id IN NUMBER,
126: p_batch_id IN NUMBER,
127: p_request_id IN NUMBER,

Line 135: -- This Procedure updates AHL_OSP_ORDERS_B's PO_HEADER_ID and sets STATUS_CODE to PO_CREATED

131: PROCEDURE Associate_OSP_PO(
132: p_osp_order_id IN NUMBER,
133: x_po_header_id OUT NOCOPY NUMBER);
134:
135: -- This Procedure updates AHL_OSP_ORDERS_B's PO_HEADER_ID and sets STATUS_CODE to PO_CREATED
136: PROCEDURE Set_PO_Header_ID(
137: p_osp_order_id IN NUMBER,
138: p_po_header_id IN NUMBER);
139:

Line 145: -- This Procedure updates AHL_OSP_ORDERS_B.STATUS_CODE to SUBMISSION_FAILED

141: PROCEDURE Set_PO_Line_ID(
142: p_osp_order_line_id IN NUMBER,
143: p_po_line_id IN NUMBER);
144:
145: -- This Procedure updates AHL_OSP_ORDERS_B.STATUS_CODE to SUBMISSION_FAILED
146: PROCEDURE Set_Submission_Failed(
147: p_osp_order_id IN NUMBER);
148:
149: -- This Procedure handles cancelled PO Lines and is Part of PO Synchronization.

Line 173: -- This Procedure updates a record of AHL_OSP_ORDERS_B using the table handler.

169: PROCEDURE Handle_Approved_POs(
170: p_commit IN VARCHAR2,
171: x_return_status OUT NOCOPY VARCHAR2);
172:
173: -- This Procedure updates a record of AHL_OSP_ORDERS_B using the table handler.
174: -- All updates to this table from this Package should go through this procedure only
175: PROCEDURE Update_OSP_Order(
176: p_osp_order_id IN NUMBER,
177: p_batch_id IN NUMBER := NULL,

Line 289: FROM AHL_OSP_ORDERS_B

285: L_DEBUG_KEY CONSTANT VARCHAR2(150) := G_LOG_PREFIX || '.Create_Purchase_Order';
286:
287: CURSOR l_osp_id_csr(p_osp_order_number IN NUMBER) IS
288: SELECT OSP_ORDER_ID
289: FROM AHL_OSP_ORDERS_B
290: WHERE OSP_ORDER_NUMBER = p_osp_order_number;
291:
292: CURSOR l_osp_dtls_csr(p_osp_order_id IN NUMBER) IS
293: -- VENDOR_CONTACT_ID added by jaramana on May 27, 2005

Line 296: FROM AHL_OSP_ORDERS_B

292: CURSOR l_osp_dtls_csr(p_osp_order_id IN NUMBER) IS
293: -- VENDOR_CONTACT_ID added by jaramana on May 27, 2005
294: SELECT VENDOR_ID, VENDOR_SITE_ID, PO_AGENT_ID, PO_BATCH_ID, PO_INTERFACE_HEADER_ID, VENDOR_CONTACT_ID
295: , STATUS_CODE -- Added by jaramana on January 7, 2008 for the Requisition ER 6034236
296: FROM AHL_OSP_ORDERS_B
297: WHERE OSP_ORDER_ID = p_osp_order_id;
298:
299: -- Begin ER 266135 Fix
300: /*

Line 380: l_curr_status AHL_OSP_ORDERS_B.STATUS_CODE%TYPE;

376: l_temp_ret_org_id NUMBER;
377: l_temp_ret_org_loc_id NUMBER;
378:
379: -- Added by jaramana on January 7, 2008 for the Requisition ER 6034236
380: l_curr_status AHL_OSP_ORDERS_B.STATUS_CODE%TYPE;
381:
382: BEGIN
383:
384: -- Standard start of API savepoint

Line 637: -- Function : Updates AHL_OSP_ORDERS_B.PO_HEADER_ID and

633:
634: -- Start of Comments --
635: -- Procedure name : Associate_OSP_With_PO
636: -- Type : Private
637: -- Function : Updates AHL_OSP_ORDERS_B.PO_HEADER_ID and
638: -- AHL_OSP_ORDER_LINES.PO_LINE_ID with PO_HEADER_ID and
639: -- PO_LINE_ID respectively for a single submitted OSP Order.
640: -- Does not give error if the OSP Order is already associated
641: -- or if there is no corresponding PO yet.

Line 684: SELECT PO_HEADER_ID FROM AHL_OSP_ORDERS_B

680: x_msg_count OUT NOCOPY NUMBER,
681: x_msg_data OUT NOCOPY VARCHAR2) IS
682:
683: CURSOR l_validate_osp_csr(p_osp_order_id IN NUMBER) IS
684: SELECT PO_HEADER_ID FROM AHL_OSP_ORDERS_B
685: WHERE OSP_ORDER_ID = p_osp_order_id;
686: -- Don't throw error based on status
687: -- AND STATUS_CODE = G_OSP_SUBMITTED_STATUS;
688:

Line 833: -- Function : Updates AHL_OSP_ORDERS_B.PO_HEADER_ID and

829:
830: -- Start of Comments --
831: -- Procedure name : Associate_All_OSP_POs
832: -- Type : Private
833: -- Function : Updates AHL_OSP_ORDERS_B.PO_HEADER_ID and
834: -- AHL_OSP_ORDER_LINES.PO_LINE_ID with PO_HEADER_ID and
835: -- PO_LINE_ID respectively for all submitted OSP Orders.
836: -- Pre-reqs :
837: -- Parameters :

Line 869: SELECT OSP_ORDER_ID FROM AHL_OSP_ORDERS_B

865: x_msg_count OUT NOCOPY NUMBER,
866: x_msg_data OUT NOCOPY VARCHAR2) IS
867:
868: CURSOR l_get_osps_csr IS
869: SELECT OSP_ORDER_ID FROM AHL_OSP_ORDERS_B
870: WHERE STATUS_CODE = G_OSP_SUBMITTED_STATUS
871: AND PO_HEADER_ID IS NULL
872: AND PO_BATCH_ID IS NOT NULL
873: -- Added by jaramana on April 7, 2008 for bug 6609988

Line 1318: FROM PO_LINES_ALL PL, AHL_OSP_ORDERS_B OSP

1314: ----------------------------------------
1315: FUNCTION Has_New_PO_Line(p_osp_order_id IN NUMBER) RETURN VARCHAR2 IS
1316: CURSOR l_get_new_po_line_csr(p_osp_order_id IN NUMBER) IS
1317: SELECT PL.PO_LINE_ID
1318: FROM PO_LINES_ALL PL, AHL_OSP_ORDERS_B OSP
1319: WHERE PL.PO_HEADER_ID = OSP.PO_HEADER_ID AND
1320: OSP.OSP_ORDER_ID = p_osp_order_id AND
1321: NVL(PL.CANCEL_FLAG, 'N') <> 'Y' AND
1322: PL.PO_LINE_ID NOT IN (SELECT PO_LINE_ID from AHL_OSP_ORDER_LINES

Line 1355: SELECT 'x' FROM AHL_OSP_ORDERS_B

1351: PROCEDURE Validate_PO_Header(
1352: p_po_header_rec IN PO_Header_Rec_Type) IS
1353:
1354: CURSOR l_validate_osp_csr(p_osp_order_id IN NUMBER) IS
1355: SELECT 'x' FROM AHL_OSP_ORDERS_B
1356: WHERE OSP_ORDER_ID = p_osp_order_id
1357: -- The following condition commented out by jaramana on request of jeli
1358: -- on May 27, 2005 so that status update can be done later.
1359: -- AND STATUS_CODE = G_OSP_SUBMITTED_STATUS

Line 2133: SELECT PO.PO_HEADER_ID FROM PO_HEADERS_ALL PO, AHL_OSP_ORDERS_B OSP

2129: */
2130: -- Changes made by jaramana on December 19, 2005
2131: -- to improve the performace of this SQL by removing the Full Table Access
2132: CURSOR l_get_po_hdr_csr(p_osp_order_id IN NUMBER) IS
2133: SELECT PO.PO_HEADER_ID FROM PO_HEADERS_ALL PO, AHL_OSP_ORDERS_B OSP
2134: WHERE PO.REFERENCE_NUM = p_osp_order_id AND
2135: OSP.OSP_ORDER_ID = p_osp_order_id AND
2136: PO.VENDOR_ID = OSP.VENDOR_ID AND
2137: PO.VENDOR_SITE_ID = OSP.VENDOR_SITE_ID AND

Line 2152: SELECT PO_REQUEST_ID FROM AHL_OSP_ORDERS_B

2148: WHERE LINE_REFERENCE_NUM = p_osp_order_line_id AND
2149: PO_HEADER_ID = p_po_header_id;
2150:
2151: CURSOR l_get_request_id_csr(p_osp_order_id IN NUMBER) IS
2152: SELECT PO_REQUEST_ID FROM AHL_OSP_ORDERS_B
2153: WHERE OSP_ORDER_ID = p_osp_order_id;
2154:
2155: L_DEBUG_KEY CONSTANT VARCHAR2(150) := G_LOG_PREFIX || '.Associate_OSP_PO';
2156: l_po_header_id NUMBER;

Line 2175: -- Update AHL_OSP_ORDERS_B's PO_HEADER_ID

2171:
2172: OPEN l_get_po_hdr_csr(p_osp_order_id);
2173: FETCH l_get_po_hdr_csr INTO x_po_header_id;
2174: IF (l_get_po_hdr_csr%FOUND) THEN
2175: -- Update AHL_OSP_ORDERS_B's PO_HEADER_ID
2176: --dbms_output.put_line('About to Update AHL_OSP_ORDERS_B.PO_HEADER_ID with ' || x_po_header_id);
2177: Set_PO_Header_Id(p_osp_order_id => p_osp_order_id,
2178: p_po_header_id => x_po_header_id);
2179:

Line 2176: --dbms_output.put_line('About to Update AHL_OSP_ORDERS_B.PO_HEADER_ID with ' || x_po_header_id);

2172: OPEN l_get_po_hdr_csr(p_osp_order_id);
2173: FETCH l_get_po_hdr_csr INTO x_po_header_id;
2174: IF (l_get_po_hdr_csr%FOUND) THEN
2175: -- Update AHL_OSP_ORDERS_B's PO_HEADER_ID
2176: --dbms_output.put_line('About to Update AHL_OSP_ORDERS_B.PO_HEADER_ID with ' || x_po_header_id);
2177: Set_PO_Header_Id(p_osp_order_id => p_osp_order_id,
2178: p_po_header_id => x_po_header_id);
2179:
2180: --dbms_output.put_line('Updated po_header_id. Logging Transaction...');

Line 2262: AHL_OSP_ORDERS_B OSP

2258: CURSOR l_get_cancelled_po_lines_csr IS
2259: SELECT PL.PO_LINE_ID, OL.OSP_ORDER_LINE_ID, PO.REFERENCE_NUM,
2260: OL.OBJECT_VERSION_NUMBER, OSP.OBJECT_VERSION_NUMBER
2261: FROM PO_LINES_ALL PL, PO_HEADERS_ALL PO, AHL_OSP_ORDER_LINES OL,
2262: AHL_OSP_ORDERS_B OSP
2263: WHERE PL.CANCEL_FLAG = 'Y' AND -- Canceled PO Line
2264: PL.PO_HEADER_ID = PO.PO_HEADER_ID AND
2265: PO.INTERFACE_SOURCE_CODE = AHL_GLOBAL.AHL_APP_SHORT_NAME AND -- AHL Created PO
2266: PO.REFERENCE_NUM = OL.OSP_ORDER_ID AND -- Related to the OSP Order

Line 2416: FROM AHL_OSP_ORDER_LINES OL, AHL_OSP_ORDERS_B OSP

2412:
2413: CURSOR l_get_deleted_po_lines_csr IS
2414: SELECT OL.OSP_ORDER_ID, OL.OSP_ORDER_LINE_ID,
2415: OL.OBJECT_VERSION_NUMBER, OSP.OBJECT_VERSION_NUMBER
2416: FROM AHL_OSP_ORDER_LINES OL, AHL_OSP_ORDERS_B OSP
2417: WHERE OL.PO_LINE_ID IS NOT NULL AND -- PO Created
2418: NVL(OL.STATUS_CODE, ' ') <> G_OL_PO_DELETED_STATUS AND -- Not yet updated
2419: OSP.OSP_ORDER_ID = OL.OSP_ORDER_ID AND
2420: -- Added by jaramana on April 7, 2008 for bug 6609988

Line 2564: FROM AHL_OSP_ORDERS_B OSP, PO_HEADERS_ALL PO

2560: x_return_status OUT NOCOPY VARCHAR2) IS
2561:
2562: CURSOR l_get_approved_POs_csr IS
2563: SELECT OSP.OSP_ORDER_ID, OSP.PO_HEADER_ID, OSP.OE_HEADER_ID
2564: FROM AHL_OSP_ORDERS_B OSP, PO_HEADERS_ALL PO
2565: WHERE OSP.STATUS_CODE = G_OSP_PO_CREATED_STATUS AND -- PO Created
2566: OSP.PO_HEADER_ID = PO.PO_HEADER_ID AND -- Join
2567: -- Added by jaramana on April 7, 2008 for bug 6609988
2568: OSP.OPERATING_UNIT_ID = MO_GLOBAL.get_current_org_id() AND

Line 2679: -- This procedure does a direct update of the AHL_OSP_ORDERS_B and the AHL_OSP_ORDER_LINES

2675: -- we need to change the OSP order to bring it to a consistent state.
2676: -- This procedure basically looks for OSP Orders for which the PO has been deleted
2677: -- and resets some values and corrects the status of the order as well as the lines
2678: -- so that the OSP Order can be resubmitted and a different PO can be created.
2679: -- This procedure does a direct update of the AHL_OSP_ORDERS_B and the AHL_OSP_ORDER_LINES
2680: -- tables and does not call the process_osp_order API to avoid unwanted validations
2681: ----------------------------------------
2682: PROCEDURE Handle_Deleted_PO_Headers(
2683: p_commit IN VARCHAR2,

Line 2692: FROM ahl_osp_orders_b osp

2688: osp.object_version_number,
2689: osp.po_header_id,
2690: osp.status_code,
2691: osp.order_type_code
2692: FROM ahl_osp_orders_b osp
2693: WHERE osp.status_code = G_OSP_PO_CREATED_STATUS AND
2694: osp.order_type_code in ('SERVICE', 'EXCHANGE') AND
2695: -- Added by jaramana on April 7, 2008 for bug 6609988
2696: osp.operating_unit_id = MO_GLOBAL.get_current_org_id() AND

Line 2757: update ahl_osp_orders_b

2753: END LOOP;
2754: CLOSE get_osp_line_dtls_csr;
2755: -- Now for the OSP Order Header, reset PO_HEADER_ID, PO_BATCH_ID, PO_REQUEST_ID and PO_INTERFACE_HEADER_ID.
2756: -- set STATUS_CODE to "ENTERED" and increment OVN
2757: update ahl_osp_orders_b
2758: set po_header_id = null,
2759: po_batch_id = null,
2760: po_request_id = null,
2761: po_interface_header_id = null,

Line 2817: -- This procedure does a direct update of the AHL_OSP_ORDERS_B and the AHL_OSP_ORDER_LINES

2813: -- we need to change the OSP order to bring it to a consistent state.
2814: -- This procedure basically looks for OSP Orders for which the SO has been deleted
2815: -- and resets some values of the order as well as the lines so that a new shipment
2816: -- can be created for the OSP Order if required.
2817: -- This procedure does a direct update of the AHL_OSP_ORDERS_B and the AHL_OSP_ORDER_LINES
2818: -- tables and does not call the process_osp_order API to avoid unwanted validations.
2819: ----------------------------------------
2820: PROCEDURE Handle_Deleted_Sales_Orders(
2821: p_commit IN VARCHAR2,

Line 2829: FROM ahl_osp_orders_b osp

2825: SELECT osp.osp_order_id,
2826: osp.object_version_number,
2827: osp.oe_header_id,
2828: osp.status_code
2829: FROM ahl_osp_orders_b osp
2830: WHERE osp.status_code <> 'CLOSED' AND
2831: osp.oe_header_id IS NOT NULL AND
2832: -- Added by jaramana on April 7, 2008 for bug 6609988
2833: osp.operating_unit_id = MO_GLOBAL.get_current_org_id() AND

Line 2886: update ahl_osp_orders_b

2882: where osp_order_line_id = l_osp_line_details_rec.osp_order_line_id;
2883: END LOOP;
2884: CLOSE get_osp_line_dtls_csr;
2885: -- Now for the OSP Order Header, reset OE_HEADER_ID and increment OVN
2886: update ahl_osp_orders_b
2887: set OE_HEADER_ID = null,
2888: object_version_number = l_osp_details_rec.object_version_number + 1,
2889: last_update_date = TRUNC(sysdate),
2890: last_updated_by = fnd_global.user_id,

Line 2931: -- This Procedure updates AHL_OSP_ORDERS_B with the Batch Id, Request Id and Interface Header Id

2927:
2928: END Handle_Deleted_Sales_Orders;
2929:
2930: ----------------------------------------
2931: -- This Procedure updates AHL_OSP_ORDERS_B with the Batch Id, Request Id and Interface Header Id
2932: ----------------------------------------
2933: PROCEDURE Record_OSP_Submission(
2934: p_osp_order_id IN NUMBER,
2935: p_batch_id IN NUMBER,

Line 2946: -- This Procedure updates AHL_OSP_ORDERS_B's PO_HEADER_ID and sets STATUS_CODE to PO_CREATED

2942: p_intf_hdr_id => p_intf_hdr_id);
2943: END Record_OSP_Submission;
2944:
2945: ----------------------------------------
2946: -- This Procedure updates AHL_OSP_ORDERS_B's PO_HEADER_ID and sets STATUS_CODE to PO_CREATED
2947: ----------------------------------------
2948: PROCEDURE Set_PO_Header_ID(
2949: p_osp_order_id IN NUMBER,
2950: p_po_header_id IN NUMBER) IS

Line 2958: -- This Procedure updates AHL_OSP_ORDERS_B.STATUS_CODE to SUBMISSION_FAILED

2954: p_status_code => G_OSP_PO_CREATED_STATUS);
2955: END Set_PO_Header_ID;
2956:
2957: ----------------------------------------
2958: -- This Procedure updates AHL_OSP_ORDERS_B.STATUS_CODE to SUBMISSION_FAILED
2959: ----------------------------------------
2960: PROCEDURE Set_Submission_Failed(
2961: p_osp_order_id IN NUMBER) IS
2962: BEGIN

Line 3103: -- This Procedure updates a record of AHL_OSP_ORDERS_B using the table handler

3099: END IF;
3100: END Set_PO_Line_ID;
3101:
3102: ----------------------------------------
3103: -- This Procedure updates a record of AHL_OSP_ORDERS_B using the table handler
3104: -- All updates to this table from this Package should go through this procedure only
3105: ----------------------------------------
3106: PROCEDURE Update_OSP_Order(
3107: p_osp_order_id IN NUMBER,

Line 3378: FROM AHL_OSP_ORDERS_B

3374:
3375: -- cursor to get the OSP order number for a given order id
3376: CURSOR get_OSP_Order_Number (c_order_id NUMBER) IS
3377: SELECT osp_order_number
3378: FROM AHL_OSP_ORDERS_B
3379: WHERE osp_order_id = c_order_id;
3380:
3381: l_debug_key CONSTANT VARCHAR2(150) := G_LOG_PREFIX || '.create_manual_PO_Number';
3382: l_manual_po_number PO_HEADERS_INTERFACE.DOCUMENT_NUM%TYPE := NULL;