DBA Data[Home] [Help]

APPS.AP_PURGE_PKG dependencies on AP_INVOICE_DISTRIBUTIONS

Line 776: FROM ap_invoice_distributions d

772: SELECT invoice_id
773: FROM ap_purge_invoice_list PL
774: WHERE EXISTS
775: (SELECT 'project-related vendor invoices'
776: FROM ap_invoice_distributions d
777: WHERE d.invoice_id = pl.invoice_id
778: AND d.pa_addition_flag in ('Y','T'))
779: OR EXISTS
780: (SELECT 'project-related expense report'

Line 841: ap_invoice_distributions D

837: FROM ap_purge_invoice_list PL
838: WHERE EXISTS (
839: SELECT 'Invoices are not transfered to PA'
840: FROM ap_invoices I,
841: ap_invoice_distributions D
842: WHERE I.invoice_id = PL.invoice_id
843: AND I.invoice_id = D.invoice_id
844: AND I.source = 'Oracle Project Accounting'
845: AND D.pa_addition_flag not in ('Y','T','E','Z') );

Line 851: FROM ap_invoice_distributions d

847: /* DELETE
848: FROM ap_purge_invoice_list PL
849: WHERE EXISTS
850: (SELECT 'project-related vendor invoices'
851: FROM ap_invoice_distributions d
852: WHERE d.invoice_id = pl.invoice_id
853: AND d.project_id is not null) -- bug1746226
854: OR EXISTS
855: (SELECT 'project-related expense report'

Line 914: INDEX(i AP_INVOICES_U1) INDEX(d AP_INVOICE_DISTRIBUTIONS_U1) */

910: DELETE /*+ PARALLEL(pl) ROWID(pl) */
911: FROM ap_purge_invoice_list pl
912: WHERE pl.rowid IN
913: (SELECT /*+ ORDERED PARALLEL(pl1) FULL(pl1) USE_NL(i,d)
914: INDEX(i AP_INVOICES_U1) INDEX(d AP_INVOICE_DISTRIBUTIONS_U1) */
915: pl1.rowid
916: FROM ap_purge_invoice_list pl1,
917: ap_invoices i,
918: ap_invoice_distributions d

Line 918: ap_invoice_distributions d

914: INDEX(i AP_INVOICES_U1) INDEX(d AP_INVOICE_DISTRIBUTIONS_U1) */
915: pl1.rowid
916: FROM ap_purge_invoice_list pl1,
917: ap_invoices i,
918: ap_invoice_distributions d
919: WHERE i.invoice_id = pl1.invoice_id
920: AND i.invoice_id = d.invoice_id
921: AND (d.last_update_date > g_activity_date
922: OR d.posted_flag <> 'Y'

Line 939: FROM ap_invoice_distributions D, ap_invoices I

935: DELETE
936: FROM ap_purge_invoice_list PL
937: WHERE EXISTS
938: (SELECT /*+ no_unnest */ 'distributions not purgeable' -- 7759218
939: FROM ap_invoice_distributions D, ap_invoices I
940: WHERE I.invoice_id = D.invoice_id
941: AND PL.invoice_id = D.invoice_id
942: AND ( D.last_update_date > g_activity_date
943: OR D.posted_flag <> 'Y'

Line 1038: FROM ap_invoice_distributions ID

1034: DELETE
1035: FROM ap_purge_invoice_list PL
1036: WHERE EXISTS
1037: (SELECT 'X'
1038: FROM ap_invoice_distributions ID
1039: WHERE PL.invoice_id = ID.invoice_id
1040: AND ID.line_type_lookup_code = 'PREPAY'
1041: AND ID.prepay_distribution_id IS NOT NULL);
1042:

Line 1129: from ap_invoice_distributions aid, rcv_transactions rcv

1125:
1126: DELETE FROM ap_purge_invoice_list PL
1127: WHERE EXISTS (
1128: select 'matched'
1129: from ap_invoice_distributions aid, rcv_transactions rcv
1130: where aid.invoice_id = PL.invoice_id
1131: and aid.rcv_transaction_id = rcv.transaction_id
1132: and rcv.last_update_date > g_activity_date);
1133:

Line 1137: from ap_invoice_distributions ad

1133:
1134: DELETE FROM ap_purge_invoice_list PL
1135: WHERE EXISTS
1136: (select null
1137: from ap_invoice_distributions ad
1138: where ad.invoice_id = PL.invoice_id
1139: and ad.rcv_transaction_id is not null
1140: and exists (
1141: select 'matching' from ap_invoice_distributions ad2

Line 1141: select 'matching' from ap_invoice_distributions ad2

1137: from ap_invoice_distributions ad
1138: where ad.invoice_id = PL.invoice_id
1139: and ad.rcv_transaction_id is not null
1140: and exists (
1141: select 'matching' from ap_invoice_distributions ad2
1142: where ad2.rcv_transaction_id = ad.rcv_transaction_id
1143: and ad2.invoice_id NOT IN (
1144: select invoice_id
1145: from ap_purge_invoice_list

Line 1264: from ap_invoice_distributions ad

1260: IF p_purge_status = 'INITIATING' THEN
1261: delete from ap_purge_invoice_list apl
1262: where exists
1263: (select /*+ no_unnest */ null -- 7759218
1264: from ap_invoice_distributions ad
1265: where ad.invoice_id = apl.invoice_id
1266: and ad.po_distribution_id is not null
1267: and not exists (select null
1268: from po_purge_po_list ppl,

Line 1281: from ap_invoice_distributions ad,po_distributions pd

1277: update ap_purge_invoice_list apl
1278: set double_check_flag = 'N'
1279: where double_check_flag = 'Y'
1280: and exists (select /*+NO_UNNEST*/ null
1281: from ap_invoice_distributions ad,po_distributions pd
1282: where ad.invoice_id = apl.invoice_id
1283: AND pd.po_distribution_id=ad.po_distribution_id
1284: and ad.po_distribution_id is not null
1285: and not exists (SELECT null

Line 1620: AP_INVOICE_DISTRIBUTIONS_U1) INDEX(l AP_INVOICE_LINES_U1) */

1616: (SELECT invoice_id, check_id
1617: FROM
1618: (SELECT /*+ ORDERED PARALLEL(PI) FULL(pi) USE_NL(i,p,c,d,l)
1619: INDEX(p AP_INVOICE_PAYMENTS_N1) INDEX(c AP_CHECKS_U1) INDEX(d
1620: AP_INVOICE_DISTRIBUTIONS_U1) INDEX(l AP_INVOICE_LINES_U1) */
1621: i.invoice_id, MIN(c.check_id) check_id
1622: FROM purge_inv pi,
1623: ap_invoices i,
1624: ap_invoice_payments p,

Line 1626: ap_invoice_distributions d,

1622: FROM purge_inv pi,
1623: ap_invoices i,
1624: ap_invoice_payments p,
1625: ap_checks c,
1626: ap_invoice_distributions d,
1627: ap_invoice_lines l
1628: WHERE i.rowid = pi.inv_rowid
1629: AND i.invoice_id = l.invoice_id
1630: AND i.invoice_id = d.invoice_id

Line 1649: INDEX(p AP_INVOICE_PAYMENTS_N1) INDEX(d AP_INVOICE_DISTRIBUTIONS_U1) */

1645: NVL(i.exclusive_payment_flag, 'N'), 'Y')
1646: GROUP BY i.invoice_id
1647: UNION
1648: SELECT /*+ ORDERED PARALLEL(pzi) FULL(pzi) USE_NL(i,p,d)
1649: INDEX(p AP_INVOICE_PAYMENTS_N1) INDEX(d AP_INVOICE_DISTRIBUTIONS_U1) */
1650: i.invoice_id, NULL check_id
1651: FROM purge_zero_inv pzi,
1652: ap_invoices i,
1653: ap_invoice_payments p,

Line 1654: ap_invoice_distributions d

1650: i.invoice_id, NULL check_id
1651: FROM purge_zero_inv pzi,
1652: ap_invoices i,
1653: ap_invoice_payments p,
1654: ap_invoice_distributions d
1655: WHERE i.rowid = pzi.inv_rowid
1656: AND p.invoice_id (+) = i.invoice_id
1657: AND i.invoice_id = d.invoice_id(+)
1658: AND i.last_update_date <= g_activity_date

Line 2977: FROM ap_invoice_distributions d

2973: SELECT invoice_id
2974: FROM ap_purge_invoice_list PL
2975: WHERE EXISTS
2976: (SELECT 'project-related vendor invoices'
2977: FROM ap_invoice_distributions d
2978: WHERE d.invoice_id = pl.invoice_id
2979: AND d.pa_addition_flag in ('Y','T'))
2980: OR EXISTS
2981: (SELECT 'project-related expense report'

Line 3050: ap_invoice_distributions D

3046: WHERE PL.double_check_flag = 'Y'
3047: AND EXISTS (
3048: SELECT 'Invoices are not transfered to PA'
3049: FROM ap_invoices I,
3050: ap_invoice_distributions D
3051: WHERE I.invoice_id = PL.invoice_id
3052: AND I.invoice_id = D.invoice_id
3053: AND I.source <> 'Oracle Project Accounting'
3054: AND D.pa_addition_flag not in ('Y','T','E','Z') );

Line 3061: FROM ap_invoice_distributions d

3057: SET PL.double_check_flag = 'N'
3058: WHERE PL.double_check_flag = 'Y'
3059: AND (EXISTS
3060: (SELECT 'project-related vendor invoices'
3061: FROM ap_invoice_distributions d
3062: WHERE d.invoice_id = pl.invoice_id
3063: AND d.project_id is not null -- bug1746226
3064: )
3065: OR EXISTS

Line 3150: FROM ap_invoice_distributions D, ap_invoices I

3146: SET PL.double_check_flag = 'N'
3147: WHERE PL.double_check_flag = 'Y'
3148: AND EXISTS
3149: (SELECT /*+NO_UNNEST*/ 'distribution no longer purgeable'
3150: FROM ap_invoice_distributions D, ap_invoices I
3151: WHERE I.invoice_id = D.invoice_id
3152: AND PL.invoice_id = D.invoice_id
3153: AND ( D.last_update_date > g_activity_date
3154: OR D.posted_flag <> 'Y'

Line 3170: FROM ap_invoice_distributions D, ap_invoices I

3166: SET PL.double_check_flag = 'N'
3167: WHERE PL.double_check_flag = 'Y'
3168: AND EXISTS
3169: (SELECT /*+NO_UNNEST*/'distribution no longer purgeable'
3170: FROM ap_invoice_distributions D, ap_invoices I
3171: WHERE I.invoice_id = D.invoice_id
3172: AND PL.invoice_id = D.invoice_id
3173: AND ( D.last_update_date > g_activity_date
3174: OR D.posted_flag <> 'Y'

Line 3235: FROM ap_invoice_distributions aid

3231: UPDATE ap_purge_invoice_list PL
3232: SET PL.double_check_flag = 'N'
3233: WHERE EXISTS (
3234: SELECT 'matched'
3235: FROM ap_invoice_distributions aid
3236: , rcv_transactions rcv
3237: WHERE aid.invoice_id = PL.invoice_id
3238: and aid.rcv_transaction_id = rcv.transaction_id
3239: --Bug 1579474

Line 3254: FROM ap_invoice_distributions ad

3250: UPDATE ap_purge_invoice_list PL
3251: SET double_check_flag = 'N'
3252: WHERE EXISTS (
3253: SELECT null
3254: FROM ap_invoice_distributions ad
3255: WHERE ad.invoice_id = PL.invoice_id
3256: and ad.rcv_transaction_id IS NOT NULL
3257: and EXISTS (
3258: SELECT 'matching'

Line 3259: FROM ap_invoice_distributions ad2

3255: WHERE ad.invoice_id = PL.invoice_id
3256: and ad.rcv_transaction_id IS NOT NULL
3257: and EXISTS (
3258: SELECT 'matching'
3259: FROM ap_invoice_distributions ad2
3260: where ad2.rcv_transaction_id = ad.rcv_transaction_id
3261: and ad2.invoice_id NOT IN (
3262: SELECT invoice_id
3263: FROM ap_purge_invoice_list

Line 5441: l_invoice_dist_id ap_invoice_distributions.invoice_distribution_id%TYPE;

5437: AND -- Bug 8913560 PL.invoice_id BETWEEN low_inv_id AND high_inv_id
5438: PL.rowid BETWEEN p_start_rowid AND p_end_rowid ;
5439:
5440: l_invoice_id ap_invoices.invoice_id%TYPE;
5441: l_invoice_dist_id ap_invoice_distributions.invoice_distribution_id%TYPE;
5442: l_check_id ap_checks.check_id%TYPE;
5443: l_payment_history_id ap_payment_history.payment_history_id%TYPE;
5444: l_invoice_payment_id ap_invoice_payments.invoice_payment_id%TYPE;
5445:

Line 5507: from ap_invoice_distributions aid

5503:
5504: delete from ap_chrg_allocations aca
5505: where exists (
5506: select 'allocations'
5507: from ap_invoice_distributions aid
5508: , ap_purge_invoice_list pil
5509: where aca.item_dist_id = aid.invoice_distribution_id
5510: and pil.invoice_id = aid.invoice_id
5511: and pil.invoice_id BETWEEN range_low and range_high

Line 5676: debug_info := 'ap_invoice_distributions';

5672: AND -- Bug 8913560 PL.invoice_id BETWEEN range_low AND range_high
5673: PL.rowid BETWEEN p_start_rowid AND p_end_rowid );
5674:
5675:
5676: debug_info := 'ap_invoice_distributions';
5677: IF g_debug_switch in ('y','Y') THEN
5678: Print('(Delete_AP_Tables)'||debug_info);
5679: END IF;
5680:

Line 5682: DELETE FROM ap_invoice_distributions

5678: Print('(Delete_AP_Tables)'||debug_info);
5679: END IF;
5680:
5681:
5682: DELETE FROM ap_invoice_distributions
5683: WHERE invoice_id IN (
5684: SELECT PL.invoice_id
5685: FROM ap_purge_invoice_list PL
5686: WHERE PL.double_check_flag = 'Y'

Line 6002: , ap_invoice_distributions aid

5998: DELETE FROM ap_encumbrance_lines aen
5999: WHERE EXISTS (
6000: SELECT 'dist'
6001: FROM ap_purge_invoice_list pil
6002: , ap_invoice_distributions aid
6003: WHERE aen.invoice_distribution_id = aid.invoice_distribution_id
6004: and aid.invoice_id = pil.invoice_id
6005: and pil.double_check_flag = 'Y'
6006: and /* Bug 8913560 pil.invoice_id BETWEEN range_low AND range_high */

Line 7989: ap_invoice_distributions = NVL(ap_invoice_distributions , 0 ) + p_invoice_distributions_rows, --bug 11829621

7985: SET ap_checks = NVL(ap_checks , 0 ) + p_check_rows,
7986: ap_invoice_payments = NVL(ap_invoice_payments , 0 ) + p_invoice_payment_rows,
7987: ap_invoices = NVL(ap_invoices , 0 ) + p_invoice_rows,
7988: ap_invoice_lines = NVL(ap_invoice_lines , 0 ) + p_invoice_lines_rows, --bug 11829621
7989: ap_invoice_distributions = NVL(ap_invoice_distributions , 0 ) + p_invoice_distributions_rows, --bug 11829621
7990: ap_ae_lines = NVL(ap_ae_lines , 0 ) + p_ae_line_rows,
7991: ap_ae_headers = NVL(ap_ae_headers , 0 ) + p_ae_header_rows,
7992: ap_accounting_events = NVL(ap_accounting_events, 0 ) + p_accounting_event_rows
7993: WHERE purge_name = p_purge_name;