DBA Data[Home] [Help]

APPS.AP_IMPORT_VALIDATION_PKG dependencies on PO_DISTRIBUTIONS

Line 8361: l_corrupt_po_distributions NUMBER;

8357: l_total_amount_billed NUMBER;
8358: l_total_quantity_billed NUMBER;
8359: l_correction_dist_amount NUMBER;
8360: l_shipment_finally_closed VARCHAR2(1);
8361: l_corrupt_po_distributions NUMBER;
8362: l_calc_line_amount NUMBER;
8363: l_accrue_on_receipt_flag po_line_locations.accrue_on_receipt_flag%TYPE;
8364: l_temp_match_option VARCHAR2(25); --Bug5225547
8365:

Line 10220: FROM po_distributions

10216: END IF;
10217: --
10218: SELECT 'Y'
10219: INTO l_po_dist_is_valid_flag
10220: FROM po_distributions
10221: WHERE po_distribution_id = l_po_distribution_id
10222: AND line_location_id IS NOT NULL; /* BUG 3253594 */
10223: EXCEPTION
10224: WHEN NO_DATA_FOUND THEN

Line 10266: FROM po_distributions

10262: --
10263: SELECT 'Y' , po_distribution_id
10264: INTO l_po_dist_is_valid_flag,
10265: l_po_distribution_id
10266: FROM po_distributions
10267: WHERE distribution_num = p_invoice_lines_rec.po_distribution_num
10268: AND po_line_id = l_po_line_id
10269: AND line_location_id = l_po_line_location_id
10270: AND po_header_id = l_po_header_id;

Line 10313: FROM po_distributions

10309: END IF;
10310: --
10311: SELECT 'Y' , po_distribution_id
10312: INTO l_po_dist_is_valid_flag, l_po_distribution_id
10313: FROM po_distributions
10314: WHERE distribution_num = p_invoice_lines_rec.po_distribution_num
10315: AND po_release_id = l_po_release_id
10316: AND line_location_id = l_po_line_location_id
10317: AND po_header_id = l_po_header_id;

Line 10360: FROM po_distributions

10356: END IF;
10357: --
10358: SELECT 'Y'
10359: INTO l_po_dist_is_consistent_flag
10360: FROM po_distributions
10361: WHERE po_distribution_id = l_po_distribution_id
10362: AND distribution_num = p_invoice_lines_rec.po_distribution_num
10363: AND line_location_id IS NOT NULL; /* BUG 3253594 */
10364: EXCEPTION

Line 10550: po_distributions pd

10546: ph.segment1
10547: INTO l_po_header_id,
10548: l_po_number
10549: FROM po_headers ph,
10550: po_distributions pd
10551: WHERE pd.po_distribution_id = l_po_distribution_id
10552: AND pd.po_header_id = ph.po_header_id
10553: AND pd.line_location_id IS NOT NULL; /* BUG 3253594 */
10554: EXCEPTION

Line 10647: FROM po_distributions

10643: END IF;
10644:
10645: SELECT po_line_id
10646: INTO l_po_line_id
10647: FROM po_distributions
10648: WHERE po_distribution_id = l_po_distribution_id
10649: AND line_location_id IS NOT NULL; /* BUG 3253594 */
10650: EXCEPTION
10651: WHEN NO_DATA_FOUND THEN

Line 10753: FROM po_distributions

10749: END IF;
10750:
10751: SELECT line_location_id
10752: INTO l_po_line_location_id
10753: FROM po_distributions
10754: WHERE po_distribution_id = l_po_distribution_id
10755: AND line_location_id IS NOT NULL; /* BUG 3253594 */
10756: EXCEPTION
10757: WHEN NO_DATA_FOUND THEN

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

