DBA Data[Home] [Help]

APPS.OE_RETROBILL_PVT dependencies on OE_ORDER_LINES

Line 232: OE_ORDER_LINES_ALL l,

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

Line 292: From OE_ORDER_LINES_ALL l

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

Line 338: From OE_ORDER_LINES_ALL l,

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

Line 339: OE_ORDER_LINES_ALL b

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

Line 430: From oe_order_lines_all oeol1

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

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

545: oe_debug_pub.add('Retro:IS_TAX_CODE_VALID:'||SQLERRM);
546: RETURN FALSE;
547: End;
548:
549: --key header and line is to facilate an index search to oe_order_lines_all
550: --p_adjustment_level value is either 'HEADER' or 'LINE'. 'HEADER' means
551: --query order level adjustment and 'LINE' means query line level adjustment
552: PROCEDURE Get_Most_Recent_Retro_Adj
553: (p_key_header_id IN NUMBER,

Line 562: From OE_ORDER_LINES_ALL l

558:
559: Cursor last_retrobill_line IS
560: Select max(line_id),
561: max(header_id)
562: From OE_ORDER_LINES_ALL l
563: Where l.order_source_id = 27
564: And l.orig_sys_document_ref = p_key_header_id
565: And l.orig_sys_line_ref = p_key_line_id
566: And retrobill_request_id <> G_CURRENT_RETROBILL_REQUEST_ID;

Line 844: From Oe_Order_Lines_All

840: Function Get_Retrobillable_Qty(p_line_id Number,
841: p_curr_ordered_qty Number) Return Number As
842: Cursor Return_Lines Is
843: Select sum(ordered_quantity)
844: From Oe_Order_Lines_All
845: Where reference_line_id = p_line_id
846: And line_category_code = 'RETURN';
847:
848:

Line 1445: oe_order_lines_all l

1441: , l.sold_to_org_id --For identifying unique customer
1442: , l.line_number
1443: , l.lock_control + 1 LOCK_CONTROL
1444: from qp_preq_lines_tmp lines,
1445: oe_order_lines_all l
1446: where lines.line_id=l.line_id
1447: and lines.line_type_code='LINE'
1448: and lines.pricing_status_code in(QP_PREQ_GRP.G_STATUS_UPDATED,QP_PREQ_GRP.G_STATUS_GSA_VIOLATION);
1449:

Line 1456: From oe_order_lines_all oeol1

1452: p_orig_sys_line_ref IN NUMBER,
1453: p_curr_retro_id IN NUMBER) IS
1454: select sum(oeol1.unit_selling_price * decode(oeol1.line_category_code,'RETURN',-1,1)),
1455: sum(oeol1.unit_list_price * decode(oeol1.line_category_code,'RETURN',-1,1))
1456: From oe_order_lines_all oeol1
1457: Where oeol1.order_source_id = p_order_source_id
1458: and oeol1.orig_sys_document_ref = p_orig_sys_document_ref
1459: and oeol1.orig_sys_line_ref = p_orig_sys_line_ref
1460: and oeol1.retrobill_request_id <> p_curr_retro_id; --exclude current retrobill line

Line 1464: From oe_order_lines_all

1460: and oeol1.retrobill_request_id <> p_curr_retro_id; --exclude current retrobill line
1461:
1462: cursor get_original_price(p_orig_sys_line_ref IN NUMBER) IS
1463: Select unit_selling_price,unit_list_price
1464: From oe_order_lines_all
1465: Where line_id = p_orig_sys_line_ref;
1466:
1467: cursor line_number(p_header_id IN NUMBER) IS
1468: Select line_id from oe_order_lines_all

Line 1468: Select line_id from oe_order_lines_all

1464: From oe_order_lines_all
1465: Where line_id = p_orig_sys_line_ref;
1466:
1467: cursor line_number(p_header_id IN NUMBER) IS
1468: Select line_id from oe_order_lines_all
1469: Where header_id = p_header_id
1470: Order by line_id;
1471:
1472: l_deleted_line NUMBER :=NULL;

Line 1548: UPDATE OE_ORDER_LINES_all l

1544: IF l_retrobill_list_price > 0 OR
1545: (l_retrobill_list_price = 0 AND
1546: l_retrobill_selling_price > 0) THEN
1547: oe_debug_pub.add('Retro: New price is lower giving credit');
1548: UPDATE OE_ORDER_LINES_all l
1549: SET UNIT_SELLING_PRICE =l_retrobill_selling_price
1550: ,UNIT_LIST_PRICE =l_retrobill_list_price
1551: ,UNIT_SELLING_PRICE_PER_PQTY=I.UNIT_SELLING_PRICE_PER_PQTY
1552: ,UNIT_LIST_PRICE_PER_PQTY =I.UNIT_LIST_PRICE_PER_PQTY

