Search Results apply_on_account




Overview

AR_CM_API_PUB is a public PL/SQL API package in the Oracle E-Business Suite Receivables (AR) module, owned by the APPS schema and classified as a PUB (public) API. Its core business function is to allow on-account credit memos to be applied against debit memos or invoices through simple, programmatic calls to PL/SQL functions. In effect, the package exposes the credit memo application and unapplication logic of Receivables in a form that can be invoked from custom code, integrations, and Oracle-delivered components without directly manipulating the underlying application tables.

The package header (ARXPCMES.pls) declares a set of record types that structure the data exchanged by its procedures. These include a record for credit memo application information (G_cm_app_rec_type), covering fields such as the credit memo transaction ID and number, the invoice or debit memo transaction ID and number, the installment (terms sequence number), the applied payment schedule ID, the amount applied, and invoice line identifiers. A second record (G_cm_unapp_rec_type) supports unapplication, carrying the credit memo and invoice identifiers together with the applied payment schedule ID and the receivable application ID. An extended application record (cm_app_rec_type) adds apply date and GL date attributes. Global variables holding original application and unapplication information are also declared. These record structures form the contract through which callers pass and receive credit memo data.

Key Procedures and Functions

The ETRM metadata documents two public procedures in this package:

  • APPLY_ON_ACCOUNT — Applies an on-account credit memo against a specified debit memo or invoice. This is the primary function of the package and corresponds to the header comment stating that credit memo APIs allow users to apply on-account credit memos using simple PL/SQL calls. It uses the application record types to identify the credit memo, the target transaction, the installment, and the amount to apply.
  • UNAPPLY_ON_ACCOUNT — Reverses a previously created on-account credit memo application. It relies on the unapplication record structure, which carries the receivable application ID and the related transaction identifiers needed to identify and undo the application.

Parameter lists are not reproduced here because the documented metadata does not enumerate them.

Tables Accessed

The package reads from and writes to the core Receivables tables (referenced via APPS synonyms):

  • AR_RECEIVABLE_APPLICATIONS — Stores the application and unapplication records. APPLY_ON_ACCOUNT inserts application rows here; UNAPPLY_ON_ACCOUNT updates or reverses them.
  • AR_PAYMENT_SCHEDULES — Holds installment and payment schedule information. It supplies the terms sequence number and the applied payment schedule ID used to bind an application to the correct installment, and its balances are adjusted as amounts are applied or unapplied.
  • RA_CUSTOMER_TRX — The transaction header table, read to identify the credit memo and the invoice or debit memo by transaction ID and transaction number.
  • RA_CUSTOMER_TRX_LINES — The transaction line table, used when application data references specific invoice lines (line ID and line number).
  • FND_CURRENCIES — The currency reference table, used to validate and interpret currency attributes associated with the transactions and applications.

Usage Notes

AR_CM_API_PUB is a published API, meaning it is intended for supported external invocation. It is typically called from custom PL/SQL code, concurrent programs, or Oracle Forms-based Receivables flows that need to apply or unapply on-account credit memos programmatically rather than through the standard user interface. The package is referenced by two other packages in the ETRM repository, indicating that delivered or dependent logic also relies on it. Because it is classified as AUTHID CURRENT_USER, it executes with the privileges of the calling user, so callers must ensure appropriate grants and initialization of Receivables session context before invoking it. As with other Receivables public APIs, callers should expect the package to validate the application, update payment schedule balances, and create the receivable application records, and should handle any errors returned through the API's standard error-handling conventions.