Search Results get_days_late




Overview

ARP_ARXCOQIT is an Oracle Receivables PL/SQL package declared with AUTHID CURRENT_USER, meaning its unqualified database references resolve against the calling schema's privileges rather than the APPS schema owner. In Oracle EBS 12.1.1 and 12.2.2, the package functions as a shared utility layer for the Receivables dispute and collections inquiry forms, particularly the "Quick Invoices and Transactions" inquiry family indicated by the ARXCOQIT naming convention. It centralizes reusable computations that the Oracle Forms user interface requires but that are inefficient or impractical to express in Form triggers, including currency-aware aggregation of payment schedule balances, dispute history lookups, and past-due day calculations. The package exposes a compact, stable interface so that multiple inquiry forms can reference identical logic, ensuring consistent presentation of disputed amounts, currencies, and delinquency across Receivables screens.

Key Procedures and Functions

The package declares seven documented program units. HISTORY_TOTAL accepts a dynamic WHERE clause and returns an aggregate total, supporting the dispute history inquiry block. FOLD_TOTAL is the principal aggregation routine: it returns a total, a functional-currency total, and, per the fix for bug 1826455, a count of distinct currencies contributing to the total. It defaults its FROM clause to ar_payment_schedules_v, allowing callers to override the source view. FOLD_CURRENCY_CODE, added under bug 2089289, returns the currency code associated with a folded query against a caller-supplied WHERE clause and optional FROM clause. GET_DATE retrieves the earliest or latest (as designed) dispute start date for a given payment schedule identifier from AR_DISPUTE_HISTORY. CHECK_CHANGED compares a payment schedule's disputed amount against a supplied value and returns a change indicator. GET_FLAG returns the ever-in-dispute flag for a payment schedule. GET_DAYS_LATE accepts a due date and derives the number of days the item is late, which is the entry point users most frequently search for; it is invoked by inquiry forms to render the "days late" column and aging indicators without duplicating calendar-difference logic in Form PL/SQL.

Tables Accessed

The package reads AR_PAYMENT_SCHEDULES and its inquiry view AR_PAYMENT_SCHEDULES_V to obtain due dates, amounts in dispute, and payment schedule identifiers. It reads AR_DISPUTE_HISTORY for dispute start dates and the ever-in-dispute flag used by GET_DATE, CHECK_CHANGED, and GET_FLAG. Aggregation routines operate against the payment schedules view by default but permit a caller-supplied FROM clause, which is executed dynamically through DBMS_SQL; DUAL supports scalar evaluations, and PLITBLM is referenced as part of the underlying query construction. All references resolve through APPS synonyms under AUTHID CURRENT_USER.

Usage Notes

ARP_ARXCOQIT is an internal, form-driven utility rather than a public API; the ETRM metadata records no other packages referencing it. It is typically invoked from Oracle Forms inquiry blocks in Receivables collections and dispute screens, and it may be called from custom PL/SQL that requires consistent currency folding or days-late computation. Because several routines accept raw WHERE and FROM clauses executed dynamically via DBMS_SQL, callers must construct predicates from trusted, internally generated sources only, never from user-entered text, to avoid SQL injection. The package is not documented as a concurrent program entry point, and no standalone submission is expected. Customizations should call the documented procedures by name and rely on their OUT NOCOPY parameters for results, avoiding direct replication of the folding and aging logic.