DBA Data[Home] [Help]

APPS.PO_DOCUMENT_CHECKS_PVT dependencies on PO_HEADERS_ALL

Line 567: l_po_header_id PO_HEADERS_ALL.po_header_id%TYPE; --

563:
564: l_return_status varchar2(1);
565:
566: l_conterms_exist_flag VARCHAR2(1); --
567: l_po_header_id PO_HEADERS_ALL.po_header_id%TYPE; --
568:
569: BEGIN
570:
571: IF g_debug_stmt THEN

Line 2273: l_agreement_id PO_HEADERS_ALL.po_header_id%TYPE;

2269: l_dist_qty_tbl NumTab; --
2270: l_dist_amt_tbl NumTab; --
2271:
2272: -- bug 6530879 Releases < Var addition START>
2273: l_agreement_id PO_HEADERS_ALL.po_header_id%TYPE;
2274: l_vendor_id PO_HEADERS_ALL.vendor_id%TYPE;
2275: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE;
2276: l_vendor_contact_id PO_HEADERS_ALL.vendor_contact_id%TYPE;
2277: -- bug 6530879 Releases < Var addition END>

Line 2274: l_vendor_id PO_HEADERS_ALL.vendor_id%TYPE;

2270: l_dist_amt_tbl NumTab; --
2271:
2272: -- bug 6530879 Releases < Var addition START>
2273: l_agreement_id PO_HEADERS_ALL.po_header_id%TYPE;
2274: l_vendor_id PO_HEADERS_ALL.vendor_id%TYPE;
2275: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE;
2276: l_vendor_contact_id PO_HEADERS_ALL.vendor_contact_id%TYPE;
2277: -- bug 6530879 Releases < Var addition END>
2278:

Line 2275: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE;

2271:
2272: -- bug 6530879 Releases < Var addition START>
2273: l_agreement_id PO_HEADERS_ALL.po_header_id%TYPE;
2274: l_vendor_id PO_HEADERS_ALL.vendor_id%TYPE;
2275: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE;
2276: l_vendor_contact_id PO_HEADERS_ALL.vendor_contact_id%TYPE;
2277: -- bug 6530879 Releases < Var addition END>
2278:
2279: --

Line 2276: l_vendor_contact_id PO_HEADERS_ALL.vendor_contact_id%TYPE;

2272: -- bug 6530879 Releases < Var addition START>
2273: l_agreement_id PO_HEADERS_ALL.po_header_id%TYPE;
2274: l_vendor_id PO_HEADERS_ALL.vendor_id%TYPE;
2275: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE;
2276: l_vendor_contact_id PO_HEADERS_ALL.vendor_contact_id%TYPE;
2277: -- bug 6530879 Releases < Var addition END>
2278:
2279: --
2280: l_return_status VARCHAR2(1);

Line 6054: PO_HEADERS_ALL POC -- : use all table

