Oracle tables involved with AP Payments:Oracle Apps Functional
By Jag - April 16, 2014
This article talks about the major tables involved in making single and batch payments.
Single Payment
1
2
3
4
5
| SELECT * FROM ap_checks_all WHERE org_id = 360 AND check_number = 9765 -- Document Num field in payment from AND doc_sequence_value = 71200004 -- Voucher Num field in payment form |
The AP_INV_SELECTION_CRITERIA_ALL table contains the invoices selected by the payment
1
2
| -- Get the Checkrun_name value from ap_checks_all. This is the payment nameselect * from ap_inv_selection_criteria_all where checkrun_name = 'Quick Payment: ID=452069' |
The AP_INVOICE_PAYMENTS_ALL table contains the payment details made for each invoice. For instance if an invoice is adjusted before making the payment, the details go into this table.
1
2
| -- Get the Check_id value from ap_checks_all. This is the invoice selected for paymentselect * from ap_invoice_payments_all where check_id = 452069 |
The invoice headers are stored in the AP_INVOICES_ALL table.
1
2
| -- Get the invoice_id from ap_invoice_payments_all. See the full details of the invoiceselect * from ap_invoices_all where invoice_id = 800541 |
The invoice lines/distributions are stored in AP_INVOICE_DISTRIBUTIONS_ALL table.
1
2
| -- Get the invoice linesselect * from ap_invoice_distributions_all where invoice_id = 800541 |
Payment statuses
1
| SELECT status_lookup_code FROM ap_checks_all |
| Status | Meaning |
| RECONCILED | Payment has been reconciled in Cash management from the bank statement |
| CLEARED | If Allow Recon. Accounting is checked in Option form, then when clearing the check from Cash Management, the status will change to CLEARED |
| OVERFLOW | |
| RECONCILED ACCOUNTED | Payment has been reconciled in Cash management from the bank statement and the payment details has been transferred to General Ledger |
| CLEARED BUT UNACCOUNTED | If Allow Recon. Accounting is NOT checked in option form, then when clearing the check from cash management, the status will changed to CLEARED BUT UNACCOUNTED and the ap_recon_distributions will not be created, hence the posting will post records to GL. |
| RECONCILED BUT UNACCOUNTED | When received bank statement and matched the check, the status will be changed to RECONCILED BUT UNACCOUNTED. |
| ISSUED | |
| VOIDED | |
| SPOILED | |
| NEGOTIABLE | |
| STOP INITIATED | Stop Payment has been initiated for the payment |
| ISSUED |
Batch Payment
Invoice selection criteria for the Payment Batch: The AP_CHECKS_ALL table is populated when the batch is created. The status of the payment batch is NEW in payment batch form and UNSTARTED in the database.
1
2
| -- Get the Checkrun_name value from ap_checks_all. This is the payment nameselect * from ap_inv_selection_criteria_all where checkrun_name = 'TEST-PAYMENT-BATCH4' |
After Select Invoices and Build is run check all the invoices that have been selected. The status of the payment batch is BUILT. The field,OK_TO_PAY_FLAG is set to Yes for payment and No for non payment. Oracle also updates the field DONT_PAY_REASON_CODE if it decides not make the payment. This can be done manually as well.
1
2
| -- Get the checkrun_name. View all the invoices that have been selected by the batchselect * from ap_selected_invoices_all where checkrun_name = 'TEST-PAYMENT-BATCH4' |
When the payment batch is Confirmed, the status of the batch becomes CONFIRMED. Now the payments have been generated. Query for the payments.
1
2
3
4
5
| -- Get the payment detailsSELECT * FROM ap_checks_all WHERE org_id = 103 AND checkrun_name = 'TEST-PAYMENT-BATCH4' -- Document Num field in payment from |
Also check the invoices for the selected payments,
1
2
3
4
5
6
7
| -- Get the Check_id value from ap_checks_all. This is the invoice selected for paymentSELECT * FROM ap_invoice_payments_all WHERE check_id IN (SELECT check_id FROM ap_checks_all WHERE org_id = 103 AND checkrun_name = 'TEST-PAYMENT-BATCH4' -- Document Num field in payment from ) |
Payment batch statuses
1
| select status from ap_inv_selection_criteria_all |
| Status | Meaning |
| UNSTARTED | For a new payment batch created |
| SELECTING | When the Select Invoice program is running |
| SELECTED | After Select Invoice program has completed |
| BUILDING | When the Build program is running |
| BUILT | Once the payment batch has been built |
| REBUILDING | When the Build program is running after adjusting payments to invoices/suppliers |
| FORMATTING | When the Format program is running |
| FORMATTED | After Format program has completed |
| CONFIRMING | When batch is being Confirmed |
| CONFIRMED | Once the batch has been confirmed |
| CANCELLING | When batch cancel is in process |
| CANCELED | Once the batch has been cancelled |
| QUICKCHECK | For single payments only |
We have covered the main payment tables. Some of the other important AP tables are,
- AP_BANK_BRANCHES
- AP_BANK_ACCOUNTS_ALL
- AP_HOLDS_ALL
- AP_PAYMENT_HISTORY_ALL
- AP_PAYMENT_DISTRIBUTIONS_ALL
- AP_PAYMENT_SCHEDULES_ALL
- AP_ACCOUNTING_EVENTS_ALL
- AP_AE_HEADERS_ALL
- AP_AE_LINES_ALL
- AP_ENCUMBRANCE_LINES_ALL
0 comments