Line 1681: FROM oe_order_lines_all

1677: l_line_num_tbl(k):= k;
1678: l_line_id_tbl(k):= N.LINE_ID;
1679: IF(G_FIRST_LINE_DELETED='Y' and k=1) THEN
1680: SELECT price_list_id INTO G_FIRST_LINE_PRICE_LIST_ID
1681: FROM oe_order_lines_all
1682: WHERE line_id=N.LINE_ID;
1683: END IF;
1684: k:=k+1;
1685: END LOOP;

Line 1689: UPDATE OE_ORDER_LINES_ALL

1685: END LOOP;
1686: oe_debug_pub.add('Retro:before update line_num');
1687: IF l_line_id_tbl.FIRST IS NOT NULL THEN
1688: FORALL K IN l_line_id_tbl.FIRST..l_line_id_tbl.LAST
1689: UPDATE OE_ORDER_LINES_ALL
1690: SET LINE_NUMBER = l_line_num_tbl(K)
1691: WHERE LINE_ID = l_line_id_tbl(K);
1692: END IF;
1693: oe_debug_pub.add('Retro:after update line_num'||SQL%ROWCOUNT);

Line 1946: , OE_ORDER_LINES_ALL oeol

1942: FROM QP_LDETS_v ldets
1943: , QP_PREQ_LINES_TMP lines
1944: , QP_LIST_HEADERS_B QH
1945: , OE_PRICE_ADJUSTMENTS oepj
1946: , OE_ORDER_LINES_ALL oeol
1947: WHERE
1948: ldets.list_header_id=qh.list_header_id
1949: --AND ldets.process_code=QP_PREQ_GRP.G_STATUS_NEW
1950: 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 2609: , OE_ORDER_LINES_ALL oeol

2605: FROM
2606: QP_LDETS_v ldets
2607: , QP_PREQ_LINES_TMP lines
2608: , QP_LIST_HEADERS_B QH
2609: , OE_ORDER_LINES_ALL oeol
2610: WHERE
2611: ldets.list_header_id=qh.list_header_id
2612: AND ldets.process_code=QP_PREQ_GRP.G_STATUS_NEW
2613: 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 2686: FROM oe_order_lines_all

2682:
2683: IF l_last_line_id <> invalid_price_adj.line_id THEN
2684: BEGIN
2685: SELECT line_category_code INTO l_line_category_code
2686: FROM oe_order_lines_all
2687: WHERE line_id = invalid_price_adj.line_id;
2688: EXCEPTION
2689: WHEN OTHERS THEN
2690: IF l_debug_level > 0 THEN

Line 2729: , oe_order_lines_all oeol

2725: , nvl(adj.adjusted_amount_per_pqty,0) * decode(l_line_category_code, 'ORDER', -1, 1)
2726: , 1
2727: , null --this offset adjustment should not have retrobill request id
2728: FROM oe_price_adjustments adj
2729: , oe_order_lines_all oeol
2730: WHERE adj.price_adjustment_id = l_price_adjustment_id
2731: AND oeol.line_id=adj.line_id
2732: )
2733: WHERE price_adjustment_id=l_price_adjustment_id;

Line 2814: FROM oe_order_lines_all

2810: FROM OM_ID_LIST_TMP;
2811:
2812: Cursor line_numbers(p_header_id IN NUMBER) IS
2813: SELECT line_id
2814: FROM oe_order_lines_all
2815: WHERE header_id=p_header_id;
2816:
2817: l_price_control_rec QP_PREQ_GRP.control_record_type;
2818: --bug5003256

Line 2876: UPDATE OE_ORDER_LINES_ALL

2872: END LOOP;
2873: oe_debug_pub.add('Retro:before update line_num');
2874: IF l_arrange_line_id_tbl.FIRST IS NOT NULL THEN
2875: FORALL i IN l_arrange_line_id_tbl.FIRST..l_arrange_line_id_tbl.LAST
2876: UPDATE OE_ORDER_LINES_ALL
2877: SET LINE_NUMBER = l_arrange_line_num_tbl(i)
2878: WHERE LINE_ID = l_arrange_line_id_tbl(i);
2879: END IF;
2880: oe_debug_pub.add('Retro:after update line_num');

Line 2893: UPDATE OE_ORDER_LINES_ALL oeol

