DBA Data[Home] [Help]

APPS.OE_RETROBILL_PVT dependencies on OE_ORDER_LINES_ALL

Line 233: OE_ORDER_LINES_ALL l,

229: , h.Order_Number
230: , h.Order_Type_Id
231: , t.value PLSQL_TBL_INDEX
232: FROM OM_ID_LIST_TMP t,
233: OE_ORDER_LINES_ALL l,
234: OE_ORDER_HEADERS_ALL h
235: WHERE l.line_id = t.key_id
236: AND l.header_id = h.header_id
237: ORDER BY sold_to_org_id1,h.transactional_curr_code,h.conversion_type_code;

Line 293: From OE_ORDER_LINES_ALL l

289: PROCEDURE Get_Last_Retro_HdrID(p_header_id IN NUMBER,
290: x_header_id OUT NOCOPY NUMBER) AS
291: Cursor last_retrobill_line IS
292: Select max(header_id)
293: From OE_ORDER_LINES_ALL l
294: Where l.order_source_id = 27
295: And l.orig_sys_document_ref = to_char(p_header_id) -- p_header_id --commented for bug#7665009
296: And retrobill_request_id <> G_CURRENT_RETROBILL_REQUEST_ID;
297:

Line 339: From OE_ORDER_LINES_ALL l,

335: PROCEDURE Get_Last_Retro_LinID(p_line_id IN NUMBER,
336: x_line_id OUT NOCOPY NUMBER) AS
337: Cursor last_retrobill_line IS
338: Select max(l.line_id)
339: From OE_ORDER_LINES_ALL l,
340: OE_ORDER_LINES_ALL b
341: Where l.order_source_id = 27
342: And l.orig_sys_document_ref = b.header_id
343: And l.orig_sys_line_ref = to_char(p_line_id) -- p_line_id --commented for bug#7665009

Line 340: OE_ORDER_LINES_ALL b

336: x_line_id OUT NOCOPY NUMBER) AS
337: Cursor last_retrobill_line IS
338: Select max(l.line_id)
339: From OE_ORDER_LINES_ALL l,
340: OE_ORDER_LINES_ALL b
341: Where l.order_source_id = 27
342: And l.orig_sys_document_ref = b.header_id
343: And l.orig_sys_line_ref = to_char(p_line_id) -- p_line_id --commented for bug#7665009
344: And l.retrobill_request_id <> G_CURRENT_RETROBILL_REQUEST_ID

Line 431: From oe_order_lines_all oeol1

427:
428: cursor retro_sum IS
429: select sum(oeol1.unit_selling_price * decode(oeol1.line_category_code,'RETURN',-1,1)),
430: sum(oeol1.unit_list_price * decode(oeol1.line_category_code,'RETURN',-1,1))
431: From oe_order_lines_all oeol1
432: Where oeol1.order_source_id = G_RETROBILL_ORDER_SOURCE_ID
433: and oeol1.orig_sys_document_ref = to_char(p_header_id) --p_header_id --commented for bug#7665009
434: and oeol1.orig_sys_line_ref = to_char(p_line_id) --p_line_id --commented for bug#7665009
435: and nvl(oeol1.retrobill_request_id,-1) <> p_curr_retro_id; --exclude current retrobill line

Line 560: --key header and line is to facilate an index search to oe_order_lines_all

