DBA Data[Home] [Help]

APPS.AP_IMPORT_VALIDATION_PKG dependencies on PO_DISTRIBUTIONS

Line 9176: l_corrupt_po_distributions NUMBER;

9172: l_total_amount_billed NUMBER;
9173: l_total_quantity_billed NUMBER;
9174: l_correction_dist_amount NUMBER;
9175: l_shipment_finally_closed VARCHAR2(1);
9176: l_corrupt_po_distributions NUMBER;
9177: l_calc_line_amount NUMBER;
9178: l_accrue_on_receipt_flag po_line_locations.accrue_on_receipt_flag%TYPE;
9179: l_temp_match_option VARCHAR2(25); --Bug5225547
9180: l_item_description VARCHAR2(240); --Bug8546486

Line 11309: FROM po_distributions

11305: END IF;
11306: --
11307: SELECT 'Y'
11308: INTO l_po_dist_is_valid_flag
11309: FROM po_distributions
11310: WHERE po_distribution_id = l_po_distribution_id
11311: AND line_location_id IS NOT NULL; /* BUG 3253594 */
11312: EXCEPTION
11313: WHEN NO_DATA_FOUND THEN

Line 11355: FROM po_distributions

11351: --
11352: SELECT 'Y' , po_distribution_id
11353: INTO l_po_dist_is_valid_flag,
11354: l_po_distribution_id
11355: FROM po_distributions
11356: WHERE distribution_num = p_invoice_lines_rec.po_distribution_num
11357: AND po_line_id = l_po_line_id
11358: AND line_location_id = l_po_line_location_id
11359: AND po_header_id = l_po_header_id;

Line 11402: FROM po_distributions

11398: END IF;
11399: --
11400: SELECT 'Y' , po_distribution_id
11401: INTO l_po_dist_is_valid_flag, l_po_distribution_id
11402: FROM po_distributions
11403: WHERE distribution_num = p_invoice_lines_rec.po_distribution_num
11404: AND po_release_id = l_po_release_id
11405: AND line_location_id = l_po_line_location_id
11406: AND po_header_id = l_po_header_id;

Line 11449: FROM po_distributions

11445: END IF;
11446: --
11447: SELECT 'Y'
11448: INTO l_po_dist_is_consistent_flag
11449: FROM po_distributions
11450: WHERE po_distribution_id = l_po_distribution_id
11451: AND distribution_num = p_invoice_lines_rec.po_distribution_num
11452: AND line_location_id IS NOT NULL; /* BUG 3253594 */
11453: EXCEPTION

Line 11639: po_distributions pd

11635: ph.segment1
11636: INTO l_po_header_id,
11637: l_po_number
11638: FROM po_headers ph,
11639: po_distributions pd
11640: WHERE pd.po_distribution_id = l_po_distribution_id
11641: AND pd.po_header_id = ph.po_header_id
11642: AND pd.line_location_id IS NOT NULL; /* BUG 3253594 */
11643: EXCEPTION

Line 11736: FROM po_distributions

11732: END IF;
11733:
11734: SELECT po_line_id
11735: INTO l_po_line_id
11736: FROM po_distributions
11737: WHERE po_distribution_id = l_po_distribution_id
11738: AND line_location_id IS NOT NULL; /* BUG 3253594 */
11739: EXCEPTION
11740: WHEN NO_DATA_FOUND THEN

Line 11842: FROM po_distributions

11838: END IF;
11839:
11840: SELECT line_location_id
11841: INTO l_po_line_location_id
11842: FROM po_distributions
11843: WHERE po_distribution_id = l_po_distribution_id
11844: AND line_location_id IS NOT NULL; /* BUG 3253594 */
11845: EXCEPTION
11846: WHEN NO_DATA_FOUND THEN

Line 11988: -- code_combination_id and quantity_ordered fields of the po_distributions

