DBA Data[Home] [Help]

APPS.AP_PURGE_PKG dependencies on AP_CHECKS

Line 615: AND sequence_name = 'AP_CHECKS_S' ;

611: SELECT last_number
612: INTO max_chk_id
613: FROM all_sequences
614: WHERE sequence_owner = l_sch_name
615: AND sequence_name = 'AP_CHECKS_S' ;
616:
617: IF ( max_inv_id > 2147483647 OR
618: max_chk_id > 2147483647 )
619: THEN

Line 982: INDEX(p AP_INVOICE_PAYMENTS_N1) INDEX(c AP_CHECKS_U1) */

978: DELETE /*+ PARALLEL(pl) ROWID(pl) */
979: FROM ap_purge_invoice_list pl
980: WHERE pl.rowid IN
981: (SELECT /*+ ORDERED PARALLEL(pl1) FULL(pl1) USE_NL(p,c)
982: INDEX(p AP_INVOICE_PAYMENTS_N1) INDEX(c AP_CHECKS_U1) */
983: pl1.rowid
984: FROM ap_purge_invoice_list pl1,
985: ap_invoice_payments p,
986: ap_checks c

Line 986: ap_checks c

982: INDEX(p AP_INVOICE_PAYMENTS_N1) INDEX(c AP_CHECKS_U1) */
983: pl1.rowid
984: FROM ap_purge_invoice_list pl1,
985: ap_invoice_payments p,
986: ap_checks c
987: WHERE p.invoice_id = pl1.invoice_id
988: AND p.check_id = c.check_id
989: AND ((p.posted_flag <> 'Y'
990: OR p.accrual_posted_flag = decode(p_using_accrual_basis,'Y','N','Z')

Line 1619: INDEX(p AP_INVOICE_PAYMENTS_N1) INDEX(c AP_CHECKS_U1) INDEX(d

1615: FROM
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,

Line 1625: ap_checks c,

1621: i.invoice_id, MIN(c.check_id) check_id
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

Line 2420: FROM ap_checks_all AC,

2416: ac.check_id, ac.bank_account_id, ac.check_number, ac.check_date,
2417: ac.amount, ac.currency_code, DECODE(void_date, null, null, 'Y'),
2418: p_purge_name, ac.doc_sequence_id, ac.doc_sequence_value, ac.payment_id,
2419: ac.org_id
2420: FROM ap_checks_all AC,
2421: ap_invoice_payments_all IP,
2422: ap_purge_invoice_list PL
2423: WHERE PL.invoice_id = IP.invoice_id
2424: AND IP.check_id = AC.check_id

Line 3197: FROM ap_invoice_payments P, ap_checks C

3193: SET PL.double_check_flag = 'N'
3194: WHERE PL.double_check_flag = 'Y'
3195: AND EXISTS (
3196: SELECT /*+NO_UNNEST*/'payment no longer purgeable'
3197: FROM ap_invoice_payments P, ap_checks C
3198: WHERE P.invoice_id = PL.invoice_id
3199: AND P.check_id = C.check_id
3200: AND (P.posted_flag <> 'Y'
3201: OR P.last_update_date > g_activity_date

Line 3323: , ap_checks apc

3319: /*
3320: SELECT 'payment accounting not purgeable'
3321: FROM xla_events xe
3322: , ap_invoice_payments aip
3323: , ap_checks apc
3324: , xla_ae_headers xeh
3325: , xla_transaction_entities xte
3326: WHERE xte.entity_code = 'AP_CHECKS'
3327: and NVL(XTE.SOURCE_ID_INT_1,-99) = apc.check_id --Bug#12615876

Line 3326: WHERE xte.entity_code = 'AP_CHECKS'

3322: , ap_invoice_payments aip
3323: , ap_checks apc
3324: , xla_ae_headers xeh
3325: , xla_transaction_entities xte
3326: WHERE xte.entity_code = 'AP_CHECKS'
3327: and NVL(XTE.SOURCE_ID_INT_1,-99) = apc.check_id --Bug#12615876
3328: and PL.invoice_id = aip.invoice_id
3329: and aip.check_id = apc.check_id
3330: and xe.event_id = xeh.event_id

Line 3588: AND sequence_name = 'AP_CHECKS_S' ;

3584: SELECT last_number
3585: INTO max_chk_id
3586: FROM all_sequences
3587: WHERE sequence_owner = l_sch_name
3588: AND sequence_name = 'AP_CHECKS_S' ;
3589:
3590: IF ( max_inv_id > 2147483647 OR
3591: max_chk_id > 2147483647 )
3592: THEN

Line 3757: debug_info := 'ap_checks';

3753: current_calling_sequence := 'Count_AP_Rows<-'||P_calling_sequence;
3754:
3755: --
3756:
3757: debug_info := 'ap_checks';
3758: IF g_debug_switch in ('y','Y') THEN
3759: Print('(Count_Ap_Rows)'||debug_info);
3760: END IF;
3761:

Line 3767: FROM ap_checks;

3763:
3764: --
3765: SELECT count(*)
3766: INTO fp_check_rows
3767: FROM ap_checks;
3768:
3769: --
3770: debug_info := 'ap_invoice_payments';
3771: IF g_debug_switch in ('y','Y') THEN

Line 4531: ap_checks = fp_check_rows,

4527:
4528:
4529: UPDATE financials_purges
4530: SET
4531: ap_checks = fp_check_rows,
4532: ap_invoice_payments = fp_invoice_payment_rows,
4533: ap_invoices = fp_invoice_rows,
4534: po_headers = fp_po_header_rows ,
4535: po_receipts = fp_receipt_line_rows,

Line 5183: ap_checks C

5179:
5180: CURSOR overflow_select is
5181: SELECT C.check_stock_id,C.check_number
5182: FROM ap_invoice_payments P, ap_purge_invoice_list PL,
5183: ap_checks C
5184: WHERE P.invoice_id = PL.invoice_id
5185: AND P.check_id = C.check_id
5186: AND PL.double_check_flag = 'Y'
5187: AND -- Bug 8913560 PL.invoice_id BETWEEN range_low AND range_high

Line 5227: FROM ap_checks C

5223:
5224: Begin
5225: SELECT 'exist'
5226: INTO overflow_exist
5227: FROM ap_checks C
5228: WHERE C.check_stock_id = overflow_check_stock_id
5229: AND C.check_number = overflow_check_number
5230: AND C.status_lookup_code = 'OVERFLOW';
5231: Exception

Line 5244: DELETE FROM ap_checks C

5240: if (overflow_exist = 'exist') then
5241:
5242: -- delete_overflow
5243:
5244: DELETE FROM ap_checks C
5245: WHERE C.check_stock_id = overflow_check_stock_id
5246: AND C.check_number = overflow_check_number
5247: AND C.status_lookup_code = 'OVERFLOW';
5248:

Line 5262: FROM ap_checks C

5258:
5259: Begin
5260: SELECT 'exist'
5261: INTO overflow_exist
5262: FROM ap_checks C
5263: WHERE C.check_stock_id = overflow_check_stock_id
5264: AND C.check_number = overflow_check_number
5265: AND C.status_lookup_code = 'OVERFLOW';
5266: Exception

Line 5301: FROM ap_checks C, ap_invoice_selection_criteria D

5297: RETURN BOOLEAN IS
5298:
5299: CURSOR setup_spoil_select is
5300: SELECT distinct C.checkrun_name
5301: FROM ap_checks C, ap_invoice_selection_criteria D
5302: WHERE D.LAST_UPDATE_DATE <= g_activity_date
5303: AND C.checkrun_name NOT IN
5304: (SELECT distinct b.checkrun_name
5305: FROM ap_checks a,

Line 5305: FROM ap_checks a,

5301: FROM ap_checks C, ap_invoice_selection_criteria D
5302: WHERE D.LAST_UPDATE_DATE <= g_activity_date
5303: AND C.checkrun_name NOT IN
5304: (SELECT distinct b.checkrun_name
5305: FROM ap_checks a,
5306: ap_invoice_selection_criteria b
5307: WHERE a.checkrun_name = b.checkrun_name
5308: AND a.status_lookup_code not in
5309: ('SET UP', 'SPOILED'))

Line 5356: DELETE FROM ap_checks C

5352: IF g_debug_switch in ('y','Y') THEN
5353: Print('(Setup_Spoil)'||debug_info);
5354: END IF;
5355:
5356: DELETE FROM ap_checks C
5357: WHERE C.checkrun_name = selected_checkrun
5358: AND C.status_lookup_code in ('SET UP','SPOILED')
5359: AND C.last_update_date <= g_activity_date;
5360:

Line 5442: l_check_id ap_checks.check_id%TYPE;

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:
5446: -- Bug 8913560 : Added the 3 variables given below

Line 5521: ap_checks C,

5517: DELETE FROM ap_doc_sequence_audit AUD
5518: WHERE (AUD.doc_sequence_id , AUD.doc_sequence_value)
5519: IN (SELECT C.doc_sequence_id , C.doc_sequence_value
5520: FROM ap_purge_invoice_list PL,
5521: ap_checks C,
5522: ap_invoice_payments IP
5523: WHERE PL.double_check_flag = 'Y'
5524: AND -- Bug 8913560 PL.invoice_id BETWEEN range_low AND range_high
5525: PL.rowid BETWEEN p_start_rowid AND p_end_rowid

Line 5531: debug_info := 'ap_checks';

5527: AND IP.check_id = C.check_id ) ;
5528:
5529: -- overflow
5530:
5531: debug_info := 'ap_checks';
5532: IF g_debug_switch in ('y','Y') THEN
5533: Print('(Delete_AP_Tables)'||debug_info);
5534: END IF;
5535:

Line 5552: -- bug 5052764 - go to base table ap_checks_all to remove FTS

5548: END IF;
5549:
5550:
5551: -- delete_checks
5552: -- bug 5052764 - go to base table ap_checks_all to remove FTS
5553: DELETE FROM ap_checks_all C
5554: WHERE C.check_id IN (
5555: SELECT P.check_id
5556: FROM ap_invoice_payments P, ap_purge_invoice_list PL

Line 5553: DELETE FROM ap_checks_all C

5549:
5550:
5551: -- delete_checks
5552: -- bug 5052764 - go to base table ap_checks_all to remove FTS
5553: DELETE FROM ap_checks_all C
5554: WHERE C.check_id IN (
5555: SELECT P.check_id
5556: FROM ap_invoice_payments P, ap_purge_invoice_list PL
5557: WHERE P.invoice_id = PL.invoice_id

Line 5949: and aae.source_table = 'AP_CHECKS'

5945: ,ap_accounting_events aae
5946: ,ap_invoice_payments aip
5947: ,ap_purge_invoice_list pil
5948: WHERE aae.source_id = aip.check_id
5949: and aae.source_table = 'AP_CHECKS'
5950: and pil.double_check_flag = 'Y'
5951: and aae.accounting_event_id = aeh.accounting_event_id
5952: and aip.invoice_id = pil.invoice_id
5953: and pil.invoice_id BETWEEN range_low AND range_high);

Line 5984: and aae.source_table = 'AP_CHECKS'

5980: , ap_purge_invoice_list pil
5981: -- bug2153117 removed
5982: -- , ap_ae_headers aeh
5983: WHERE aae.source_id = aip.check_id
5984: and aae.source_table = 'AP_CHECKS'
5985: and pil.double_check_flag = 'Y'
5986: -- Commented the below line as a fix for bug 2880690
5987: -- and aae.accounting_event_id = aeh.accounting_event_id
5988: and aip.invoice_id = pil.invoice_id

Line 6025: AP_CHECKS APC,

6021:
6022: DELETE FROM AP_ACCOUNTING_EVENTS AAE WHERE
6023: aae.source_id in ( SELECT APC.CHECK_ID
6024: FROM AP_PURGE_INVOICE_LIST PIL,
6025: AP_CHECKS APC,
6026: AP_INVOICE_PAYMENTS AIP
6027: WHERE PIL.DOUBLE_CHECK_FLAG = 'Y'
6028: AND APC.CHECK_ID = AIP.CHECK_ID
6029: AND AIP.INVOICE_ID = PIL.INVOICE_ID

Line 6032: AND AAE.SOURCE_TABLE = 'AP_CHECKS' ;

6028: AND APC.CHECK_ID = AIP.CHECK_ID
6029: AND AIP.INVOICE_ID = PIL.INVOICE_ID
6030: AND PIL.INVOICE_ID BETWEEN range_low
6031: AND range_high )
6032: AND AAE.SOURCE_TABLE = 'AP_CHECKS' ;
6033:
6034:
6035: DELETE FROM AP_ACCOUNTING_EVENTS AAE WHERE
6036: AAE.source_id IN ( SELECT APH.CHECK_ID

Line 6891: ap_checks = check_rows,

6887: end if;
6888:
6889: UPDATE financials_purges
6890: SET
6891: ap_checks = check_rows,
6892: ap_invoice_payments = invoice_payment_rows,
6893: ap_invoices = invoice_rows,
6894: ap_ae_lines = ae_line_rows,
6895: ap_ae_headers = ae_header_rows,

Line 6902: SELECT NVL( ap_checks, 0 ) ,

6898:
6899: COMMIT ;
6900: ELSE */
6901: IF l_purge_without_review <> 'Y' THEN
6902: SELECT NVL( ap_checks, 0 ) ,
6903: NVL( ap_invoice_payments, 0 ) ,
6904: NVL( ap_invoices, 0 ) ,
6905: NVL( ap_ae_lines, 0 ) ,
6906: NVL( ap_ae_headers, 0 ) ,

Line 7018: SELECT NVL( ap_checks, 0 ) ,

7014: RETURN(FALSE);
7015: end if;
7016: */
7017: -- Bug 8913560 Start
7018: SELECT NVL( ap_checks, 0 ) ,
7019: NVL( ap_invoice_payments, 0 ) ,
7020: NVL( ap_invoices, 0 ) ,
7021: NVL( ap_ae_lines, 0 ) ,
7022: NVL( ap_ae_headers, 0 ) ,

Line 7194: ap_checks = nvl(ap_checks, 0) - check_rows,

7190: p_category <> 'SIMPLE INVOICES' ) THEN
7191: -- record_final_statistics
7192: UPDATE financials_purges
7193: SET
7194: ap_checks = nvl(ap_checks, 0) - check_rows,
7195: ap_invoice_payments = nvl(ap_invoice_payments, 0) - invoice_payment_rows,
7196: ap_invoices = nvl(ap_invoices, 0) - invoice_rows,
7197: po_headers = nvl(po_headers, 0) - po_header_rows,
7198: po_requisition_headers = nvl(po_requisition_headers, 0) - req_header_rows,

Line 7985: SET ap_checks = NVL(ap_checks , 0 ) + p_check_rows,

7981: IS
7982: PRAGMA AUTONOMOUS_TRANSACTION ;
7983: BEGIN
7984: UPDATE financials_purges
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