556: oe_debug_pub.add('Retro:IS_TAX_CODE_VALID:'||SQLERRM);
557: RETURN FALSE;
558: End;
559:
560: --key header and line is to facilate an index search to oe_order_lines_all
561: --p_adjustment_level value is either 'HEADER' or 'LINE'. 'HEADER' means
562: --query order level adjustment and 'LINE' means query line level adjustment
563: PROCEDURE Get_Most_Recent_Retro_Adj
564: (p_key_header_id IN NUMBER,

Line 573: From OE_ORDER_LINES_ALL l

569:
570: Cursor last_retrobill_line IS
571: Select max(line_id),
572: max(header_id)
573: From OE_ORDER_LINES_ALL l
574: Where l.order_source_id = 27
575: And l.orig_sys_document_ref = to_char(p_key_header_id) --p_key_header_id --commented for bug#7665009
576: And l.orig_sys_line_ref = to_char(p_key_line_id) --p_key_line_id --commented for bug#7665009
577: And retrobill_request_id <> G_CURRENT_RETROBILL_REQUEST_ID;

Line 639: and a.org_id = (select org_id from oe_order_lines_all where line_id = p_line_id) --bug# 8448816

635: and INTERFACE_LINE_ATTRIBUTE1=to_char(p_order_number) ----bug5138249
636: and INTERFACE_LINE_ATTRIBUTE2=b.name
637: and INTERFACE_LINE_ATTRIBUTE6=to_char(p_line_id) --bug5138249
638: and INTERFACE_LINE_ATTRIBUTE11 = '0'
639: and a.org_id = (select org_id from oe_order_lines_all where line_id = p_line_id) --bug# 8448816
640: and b.transaction_type_id = p_order_type_id
641: and b.language = (select language_code from fnd_languages where installed_flag = 'B');
642:
643: --CONTEXT,ATTRIBUTE1,ATTRIBUTE2 and ATTRIBUTE6 will hit a concatenate index in AR table

Line 856: From Oe_Order_Lines_All

852: Function Get_Retrobillable_Qty(p_line_id Number,
853: p_curr_ordered_qty Number) Return Number As
854: Cursor Return_Lines Is
855: Select sum(ordered_quantity)
856: From Oe_Order_Lines_All
857: Where reference_line_id = p_line_id
858: And line_category_code = 'RETURN';
859:
860:

Line 1749: oe_order_lines_all l

1745: , l.sold_to_org_id --For identifying unique customer
1746: , l.line_number
1747: , l.lock_control + 1 LOCK_CONTROL
1748: from qp_preq_lines_tmp lines,
1749: oe_order_lines_all l
1750: where lines.line_id=l.line_id
1751: and lines.line_type_code='LINE'
1752: and lines.pricing_status_code in(QP_PREQ_GRP.G_STATUS_UPDATED,QP_PREQ_GRP.G_STATUS_GSA_VIOLATION);
1753:

Line 1760: From oe_order_lines_all oeol1

1756: p_orig_sys_line_ref IN NUMBER,
1757: p_curr_retro_id IN NUMBER) IS
1758: select sum(oeol1.unit_selling_price * decode(oeol1.line_category_code,'RETURN',-1,1)),
1759: sum(oeol1.unit_list_price * decode(oeol1.line_category_code,'RETURN',-1,1))
1760: From oe_order_lines_all oeol1
1761: Where oeol1.order_source_id = p_order_source_id
1762: and oeol1.orig_sys_document_ref = to_char(p_orig_sys_document_ref) --p_orig_sys_document_ref --commented for bug#7665009
1763: and oeol1.orig_sys_line_ref = to_char(p_orig_sys_line_ref) --p_orig_sys_line_ref --commented for bug#7665009
1764: and oeol1.retrobill_request_id <> p_curr_retro_id; --exclude current retrobill line

Line 1768: From oe_order_lines_all

1764: and oeol1.retrobill_request_id <> p_curr_retro_id; --exclude current retrobill line
1765:
1766: cursor get_original_price(p_orig_sys_line_ref IN NUMBER) IS
1767: Select unit_selling_price,unit_list_price
1768: From oe_order_lines_all
1769: Where line_id = p_orig_sys_line_ref;
1770:
1771: cursor line_number(p_header_id IN NUMBER) IS
1772: Select line_id from oe_order_lines_all

Line 1772: Select line_id from oe_order_lines_all

1768: From oe_order_lines_all
1769: Where line_id = p_orig_sys_line_ref;
1770:
1771: cursor line_number(p_header_id IN NUMBER) IS
1772: Select line_id from oe_order_lines_all
1773: Where header_id = p_header_id
1774: Order by line_id;
1775:
1776: l_deleted_line NUMBER :=NULL;

Line 1851: from oe_order_lines_all

1847: END IF;
1848:
1849: -------- Bug# 8609475 : Start -------
1850: select line_category_code into l_line_category_code
1851: from oe_order_lines_all
1852: where line_id = to_number(I.orig_sys_line_ref);
1853:
1854: oe_debug_pub.add(' line_category_code of original order: l_line_category_code = '|| l_line_category_code);
1855:

Line 1870: UPDATE OE_ORDER_LINES_all l

1866: IF l_retrobill_list_price > 0 OR
1867: (l_retrobill_list_price = 0 AND l_retrobill_selling_price > 0)
1868: THEN
1869: oe_debug_pub.add('Retro: New price is lower giving credit');
1870: UPDATE OE_ORDER_LINES_all l
1871: SET UNIT_SELLING_PRICE =l_retrobill_selling_price
1872: ,UNIT_LIST_PRICE =l_retrobill_list_price
1873: ,UNIT_SELLING_PRICE_PER_PQTY=I.UNIT_SELLING_PRICE_PER_PQTY
1874: ,UNIT_LIST_PRICE_PER_PQTY =I.UNIT_LIST_PRICE_PER_PQTY