10868:
10869: ---------------------------------------------------------------------------
10870: -- 31.2: Check for Corrupt PO data - Amount Based Matching
10871: -- Forward Bug 3253594. Po team made the po_line_id, line_location_id,
10872: -- code_combination_id and quantity_ordered fields of the po_distributions
10873: -- table nullable for certain types of PO's (i.e. Blanket Agreements and
10874: -- Global Agreements). These fields must be not not null in the types of
10875: -- PO's that the 'Payables Open Interface Import' concurrent program
10876: -- handles. Thus, if a distribution with any of these fields null is

Line 10878: -- corrupt po distributions

10874: -- Global Agreements). These fields must be not not null in the types of
10875: -- PO's that the 'Payables Open Interface Import' concurrent program
10876: -- handles. Thus, if a distribution with any of these fields null is
10877: -- encountered then we can import the invoice because it references
10878: -- corrupt po distributions
10879: -- Complex Work Project. Matching Basis will be derived from po shipment.
10880: ---------------------------------------------------------------------------
10881:
10882: IF (l_po_header_id IS NOT NULL) THEN

Line 10900: INTO l_corrupt_po_distributions

10896: where po_header_id=l_po_header_id;
10897: --end of select for 5292782
10898:
10899: SELECT COUNT(*)
10900: INTO l_corrupt_po_distributions
10901: FROM po_distributions
10902: WHERE po_header_id = l_po_header_id
10903: AND (line_location_id IS NULL
10904: OR po_line_id IS NULL

Line 10901: FROM po_distributions

10897: --end of select for 5292782
10898:
10899: SELECT COUNT(*)
10900: INTO l_corrupt_po_distributions
10901: FROM po_distributions
10902: WHERE po_header_id = l_po_header_id
10903: AND (line_location_id IS NULL
10904: OR po_line_id IS NULL
10905: OR code_combination_id IS NULL)

Line 10908: IF (l_corrupt_po_distributions = 0) THEN

10904: OR po_line_id IS NULL
10905: OR code_combination_id IS NULL)
10906: AND rownum = 1; -- Bug 5448579
10907:
10908: IF (l_corrupt_po_distributions = 0) THEN
10909:
10910: SELECT COUNT(*)
10911: INTO l_corrupt_po_distributions
10912: FROM po_distributions pod,

Line 10911: INTO l_corrupt_po_distributions

10907:
10908: IF (l_corrupt_po_distributions = 0) THEN
10909:
10910: SELECT COUNT(*)
10911: INTO l_corrupt_po_distributions
10912: FROM po_distributions pod,
10913: po_line_locations pll
10914: WHERE pod.po_header_id = l_po_header_id
10915: AND pod.line_location_id = pll.line_location_id

Line 10912: FROM po_distributions pod,

10908: IF (l_corrupt_po_distributions = 0) THEN
10909:
10910: SELECT COUNT(*)
10911: INTO l_corrupt_po_distributions
10912: FROM po_distributions pod,
10913: po_line_locations pll
10914: WHERE pod.po_header_id = l_po_header_id
10915: AND pod.line_location_id = pll.line_location_id
10916: AND ((pll.matching_basis = 'QUANTITY'

Line 10925: IF (l_corrupt_po_distributions > 0) THEN

10921:
10922: END IF;
10923:
10924: IF (l_blanket<>'BLANKET') THEN --bug 5292782
10925: IF (l_corrupt_po_distributions > 0) THEN
10926: IF (AP_IMPORT_UTILITIES_PKG.insert_rejections(
10927: AP_IMPORT_INVOICES_PKG.g_invoice_lines_table,
10928: p_invoice_lines_rec.invoice_line_id,
10929: 'INVALID PO NUM',

Line 11495: FROM po_distributions

11491: WHERE invoice_id = l_price_correct_inv_id
11492: AND invoice_line_number = p_invoice_lines_rec.price_correct_inv_line_num
11493: AND po_distribution_id IN (
11494: SELECT po_distribution_id
11495: FROM po_distributions
11496: WHERE line_location_id = l_po_line_location_id);
11497:
11498: EXCEPTION
11499: WHEN NO_DATA_FOUND THEN

Line 11945: FROM po_distributions

11941: BEGIN
11942: --Contract Payments: Modified the SELECT clause
11943: SELECT decode(distribution_type,'PREPAYMENT',nvl(amount_financed,0),nvl(amount_billed,0))
11944: INTO l_pc_po_amt_billed
11945: FROM po_distributions
11946: WHERE po_distribution_id = l_po_distribution_id
11947: AND line_location_id IS NOT NULL; /* BUG 3253594 */
11948:
11949: --bugfix:5640388

Line 12023: FROM po_distributions

12019:
12020: SELECT nvl(SUM(decode(distribution_type,'PREPAYMENT',nvl(amount_financed,0),nvl(amount_billed,0))),0),
12021: nvl(SUM(decode(distribution_type,'PREPAYMENT',nvl(quantity_financed,0),nvl(quantity_billed,0))),0)
12022: INTO l_total_amount_billed, l_total_quantity_billed
12023: FROM po_distributions
12024: WHERE line_location_id = l_po_line_location_id
12025: AND po_distribution_id IN (SELECT po_distribution_id
12026: FROM ap_invoice_distributions
12027: WHERE invoice_id = l_price_correct_inv_id

Line 12084: FROM po_distributions pod

12080: FOR pc_po_dists IN (SELECT decode(pod.distribution_type,'PREPAYMENT',nvl(pod.quantity_financed,0),
12081: nvl(pod.quantity_billed,0)) quantity_billed,
12082: decode(pod.distribution_type,'PREPAYMENT',nvl(pod.amount_financed,0),
12083: nvl(pod.amount_billed,0)) amount_billed
12084: FROM po_distributions pod
12085: WHERE pod.line_location_id = l_po_line_location_id
12086: AND pod.po_distribution_id IN (
12087: SELECT aid.po_distribution_id
12088: FROM ap_invoice_distributions aid

Line 12174: FROM po_distributions

12170: BEGIN
12171:
12172: SELECT line_location_id
12173: INTO l_po_line_location_id
12174: FROM po_distributions
12175: WHERE po_distribution_id = l_po_distribution_id;
12176:
12177: EXCEPTION
12178: WHEN NO_DATA_FOUND THEN

Line 12553: FROM po_distributions pd,

12549: --'Prepayment' type shipments for complex work pos for Prepayment invoices and otherwise
12550: --Standard/Blanket/Scheduled shipments are valid for Standard/Credit invoices.
12551: SELECT 'X'
12552: INTO l_invalid_shipment_type
12553: FROM po_distributions pd,
12554: po_line_locations pll
12555: WHERE pd.line_location_id = pll.line_location_id
12556: AND pd.po_distribution_id = l_po_distribution_id
12557: AND

Line 14019: CURSOR po_distributions_cur IS

14015: l_dist_code_concatenated VARCHAR2(2000):='';
14016: current_calling_sequence VARCHAR2(2000);
14017: debug_info VARCHAR2(500);
14018:
14019: CURSOR po_distributions_cur IS
14020: SELECT code_combination_id
14021: FROM po_distributions
14022: WHERE line_location_id = l_po_line_location_id
14023: AND nvl(accrue_on_receipt_flag,'N') <> 'Y' --Bug 2667171 added this Condition

Line 14021: FROM po_distributions

14017: debug_info VARCHAR2(500);
14018:
14019: CURSOR po_distributions_cur IS
14020: SELECT code_combination_id
14021: FROM po_distributions
14022: WHERE line_location_id = l_po_line_location_id
14023: AND nvl(accrue_on_receipt_flag,'N') <> 'Y' --Bug 2667171 added this Condition
14024: ORDER BY distribution_num;
14025:

Line 14029: FROM po_distributions pd,

14025:
14026: --Contract Payments: Modified the where clause
14027: CURSOR po_line_locations_cur IS
14028: SELECT pd.code_combination_id
14029: FROM po_distributions pd,
14030: po_line_locations pll
14031: WHERE pd.line_location_id = pll.line_location_id
14032: AND pll.po_line_id = l_po_line_id
14033: AND(

Line 14073: FROM po_distributions

14069: END IF;
14070:
14071: SELECT code_combination_id
14072: INTO l_code_combination_id
14073: FROM po_distributions
14074: WHERE po_distribution_id = l_po_distribution_id
14075: AND line_location_id IS NOT NULL; /* BUG 3253594 */
14076: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
14077: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,

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

14146: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
14147: '(v_check_po_overlay 1) Get l_code_combination_id FROM '
14148: ||'l_po_line_location_id ');
14149: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
14150: '(v_check_po_overlay 1) Open po_distributions ');
14151: END IF;
14152:
14153: OPEN po_distributions_cur;
14154:

Line 14153: OPEN po_distributions_cur;

14149: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
14150: '(v_check_po_overlay 1) Open po_distributions ');
14151: END IF;
14152:
14153: OPEN po_distributions_cur;
14154:
14155: LOOP
14156: --
14157: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN

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

14155: LOOP
14156: --
14157: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
14158: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
14159: '(v_check_po_overlay 2) Fetch po_distributions_cur ');
14160: END IF;
14161:
14162: FETCH po_distributions_cur INTO
14163: l_code_combination_id;

Line 14162: FETCH po_distributions_cur INTO

14158: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
14159: '(v_check_po_overlay 2) Fetch po_distributions_cur ');
14160: END IF;
14161:
14162: FETCH po_distributions_cur INTO
14163: l_code_combination_id;
14164: --
14165: EXIT WHEN po_distributions_cur%NOTFOUND OR
14166: po_distributions_cur%NOTFOUND IS NULL;

Line 14165: EXIT WHEN po_distributions_cur%NOTFOUND OR

14161:
14162: FETCH po_distributions_cur INTO
14163: l_code_combination_id;
14164: --
14165: EXIT WHEN po_distributions_cur%NOTFOUND OR
14166: po_distributions_cur%NOTFOUND IS NULL;
14167:
14168: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
14169: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,

Line 14166: po_distributions_cur%NOTFOUND IS NULL;

14162: FETCH po_distributions_cur INTO
14163: l_code_combination_id;
14164: --
14165: EXIT WHEN po_distributions_cur%NOTFOUND OR
14166: po_distributions_cur%NOTFOUND IS NULL;
14167:
14168: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
14169: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
14170: '------------------> l_code_combination_id = '

Line 14202: CLOSE po_distributions_cur;

14198: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
14199: '(v_check_po_overlay 3) Overlay_Segments<-'
14200: ||current_calling_sequence);
14201: END IF;
14202: CLOSE po_distributions_cur;
14203: RAISE check_po_failure;
14204: ELSE
14205: -- show output values (only IF debug_switch = 'Y')
14206: --

Line 14233: CLOSE po_distributions_cur;

14229: AP_IMPORT_UTILITIES_PKG.Print(
14230: AP_IMPORT_INVOICES_PKG.g_debug_switch,
14231: 'insert_rejections<-'||current_calling_sequence);
14232: END IF;
14233: CLOSE po_distributions_cur;
14234: RAISE check_po_failure;
14235: --
14236: END IF;
14237: l_current_invoice_status := 'N';

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

14240:
14241: END LOOP;
14242: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
14243: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
14244: '(v_check_po_overlay 5) Close po_distributions ');
14245: END IF;
14246: CLOSE po_distributions_cur;
14247: ELSIF ((l_po_line_id IS NOT NULL) AND
14248: (l_po_line_location_id IS NULL)) THEN

Line 14246: CLOSE po_distributions_cur;

14242: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
14243: AP_IMPORT_UTILITIES_PKG.Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,
14244: '(v_check_po_overlay 5) Close po_distributions ');
14245: END IF;
14246: CLOSE po_distributions_cur;
14247: ELSIF ((l_po_line_id IS NOT NULL) AND
14248: (l_po_line_location_id IS NULL)) THEN
14249: -- po distribution id is not NULL
14250: -- PO Line Level Matching