11984:
11985: ---------------------------------------------------------------------------
11986: -- 31.2: Check for Corrupt PO data - Amount Based Matching
11987: -- Forward Bug 3253594. Po team made the po_line_id, line_location_id,
11988: -- code_combination_id and quantity_ordered fields of the po_distributions
11989: -- table nullable for certain types of PO's (i.e. Blanket Agreements and
11990: -- Global Agreements). These fields must be not not null in the types of
11991: -- PO's that the 'Payables Open Interface Import' concurrent program
11992: -- handles. Thus, if a distribution with any of these fields null is

Line 11994: -- corrupt po distributions

11990: -- Global Agreements). These fields must be not not null in the types of
11991: -- PO's that the 'Payables Open Interface Import' concurrent program
11992: -- handles. Thus, if a distribution with any of these fields null is
11993: -- encountered then we can import the invoice because it references
11994: -- corrupt po distributions
11995: -- Complex Work Project. Matching Basis will be derived from po shipment.
11996: ---------------------------------------------------------------------------
11997:
11998: IF (l_po_header_id IS NOT NULL) THEN

Line 12018: INTO l_corrupt_po_distributions

12014:
12015: IF (l_blanket<>'BLANKET') THEN /* Bug10103888 */
12016:
12017: SELECT COUNT(*)
12018: INTO l_corrupt_po_distributions
12019: FROM po_distributions
12020: WHERE po_header_id = l_po_header_id
12021: AND (line_location_id IS NULL
12022: OR po_line_id IS NULL

Line 12019: FROM po_distributions

12015: IF (l_blanket<>'BLANKET') THEN /* Bug10103888 */
12016:
12017: SELECT COUNT(*)
12018: INTO l_corrupt_po_distributions
12019: FROM po_distributions
12020: WHERE po_header_id = l_po_header_id
12021: AND (line_location_id IS NULL
12022: OR po_line_id IS NULL
12023: OR code_combination_id IS NULL)

Line 12026: IF (l_corrupt_po_distributions = 0) THEN

12022: OR po_line_id IS NULL
12023: OR code_combination_id IS NULL)
12024: AND rownum = 1; -- Bug 5448579
12025:
12026: IF (l_corrupt_po_distributions = 0) THEN
12027:
12028: SELECT COUNT(*)
12029: INTO l_corrupt_po_distributions
12030: FROM po_distributions pod,

Line 12029: INTO l_corrupt_po_distributions

12025:
12026: IF (l_corrupt_po_distributions = 0) THEN
12027:
12028: SELECT COUNT(*)
12029: INTO l_corrupt_po_distributions
12030: FROM po_distributions pod,
12031: po_line_locations pll
12032: WHERE pod.po_header_id = l_po_header_id
12033: AND pod.line_location_id = pll.line_location_id

Line 12030: FROM po_distributions pod,

12026: IF (l_corrupt_po_distributions = 0) THEN
12027:
12028: SELECT COUNT(*)
12029: INTO l_corrupt_po_distributions
12030: FROM po_distributions pod,
12031: po_line_locations pll
12032: WHERE pod.po_header_id = l_po_header_id
12033: AND pod.line_location_id = pll.line_location_id
12034: AND ((pll.matching_basis = 'QUANTITY'

Line 12043: IF (l_corrupt_po_distributions > 0) THEN

12039:
12040: END IF;
12041:
12042: /* IF (l_blanket<>'BLANKET') THEN --bug 5292782 Moved above for bug 10103888 */
12043: IF (l_corrupt_po_distributions > 0) THEN
12044: IF (AP_IMPORT_UTILITIES_PKG.insert_rejections(
12045: AP_IMPORT_INVOICES_PKG.g_invoice_lines_table,
12046: p_invoice_lines_rec.invoice_line_id,
12047: 'INVALID PO NUM',

Line 12654: FROM po_distributions

12650: WHERE invoice_id = l_price_correct_inv_id
12651: AND invoice_line_number = p_invoice_lines_rec.price_correct_inv_line_num
12652: AND po_distribution_id IN (
12653: SELECT po_distribution_id
12654: FROM po_distributions
12655: WHERE line_location_id = l_po_line_location_id);
12656:
12657: EXCEPTION
12658: WHEN NO_DATA_FOUND THEN

Line 13152: FROM po_distributions

13148: BEGIN
13149: --Contract Payments: Modified the SELECT clause
13150: SELECT decode(distribution_type,'PREPAYMENT',nvl(amount_financed,0),nvl(amount_billed,0))
13151: INTO l_pc_po_amt_billed
13152: FROM po_distributions
13153: WHERE po_distribution_id = l_po_distribution_id
13154: AND line_location_id IS NOT NULL; /* BUG 3253594 */
13155:
13156: --bugfix:5640388

Line 13242: FROM po_distributions

13238:
13239: SELECT nvl(SUM(decode(distribution_type,'PREPAYMENT',nvl(amount_financed,0),nvl(amount_billed,0))),0),
13240: nvl(SUM(decode(distribution_type,'PREPAYMENT',nvl(quantity_financed,0),nvl(quantity_billed,0))),0)
13241: INTO l_total_amount_billed, l_total_quantity_billed
13242: FROM po_distributions
13243: WHERE line_location_id = l_po_line_location_id
13244: AND po_distribution_id IN (SELECT po_distribution_id
13245: FROM ap_invoice_distributions
13246: WHERE invoice_id = l_price_correct_inv_id

Line 13315: FROM po_distributions pod

13311: FOR pc_po_dists IN (SELECT decode(pod.distribution_type,'PREPAYMENT',nvl(pod.quantity_financed,0),
13312: nvl(pod.quantity_billed,0)) quantity_billed,
13313: decode(pod.distribution_type,'PREPAYMENT',nvl(pod.amount_financed,0),
13314: nvl(pod.amount_billed,0)) amount_billed
13315: FROM po_distributions pod
13316: WHERE pod.line_location_id = l_po_line_location_id
13317: AND pod.po_distribution_id IN (
13318: SELECT aid.po_distribution_id
13319: FROM ap_invoice_distributions aid

Line 13418: FROM po_distributions

13414: BEGIN
13415:
13416: SELECT line_location_id
13417: INTO l_po_line_location_id
13418: FROM po_distributions
13419: WHERE po_distribution_id = l_po_distribution_id;
13420:
13421: EXCEPTION
13422: WHEN NO_DATA_FOUND THEN

Line 13905: FROM po_distributions pd,

13901: --'Prepayment' type shipments for complex work pos for Prepayment invoices and otherwise
13902: --Standard/Blanket/Scheduled shipments are valid for Standard/Credit invoices.
13903: SELECT 'X'
13904: INTO l_invalid_shipment_type
13905: FROM po_distributions pd,
13906: po_line_locations pll
13907: WHERE pd.line_location_id = pll.line_location_id
13908: AND pd.po_distribution_id = l_po_distribution_id
13909: AND

Line 15397: CURSOR po_distributions_cur IS

15393: l_dist_code_concatenated VARCHAR2(2000):='';
15394: current_calling_sequence VARCHAR2(2000);
15395: debug_info VARCHAR2(500);
15396:
15397: CURSOR po_distributions_cur IS
15398: SELECT code_combination_id
15399: FROM po_distributions
15400: WHERE line_location_id = l_po_line_location_id
15401: AND nvl(accrue_on_receipt_flag,'N') <> 'Y' --Bug 2667171 added this Condition

Line 15399: FROM po_distributions

15395: debug_info VARCHAR2(500);
15396:
15397: CURSOR po_distributions_cur IS
15398: SELECT code_combination_id
15399: FROM po_distributions
15400: WHERE line_location_id = l_po_line_location_id
15401: AND nvl(accrue_on_receipt_flag,'N') <> 'Y' --Bug 2667171 added this Condition
15402: ORDER BY distribution_num;
15403:

Line 15407: FROM po_distributions pd,

15403:
15404: --Contract Payments: Modified the where clause
15405: CURSOR po_line_locations_cur IS
15406: SELECT pd.code_combination_id
15407: FROM po_distributions pd,
15408: po_line_locations pll
15409: WHERE pd.line_location_id = pll.line_location_id
15410: AND pll.po_line_id = l_po_line_id
15411: AND(

Line 15452: FROM po_distributions

15448: END IF;
15449:
15450: SELECT code_combination_id
15451: INTO l_code_combination_id
15452: FROM po_distributions
15453: WHERE po_distribution_id = l_po_distribution_id
15454: AND line_location_id IS NOT NULL; /* BUG 3253594 */
15455: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
15456: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,

Line 15531: '(v_check_po_overlay 1) Open po_distributions ');

15527: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
15528: '(v_check_po_overlay 1) Get l_code_combination_id FROM '
15529: ||'l_po_line_location_id ');
15530: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
15531: '(v_check_po_overlay 1) Open po_distributions ');
15532: END IF;
15533:
15534: OPEN po_distributions_cur;
15535:

Line 15534: OPEN po_distributions_cur;

15530: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
15531: '(v_check_po_overlay 1) Open po_distributions ');
15532: END IF;
15533:
15534: OPEN po_distributions_cur;
15535:
15536: LOOP
15537: --
15538: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN

Line 15540: '(v_check_po_overlay 2) Fetch po_distributions_cur ');

15536: LOOP
15537: --
15538: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
15539: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
15540: '(v_check_po_overlay 2) Fetch po_distributions_cur ');
15541: END IF;
15542:
15543: FETCH po_distributions_cur INTO
15544: l_code_combination_id;

Line 15543: FETCH po_distributions_cur INTO

15539: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
15540: '(v_check_po_overlay 2) Fetch po_distributions_cur ');
15541: END IF;
15542:
15543: FETCH po_distributions_cur INTO
15544: l_code_combination_id;
15545: --
15546: EXIT WHEN po_distributions_cur%NOTFOUND OR
15547: po_distributions_cur%NOTFOUND IS NULL;

Line 15546: EXIT WHEN po_distributions_cur%NOTFOUND OR

15542:
15543: FETCH po_distributions_cur INTO
15544: l_code_combination_id;
15545: --
15546: EXIT WHEN po_distributions_cur%NOTFOUND OR
15547: po_distributions_cur%NOTFOUND IS NULL;
15548:
15549: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
15550: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,

Line 15547: po_distributions_cur%NOTFOUND IS NULL;

15543: FETCH po_distributions_cur INTO
15544: l_code_combination_id;
15545: --
15546: EXIT WHEN po_distributions_cur%NOTFOUND OR
15547: po_distributions_cur%NOTFOUND IS NULL;
15548:
15549: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
15550: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
15551: '------------------> l_code_combination_id = '

Line 15584: CLOSE po_distributions_cur;

15580: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
15581: '(v_check_po_overlay 3) Overlay_Segments<-'
15582: ||current_calling_sequence);
15583: END IF;
15584: CLOSE po_distributions_cur;
15585: RAISE check_po_failure;
15586: ELSE
15587: -- show output values (only IF debug_switch = 'Y')
15588: --

Line 15616: CLOSE po_distributions_cur;

15612: AP_IMPORT_UTILITIES_PKG.Print(
15613: AP_IMPORT_INVOICES_PKG.g_debug_switch,
15614: 'insert_rejections<-'||current_calling_sequence);
15615: END IF;
15616: CLOSE po_distributions_cur;
15617: RAISE check_po_failure;
15618: --
15619: END IF;
15620: l_current_invoice_status := 'N';

Line 15627: '(v_check_po_overlay 5) Close po_distributions ');

15623:
15624: END LOOP;
15625: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
15626: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
15627: '(v_check_po_overlay 5) Close po_distributions ');
15628: END IF;
15629: CLOSE po_distributions_cur;
15630: ELSIF ((l_po_line_id IS NOT NULL) AND
15631: (l_po_line_location_id IS NULL)) THEN

Line 15629: CLOSE po_distributions_cur;

15625: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
15626: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
15627: '(v_check_po_overlay 5) Close po_distributions ');
15628: END IF;
15629: CLOSE po_distributions_cur;
15630: ELSIF ((l_po_line_id IS NOT NULL) AND
15631: (l_po_line_location_id IS NULL)) THEN
15632: -- po distribution id is not NULL
15633: -- PO Line Level Matching