Line 2017: FROM oe_order_lines_all

2013: l_line_num_tbl(k):= k;
2014: l_line_id_tbl(k):= N.LINE_ID;
2015: IF(G_FIRST_LINE_DELETED='Y' and k=1) THEN
2016: SELECT price_list_id INTO G_FIRST_LINE_PRICE_LIST_ID
2017: FROM oe_order_lines_all
2018: WHERE line_id=N.LINE_ID;
2019: END IF;
2020: k:=k+1;
2021: END LOOP;

Line 2025: UPDATE OE_ORDER_LINES_ALL

2021: END LOOP;
2022: oe_debug_pub.add('Retro:before update line_num');
2023: IF l_line_id_tbl.FIRST IS NOT NULL THEN
2024: FORALL K IN l_line_id_tbl.FIRST..l_line_id_tbl.LAST
2025: UPDATE OE_ORDER_LINES_ALL
2026: SET LINE_NUMBER = l_line_num_tbl(K)
2027: WHERE LINE_ID = l_line_id_tbl(K);
2028: END IF;
2029: oe_debug_pub.add('Retro:after update line_num'||SQL%ROWCOUNT);

Line 2284: , OE_ORDER_LINES_ALL oeol

2280: FROM QP_LDETS_v ldets
2281: , QP_PREQ_LINES_TMP lines
2282: , QP_LIST_HEADERS_B QH
2283: , OE_PRICE_ADJUSTMENTS oepj
2284: , OE_ORDER_LINES_ALL oeol
2285: WHERE
2286: ldets.list_header_id=qh.list_header_id
2287: --AND ldets.process_code=QP_PREQ_GRP.G_STATUS_NEW
2288: AND lines.pricing_status_code in (QP_PREQ_GRP.G_STATUS_NEW,QP_PREQ_GRP.G_STATUS_UPDATED,QP_PREQ_GRP.G_STATUS_GSA_VIOLATION)

Line 2947: , OE_ORDER_LINES_ALL oeol

2943: FROM
2944: QP_LDETS_v ldets
2945: , QP_PREQ_LINES_TMP lines
2946: , QP_LIST_HEADERS_B QH
2947: , OE_ORDER_LINES_ALL oeol
2948: WHERE
2949: ldets.list_header_id=qh.list_header_id
2950: AND ldets.process_code=QP_PREQ_GRP.G_STATUS_NEW
2951: AND lines.pricing_status_code in (QP_PREQ_GRP.G_STATUS_NEW,QP_PREQ_GRP.G_STATUS_UPDATED,QP_PREQ_GRP.G_STATUS_GSA_VIOLATION)

Line 3024: FROM oe_order_lines_all

3020:
3021: IF l_last_line_id <> invalid_price_adj.line_id THEN
3022: BEGIN
3023: SELECT line_category_code INTO l_line_category_code
3024: FROM oe_order_lines_all
3025: WHERE line_id = invalid_price_adj.line_id;
3026: EXCEPTION
3027: WHEN OTHERS THEN
3028: IF l_debug_level > 0 THEN

Line 3067: , oe_order_lines_all oeol

3063: , nvl(adj.adjusted_amount_per_pqty,0) * decode(l_line_category_code, 'ORDER', -1, 1)
3064: , 1
3065: , null --this offset adjustment should not have retrobill request id
3066: FROM oe_price_adjustments adj
3067: , oe_order_lines_all oeol
3068: WHERE adj.price_adjustment_id = l_price_adjustment_id
3069: AND oeol.line_id=adj.line_id
3070: )
3071: WHERE price_adjustment_id=l_price_adjustment_id;

Line 3152: FROM oe_order_lines_all

3148: FROM OM_ID_LIST_TMP;
3149:
3150: Cursor line_numbers(p_header_id IN NUMBER) IS
3151: SELECT line_id
3152: FROM oe_order_lines_all
3153: WHERE header_id=p_header_id;
3154:
3155: l_price_control_rec QP_PREQ_GRP.control_record_type;
3156: --bug5003256

Line 3214: UPDATE OE_ORDER_LINES_ALL

3210: END LOOP;
3211: oe_debug_pub.add('Retro:before update line_num');
3212: IF l_arrange_line_id_tbl.FIRST IS NOT NULL THEN
3213: FORALL i IN l_arrange_line_id_tbl.FIRST..l_arrange_line_id_tbl.LAST
3214: UPDATE OE_ORDER_LINES_ALL
3215: SET LINE_NUMBER = l_arrange_line_num_tbl(i)
3216: WHERE LINE_ID = l_arrange_line_id_tbl(i);
3217: END IF;
3218: oe_debug_pub.add('Retro:after update line_num');

