Search Results invoice_list_tabtype
Overview
ARI_SERVICE_CHARGE_PKG is a PL/SQL package in the Oracle Receivables (AR) module, owned by the APPS schema and defined with AUTHID CURRENT_USER. Its documented purpose is to apply service charges (late payment interest and similar finance charges) to open invoices in Oracle E-Business Suite. The package header carries the RCS version identifier ARISCRGS.pls 120.2.12020000.2, dated 22-July-2012, indicating that it is part of the standard shipped Receivables codebase and was maintained through the 12.1.1 and 12.2.2 release streams. The original creation comment attributes the package to developer bchowdar in January 2003.
The package encapsulates the logic required to compute a service charge against a set of invoices and then to post that charge as an adjustment against the affected payment schedules. This separates the calculation step from the posting step, which allows the calling program to compute charges for a batch of invoices, inspect or filter the results, and apply only the qualifying adjustments.
Key Procedures and Functions
The ETRM metadata documents three procedures and functions in the package.
- APPLY_CHARGE — A function that receives a set of invoice records (the INVOICE_LIST_TABTYPE collection) and applies the service charge to those invoices. This is the entry point corresponding to the user query "apply_charge". It returns a VARCHAR2 result, conventionally used in EBS APIs to signal success or convey an error or warning message. Because it consumes the output of COMPUTE_SERVICE_CHARGE, it acts as the posting stage of the service charge process.
- COMPUTE_SERVICE_CHARGE — A procedure that takes the invoice set as an IN OUT NOCOPY parameter, together with a payment type indicator, and calculates the service charge amount for each invoice in the collection. Declaring the collection as IN OUT NOCOPY allows the computed SERVICE_CHARGE value to be written back into each INVOICE_REC_TYPE record without copying the entire collection, which matters for performance on large invoice batches.
- ADJUST_INVOICE — A function that accepts a single ADJUSTMENT_REC_TYPE record, which carries a payment schedule identifier, receivables transaction identifier, amount, transaction line identifier, apply date, GL date, and created-from value, and posts the adjustment against the invoice. It returns a VARCHAR2 status. This is the low-level routine used to write the service charge adjustment to AR_ADJUSTMENTS.
The package also declares two record types (ADJUSTMENT_REC_TYPE and INVOICE_REC_TYPE) and the INVOICE_LIST_TABTYPE associative array collection over INVOICE_REC_TYPE. The customer site use identifier was added to INVOICE_REC_TYPE under Bug 3886652, reflecting the need to resolve service charge treatment by customer site.
Tables Accessed
The documented tables, accessed through APPS synonyms, are:
- AR_ADJUSTMENTS — The primary target of the package. Both ADJUSTMENT_REC_TYPE and INVOICE_REC_TYPE draw their column datatypes from this table (payment schedule, receivables transaction, amount, customer transaction line, apply date, and GL date). SERVICE_CHARGE amounts are ultimately persisted here as adjustments against the invoice.
- AR_IREC_PAYMENT_LIST_GT — A global temporary table used by the Receivables interest and service charge process to carry the working set of payment schedule lines through the calculation and application steps. Its temporary, session-scoped nature makes it suitable for batch service charge runs.
- PLITBLM — The standard EBS PL/SQL internal table (index-by) declaration package, referenced for the collection and table type definitions used by the API's list parameters.
Usage Notes
ARI_SERVICE_CHARGE_PKG is classified as OTHER in the ETRM API classification scheme and is referenced by one other package, indicating that it is generally called from within Receivables processing rather than directly by end users. Typical invocation paths include the Receivables service charge concurrent programs and the underlying interest calculation logic, which populate the global temporary table, call COMPUTE_SERVICE_CHARGE to calculate charges per invoice, and then call APPLY_CHARGE to post the resulting adjustments.
Custom code that needs to replicate or extend service charge behavior can populate the INVOICE_LIST_TABTYPE collection, invoke COMPUTE_SERVICE_CHARGE, and then invoke APPLY_CHARGE, always checking the VARCHAR2 return value for errors before committing. Because the package is AUTHID CURRENT_USER and resides in APPS, callers must be granted EXECUTE on the package and must have appropriate Receivables privileges on the underlying objects.