11:
12: l_Line_Adj_Assoc_Tbl OE_Order_PUB.Line_Adj_Assoc_Tbl_Type;
13:
14: --
15: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
16: --
17: BEGIN
18: Query_Rows
19: ( p_price_adj_Assoc_id => p_price_adj_Assoc_id
55: ( PRICE_ADJ_assoc_ID = p_price_adj_Assoc_id
56: or price_adjustment_id = p_price_adjustment_id);
57:
58: --
59: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
60: --
61: BEGIN
62:
63: l_count := 1;
124: IS
125: l_lock_control NUMBER := 1;
126:
127: --
128: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
129: --
130: BEGIN
131:
132: INSERT INTO OE_PRICE_ADJ_ASSOCS
185: IS
186: l_lock_control NUMBER;
187:
188: --
189: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
190: --
191: BEGIN
192:
193: SELECT lock_control
238: , p_price_adjustment_id NUMBER := FND_API.G_MISS_NUM
239: )
240: IS
241: --
242: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
243: --
244: BEGIN
245: IF p_price_adjustment_id <> FND_API.G_MISS_NUM then
246: IF l_debug_level > 0 THEN
243: --
244: BEGIN
245: IF p_price_adjustment_id <> FND_API.G_MISS_NUM then
246: IF l_debug_level > 0 THEN
247: oe_debug_pub.add( 'PRICE ADJ: DELETE ROW OE_LINE_ADJ_ASSOCS_UTIL' , 5 ) ;
248: END IF;
249: --Modified the below delete statement to fix bug 2626303
250: DELETE OE_PRICE_ADJ_ASSOCS opaa
251: WHERE opaa.rltd_price_adj_id in
278: IS
279:
280: l_Line_Adj_Assoc_Rec OE_Order_PUB.Line_Adj_Assoc_Rec_Type := p_x_Line_Adj_Assoc_Rec;
281: --
282: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
283: --
284: BEGIN
285:
286: IF l_Line_Adj_Assoc_Rec.RLTD_PRICE_ADJ_ID = FND_API.G_MISS_NUM THEN
346: )
347: IS
348: l_Line_Adj_Assoc_Rec OE_Order_PUB.Line_Adj_Assoc_Rec_Type := p_x_Line_Adj_Assoc_Rec;
349: --
350: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
351: --
352: BEGIN
353:
354: IF l_Line_Adj_Assoc_Rec.RLTD_PRICE_ADJ_ID = FND_API.G_MISS_NUM THEN
415: )
416: IS
417:
418: --
419: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
420: --
421: BEGIN
422:
423: p_x_Line_Adj_Assoc_Rec := p_x_Line_Adj_Assoc_Rec;
436: l_lock_control NUMBER;
437: l_price_adj_assoc_id NUMBER;
438:
439: --
440: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
441: --
442: BEGIN
443:
444: IF l_debug_level > 0 THEN
441: --
442: BEGIN
443:
444: IF l_debug_level > 0 THEN
445: oe_debug_pub.add( 'ENTERING OE_LINE_ADJ_ASSOCS_UTIL.LOCK_ROW.' , 1 ) ;
446: END IF;
447: SAVEPOINT Lock_Row;
448:
449: l_lock_control := NULL;
467: );
468:
469:
470: IF l_debug_level > 0 THEN
471: oe_debug_pub.add( 'QUERIED LOCK_CONTROL: '|| P_X_LINE_ADJ_ASSOC_REC.LOCK_CONTROL , 1 ) ;
472: END IF;
473:
474: -- If lock_control is not passed(is null or missing), then return the locked record.
475:
489: -- Row locked. If the whole record is passed, then
490: -- Compare lock_control.
491:
492: IF l_debug_level > 0 THEN
493: oe_debug_pub.add( 'COMPARE ' , 1 ) ;
494: END IF;
495:
496: IF OE_GLOBALS.Equal(p_x_Line_Adj_Assoc_rec.lock_control,
497: l_lock_control)
499:
500: -- Row has not changed. Set out parameter.
501:
502: IF l_debug_level > 0 THEN
503: oe_debug_pub.add( 'LOCKED ROW' , 1 ) ;
504: END IF;
505:
506: -- Set return status
507:
511: ELSE
512:
513: -- Row has changed by another user.
514: IF l_debug_level > 0 THEN
515: oe_debug_pub.add( 'ROW CHANGED BY OTHER USER' , 1 ) ;
516: END IF;
517:
518: x_return_status := FND_API.G_RET_STS_ERROR;
519: p_x_Line_Adj_Assoc_rec.return_status := FND_API.G_RET_STS_ERROR;
587: l_price_adj_assoc_id NUMBER;
588: l_lock_control NUMBER;
589:
590: --
591: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
592: --
593: BEGIN
594:
595: IF l_debug_level > 0 THEN
592: --
593: BEGIN
594:
595: IF l_debug_level > 0 THEN
596: oe_debug_pub.add( 'ENTERING OE_LINE_ADJ_ASSOCS_UTIL.LOCK_ROWS.' , 1 ) ;
597: END IF;
598:
599: IF (p_price_adj_assoc_id IS NOT NULL AND
600: p_price_adj_assoc_id <> FND_API.G_MISS_NUM) AND
681: );
682: END IF;
683:
684: IF l_debug_level > 0 THEN
685: oe_debug_pub.add( 'EXITING OE_LINE_ADJ_ASSOCS_UTIL.LOCK_ROWS.' , 1 ) ;
686: END IF;
687:
688: END lock_rows;
689:
707: l_rltd_price_adj_id NUMBER;
708: BEGIN
709: IF p_from_line_id IS NOT NULL AND p_from_line_id <> FND_API.G_MISS_NUM THEN
710:
711: oe_debug_pub.ADD('Getting data',1);
712:
713: BEGIN
714: --Get the price_adjustment_id of the PRG adjustment record
715: SELECT p.price_adjustment_id INTO l_price_adjustment_id FROM oe_order_lines_all l, oe_price_adjustments p
714: --Get the price_adjustment_id of the PRG adjustment record
715: SELECT p.price_adjustment_id INTO l_price_adjustment_id FROM oe_order_lines_all l, oe_price_adjustments p
716: WHERE l.line_id = p_to_line_id AND l.service_reference_type_code = 'ORDER' AND p.line_id = l.service_reference_line_id AND p.list_line_id = p_prg_list_line_id;
717:
718: oe_debug_pub.ADD('l_price_adjustment_id '||l_price_adjustment_id,1);
719:
720: EXCEPTION
721: WHEN No_Data_Found THEN
722: oe_debug_pub.ADD('PRG adjustment records is not created for the new split line',1);
718: oe_debug_pub.ADD('l_price_adjustment_id '||l_price_adjustment_id,1);
719:
720: EXCEPTION
721: WHEN No_Data_Found THEN
722: oe_debug_pub.ADD('PRG adjustment records is not created for the new split line',1);
723:
724: END;
725:
726: BEGIN
725:
726: BEGIN
727: SELECT p.price_adjustment_id INTO l_rltd_price_adj_id FROM oe_price_adjustments p
728: WHERE p.line_id =p_to_line_id AND p.list_line_id = p_assoc_list_line_id;
729: oe_debug_pub.ADD('l_rltd_price_adj_id '||l_rltd_price_adj_id,1);
730: EXCEPTION
731: WHEN No_Data_Found THEN
732: oe_debug_pub.ADD('Discount adjustment record is not created for the new split service line',1);
733:
728: WHERE p.line_id =p_to_line_id AND p.list_line_id = p_assoc_list_line_id;
729: oe_debug_pub.ADD('l_rltd_price_adj_id '||l_rltd_price_adj_id,1);
730: EXCEPTION
731: WHEN No_Data_Found THEN
732: oe_debug_pub.ADD('Discount adjustment record is not created for the new split service line',1);
733:
734: END;
735: IF l_rltd_price_adj_id IS NOT NULL AND l_price_adjustment_id IS NOT NULL THEN
736:
748: END IF;
749:
750: EXCEPTION
751: WHEN OTHERS THEN
752: oe_debug_pub.ADD('Error while building assoc',1);
753: END;
754:
755: END Oe_Line_Adj_Assocs_util;