Line 3231: UPDATE OE_ORDER_LINES_ALL oeol

3227: VALUES (l_line_id_tbl(j),l_retrobill_qty_tbl(j));
3228: oe_debug_pub.add('Retro:execution mode='||p_execution_mode);
3229:
3230: --pricing quantity derivation might be wrong need to get back to this!!!
3231: UPDATE OE_ORDER_LINES_ALL oeol
3232: SET (ordered_quantity,
3233: pricing_quantity
3234: )
3235: = (Select value,

Line 3288: FROM oe_order_lines_all

3284:
3285: --bug5003256 start
3286: IF (l_return_status<>FND_API.G_RET_STS_SUCCESS) THEN
3287: SELECT count(*) INTO l_book_line_count
3288: FROM oe_order_lines_all
3289: WHERE header_id = k.header_id;
3290: x_error_count := x_error_count + l_book_line_count;
3291: END IF;
3292: --bug5003256 end

Line 3310: UPDATE OE_ORDER_LINES_ALL

3306: FOR k in unique_header_id LOOP
3307: oe_debug_pub.add('Retro:Repricing Order: header id:'||k.header_id);
3308: --cal price flag from retrobilling lines are 'N', set them to 'Y' before
3309: --reprice and then set them back to 'N'
3310: UPDATE OE_ORDER_LINES_ALL
3311: SET calculate_price_flag='Y'
3312: WHERE header_id=k.header_id;
3313:
3314: oe_order_adj_pvt.Price_line(X_Return_Status => l_Return_Status

Line 3328: UPDATE OE_ORDER_LINES_ALL

3324: x_error_count := x_error_count + l_line_tbl.count;
3325: END IF;
3326: --bug5003256 end
3327:
3328: UPDATE OE_ORDER_LINES_ALL
3329: SET calculate_price_flag='N'
3330: WHERE header_id=k.header_id;
3331:
3332: END LOOP;

Line 3351: select count(*) into l_line_count from oe_order_lines_all where header_id=p_header_id;

3347: BEGIN
3348: oe_debug_pub.add('Entering procedure Delete_Order');
3349: --bug5003256
3350: x_header_deleted := FALSE;
3351: select count(*) into l_line_count from oe_order_lines_all where header_id=p_header_id;
3352: IF(l_line_count =0) THEN
3353: OE_Header_Util.Delete_Row(p_header_id);
3354: --bug5003256
3355: x_header_deleted := TRUE;

Line 3649: FROM oe_order_lines_all

3645:
3646: --bug5003256 start
3647: IF (lx_return_status<>FND_API.G_RET_STS_SUCCESS) THEN
3648: SELECT count(*) INTO l_book_line_count
3649: FROM oe_order_lines_all
3650: WHERE header_id = l_to_be_exe_hdr_id_tbl(i);
3651:
3652: x_error_count := x_error_count + l_book_line_count;
3653: END IF;

Line 3754: (select retrobill_request_id from oe_order_lines_all

3750: from oe_retrobill_requests
3751: where
3752: retrobill_request_id
3753: in
3754: (select retrobill_request_id from oe_order_lines_all
3755: where
3756: order_source_id=27 and
3757: orig_sys_document_ref=to_char(c_header_id) and
3758: orig_sys_line_ref=to_char(c_line_id) and

Line 4059: oe_order_lines_all retro_line

4055: , retro_line.retrobill_request_id
4056: , retro_header.order_number
4057: , retro_header.order_type_id
4058: from
4059: oe_order_lines_all retro_line
4060: , oe_order_lines orig_line
4061: , oe_order_headers_all retro_header
4062: where orig_line.line_id = p_line_rec.reference_line_id
4063: and retro_line.order_source_id=27

Line 4141: FROM oe_order_lines_all where line_id=p_line_rec.reference_line_id;

4137: ,unit_selling_price INTO
4138: l_orig_header_id
4139: ,l_orig_list_price
4140: ,l_orig_selling_price
4141: FROM oe_order_lines_all where line_id=p_line_rec.reference_line_id;
4142: EXCEPTION
4143: WHEN OTHERS THEN
4144: -- THis is impossible
4145: RAISE FND_API.G_EXC_ERROR;

Line 4316: oe_order_lines_all where

4312: END IF;
4313:
4314: BEGIN
4315: select count(*) into l_count from
4316: oe_order_lines_all where
4317: order_source_id=27 and
4318: orig_sys_document_ref=to_char(l_header_id) and
4319: orig_sys_line_ref = to_char(l_line_id)
4320: and l_creation_date < creation_date;