DBA Data[Home] [Help]

APPS.PAAPIMP_PKG dependencies on AP_INVOICE_DISTRIBUTIONS_ALL

Line 883: UPDATE ap_invoice_distributions_all DIST

879: write_log(LOG, '......Paapimp is not running, do cleanup');
880: end if;
881: G_err_stage := 'UPDATING INVOICE DISTRIBUTIONS';
882:
883: UPDATE ap_invoice_distributions_all DIST
884: SET DIST.pa_addition_flag = 'N'
885: , DIST.request_id = G_REQUEST_ID
886: WHERE DIST.pa_addition_flag IN ('O','W')
887: AND DIST.posted_flag||''= 'Y'

Line 1578: FROM ap_invoice_distributions_All

1574: BEGIN
1575:
1576: SELECT prepay_amount_remaining
1577: INTO l_prepay_rem_amt
1578: FROM ap_invoice_distributions_All
1579: WHERE invoice_distribution_id = p_prepay_dist_id;
1580:
1581: -- ==================================================================================
1582: -- Bug: 5393523

Line 1708: UPDATE ap_invoice_distributions_all dist

1704: Pre Rel12 Upgrade should also be brought into Projects */
1705:
1706: write_log(LOG, 'Marking Historical Prepayments for processing...');
1707:
1708: UPDATE ap_invoice_distributions_all dist
1709: SET dist.pa_addition_flag = 'O',
1710: request_id = G_REQUEST_ID,
1711: last_update_date=SYSDATE,
1712: last_updated_by= G_USER_ID,

Line 1740: AP_Invoice_Distributions_all aid

