[Home] [Help]
218: AND config_rev_nbr = p_config_rev_nbr
219: AND inventory_item_id = l_model_line_rec.inventory_item_id;
220:
221: -- Bug 6073974 Update the Configuration id for model line
222: UPDATE OE_ORDER_LINES_ALL
223: SET CONFIGURATION_ID = l_model_line_rec.configuration_id
224: WHERE inventory_item_id = l_model_line_rec.inventory_item_id
225: AND LINE_ID = l_model_line_rec.line_id;
226:
337: ELSE
338: RAISE FND_API.G_EXC_ERROR;
339: END IF;
340: ELSE
341: -- If we successfully save the configuration in oe_order_lines then
342: -- Time to delete previous revisions from spc
343:
344: IF l_model_line_rec.config_header_id is not null AND
345: l_model_line_rec.config_rev_nbr is not null
409: /*------------------------------------------------------------------
410: PROCEDURE Handle_Inserts
411:
412: if a component is present in cz_config_details_v but not present
413: in oe_order_lines, we need to insert it.
414:
415: Change Record:
416: Bug 2181376: explode bill is not required since in this
417: procedure we will selecet all required data from cz_config_details_v
458: WHERE c.config_hdr_id = p_config_hdr_id
459: AND c.config_rev_nbr = p_config_rev_nbr
460: AND NOT EXISTS
461: ( SELECT 'X'
462: FROM oe_order_lines l
463: WHERE l.top_model_line_id = p_model_line_rec.line_id
464: AND l.component_code = c.component_code
465: AND l.configuration_id = c.config_item_id
466: AND l.open_flag = 'Y')
490: END IF;
491:
492: BEGIN
493:
494: UPDATE oe_order_lines oe
495: SET ( configuration_id , sort_order ) =
496: (SELECT config_item_id , bom_sort_order --bug6628691
497: FROM cz_config_details_v
498: WHERE config_hdr_id = p_config_hdr_id
513: IF l_debug_level > 0 THEN
514: oe_debug_pub.add( 'CRM 1:CONFIGURATION_ID NOT UPDATED ' , 3 ) ;
515: END IF;
516:
517: UPDATE oe_order_lines oe
518: SET ( configuration_id , sort_order ) =
519: (SELECT config_item_id , bom_sort_order --bug6628691
520: FROM cz_config_details_v
521: WHERE config_hdr_id = p_config_hdr_id
728: l_class_line_rec.inventory_item_id := config_rec.inventory_item_id;
729: l_class_line_rec.configuration_id := config_rec.config_item_id;
730: l_class_line_rec.ordered_item := l_concatenated_segments;
731:
732: SELECT OE_ORDER_LINES_S.NEXTVAL
733: INTO l_class_line_rec.line_id
734: FROM DUAL;
735:
736: l_class_line_rec.pricing_quantity_uom
793: /*------------------------------------------------------------
794: PROCEDURE Handle_Inserts_Old
795:
796: if a component is present in cz_config_details_v but not present
797: in oe_order_lines, we need to insert it.
798:
799: Change Record:
800: Bug 2181376: explode bill is not required since in this
801: procedure we will selecet all required data from cz_config_details_v
826: WHERE c.config_hdr_id = p_config_hdr_id
827: AND c.config_rev_nbr = p_config_rev_nbr
828: AND NOT EXISTS
829: ( SELECT 'X'
830: FROM oe_order_lines l
831: WHERE l.top_model_line_id = p_model_line_rec.line_id
832: AND l.component_code = c.component_code
833: AND l.open_flag = 'Y')
834: ORDER BY c.component_code;
909: l_class_line_rec.sort_order := config_rec.bom_sort_order;
910: l_class_line_rec.inventory_item_id := config_rec.inventory_item_id;
911: l_class_line_rec.ordered_item := l_concatenated_segments;
912:
913: SELECT OE_ORDER_LINES_S.NEXTVAL
914: INTO l_class_line_rec.line_id
915: FROM DUAL;
916:
917: l_class_line_rec.pricing_quantity_uom
958:
959: /*-----------------------------------------------------------
960: PROCEDURE Handle_Updates
961:
962: If quantity of a component is different in oe_order_lines and
963: cz_config_details_v, we need to update that component.
964:
965: for config UI only: if there is a constraint on qty change,
966: should we pass a hardcoded reason/comment, or should we fail?
988: ,l.ordered_quantity
989: ,l.item_type_code
990: ,c.line_type
991: ,c.bom_sort_order
992: FROM CZ_CONFIG_DETAILS_V c, oe_order_lines l
993: WHERE c.config_hdr_id = p_config_hdr_id
994: AND c.config_rev_nbr = p_config_rev_nbr
995: AND (c.quantity <> l.ordered_quantity OR
996: c.line_type <> l.line_type_id OR
1097:
1098: /*-----------------------------------------------------------
1099: PROCEDURE Handle_Updates_Old
1100:
1101: If quantity of a component is different in oe_order_lines and
1102: cz_config_details_v, we need to update that component.
1103:
1104: for config UI only: if there is a constraint on qty change,
1105: should we pass a hardcoded reason/comment, or should we fail?
1121: ,c.component_code
1122: ,c.quantity
1123: ,l.ordered_quantity
1124: ,l.item_type_code
1125: FROM CZ_CONFIG_DETAILS_V c, oe_order_lines l
1126: WHERE c.config_hdr_id = p_config_hdr_id
1127: AND c.config_rev_nbr = p_config_rev_nbr
1128: AND c.quantity <> l.ordered_quantity
1129: AND l.top_model_line_id = p_model_line_rec.line_id
1192:
1193: /*---------------------------------------------------------
1194: PROCEDURE Handle_Deletes
1195:
1196: If a component exists in oe_order_lines, but does not exist
1197: in cz_config_details_v, we need to delete that component.
1198:
1199: Change Record:
1200:
1207: 1) you can not enter reason and comment in configurator, so
1208: if cancellation constraint is on, delete will fail.
1209: 2) configuraor will take care of cascading change to
1210: child and parent lines, so we do not have to check in
1211: oe_order_lines.
1212: ----------------------------------------------------------*/
1213:
1214: PROCEDURE Handle_Deletes
1215: ( p_model_line_rec IN OE_Order_Pub.Line_rec_Type
1222: IS
1223: CURSOR config_del_cursor IS
1224: SELECT l.line_id, l.item_type_code, l.link_to_line_id,
1225: l.component_code, nvl(l.cancelled_flag, 'N') cancelled_flag
1226: FROM oe_order_lines l
1227: WHERE l.top_model_line_id = p_model_line_rec.line_id
1228: AND (l.item_type_code = OE_GLOBALS.G_ITEM_CLASS OR
1229: l.item_type_code = OE_GLOBALS.G_ITEM_OPTION OR
1230: l.item_type_code = OE_GLOBALS.G_ITEM_KIT)
1381:
1382: /*---------------------------------------------------------
1383: PROCEDURE Handle_Deletes_Old
1384:
1385: If a component exists in oe_order_lines, but does not exist
1386: in cz_config_details_v, we need to delete that component.
1387:
1388: Change Record:
1389:
1396: 1) you can not enter reason and comment in configurator, so
1397: if cancellation constraint is on, delete will fail.
1398: 2) configuraor will take care of cascading change to
1399: child and parent lines, so we do not have to check in
1400: oe_order_lines.
1401: ----------------------------------------------------------*/
1402:
1403: PROCEDURE Handle_Deletes_Old
1404: ( p_model_line_rec IN OE_Order_Pub.Line_rec_Type
1411: IS
1412: CURSOR config_del_cursor IS
1413: SELECT l.line_id, l.item_type_code, l.link_to_line_id,
1414: l.component_code
1415: FROM oe_order_lines l
1416: WHERE l.top_model_line_id = p_model_line_rec.line_id
1417: AND (l.item_type_code = OE_GLOBALS.G_ITEM_CLASS OR
1418: l.item_type_code = OE_GLOBALS.G_ITEM_OPTION OR
1419: l.item_type_code = OE_GLOBALS.G_ITEM_KIT)
1548: /*--------------------------------------------------------------------
1549: PROCEDURE Check_If_cancellation
1550: This procedure is used to see if the deletion of the option/class
1551: is actually a complete cancellation. If so, we will not delete
1552: the lines from oe_order_lines and they will be closed instead.
1553:
1554: Change Record:
1555: bug 2191666: the sqls and logic modified when a class gets
1556: cancelled as a result of cascading.
1582:
1583: BEGIN
1584: SELECT ordered_quantity, open_flag, component_code
1585: INTO l_ordered_quantity, l_open_flag, l_component_code
1586: FROM oe_order_lines
1587: WHERE line_id = l_line_id;
1588:
1589: IF l_ordered_quantity = 0 THEN
1590: IF l_open_flag = 'N' THEN
1635: END IF;
1636:
1637: SELECT link_to_line_id
1638: INTO l_parent_line_id
1639: FROM oe_order_lines
1640: WHERE line_id = l_line_id;
1641:
1642: IF l_debug_level > 0 THEN
1643: oe_debug_pub.add( 'CAME HERE '|| L_PARENT_LINE_ID , 3 ) ;
1647: BEGIN
1648:
1649: SELECT open_flag
1650: INTO l_open_flag
1651: FROM oe_order_lines
1652: WHERE line_id = l_parent_line_id;
1653:
1654: EXCEPTION
1655: WHEN TOO_MANY_ROWS THEN
1684: BEGIN
1685:
1686: SELECT count(*)
1687: INTO l_line_id
1688: FROM oe_order_lines
1689: WHERE top_model_line_id = p_top_model_line_id
1690: AND link_to_line_id = p_line_id
1691: AND open_flag = 'Y'
1692: AND item_type_code IN ('CLASS', 'OPTION', 'KIT');
1692: AND item_type_code IN ('CLASS', 'OPTION', 'KIT');
1693:
1694: SELECT count(*)
1695: INTO l_parent_line_id
1696: FROM oe_order_lines
1697: WHERE top_model_line_id = p_top_model_line_id
1698: AND link_to_line_id = p_line_id
1699: AND item_type_code IN ('CLASS', 'OPTION', 'KIT');
1700:
1717:
1718: BEGIN
1719: SELECT count(*)
1720: INTO l_line_id
1721: FROM oe_order_lines
1722: WHERE top_model_line_id = p_top_model_line_id
1723: AND component_code like (l_component_code || '%')
1724: AND open_flag = 'N'
1725: AND cancelled_flag = 'Y'
1994: IF l_debug_level > 0 THEN
1995: oe_debug_pub.add('UPDATE: ' || L_LINE_REC.LINE_ID , 1 ) ;
1996: END IF;
1997:
1998: UPDATE oe_order_lines
1999: SET ordered_quantity = l_line_rec.ordered_quantity
2000: WHERE line_id = l_line_rec.line_id;
2001:
2002: ELSIF l_line_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
2003: IF l_debug_level > 0 THEN
2004: oe_debug_pub.add('DELETE: ' || L_LINE_REC.LINE_ID , 1 ) ;
2005: END IF;
2006:
2007: DELETE FROM oe_order_lines
2008: WHERE line_id = l_line_rec.line_id;
2009:
2010: ELSE
2011: IF l_debug_level > 0 THEN
2170: -- ato_line_id , inventory item id and ordered item
2171: CURSOR option_nbr IS
2172: SELECT line_id, link_to_line_id, item_type_code,ordered_quantity,
2173: ato_line_id,inventory_item_id,ordered_item
2174: FROM oe_order_lines
2175: WHERE top_model_line_id = p_top_model_line_id
2176: AND line_id <> p_top_model_line_id
2177: AND service_reference_line_id is null
2178: AND item_type_code <> OE_GLOBALS.G_ITEM_INCLUDED
2191: nvl(model_remnant_flag, 'N')
2192: INTO l_model_item_type_code , l_model_ato_line_id,
2193: l_prev_config_header_id, l_prev_config_rev_nbr,
2194: l_remnant_flag
2195: FROM oe_order_lines
2196: WHERE line_id = p_top_model_line_id;
2197: EXCEPTION
2198: WHEN OTHERS THEN
2199: IF l_debug_level > 0 THEN
2211: IF l_debug_level > 0 THEN
2212: oe_debug_pub.add('OPTIONS WINDOW , CONFIGURATION ID' , 1 ) ;
2213: END IF;
2214:
2215: UPDATE oe_order_lines
2216: SET configuration_id = nvl(configuration_id, 0) + 1,
2217: lock_control = lock_control + 1
2218: WHERE top_model_line_id = p_top_model_line_id
2219: AND item_type_code IN ('MODEL', 'CLASS', 'OPTION', 'KIT');
2224: oe_debug_pub.add( L_PREV_CONFIG_HEADER_ID
2225: ||' '||L_PREV_CONFIG_REV_NBR , 1 ) ;
2226: END IF;
2227:
2228: UPDATE oe_order_lines
2229: SET config_header_id = p_config_hdr_id,
2230: config_rev_nbr = p_config_rev_nbr,
2231: lock_control = lock_control + 1
2232: WHERE top_model_line_id = p_top_model_line_id
2247: ,p_ui_flag => p_ui_flag
2248: ,p_config_hdr_id => p_config_hdr_id);
2249:
2250: --## bug fix 1643546, added new and condition ##1820608
2251: UPDATE oe_order_lines
2252: SET shippable_flag = 'N'
2253: WHERE top_model_line_id = p_top_model_line_id
2254: AND ato_line_id is NOT NULL
2255: AND item_type_code <> OE_GLOBALS.G_ITEM_CONFIG
2271:
2272: --/************* update option_number *****************/
2273:
2274: IF l_debug_level > 0 THEN
2275: oe_debug_pub.add('UPDATING OPTION_NUMBER IN OE_ORDER_LINES' , 1 ) ;
2276: END IF;
2277:
2278: OPEN option_nbr;
2279: LOOP
2283: EXIT when option_nbr%notfound;
2284:
2285: l_option_nbr := l_option_nbr + 1;
2286:
2287: UPDATE oe_order_lines
2288: SET option_number = l_option_nbr,
2289: lock_control = lock_control + 1
2290: WHERE line_id = l_line_id;
2291:
2338: SELECT ordered_quantity,ordered_item,
2339: item_type_code,inventory_item_id
2340: INTO l_parent_ordered_quantity,l_parent_ordered_item,
2341: l_parent_item_type_code, l_parent_inv_item_id
2342: FROM OE_ORDER_LINES
2343: WHERE line_id = l_link;
2344:
2345: IF mod(l_child_ordered_quantity,l_parent_ordered_quantity) <> 0
2346: THEN
2368: (l_item_type_code = OE_GLOBALS.G_ITEM_CLASS OR
2369: l_item_type_code = OE_GLOBALS.G_ITEM_KIT)
2370: THEN
2371: BEGIN
2372: UPDATE oe_order_lines
2373: SET option_number = l_option_nbr,
2374: lock_control = lock_control + 1
2375: WHERE top_model_line_id = p_top_model_line_id
2376: AND link_to_line_id = l_line_id
2383: END IF;
2384: END;
2385:
2386: BEGIN
2387: UPDATE oe_order_lines
2388: SET option_number = l_option_nbr,
2389: lock_control = lock_control + 1
2390: WHERE top_model_line_id = p_top_model_line_id
2391: AND ato_line_id = l_line_id
2404: CLOSE option_nbr;
2405:
2406: IF l_model_ato_line_id is NULL THEN
2407:
2408: UPDATE oe_order_lines o
2409: SET ordered_quantity =
2410: (SELECT ordered_quantity
2411: FROM oe_order_lines
2412: WHERE line_id = o.link_to_line_id)
2407:
2408: UPDATE oe_order_lines o
2409: SET ordered_quantity =
2410: (SELECT ordered_quantity
2411: FROM oe_order_lines
2412: WHERE line_id = o.link_to_line_id)
2413: WHERE top_model_line_id = p_top_model_line_id
2414: AND item_type_code = OE_GLOBALS.G_ITEM_CONFIG
2415: AND nvl(model_remnant_flag, 'N') = 'N';
2413: WHERE top_model_line_id = p_top_model_line_id
2414: AND item_type_code = OE_GLOBALS.G_ITEM_CONFIG
2415: AND nvl(model_remnant_flag, 'N') = 'N';
2416:
2417: UPDATE oe_order_lines
2418: SET cancelled_flag = 'Y'
2419: WHERE top_model_line_id = p_top_model_line_id
2420: AND item_type_code = 'CONFIG'
2421: AND ordered_quantity = 0;
2465: IF l_debug_level > 0 THEN
2466: oe_debug_pub.add('1 LLID: PACK H NEW LOGIC FOR SPLIT ' , 1 ) ;
2467: END IF;
2468:
2469: UPDATE oe_order_lines OEOPT
2470: SET link_to_line_id =
2471: (SELECT line_id
2472: FROM oe_order_lines oe1
2473: WHERE split_from_line_id =
2468:
2469: UPDATE oe_order_lines OEOPT
2470: SET link_to_line_id =
2471: (SELECT line_id
2472: FROM oe_order_lines oe1
2473: WHERE split_from_line_id =
2474: (SELECT link_to_line_id
2475: FROM oe_order_lines oe2
2476: WHERE line_id = OEOPT.split_from_line_id
2471: (SELECT line_id
2472: FROM oe_order_lines oe1
2473: WHERE split_from_line_id =
2474: (SELECT link_to_line_id
2475: FROM oe_order_lines oe2
2476: WHERE line_id = OEOPT.split_from_line_id
2477: AND oe2.open_flag = 'Y')
2478: AND oe1.top_model_line_id = p_top_model_line_id
2479: AND oe1.open_flag = 'Y' )
2497: IF l_debug_level > 0 THEN
2498: oe_debug_pub.add('2 LLID: PACK H NEW LOGIC MI '|| P_REMNANT_FLAG , 1 ) ;
2499: END IF;
2500:
2501: UPDATE oe_order_lines OEOPT
2502: SET link_to_line_id =
2503: ( SELECT line_id
2504: FROM oe_order_lines OELNK
2505: WHERE OELNK.top_model_line_id = OEOPT.top_model_line_id
2500:
2501: UPDATE oe_order_lines OEOPT
2502: SET link_to_line_id =
2503: ( SELECT line_id
2504: FROM oe_order_lines OELNK
2505: WHERE OELNK.top_model_line_id = OEOPT.top_model_line_id
2506: AND OELNK.configuration_id =
2507: ( SELECT parent_config_item_id
2508: FROM cz_config_details_v
2527: IF l_debug_level > 0 THEN
2528: oe_debug_pub.add('LLID OPTIONS WINDOW OR OLD LOGIC ' , 3 ) ;
2529: END IF;
2530:
2531: UPDATE oe_order_lines OEOPT
2532: SET link_to_line_id =
2533: ( SELECT OELNK.line_id
2534: FROM oe_order_lines OELNK
2535: WHERE (( OELNK.line_id = oeopt.top_model_line_id OR
2530:
2531: UPDATE oe_order_lines OEOPT
2532: SET link_to_line_id =
2533: ( SELECT OELNK.line_id
2534: FROM oe_order_lines OELNK
2535: WHERE (( OELNK.line_id = oeopt.top_model_line_id OR
2536: OELNK.top_model_line_id = OEOPT.top_model_line_id ))
2537: AND (OELNK.component_code = SUBSTR( OEOPT.component_code,1,
2538: LENGTH( RTRIM( OEOPT.component_code,'0123456789' )) - 1)
2552: END IF;
2553:
2554: -- only in a post split situation.
2555:
2556: UPDATE oe_order_lines OEOPT
2557: SET link_to_line_id =
2558: (SELECT line_id
2559: FROM oe_order_lines oe1
2560: WHERE split_from_line_id =
2555:
2556: UPDATE oe_order_lines OEOPT
2557: SET link_to_line_id =
2558: (SELECT line_id
2559: FROM oe_order_lines oe1
2560: WHERE split_from_line_id =
2561: (SELECT link_to_line_id
2562: FROM oe_order_lines oe2
2563: WHERE line_id = OEOPT.split_from_line_id
2558: (SELECT line_id
2559: FROM oe_order_lines oe1
2560: WHERE split_from_line_id =
2561: (SELECT link_to_line_id
2562: FROM oe_order_lines oe2
2563: WHERE line_id = OEOPT.split_from_line_id
2564: AND oe2.open_flag = 'Y')
2565: AND oe1.top_model_line_id = p_top_model_line_id
2566: AND oe1.open_flag = 'Y' )
2579:
2580: END IF;
2581:
2582: IF l_debug_level > 0 THEN
2583: oe_debug_pub.add('UPDATED LINK_TO_LINE_ID IN OE_ORDER_LINES' , 2 ) ;
2584: END IF;
2585:
2586: EXCEPTION
2587: WHEN OTHERS THEN
2635: -- cursor modified, ## 1820608
2636:
2637: CURSOR ATO_MODELS IS
2638: SELECT unique(ato_line_id)
2639: FROM oe_order_lines_all
2640: WHERE top_model_line_id = p_top_model_line_id
2641: AND ato_line_id is not null
2642: AND item_type_code = OE_GLOBALS.G_ITEM_CLASS
2643: AND open_flag = 'Y'; -- ato subconfigs
2644:
2645: CURSOR ATO_OPTIONS(p_ato_line_id IN NUMBER)
2646: IS
2647: SELECT opt.line_id
2648: FROM oe_order_lines_all opt, oe_order_lines_all ato_model
2649: WHERE opt.top_model_line_id = p_top_model_line_id AND
2650: ato_model.top_model_line_id = p_top_model_line_id AND
2651: ato_model.line_id = p_ato_line_id AND
2652: opt.open_flag = 'Y' AND
2698: IF l_debug_level > 0 THEN
2699: oe_debug_pub.add('UPDATE_ATO: PACK H NEW LOGIC MI' , 1 ) ;
2700: END IF;
2701:
2702: UPDATE oe_order_lines OEOPT
2703: SET ato_line_id =
2704: ( SELECT line_id
2705: FROM oe_order_lines OEATO
2706: WHERE OEOPT.top_model_line_id = OEATO.top_model_line_id
2701:
2702: UPDATE oe_order_lines OEOPT
2703: SET ato_line_id =
2704: ( SELECT line_id
2705: FROM oe_order_lines OEATO
2706: WHERE OEOPT.top_model_line_id = OEATO.top_model_line_id
2707: AND OEATO.configuration_id =
2708: (SELECT ato_config_item_id
2709: FROM cz_config_details_v
2733:
2734: -- note that the CONFIG line needs ato_line_id after
2735: -- proportional split.
2736:
2737: UPDATE oe_order_lines OEOPT
2738: SET ato_line_id =
2739: (SELECT line_id
2740: FROM oe_order_lines oe1
2741: WHERE split_from_line_id =
2736:
2737: UPDATE oe_order_lines OEOPT
2738: SET ato_line_id =
2739: (SELECT line_id
2740: FROM oe_order_lines oe1
2741: WHERE split_from_line_id =
2742: (SELECT ato_line_id
2743: FROM oe_order_lines oe2
2744: WHERE line_id = OEOPT.split_from_line_id
2739: (SELECT line_id
2740: FROM oe_order_lines oe1
2741: WHERE split_from_line_id =
2742: (SELECT ato_line_id
2743: FROM oe_order_lines oe2
2744: WHERE line_id = OEOPT.split_from_line_id
2745: AND oe2.open_flag = 'Y')
2746: AND oe1.top_model_line_id = p_top_model_line_id
2747: AND oe1.open_flag = 'Y' )
2763: -- in case of ato', all of the lines will be remanant or
2764: -- or none. we do not have choice here, even options window
2765: -- will have this change.
2766:
2767: UPDATE oe_order_lines OEOPT
2768: SET ato_line_id =
2769: (SELECT line_id
2770: FROM oe_order_lines oe1
2771: WHERE split_from_line_id =
2766:
2767: UPDATE oe_order_lines OEOPT
2768: SET ato_line_id =
2769: (SELECT line_id
2770: FROM oe_order_lines oe1
2771: WHERE split_from_line_id =
2772: (SELECT ato_line_id
2773: FROM oe_order_lines oe2
2774: WHERE line_id = OEOPT.split_from_line_id
2769: (SELECT line_id
2770: FROM oe_order_lines oe1
2771: WHERE split_from_line_id =
2772: (SELECT ato_line_id
2773: FROM oe_order_lines oe2
2774: WHERE line_id = OEOPT.split_from_line_id
2775: AND oe2.open_flag = 'Y')
2776: AND oe1.top_model_line_id = p_top_model_line_id
2777: AND oe1.open_flag = 'Y' )
2793: IF l_debug_level > 0 THEN
2794: oe_debug_pub.add('OLD ATO_LINE_ID / NOT SPLIT' , 1 ) ;
2795: END IF;
2796:
2797: UPDATE OE_ORDER_LINES_ALL OEOPT
2798: SET ATO_LINE_ID =
2799: ( SELECT OEATO.LINE_ID
2800: FROM OE_ORDER_LINES_ALL OEATO
2801: WHERE OEATO.TOP_MODEL_LINE_ID =
2796:
2797: UPDATE OE_ORDER_LINES_ALL OEOPT
2798: SET ATO_LINE_ID =
2799: ( SELECT OEATO.LINE_ID
2800: FROM OE_ORDER_LINES_ALL OEATO
2801: WHERE OEATO.TOP_MODEL_LINE_ID =
2802: OEOPT.TOP_MODEL_LINE_ID
2803: AND ITEM_TYPE_CODE = 'CLASS'
2804: AND OEATO.COMPONENT_CODE =
2815: AND replenish_to_order_flag = 'Y'
2816: )
2817: AND OEATO.COMPONENT_CODE =
2818: ( SELECT MIN( OEMIN.COMPONENT_CODE )
2819: FROM OE_ORDER_LINES_ALL OEMIN
2820: WHERE OEMIN.TOP_MODEL_LINE_ID
2821: = OEOPT.TOP_MODEL_LINE_ID
2822: AND OEMIN.COMPONENT_CODE =
2823: SUBSTR( OEOPT.COMPONENT_CODE, 1,
3150: ELSE
3151:
3152: FORALL I IN l_new_item_id_tbl.FIRST..l_new_item_id_tbl.LAST
3153:
3154: UPDATE oe_order_lines
3155: SET configuration_id = l_new_item_id_tbl(I)
3156: WHERE top_model_line_id = p_top_model_line_id
3157: AND configuration_id = l_orig_item_id_tbl(I);
3158:
3169: IF l_debug_level > 0 THEN
3170: oe_debug_pub.add('NULL CONFIG_HEADER_ID TO COPY_CONFIG , OR REMNANT SET' , 1 ) ;
3171: END IF;
3172:
3173: UPDATE oe_order_lines
3174: SET configuration_id = null,
3175: config_header_id = null,
3176: config_rev_nbr = null
3177: WHERE top_model_line_id = p_top_model_line_id;
3190: IF l_debug_level > 0 THEN
3191: oe_debug_pub.add('1 COPY CONFIG: PACK H NEW LOGIC MI' , 1 ) ;
3192: END IF;
3193:
3194: UPDATE oe_order_lines
3195: SET link_to_line_id = NULL
3196: WHERE top_model_line_id = p_top_model_line_id
3197: AND split_from_line_id is not NULL;
3198:
3197: AND split_from_line_id is not NULL;
3198:
3199: ELSE
3200:
3201: UPDATE oe_order_lines
3202: SET link_to_line_id = NULL
3203: WHERE top_model_line_id = p_top_model_line_id;
3204:
3205: END IF;
3215: */
3216:
3217: SELECT ato_line_id ,booked_flag, item_type_code
3218: INTO l_ato_line_id, l_booked_flag, l_error_message
3219: FROM oe_order_lines
3220: WHERE line_id = p_top_model_line_id;
3221:
3222:
3223: -- if ato model, do not clear ato_line_id. also for ato_item
3228: IF l_debug_level > 0 THEN
3229: oe_debug_pub.add('NULLING ATO_LINE_ID FOR ATO SUB' , 4 ) ;
3230: END IF;
3231:
3232: UPDATE oe_order_lines
3233: SET ato_line_id = NULL
3234: WHERE top_model_line_id = p_top_model_line_id
3235: AND NOT (item_type_code = OE_GLOBALS.G_ITEM_OPTION AND
3236: ato_line_id = line_id);
3328: l_holds_tbl(1).line_id := p_line_id;
3329:
3330: SELECT line_number || '.'|| shipment_number
3331: INTO l_line_number
3332: FROM oe_order_lines
3333: WHERE line_id = p_line_id;
3334:
3335: IF l_debug_level > 0 THEN
3336: oe_debug_pub.add('OE_CONFIG_PVT , BEFORE CHECK_HOLDS ON MODEL' , 1 ) ;
3609: oe_debug_pub.add('TOP_BILL_SEQ_ID SELECTED FROM BOM_bill_of_mat' ) ;
3610: END IF;
3611:
3612: IF p_do_update THEN
3613: UPDATE oe_order_lines
3614: SET component_sequence_id = p_model_line_rec.component_sequence_id
3615: ,sort_order = p_model_line_rec.sort_order
3616: ,component_code = p_model_line_rec.component_code
3617: ,lock_control = lock_control + 1
3687: CURSOR inc_items(p_link_to_line_id NUMBER,
3688: p_top_model_line_id NUMBER)
3689: IS
3690: SELECT line_id, ordered_quantity
3691: FROM oe_order_lines
3692: WHERE top_model_line_id = p_top_model_line_id
3693: AND link_to_line_id = p_link_to_line_id
3694: AND item_type_code = OE_GLOBALS.G_ITEM_INCLUDED;
3695:
3846: l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
3847:
3848: CURSOR included_items IS
3849: SELECT line_id, component_code, link_to_line_id, ordered_quantity
3850: FROM oe_order_lines
3851: WHERE item_type_code = 'INCLUDED'
3852: AND link_to_line_id <> top_model_line_id
3853: AND top_model_line_id = p_top_model_line_id;
3854:
3872: IF l_component_sequence_id is NULL THEN
3873:
3874: SELECT component_sequence_id, creation_date
3875: INTO l_component_sequence_id, l_creation_date
3876: FROM oe_order_lines
3877: WHERE line_id = p_top_model_line_id;
3878: END IF;
3879:
3880: l_found := FALSE;
3919: -- already updated/deleted and batch validation logged.
3920: BEGIN
3921: SELECT ordered_quantity
3922: INTO l_ordered_qty
3923: FROM oe_order_lines
3924: WHERE top_model_line_id = p_top_model_line_id
3925: AND line_id = l_rec.link_to_line_id;
3926:
3927: l_line_rec := OE_Order_Pub.G_Miss_Line_Rec;