2889: VALUES (l_line_id_tbl(j),l_retrobill_qty_tbl(j));
2890: oe_debug_pub.add('Retro:execution mode='||p_execution_mode);
2891:
2892: --pricing quantity derivation might be wrong need to get back to this!!!
2893: UPDATE OE_ORDER_LINES_ALL oeol
2894: SET (ordered_quantity,
2895: pricing_quantity
2896: )
2897: = (Select value,

Line 2950: FROM oe_order_lines_all

2946:
2947: --bug5003256 start
2948: IF (l_return_status<>FND_API.G_RET_STS_SUCCESS) THEN
2949: SELECT count(*) INTO l_book_line_count
2950: FROM oe_order_lines_all
2951: WHERE header_id = k.header_id;
2952: x_error_count := x_error_count + l_book_line_count;
2953: END IF;
2954: --bug5003256 end

Line 2972: UPDATE OE_ORDER_LINES_ALL

2968: FOR k in unique_header_id LOOP
2969: oe_debug_pub.add('Retro:Repricing Order: header id:'||k.header_id);
2970: --cal price flag from retrobilling lines are 'N', set them to 'Y' before
2971: --reprice and then set them back to 'N'
2972: UPDATE OE_ORDER_LINES_ALL
2973: SET calculate_price_flag='Y'
2974: WHERE header_id=k.header_id;
2975:
2976: oe_order_adj_pvt.Price_line(X_Return_Status => l_Return_Status

Line 2990: UPDATE OE_ORDER_LINES_ALL

2986: x_error_count := x_error_count + l_line_tbl.count;
2987: END IF;
2988: --bug5003256 end
2989:
2990: UPDATE OE_ORDER_LINES_ALL
2991: SET calculate_price_flag='N'
2992: WHERE header_id=k.header_id;
2993:
2994: END LOOP;

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

3009: BEGIN
3010: oe_debug_pub.add('Entering procedure Delete_Order');
3011: --bug5003256
3012: x_header_deleted := FALSE;
3013: select count(*) into l_line_count from oe_order_lines_all where header_id=p_header_id;
3014: IF(l_line_count =0) THEN
3015: OE_Header_Util.Delete_Row(p_header_id);
3016: --bug5003256
3017: x_header_deleted := TRUE;

Line 3264: FROM oe_order_lines_all

3260:
3261: --bug5003256 start
3262: IF (lx_return_status<>FND_API.G_RET_STS_SUCCESS) THEN
3263: SELECT count(*) INTO l_book_line_count
3264: FROM oe_order_lines_all
3265: WHERE header_id = l_to_be_exe_hdr_id_tbl(i);
3266:
3267: x_error_count := x_error_count + l_book_line_count;
3268: END IF;

Line 3368: (select retrobill_request_id from oe_order_lines_all

3364: from oe_retrobill_requests
3365: where
3366: retrobill_request_id
3367: in
3368: (select retrobill_request_id from oe_order_lines_all
3369: where
3370: order_source_id=27 and
3371: orig_sys_document_ref=to_char(c_header_id) and
3372: orig_sys_line_ref=to_char(c_line_id) and

Line 3658: oe_order_lines_all retro_line

3654: , retro_line.retrobill_request_id
3655: , retro_header.order_number
3656: , retro_header.order_type_id
3657: from
3658: oe_order_lines_all retro_line
3659: , oe_order_lines orig_line
3660: , oe_order_headers_all retro_header
3661: where orig_line.line_id = p_line_rec.reference_line_id
3662: and retro_line.order_source_id=27

Line 3659: , oe_order_lines orig_line

3655: , retro_header.order_number
3656: , retro_header.order_type_id
3657: from
3658: oe_order_lines_all retro_line
3659: , oe_order_lines orig_line
3660: , oe_order_headers_all retro_header
3661: where orig_line.line_id = p_line_rec.reference_line_id
3662: and retro_line.order_source_id=27
3663: and retro_line.orig_sys_document_ref = to_char(orig_line.header_id) --bug5553346

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

3736: ,unit_selling_price INTO
3737: l_orig_header_id
3738: ,l_orig_list_price
3739: ,l_orig_selling_price
3740: FROM oe_order_lines_all where line_id=p_line_rec.reference_line_id;
3741: EXCEPTION
3742: WHEN OTHERS THEN
3743: -- THis is impossible
3744: RAISE FND_API.G_EXC_ERROR;

Line 3891: oe_order_lines_all where

3887: END IF;
3888:
3889: BEGIN
3890: select count(*) into l_count from
3891: oe_order_lines_all where
3892: order_source_id=27 and
3893: orig_sys_document_ref=to_char(l_header_id) and
3894: orig_sys_line_ref = to_char(l_line_id)
3895: and l_creation_date < creation_date;