1736: AND inv.source in ('CREDIT CARD','Both Pay')
1737: AND nvl(inv.PAID_ON_BEHALF_EMPLOYEE_ID,0) > 0)))
1738: AND exists(SELECT inv.invoice_id
1739: FROM AP_INVOICES inv,
1740: AP_Invoice_Distributions_all aid
1741: WHERE aid.invoice_id = inv.invoice_id
1742: AND inv.invoice_type_lookup_code = 'PREPAYMENT'
1743: AND aid.historical_flag = 'Y'
1744: AND aid.pa_addition_flag = 'Y'

Line 1886: AP_Invoice_Distributions_all aid

1882: AND inv.source in ('CREDIT CARD','Both Pay')
1883: AND nvl(inv.PAID_ON_BEHALF_EMPLOYEE_ID,0) > 0)))
1884: AND exists(SELECT inv.invoice_id
1885: FROM AP_INVOICES_ALL inv,
1886: AP_Invoice_Distributions_all aid
1887: WHERE aid.invoice_id = inv.invoice_id
1888: AND inv.invoice_type_lookup_code = 'PREPAYMENT'
1889: AND aid.historical_flag = 'Y'
1890: AND aid.pa_addition_flag = 'Y'

Line 1986: ap_invoice_distributions_all dist2

1982: EXISTS (
1983: SELECT NULL
1984: FROM ap_invoices_all inv,
1985: po_distributions_all PO,
1986: ap_invoice_distributions_all dist2
1987: WHERE inv.invoice_id = dist2.invoice_id
1988: AND nvl(po.distribution_type,'XXX') <> 'PREPAYMENT'
1989: AND dist2.invoice_id = DIST.invoice_id
1990: AND dist2.invoice_distribution_id = DIST.invoice_distribution_id

Line 2006: ap_invoice_distributions_all dist3

2002: OR
2003: EXISTS (
2004: SELECT NULL
2005: FROM ap_invoices_all inv1,
2006: ap_invoice_distributions_all dist3
2007: WHERE inv1.invoice_id = dist3.invoice_id
2008: AND inv1.invoice_id = dist.invoice_id
2009: AND inv1.invoice_type_lookup_code <> 'EXPENSE REPORT'
2010: AND (dist.reversal_flag = 'Y' or dist.cancellation_flag = 'Y' )

Line 2052: UPDATE ap_invoice_distributions_all dist

2048: Pre Rel12 Upgrade should also be brought into Projects */
2049:
2050: write_log(LOG, 'Marking PREPAYMENT invoices in Cash Based Acctng');
2051:
2052: UPDATE ap_invoice_distributions_all dist
2053: SET dist.pa_addition_flag = 'O',
2054: request_id = G_REQUEST_ID,
2055: last_update_date=SYSDATE,
2056: last_updated_by= G_USER_ID,

Line 2080: AP_Invoice_Distributions_all aid

2076: AND nvl(INV.source, 'xx' ) NOT IN ('Oracle Project Accounting',
2077: 'PA_IC_INVOICES','PA_COST_ADJUSTMENTS') )
2078: AND exists(SELECT inv.invoice_id
2079: FROM AP_INVOICES inv,
2080: AP_Invoice_Distributions_all aid
2081: WHERE aid.invoice_id = inv.invoice_id
2082: AND inv.invoice_type_lookup_code = 'PREPAYMENT'
2083: AND aid.historical_flag = 'Y'
2084: AND aid.pa_addition_flag = 'Y'

Line 2145: ap_invoice_distributions_all dist2

2141: AND EXISTS (
2142: SELECT NULL
2143: FROM ap_invoices_all inv,
2144: po_distributions_all PO,
2145: ap_invoice_distributions_all dist2
2146: WHERE inv.invoice_id = dist2.invoice_id
2147: AND nvl(po.distribution_type,'XXX') <> 'PREPAYMENT'
2148: AND dist2.invoice_id = DIST.invoice_id
2149: /*credit card txn enhancement, make sure this update doesn't pick tehm */

Line 2226: ap_invoice_distributions_all dist2

2222: EXISTS (
2223: SELECT NULL
2224: FROM ap_invoices_all inv,
2225: po_distributions_all PO,
2226: ap_invoice_distributions_all dist2
2227: WHERE inv.invoice_id = dist2.invoice_id
2228: AND nvl(po.distribution_type,'XXX') <> 'PREPAYMENT'
2229: AND dist2.invoice_id = DIST.invoice_id
2230: AND dist2.invoice_distribution_id = DIST.invoice_distribution_id

Line 2291: UPDATE ap_invoice_distributions_all dist

2287: Pre Rel12 Upgrade should also be brought into Projects */
2288:
2289: write_log(LOG, 'Marking Historical Prepayments for processing...');
2290:
2291: UPDATE ap_invoice_distributions_all dist
2292: SET dist.pa_addition_flag = 'O',
2293: request_id = G_REQUEST_ID,
2294: last_update_date=SYSDATE,
2295: last_updated_by= G_USER_ID,

Line 2318: AP_Invoice_Distributions_all aid

2314: AND nvl(INV.source, 'xx' ) NOT IN ('Oracle Project Accounting',
2315: 'PA_IC_INVOICES','PA_COST_ADJUSTMENTS') )
2316: AND exists(SELECT inv.invoice_id
2317: FROM AP_INVOICES_all inv,
2318: AP_Invoice_Distributions_all aid
2319: WHERE aid.invoice_id = inv.invoice_id
2320: AND inv.invoice_type_lookup_code = 'PREPAYMENT'
2321: AND aid.historical_flag = 'Y'
2322: AND aid.pa_addition_flag = 'Y'

Line 2383: ap_invoice_distributions_all dist2

2379: AND EXISTS (
2380: SELECT NULL
2381: FROM ap_invoices_all inv,
2382: po_distributions_all PO,
2383: ap_invoice_distributions_all dist2
2384: WHERE inv.invoice_id = dist2.invoice_id
2385: AND nvl(po.distribution_type,'XXX') <> 'PREPAYMENT'
2386: AND dist2.invoice_id = DIST.invoice_id
2387: /* credit card txn enhancement, make sure this update doesn't pick tehm */

Line 2617: UPDATE ap_invoice_distributions_all dist

2613: write_log(LOG,'Before bulk update of prepayment invoices');
2614:
2615: FORALL i IN l_invoice_id_tbl.FIRST..l_invoice_id_tbl.LAST
2616:
2617: UPDATE ap_invoice_distributions_all dist
2618: SET dist.pa_addition_flag = decode(l_insert_flag_tbl(i),'F','G','P','N')
2619: WHERE dist.invoice_id = l_invoice_id_tbl(i)
2620: AND dist.invoice_distribution_id = l_invoice_dist_id_tbl(i)
2621: AND dist.pa_addition_flag = 'O'

Line 3341: FROM ap_invoice_distributions_all

3337:
3338: IF l_prepay_dist_id_tbl(i) is not null THEN
3339: SELECT nvl(historical_flag,'N')
3340: INTO l_prepay_hist_flag
3341: FROM ap_invoice_distributions_all
3342: WHERE invoice_distribution_id = l_prepay_dist_id_tbl(i);
3343:
3344: ELSIF l_parent_rev_id_tbl(i) is not null THEN --Bug#5444174
3345: SELECT nvl(historical_flag,'N')

Line 3347: FROM ap_invoice_distributions_all

3343:
3344: ELSIF l_parent_rev_id_tbl(i) is not null THEN --Bug#5444174
3345: SELECT nvl(historical_flag,'N')
3346: INTO l_prepay_hist_flag
3347: FROM ap_invoice_distributions_all
3348: WHERE invoice_distribution_id = l_parent_rev_id_tbl(i);
3349: END IF;
3350:
3351: EXCEPTION

Line 3434: FROM ap_invoice_distributions_all

3430: End If;
3431:
3432: SELECT nvl(historical_flag,'N')
3433: INTO l_historical_flag
3434: FROM ap_invoice_distributions_all
3435: WHERE invoice_id = l_invoice_id_tbl(i)
3436: AND invoice_distribution_id = l_parent_rev_id_tbl(i); --check the index on this table
3437:
3438: EXCEPTION

Line 4145: UPDATE ap_invoice_distributions_all dist

4141: write_log(LOG, G_err_stage);
4142:
4143: FORALL i IN l_sys_ref1_tbl.FIRST..l_sys_ref1_tbl.LAST
4144:
4145: UPDATE ap_invoice_distributions_all dist
4146: SET dist.pa_addition_flag = l_pa_addflag_tbl(i)
4147: ,dist.assets_addition_flag = decode(l_assets_addflag_tbl(i),'P','P',dist.assets_addition_flag)
4148: WHERE dist.invoice_id = l_sys_ref2_tbl(i)
4149: AND dist.invoice_distribution_id = l_sys_ref5_tbl(i)

Line 4160: from ap_invoice_distributions_all dist

4156: SET historical_flag = 'Y'
4157: WHERE document_header_id = l_sys_ref2_tbl(i)
4158: AND document_distribution_id = l_sys_ref5_tbl(i)
4159: AND exists (select 'exist'
4160: from ap_invoice_distributions_all dist
4161: where dist.invoice_id =l_sys_ref2_tbl(i)
4162: and dist.invoice_distribution_id = l_sys_ref5_tbl(i)
4163: and dist.pa_addition_flag = 'Y'
4164: and dist.historical_flag = 'Y');

Line 4190: AP_Invoice_Distributions_all aid,

4186: WHERE hist.payment_history_id = dist.payment_history_id
4187: AND hist.posted_flag = 'Y')
4188: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
4189: FROM AP_INVOICES_ALL inv,
4190: AP_Invoice_Distributions_all aid,
4191: ap_invoice_payments_all aip
4192: WHERE inv.invoice_id = aip.invoice_id
4193: AND aid.invoice_id = inv.invoice_id
4194: AND aip.invoice_payment_id = dist.invoice_payment_id

Line 4456: AP_Invoice_Distributions_all aid,

4452: WHERE hist.payment_history_id = dist.payment_history_id
4453: AND hist.posted_flag = 'Y')
4454: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
4455: FROM AP_INVOICES_ALL inv,
4456: AP_Invoice_Distributions_all aid,
4457: ap_invoice_payments_all aip
4458: WHERE inv.invoice_id = aip.invoice_id
4459: AND aid.invoice_id = inv.invoice_id
4460: AND aip.invoice_payment_id = dist.invoice_payment_id

Line 4495: AP_Invoice_Distributions_all aid,

4491: AND hist.posted_flag = 'Y')
4492: AND exists(SELECT/*+ no_unnest */ inv.invoice_id
4493: FROM AP_INVOICES_ALL inv,
4494: PO_Distributions_all PO,
4495: AP_Invoice_Distributions_all aid,
4496: ap_invoice_payments_all aip
4497: WHERE inv.invoice_id = aip.invoice_id
4498: AND aid.invoice_id = inv.invoice_id
4499: AND aip.invoice_payment_id = dist.invoice_payment_id

Line 4552: AP_Invoice_Distributions_all aid,

4548: WHERE hist.payment_history_id = dist.payment_history_id
4549: AND hist.posted_flag = 'Y')
4550: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
4551: FROM AP_INVOICES_ALL inv,
4552: AP_Invoice_Distributions_all aid,
4553: ap_invoice_payments_all aip
4554: WHERE inv.invoice_id = aip.invoice_id
4555: AND aid.invoice_id = inv.invoice_id
4556: AND aip.invoice_payment_id = dist.invoice_payment_id

Line 4587: AP_Invoice_Distributions_all aid,

4583: AND hist.posted_flag = 'Y')
4584: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
4585: FROM AP_INVOICES_ALL inv,
4586: PO_Distributions_all PO,
4587: AP_Invoice_Distributions_all aid,
4588: ap_invoice_payments_all aip
4589: WHERE inv.invoice_id = aip.invoice_id
4590: AND aid.invoice_id = inv.invoice_id
4591: AND aip.invoice_payment_id = dist.invoice_payment_id

Line 7383: UPDATE ap_invoice_distributions_all dist

7379:
7380: G_err_stage := 'Within calling lock_ap_invoice';
7381: write_log(LOG, G_err_stage);
7382:
7383: UPDATE ap_invoice_distributions_all dist
7384: SET dist.pa_addition_flag = 'L'
7385: WHERE dist.po_distribution_id = p_po_distribution_id
7386: AND dist.pa_addition_flag = 'N';
7387:

Line 7412: UPDATE ap_invoice_distributions_all dist

7408:
7409: G_err_stage := 'Within calling tieback_locked_invoice';
7410: write_log(LOG, G_err_stage);
7411:
7412: UPDATE ap_invoice_distributions_all dist
7413: SET dist.pa_addition_flag = 'N'
7414: WHERE dist.pa_addition_flag = 'L';
7415:
7416: l_num_rows := SQL%ROWCOUNT;

Line 7473: UPDATE ap_invoice_distributions_all apdist

7469: If g_body_debug_mode = 'Y' Then
7470: write_log(LOG, 'Updating empty invoice variance lines pa addtion flag to G for a project');
7471: End if;
7472:
7473: UPDATE ap_invoice_distributions_all apdist
7474: SET apdist.pa_addition_flag = DECODE(NVL(apdist.amount_variance,0),0,'G',increment_W_count('W')),
7475: request_id = G_REQUEST_ID,
7476: last_update_date=SYSDATE,
7477: last_updated_by=G_USER_ID,

Line 7484: FROM ap_invoices inv, ap_invoice_distributions_all dist

7480: program_application_id= G_PROG_APPL_ID,
7481: program_update_date=SYSDATE
7482: WHERE rowid IN (
7483: SELECT dist.rowid
7484: FROM ap_invoices inv, ap_invoice_distributions_all dist
7485: WHERE inv.invoice_id = dist.invoice_id
7486: AND (dist.line_type_lookup_code in ('ITEM','ACCRUAL','NONREC_TAX')
7487: OR ( pa_nl_installed.is_nl_installed = 'Y' --EIB trackable items
7488: AND EXISTS (SELECT 'X'

Line 7501: FROM ap_invoice_distributions_all apdist2

7497: AND si.organization_id = po_dist1.org_id)
7498: )
7499: ) --Bug#5399352. Added this here to take care of IPV/TIPV records matched to EIB item PO.
7500: AND NOT EXISTS (SELECT NULL
7501: FROM ap_invoice_distributions_all apdist2
7502: WHERE apdist2.pa_addition_flag = 'Y'
7503: AND apdist2.po_distribution_id = dist.po_distribution_id
7504: AND apdist2.line_type_lookup_code = dist.line_type_lookup_code
7505: AND apdist2.line_type_lookup_code in ('ITEM','ACCRUAL','NONREC_TAX')

Line 7508: FROM ap_invoice_distributions_all apdist1

7504: AND apdist2.line_type_lookup_code = dist.line_type_lookup_code
7505: AND apdist2.line_type_lookup_code in ('ITEM','ACCRUAL','NONREC_TAX')
7506: )
7507: AND ( EXISTS (SELECT NULL
7508: FROM ap_invoice_distributions_all apdist1
7509: WHERE apdist1.pa_addition_flag IN ('F', 'G')
7510: AND apdist1.po_distribution_id = dist.po_distribution_id
7511: )
7512: OR EXISTS ( SELECT rcv_txn.po_distribution_id

Line 7549: UPDATE ap_invoice_distributions_all apdist

7545: pulled from Payables. The pa_addition_flag for such invoice ITEM distribution lines is updated to G to prevent
7546: further processing into Projects.
7547: However, if there is an amount variance on such invoice, it needs to be processed as W to releive variance commitment */
7548:
7549: UPDATE ap_invoice_distributions_all apdist
7550: SET apdist.pa_addition_flag = DECODE(NVL(apdist.amount_variance,0),0,'G',increment_W_count('W')),
7551: request_id = G_REQUEST_ID,
7552: last_update_date=SYSDATE,
7553: last_updated_by=G_USER_ID,

Line 7562: ap_invoice_distributions_all dist

7558: WHERE rowid in (
7559: SELECT dist.rowid
7560: FROM ap_invoices inv,
7561: po_distributions po,
7562: ap_invoice_distributions_all dist
7563: WHERE inv.invoice_id = dist.invoice_id
7564: AND po.po_distribution_id = dist.po_distribution_id
7565: AND nvl(po.distribution_type,'XXX') <> 'PREPAYMENT' -- bug 7192304, added nvl
7566: AND NVL(po.destination_type_code, 'EXPENSE') = 'EXPENSE'

Line 7603: UPDATE ap_invoice_distributions_all apdist

7599: If g_body_debug_mode = 'Y' Then
7600: write_log(LOG, 'Updating empty invoice variance lines pa addtion flag to G for all');
7601: End if;
7602:
7603: UPDATE ap_invoice_distributions_all apdist
7604: SET apdist.pa_addition_flag = DECODE(NVL(apdist.amount_variance,0),0,'G',increment_W_count('W')),
7605: request_id = G_REQUEST_ID,
7606: last_update_date=SYSDATE,
7607: last_updated_by=G_USER_ID,

Line 7614: FROM ap_invoices inv, ap_invoice_distributions_all dist

7610: program_application_id= G_PROG_APPL_ID,
7611: program_update_date=SYSDATE
7612: WHERE rowid IN (
7613: SELECT dist.rowid
7614: FROM ap_invoices inv, ap_invoice_distributions_all dist
7615: WHERE inv.invoice_id = dist.invoice_id
7616: AND ( dist.line_type_lookup_code in ('ITEM','ACCRUAL','NONREC_TAX')
7617: OR ( pa_nl_installed.is_nl_installed = 'Y' --EIB trackable items
7618: AND EXISTS (SELECT 'X'

Line 7631: FROM ap_invoice_distributions_all apdist2

7627: AND si.organization_id = po_dist1.org_id)
7628: )
7629: ) --Bug#5399352. Added this here to take care of IPV/TIPV records matched to EIB item PO.
7630: AND NOT EXISTS (SELECT NULL
7631: FROM ap_invoice_distributions_all apdist2
7632: WHERE apdist2.pa_addition_flag = 'Y'
7633: AND apdist2.po_distribution_id = dist.po_distribution_id
7634: AND apdist2.line_type_lookup_code in ('ITEM','ACCRUAL','NONREC_TAX')
7635: )

Line 7637: FROM ap_invoice_distributions_all apdist1

7633: AND apdist2.po_distribution_id = dist.po_distribution_id
7634: AND apdist2.line_type_lookup_code in ('ITEM','ACCRUAL','NONREC_TAX')
7635: )
7636: AND ( EXISTS (SELECT NULL
7637: FROM ap_invoice_distributions_all apdist1
7638: WHERE apdist1.pa_addition_flag IN ('F', 'G')
7639: AND apdist1.po_distribution_id = dist.po_distribution_id
7640: )
7641: OR EXISTS ( SELECT rcv_txn.po_distribution_id

Line 7678: UPDATE ap_invoice_distributions_all apdist

7674: pulled from Payables. The pa_addition_flag for such invoice ITEM distribution lines is updated to G to prevent
7675: further processing into Projects.
7676: However, if there is an amount variance on such invoice, it needs to be processed as W to releive variance commitment */
7677:
7678: UPDATE ap_invoice_distributions_all apdist
7679: SET apdist.pa_addition_flag = DECODE(NVL(apdist.amount_variance,0),0,'G',increment_W_count('W')),
7680: request_id = G_REQUEST_ID,
7681: last_update_date=SYSDATE,
7682: last_updated_by=G_USER_ID,

Line 7691: ap_invoice_distributions_all dist

7687: WHERE rowid in (
7688: SELECT dist.rowid
7689: FROM ap_invoices inv,
7690: po_distributions po,
7691: ap_invoice_distributions_all dist
7692: WHERE inv.invoice_id = dist.invoice_id
7693: AND po.po_distribution_id = dist.po_distribution_id
7694: AND NVL(po.destination_type_code, 'EXPENSE') = 'EXPENSE'
7695: AND nvl(po.distribution_type,'XXX') <> 'PREPAYMENT' -- bug 7192304, added nvl

Line 8265: FROM ap_invoice_distributions_all

8261: BEGIN
8262:
8263: SELECT nvl(historical_flag,'N') --check if this flag can be used
8264: INTO l_historical_flag
8265: FROM ap_invoice_distributions_all
8266: WHERE invoice_id = l_invoice_id_tbl(i)
8267: AND invoice_distribution_id = l_parent_rev_id_tbl(i); --check the index on this table
8268:
8269: EXCEPTION

Line 8620: UPDATE ap_invoice_distributions_all dist

8616: write_log(LOG, G_err_stage);
8617:
8618: FORALL i IN l_sys_ref1_tbl.FIRST..l_sys_ref1_tbl.LAST
8619:
8620: UPDATE ap_invoice_distributions_all dist
8621: SET dist.pa_addition_flag = l_pa_addflag_tbl(i)
8622: ,dist.assets_addition_flag = decode(l_assets_addflag_tbl(i),'P','P',dist.assets_addition_flag)
8623: WHERE dist.invoice_id = l_sys_ref2_tbl(i)
8624: AND dist.invoice_distribution_id = l_sys_ref5_tbl(i)

Line 8915: AP_Invoice_Distributions_all aid,

8911: AND hist.posted_flag = 'Y')
8912: AND exists (SELECT inv.invoice_id
8913: FROM AP_INVOICES inv,
8914: PO_VENDORS vend,
8915: AP_Invoice_Distributions_all aid,
8916: ap_invoice_payments_all aip
8917: WHERE inv.invoice_id = aid.invoice_id
8918: AND inv.vendor_id = vend.vendor_id
8919: AND aip.invoice_payment_id = dist.invoice_payment_id

Line 8956: AP_Invoice_Distributions_all aid, --STD INV DIST LINE

8952: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
8953: FROM AP_INVOICES_ALL inv,
8954: PO_VENDORS vend,
8955: PO_Distributions_all PO,
8956: AP_Invoice_Distributions_all aid, --STD INV DIST LINE
8957: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE
8958: WHERE aid.invoice_id = inv.invoice_id
8959: AND inv.vendor_id = vend.vendor_id
8960: AND inv.org_id = G_ORG_ID

Line 8957: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE

8953: FROM AP_INVOICES_ALL inv,
8954: PO_VENDORS vend,
8955: PO_Distributions_all PO,
8956: AP_Invoice_Distributions_all aid, --STD INV DIST LINE
8957: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE
8958: WHERE aid.invoice_id = inv.invoice_id
8959: AND inv.vendor_id = vend.vendor_id
8960: AND inv.org_id = G_ORG_ID
8961: AND aid.invoice_distribution_id = dist.invoice_distribution_id -- Std inv line

Line 9005: AP_Invoice_Distributions_all aid,

9001: AND hist.posted_flag = 'Y')
9002: AND exists (SELECT inv.invoice_id
9003: FROM AP_INVOICES_ALL inv,
9004: PO_VENDORS vend,
9005: AP_Invoice_Distributions_all aid,
9006: ap_invoice_payments_all aip
9007: WHERE inv.vendor_id = vend.vendor_id
9008: AND aid.invoice_id = inv.invoice_id
9009: AND inv.org_id = G_ORG_ID

Line 9047: AP_Invoice_Distributions_all aid, --STD INV DIST LINE

9043: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
9044: FROM AP_INVOICES_ALL inv,
9045: PO_VENDORS vend,
9046: PO_Distributions_all PO,
9047: AP_Invoice_Distributions_all aid, --STD INV DIST LINE
9048: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE
9049: WHERE aid.invoice_id = inv.invoice_id
9050: AND inv.vendor_id = vend.vendor_id
9051: AND inv.org_id = G_ORG_ID

Line 9048: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE

9044: FROM AP_INVOICES_ALL inv,
9045: PO_VENDORS vend,
9046: PO_Distributions_all PO,
9047: AP_Invoice_Distributions_all aid, --STD INV DIST LINE
9048: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE
9049: WHERE aid.invoice_id = inv.invoice_id
9050: AND inv.vendor_id = vend.vendor_id
9051: AND inv.org_id = G_ORG_ID
9052: AND aid.invoice_distribution_id = dist.invoice_distribution_id -- Std inv line

Line 9110: AP_Invoice_Distributions_all aid,

9106: AND hist.posted_flag = 'Y')
9107: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
9108: FROM AP_INVOICES_ALL inv,
9109: PO_Distributions_all PO,
9110: AP_Invoice_Distributions_all aid,
9111: ap_invoice_payments_all aip
9112: WHERE inv.invoice_id = aip.invoice_id
9113: AND aid.invoice_id = inv.invoice_id
9114: AND inv.org_id = G_ORG_ID

Line 9157: AP_Invoice_Distributions_all aid, --STD INV DIST LINE

9153: AND dist.amount <> 0
9154: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
9155: FROM AP_INVOICES_ALL inv,
9156: PO_Distributions_all PO,
9157: AP_Invoice_Distributions_all aid, --STD INV DIST LINE
9158: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE
9159: WHERE aid.invoice_id = inv.invoice_id
9160: AND aid.invoice_distribution_id = dist.invoice_distribution_id -- Std inv line
9161: AND inv.org_id = G_ORG_ID

Line 9158: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE

9154: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
9155: FROM AP_INVOICES_ALL inv,
9156: PO_Distributions_all PO,
9157: AP_Invoice_Distributions_all aid, --STD INV DIST LINE
9158: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE
9159: WHERE aid.invoice_id = inv.invoice_id
9160: AND aid.invoice_distribution_id = dist.invoice_distribution_id -- Std inv line
9161: AND inv.org_id = G_ORG_ID
9162: AND aid2.invoice_id = aid.invoice_id

Line 9212: AP_Invoice_Distributions_all aid,

9208: AND hist.posted_flag = 'Y')
9209: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
9210: FROM AP_INVOICES_ALL inv,
9211: PO_Distributions_all PO,
9212: AP_Invoice_Distributions_all aid,
9213: ap_invoice_payments_all aip
9214: WHERE inv.invoice_id = aip.invoice_id
9215: AND aid.invoice_id = inv.invoice_id
9216: AND inv.org_id = G_ORG_ID

Line 9259: AP_Invoice_Distributions_all aid, --STD INV DIST LINE

9255: AND dist.amount <> 0
9256: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
9257: FROM AP_INVOICES_ALL inv,
9258: PO_Distributions_all PO,
9259: AP_Invoice_Distributions_all aid, --STD INV DIST LINE
9260: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE
9261: WHERE aid.invoice_id = inv.invoice_id
9262: AND inv.org_id = G_ORG_ID
9263: AND aid.invoice_distribution_id = dist.invoice_distribution_id -- Std inv line

Line 9260: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE

9256: AND exists(SELECT /*+ no_unnest */ inv.invoice_id
9257: FROM AP_INVOICES_ALL inv,
9258: PO_Distributions_all PO,
9259: AP_Invoice_Distributions_all aid, --STD INV DIST LINE
9260: AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE
9261: WHERE aid.invoice_id = inv.invoice_id
9262: AND inv.org_id = G_ORG_ID
9263: AND aid.invoice_distribution_id = dist.invoice_distribution_id -- Std inv line
9264: AND aid2.invoice_id = aid.invoice_id

Line 10932: UPDATE ap_invoice_distributions_all dist

10928:
10929: IF l_batch <> 'APDISC' THEN --Payment Discount batch
10930:
10931: FORALL i IN l_sys_ref1_tbl.FIRST..l_sys_ref1_tbl.LAST
10932: UPDATE ap_invoice_distributions_all dist
10933: SET dist.assets_addition_flag = decode(l_assets_addflag_tbl(i),'P','P',dist.assets_addition_flag)
10934: WHERE dist.invoice_distribution_id = l_sys_ref5_tbl(i) ;
10935: END IF;
10936: