[Home] [Help]
137: --| belong to that range would not be |
138: --| picked up and redundant Replenishment |
139: --| POs won't be created. |
140: --| 05/09/2006 vchu Modified the INSERT INTO |
141: --| JMF_SUBCONTRACT_ORDERS_TEMP statement |
142: --| to populate the need_by_date as the |
143: --| promised_date from po_line_locations_all|
144: --| table, if need_by_date was null. |
145: --| 05/12/2006 vchu Bug fix for 5212199: Added where clause |
163: --| 06/13/2006 vchu Fixed bug 5153959: |
164: --| Modified the join statement with |
165: --| mtl_units_of_measure of the select |
166: --| statement for inserting into the |
167: --| JMF_SUBCONTRACT_ORDERS_TEMP temp table |
168: --| (in Load_Subcontract_Orders) to take |
169: --| the unit_meas_lookup_code from the PO |
170: --| Line if that of the PO Line Location |
171: --| was NULL. |
170: --| Line if that of the PO Line Location |
171: --| was NULL. |
172: --| 06/14/2006 vchu Added a join to po_releases_all table |
173: --| in the select statement for inserting |
174: --| into the JMF_SUBCONTRACT_ORDERS_TEMP |
175: --| temp table, in order to make sure the |
176: --| Blanket Releases are approved, if the |
177: --| shipments are against Blanket Releases. |
178: --| 06/16/2006 rajkrish Fixed the worker batch issue |
264:
265: G_PKG_NAME CONSTANT VARCHAR2(30) := 'JMF_SUBCONTRACT_ORDERS_PVT';
266: g_log_enabled BOOLEAN;
267:
268: TYPE g_SubcontractTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS_TEMP%ROWTYPE;
269: TYPE g_OsaTabTyp IS TABLE OF JMF_SUBCONTRACT_ORDERS%ROWTYPE;
270: TYPE g_Comp_TabTyp IS TABLE OF JMF_SHIKYU_COMPONENTS%ROWTYPE;
271: TYPE g_oem_tp_rec IS RECORD
272: ( oem_organization_id NUMBER
1293: , osa_item_id
1294: , osa_item_price
1295: , project_id
1296: , task_id
1297: FROM JMF_SUBCONTRACT_ORDERS_TEMP;
1298:
1299: -- Bugs 5198838 and 5212219: Should get the project id for the distributions
1300: -- of the Subcontracting Order Shipment as long as it is NOT NULL.
1301: -- Should not restrict the task id to be NOT NULL as well.
1321:
1322: --Get all the Subcontract orders that were not processed by the
1323: --Interlock processor.
1324:
1325: INSERT INTO JMF_SUBCONTRACT_ORDERS_TEMP
1326: ( subcontract_po_shipment_id
1327: , subcontract_po_header_id
1328: , subcontract_po_line_id
1329: , oem_organization_id
1580: THEN
1581: l_valid_flag := 'Y';
1582: l_curr_index := l_project_tbl.FIRST;
1583:
1584: UPDATE jmf_subcontract_orders_temp
1585: SET project_id = l_project_tbl(l_curr_index).project_id
1586: , task_id = l_project_tbl(l_curr_index).task_id
1587: WHERE subcontract_po_shipment_id = l_shipment_id;
1588: ELSE
1599: -- ORDERS table for processing.
1600:
1601: IF l_valid_flag = 'N'
1602: THEN
1603: DELETE FROM JMF_SUBCONTRACT_ORDERS_TEMP
1604: WHERE subcontract_po_shipment_id = l_subcontract_rec(i).subcontract_po_shipment_id;
1605:
1606: IF g_log_enabled THEN
1607: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1609: , G_PKG_NAME
1610: , '>> ' || l_program
1611: || ': l_valid_flag is ''N'': Deleting record with subcontract_po_shipment_id = '
1612: || l_subcontract_rec(i).subcontract_po_shipment_id
1613: || ' from JMF_SUBCONTRACT_ORDERS_TEMP'
1614: );
1615: END IF;
1616: END IF;
1617: ELSE
1614: );
1615: END IF;
1616: END IF;
1617: ELSE
1618: UPDATE JMF_SUBCONTRACT_ORDERS_TEMP
1619: SET tp_organization_id = l_subcontract_rec(i).tp_organization_id
1620: WHERE subcontract_po_shipment_id = l_subcontract_rec(i).subcontract_po_shipment_id;
1621:
1622: --Debug changes for bug 9315131
1666: , currency
1667: , quantity
1668: , project_id
1669: , task_id
1670: FROM JMF_SUBCONTRACT_ORDERS_TEMP ) jsot
1671: ON ( jso.subcontract_po_shipment_id = jsot.subcontract_po_shipment_id)
1672: WHEN NOT MATCHED THEN
1673: INSERT
1674: ( jso.subcontract_po_shipment_id