Query to Find AR Credit Memos Applied to an Invoice in Oracle R12

When a credit memo is applied to an invoice in Oracle Receivables, the application is stored in AR_RECEIVABLE_APPLICATIONS_ALL with APPLICATION_TYPE = 'CM'. Its PAYMENT_SCHEDULE_ID points to the credit memo’s payment schedule and APPLIED_CUSTOMER_TRX_ID to the invoice. The query below lists, for a credit memo number, every invoice it was applied to with both transaction types, original amounts, the amount applied and what remains due on each.

SQL: credit memo applications to invoices

-- AR credit memos applied to invoices 
select 
  rct.trx_number "INV Number", 
  ctt_inv.name "Invoice Type", 
  ps_cm.trx_number "CM/RCPT Number", 
  ctt_cm.name "CM/Receipt Type", 
  ps_inv.amount_due_original "INV Amount", 
  ps_cm.amount_due_original * -1 "CM/RCPT Amount", 
  app.amount_applied "Amt Applied", 
  ps_inv.amount_due_remaining "INV Amt Due", 
  ps_cm.amount_due_remaining *-1 "CM/RCPT Amt Due", 
  app.receivable_application_id "ID", 
  app.creation_date, 
  app.status 
from 
  ar_receivable_applications_all app, 
  ra_customer_trx_all rct, 
  ar_payment_schedules_all ps_cm, 
  ar_payment_schedules_all ps_inv, 
  ra_cust_trx_types_all ctt_inv, 
  ra_cust_trx_types_all ctt_cm 
where 
  1 = 1 /* 
  and app.status = 'APP' */ 
  and app.application_type = 'CM' 
  and app.applied_customer_trx_id = rct.customer_trx_id 
  and app.payment_schedule_id = ps_cm.payment_schedule_id 
  and rct.cust_trx_type_id = ctt_inv.cust_trx_type_id 
  and ps_cm.cust_trx_type_id = ctt_cm.cust_trx_type_id 
  and rct.customer_trx_id = ps_inv.customer_trx_id 
  and ps_cm.trx_number in ('5079644');

Notes

  • Replace '5079644' with the credit memo number, or filter on rct.trx_number to start from the invoice.
  • Uncomment the app.status = 'APP' line to exclude reversed or unapplied rows.
  • Credit memo amounts are negative in AR_PAYMENT_SCHEDULES_ALL; the query multiplies them by -1 to show positive values.
  • Add app.org_id when the same numbers exist in several operating units.

Where are AR credit memo applications stored?

In AR_RECEIVABLE_APPLICATIONS_ALL with APPLICATION_TYPE = ‘CM’. Receipt applications use APPLICATION_TYPE = ‘CASH’.

How do I find the remaining balance of an invoice in Oracle AR?

AR_PAYMENT_SCHEDULES_ALL.AMOUNT_DUE_REMAINING for the invoice’s payment schedule.

Related queries

Related posts: Upload your own post and refer it anywhere anytime:

Leave a Comment