6050: p_sequence + ROWNUM,
6051: substr(g_linemsg||g_delim||POL.line_num||g_delim||l_textline,1,240),
6052: 'PO_SUB_REF_UNAPPROVED_CONTRACT'
6053: FROM PO_LINES_GT POL,
6054: PO_HEADERS_ALL POC -- : use all table
6055: WHERE POL.po_header_id = p_document_id
6056: AND POL.contract_id = POC.po_header_id --
6057: AND POC.type_lookup_code = 'CONTRACT'
6058: /* R12 GCPA

Line 6112: PO_HEADERS_ALL POC, -- : Use _ALL table

6108: p_sequence + ROWNUM,
6109: substr(g_linemsg||g_delim||POL.line_num||g_delim||l_textline,1,240),
6110: 'PO_SUB_LINE_CONTRACT_MISMATCH'
6111: FROM PO_LINES_GT POL,
6112: PO_HEADERS_ALL POC, -- : Use _ALL table
6113: PO_HEADERS_GT POH
6114: WHERE POH.po_header_id = p_document_id
6115: AND POL.po_header_id = POH.po_header_id
6116: AND POL.contract_id = POC.po_header_id --

Line 6503: po_headers_all POC

6499: l_textline,1,240),
6500: 'PO_SUB_LINE_CONTRACT_HOLD'
6501: FROM po_lines_gt POL,
6502: po_headers_gt POH,
6503: po_headers_all POC
6504: WHERE POH.po_header_id = p_document_id
6505: AND NVL(POH.authorization_status, 'INCOMPLETE') = 'INCOMPLETE'
6506: AND POL.po_header_id = POH.po_header_id
6507: AND POC.po_header_id = POL.contract_id

Line 6559: po_headers_all POC

6555: l_textline,1,240),
6556: 'PO_SUB_LINE_CONTRACT_EXP'
6557: FROM po_lines_gt POL,
6558: po_headers_gt POH,
6559: po_headers_all POC
6560: WHERE POH.po_header_id = p_document_id
6561: AND NVL(POH.authorization_status, 'INCOMPLETE') = 'INCOMPLETE'
6562: AND POL.po_header_id = POH.po_header_id
6563: AND POC.po_header_id = POL.contract_id

Line 8030: FROM PO_HEADERS_GT POH, PO_LINES_GT POL, PO_HEADERS_ALL POHA

8026: -- Bug 2818810. Added extra join to alias POHA to return 'Y' only if at least
8027: -- one line references a GA.
8028: CURSOR std_ga_ref_cursor(p_document_id NUMBER) IS
8029: SELECT 'Y'
8030: FROM PO_HEADERS_GT POH, PO_LINES_GT POL, PO_HEADERS_ALL POHA
8031: WHERE POH.po_header_id = p_document_id
8032: AND POH.po_header_id = POL.po_header_id
8033: AND POL.from_header_id = POHA.po_header_id
8034: AND POHA.type_lookup_code = 'BLANKET'

Line 8041: po_headers_all POHA

8037: --
8038: CURSOR std_gc_ref_cursor (p_doc_id NUMBER) IS
8039: SELECT 'Y'
8040: FROM po_lines_gt POL,
8041: po_headers_all POHA
8042: WHERE POL.po_header_id = p_doc_id
8043: AND POL.contract_id = POHA.po_header_id
8044: AND POHA.global_agreement_flag = 'Y';
8045: --

Line 8567: FROM PO_HEADERS_GT POH1, PO_LINES_GT POL, PO_HEADERS_ALL POH

8563: p_sequence + ROWNUM,
8564: substr(g_linemsg||g_delim||POL.line_num||g_delim
8565: ||l_textline,1,240),
8566: 'PO_SUB_STD_GA_DISABLED'
8567: FROM PO_HEADERS_GT POH1, PO_LINES_GT POL, PO_HEADERS_ALL POH
8568: WHERE POH1.po_header_id = p_document_id
8569: AND POL.po_header_id = POH1.po_header_id
8570: AND POL.from_header_id = POH.po_header_id --JOIN
8571: AND POH.type_lookup_code = 'BLANKET'

Line 8635: FROM PO_HEADERS_GT POH1, PO_LINES_GT POL, PO_HEADERS_ALL POH2

8631: p_sequence + ROWNUM,
8632: substr(g_linemsg||g_delim||POL.line_num||g_delim
8633: ||l_textline,1,240),
8634: 'PO_SUB_STD_GA_APPROVED'
8635: FROM PO_HEADERS_GT POH1, PO_LINES_GT POL, PO_HEADERS_ALL POH2
8636: WHERE POH1.po_header_id = p_document_id
8637: AND POL.po_header_id = POH1.po_header_id --JOIN
8638: AND POH2.po_header_id = POL.from_header_id --JOIN
8639: AND POH2.type_lookup_code = 'BLANKET'

Line 8692: FROM PO_HEADERS_GT POH1, PO_LINES_GT POL, PO_HEADERS_ALL POH2

8688: p_sequence + ROWNUM,
8689: substr(g_linemsg||g_delim||POL.line_num||g_delim
8690: ||l_textline,1,240),
8691: 'PO_SUB_STD_GA_ON_HOLD'
8692: FROM PO_HEADERS_GT POH1, PO_LINES_GT POL, PO_HEADERS_ALL POH2
8693: WHERE POH1.po_header_id = p_document_id
8694: AND POL.po_header_id = POH1.po_header_id --JOIN
8695: AND POH2.po_header_id = POL.from_header_id --JOIN
8696: AND POH2.type_lookup_code = 'BLANKET'

Line 8752: FROM PO_LINES_GT POL, PO_HEADERS_GT POH1, PO_HEADERS_ALL POH2

8748: p_sequence + ROWNUM,
8749: substr(g_linemsg||g_delim||POL.line_num||g_delim
8750: ||l_textline,1,240),
8751: 'PO_SUB_STD_GA_VENDOR_MISMATCH'
8752: FROM PO_LINES_GT POL, PO_HEADERS_GT POH1, PO_HEADERS_ALL POH2
8753: WHERE POL.po_header_id = p_document_id
8754: AND POL.po_header_id = POH1.po_header_id --JOIN
8755: AND POL.from_header_id = POH2.po_header_id --JOIN
8756: AND POH2.type_lookup_code = 'BLANKET'

Line 8806: FROM PO_LINES_GT POL, PO_HEADERS_GT POH1, PO_HEADERS_ALL POH2

8802: p_sequence + ROWNUM,
8803: substr(g_linemsg||g_delim||POL.line_num||g_delim
8804: ||l_textline,1,240),
8805: 'PO_SUB_STD_GA_VDR_SITE_MISMT'
8806: FROM PO_LINES_GT POL, PO_HEADERS_GT POH1, PO_HEADERS_ALL POH2
8807: WHERE POL.po_header_id = p_document_id
8808: AND POL.po_header_id = POH1.po_header_id --JOIN
8809: AND POL.from_header_id = POH2.po_header_id --JOIN
8810: AND POH2.type_lookup_code = 'BLANKET'

Line 8871: FROM PO_LINES_GT POL, PO_HEADERS_GT POH, PO_HEADERS_ALL POH2, PO_LINES_ALL POL2, PO_LINE_LOCATIONS_GT PLL

8867: p_sequence + ROWNUM,
8868: substr(g_linemsg||g_delim||POL.line_num||g_delim
8869: ||l_textline,1,240),
8870: 'PO_SUB_STD_AFTER_GA_DATE'
8871: FROM PO_LINES_GT POL, PO_HEADERS_GT POH, PO_HEADERS_ALL POH2, PO_LINES_ALL POL2, PO_LINE_LOCATIONS_GT PLL
8872: WHERE POL.po_header_id = p_document_id
8873: AND POL.po_header_id = POH.po_header_id -- JOIN
8874: AND PLL.po_line_id = POL.po_line_id --JOIN, Bug #5415428 - Get the Need by date
8875: AND POL.from_header_id = POH2.po_header_id --JOIN

Line 8927: FROM PO_LINES_GT POL, PO_HEADERS_GT POH, PO_HEADERS_ALL POH2, PO_LINE_LOCATIONS_GT PLL

8923: p_sequence + ROWNUM,
8924: substr(g_linemsg||g_delim||POL.line_num||g_delim||
8925: g_shipmsg||g_delim||PLL.shipment_num||g_delim||l_textline,1,240),
8926: 'PO_SUB_STD_BEFORE_GA_DATE'
8927: FROM PO_LINES_GT POL, PO_HEADERS_GT POH, PO_HEADERS_ALL POH2, PO_LINE_LOCATIONS_GT PLL
8928: WHERE POL.po_header_id = p_document_id
8929: AND POL.po_header_id = POH.po_header_id
8930: AND PLL.po_line_id = POL.po_line_id --JOIN
8931: AND POL.from_header_id = POH2.po_header_id --JOIN

Line 8980: FROM PO_LINES_GT POL, PO_HEADERS_GT POH1, PO_HEADERS_ALL POH2

8976: p_sequence + ROWNUM,
8977: substr(g_linemsg||g_delim||POL.line_num||g_delim
8978: ||l_textline,1,240),
8979: 'PO_SUB_STD_GA_CURR_MISMATCH'
8980: FROM PO_LINES_GT POL, PO_HEADERS_GT POH1, PO_HEADERS_ALL POH2
8981: WHERE POL.po_header_id = p_document_id
8982: AND POL.po_header_id = POH1.po_header_id --JOIN
8983: AND POL.from_header_id = POH2.po_header_id --JOIN
8984: AND POH2.type_lookup_code = 'BLANKET'

Line 9048: FROM PO_LINES_GT POL, PO_HEADERS_ALL POH1, PO_LINE_LOCATIONS_GT PLL1

9044: )
9045: , 0 )
9046: , POH1.amount_limit
9047: BULK COLLECT INTO l_curr_doc_line_num,l_po_amount,l_amount_limit
9048: FROM PO_LINES_GT POL, PO_HEADERS_ALL POH1, PO_LINE_LOCATIONS_GT PLL1
9049: WHERE PLL1.from_header_id = POL.from_header_id
9050: AND POL.po_header_id = p_document_id
9051: AND POL.from_header_id = POH1.po_header_id
9052: AND POH1.type_lookup_code = 'BLANKET'

Line 9081: FROM PO_LINE_LOCATIONS_ALL PLL2, PO_HEADERS_ALL POH1,

9077: * PLL2.price_override )
9078: )
9079: , 0 )
9080: BULK COLLECT INTO l_prev_doc_line_num, l_prev_rel_amount
9081: FROM PO_LINE_LOCATIONS_ALL PLL2, PO_HEADERS_ALL POH1,
9082: PO_HEADERS_ALL POH2, PO_LINES_GT POL
9083: WHERE POL.po_header_id = p_document_id
9084: AND POL.from_header_id = POH1.po_header_id --JOIN
9085: AND POH1.type_lookup_code = 'BLANKET'

Line 9082: PO_HEADERS_ALL POH2, PO_LINES_GT POL

9078: )
9079: , 0 )
9080: BULK COLLECT INTO l_prev_doc_line_num, l_prev_rel_amount
9081: FROM PO_LINE_LOCATIONS_ALL PLL2, PO_HEADERS_ALL POH1,
9082: PO_HEADERS_ALL POH2, PO_LINES_GT POL
9083: WHERE POL.po_header_id = p_document_id
9084: AND POL.from_header_id = POH1.po_header_id --JOIN
9085: AND POH1.type_lookup_code = 'BLANKET'
9086: AND POH1.global_agreement_flag = 'Y'

Line 9226: FROM PO_LINES_GT POL1, PO_LINES_ALL POL2, PO_HEADERS_ALL POH

9222: decode ( POL1.order_type_lookup_code --
9223: , 'FIXED PRICE' , 'PO_SUB_PO_LINE_GT_GA_AMT_TOL'
9224: , 'PO_SUB_PO_LINE_GT_GA_PRICE_TOL'
9225: )
9226: FROM PO_LINES_GT POL1, PO_LINES_ALL POL2, PO_HEADERS_ALL POH
9227: WHERE POL1.po_header_id = p_document_id
9228: AND POH.po_header_id = POL1.from_header_id --JOIN
9229: AND POH.type_lookup_code = 'BLANKET'
9230: AND POH.global_agreement_flag = 'Y'

Line 9298: FROM PO_LINES_GT POL1, PO_LINES_ALL POL2, PO_HEADERS_ALL POH

9294: p_sequence + ROWNUM,
9295: substr(g_linemsg||g_delim||POL1.line_num||g_delim
9296: ||l_textline,1,240),
9297: 'PO_SUB_STD_GA_LINE_LESS_MINREL' -- <2710030>
9298: FROM PO_LINES_GT POL1, PO_LINES_ALL POL2, PO_HEADERS_ALL POH
9299: WHERE POL1.po_header_id = p_document_id
9300: AND POL1.from_header_id = POL2.po_header_id --JOIN
9301: AND POL1.from_line_id = POL2.po_line_id --JOIN
9302: AND POL1.from_header_id = POH.po_header_id --JOIN

Line 9462: po_headers_all POHA

9458: 'PA_SUB_STD_GC_NOT_EN_PUR'
9459: FROM
9460: po_headers_gt POH,
9461: po_lines_gt POL,
9462: po_headers_all POHA
9463: WHERE
9464: POH.po_header_id = p_document_id
9465: AND POL.po_header_id = POH.po_header_id
9466: AND POL.contract_id = POHA.po_header_id

Line 9535: po_headers_all POHA

9531: 'PA_SUB_STD_GC_INVALID_SITE'
9532: FROM
9533: po_headers_gt POH,
9534: po_lines_gt POL,
9535: po_headers_all POHA
9536: WHERE
9537: POH.po_header_id = p_document_id
9538: AND POL.po_header_id = POH.po_header_id
9539: AND POL.contract_id = POHA.po_header_id

Line 9571: -- Added a join with po_headers_all POHA1 for getting rate.

9567: -- Removed Check 3 as different currencies are being allowed if OU is same.
9568: -- Renumbered Check 4 as Check 3.
9569: -- In the new Check 3, Removed the IF condition as currency mismatch is allowed.
9570: -- Also multiplied amount values by rate for handling currency mismatch.
9571: -- Added a join with po_headers_all POHA1 for getting rate.
9572:
9573: -- Check 3: Amount Released should not exceed the amount limit on the GC
9574:
9575: -- bug3251561

Line 9599: po_headers_all POHA, -- global contract

9595: BULK COLLECT INTO l_curr_doc_line_num,
9596: l_po_amount,
9597: l_amount_limit
9598: FROM po_lines_gt POL, -- target_line
9599: po_headers_all POHA, -- global contract
9600: po_lines_gt POL1, -- all lines in current doc
9601: -- having the same contract ref
9602: po_headers_all POHA1 -- document
9603: WHERE

Line 9602: po_headers_all POHA1 -- document

9598: FROM po_lines_gt POL, -- target_line
9599: po_headers_all POHA, -- global contract
9600: po_lines_gt POL1, -- all lines in current doc
9601: -- having the same contract ref
9602: po_headers_all POHA1 -- document
9603: WHERE
9604: POL.po_header_id = p_document_id
9605: AND POL.po_header_id = POHA1.po_header_id
9606: AND POL.contract_id = POHA.po_header_id

Line 9641: po_headers_all POH1, -- headers of lines in POL1

9637: l_prev_rel_amount
9638: FROM po_lines_gt POL, -- target line
9639: po_lines_all POL1, -- all lines from other doc with
9640: -- the same GC ref
9641: po_headers_all POH1, -- headers of lines in POL1
9642: po_headers_all POHA -- global contract
9643: WHERE
9644: POL.po_header_id = p_document_id
9645: AND POL.contract_id = POHA.po_header_id

Line 9642: po_headers_all POHA -- global contract

9638: FROM po_lines_gt POL, -- target line
9639: po_lines_all POL1, -- all lines from other doc with
9640: -- the same GC ref
9641: po_headers_all POH1, -- headers of lines in POL1
9642: po_headers_all POHA -- global contract
9643: WHERE
9644: POL.po_header_id = p_document_id
9645: AND POL.contract_id = POHA.po_header_id
9646: AND POHA.global_agreement_flag = 'Y'

Line 12755: OR EXISTS (select null from po_headers_all h

12751: FROM DUAL
12752: WHERE (p_release_id(i) IS NOT NULL
12753: --Case 1: No Release is specified, PO Header has to be specified
12754: -- Through any of HeaderId, DocNum-and-SubType, or VendorOrderNum
12755: OR EXISTS (select null from po_headers_all h
12756: WHERE h.po_header_id = l_header_id(i)
12757: AND (h.authorization_status is NULL
12758: OR h.authorization_status NOT IN ('PRE-APPROVED', 'IN PROCESS'))
12759: AND (h.cancel_flag is null or h.cancel_flag <> 'Y')

Line 12982: OR EXISTS (select null from po_headers_all h

12978: WHERE (p_release_id(i) IS NOT NULL
12979: --Case 1: No Release is specified, PO Header has to be specified
12980: -- Through any of HeaderId, DocNum-and-SubType, or VendorOrderNum
12981: -- Bug 3407980: Modified closed_code condition so that it only discards 'FINALLY CLOSED'
12982: OR EXISTS (select null from po_headers_all h
12983: WHERE h.po_header_id = l_header_id(i)
12984: AND (h.authorization_status is NULL
12985: OR h.authorization_status NOT IN ('APPROVED'))
12986: AND (h.closed_code is NULL or h.closed_code <> 'FINALLY CLOSED')

Line 13155: OR EXISTS (select null from po_headers_all h

13151: WHERE (p_release_id(i) IS NOT NULL
13152: --Case 1: No Release is specified, PO Header has to be specified
13153: -- Through any of HeaderId, DocNum-and-SubType, or VendorOrderNum
13154: -- Bug 3407980: Modified closed_code condition so that it only discards 'FINALLY CLOSED'
13155: OR EXISTS (select null from po_headers_all h
13156: WHERE h.po_header_id = l_header_id(i)
13157: AND (h.closed_code is NULL or h.closed_code <> 'FINALLY CLOSED')
13158: AND (h.frozen_flag is NULL or h.frozen_flag <> 'Y')
13159: AND (h.user_hold_flag is NULL or h.user_hold_flag <> 'Y')))

Line 13292: -- bug 4931241 modified the sql query to avoid FTS on PO_HEADERS_ALL

13288:
13289: -- For all the entities with null p_release_id(i), get Header status fields into
13290: -- global temprary table while storing sequence into po_headers_gt.PO_HEADER_ID column
13291: l_progress := '030';
13292: -- bug 4931241 modified the sql query to avoid FTS on PO_HEADERS_ALL
13293: -- Removed the where clause for document num and vendor_order_num
13294: -- They do not uniquely identify the document. Added validation in group package
13295: FORALL i IN 1..p_count
13296: INSERT

Line 13309: FROM po_headers_all h

13305: SEGMENT1, SUMMARY_FLAG, ENABLED_FLAG,
13306: NVL(authorization_status, 'INCOMPLETE'), nvl(approved_flag, 'N'),
13307: nvl(closed_code, 'OPEN'), NVL(cancel_flag, 'N'),
13308: NVL(frozen_flag, 'N'), NVL(user_hold_flag, 'N'), l_sequence(i)
13309: FROM po_headers_all h
13310: WHERE p_release_id(i) is null
13311: AND h.po_header_id = p_header_id(i)
13312: ;
13313:

Line 15094: FROM po_headers_all

15090: -- set x_header_id(i) as -999, indicating that po_header_Id
15091: -- cannot be derived by the IN paramters
15092: SELECT NVL(MIN(po_header_id), '-999')
15093: INTO x_header_id(i)
15094: FROM po_headers_all
15095: WHERE vendor_order_num = p_vendor_order_num(i)
15096: AND po_header_id = NVL(x_header_id(i), po_header_id);
15097:
15098: IF g_debug_stmt THEN

Line 15204: FROM po_headers_all

15200: -- SQL Why: need to check vendor site registration status below
15201: BEGIN
15202: SELECT vendor_id, vendor_site_id
15203: INTO l_vendor_id, l_vendor_site_id
15204: FROM po_headers_all
15205: WHERE po_header_id = p_document_id;
15206: EXCEPTION
15207: WHEN OTHERS THEN
15208: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

Line 16961: FROM po_headers_all poh

16957:
16958: -- Get the currency code and precision
16959: SELECT poh.currency_code
16960: INTO l_currency_code
16961: FROM po_headers_all poh
16962: WHERE poh.po_header_id = p_document_id;
16963:
16964: PO_CORE_S2.get_currency_info(
16965: x_currency_code => l_currency_code

Line 17783: po_headers_all poh

17779: l_consigned_flag,
17780: l_outsourced_assembly
17781: FROM po_line_locations_all poll,
17782: po_lines_all pol,
17783: po_headers_all poh
17784: WHERE poh.po_header_id = pol.po_header_id
17785: AND pol.po_line_id = poll.po_line_id
17786: AND poll.line_location_id = p_line_location_id;
17787: EXCEPTION