Search Results ar_invoice_count_terms_v




Overview

AR_INVOICE_COUNT_TERMS_V is a read-only database view owned by the APPS schema in Oracle E-Business Suite Release 12.1.1 and 12.2.2, belonging to the Oracle Receivables (AR) product family. Its documented purpose is to collect the number of payment dates defined for a transaction. In practical terms, the view aggregates the number of scheduled installment lines attached to each payment term, exposing that count keyed by term identifier. Because it is a view rather than a table, it stores no data of its own; it is a purely derived, query-only object that draws its values from the Receivables payment terms line table at runtime.

The object holds a VALID status in the ETRM metadata, confirming it is a supported and active dictionary component. Within Receivables, payment terms govern when invoices become due and how they may be split across multiple due dates. This view provides a lightweight, pre-aggregated summary of how many such installment dates each term defines, which is useful in reporting, validation, and integration logic where the cardinality of term lines matters rather than the individual line detail.

Underlying Base Objects

The view is defined over two documented base objects: RA_TERMS_LINES and DUAL, both referenced through public synonyms in the APPS schema. RA_TERMS_LINES is the Receivables table that stores the individual installment lines belonging to a payment term. Each row represents one payment date or installment definition associated with a given TERM_ID. DUAL is the Oracle-supplied single-row pseudo-table used here to guarantee that the result set always contains at least one row.

The defining query groups RA_TERMS_LINES by TERM_ID and counts the rows per term, then unions that aggregate with a synthetic row of TERM_ID = -1 and NUMBER_OF_TERMS = 0. The purpose of that union branch is to ensure the view returns a row even when no matching terms exist, providing a predictable placeholder rather than an empty result set for outer-join or lookup-style usage.

Key Columns

  • TERM_ID — The payment term identifier. This is the grouping key and corresponds to the term identifier in RA_TERMS_LINES. The special value of -1 appears in the union branch and represents the "no terms" placeholder row.
  • NUMBER_OF_TERMS — The count of payment dates (installment lines) defined for the given TERM_ID, produced by COUNT(*). For TERM_ID = -1 the value is fixed at 0.

There are no other exposed columns. The view is deliberately narrow, returning one row per distinct term that has at least one line, plus the single placeholder row.

Common Use Cases and Queries

The view is typically used to determine how many installment dates a payment term carries — for example, to distinguish single-due-date terms from multi-installment terms in reporting, to validate term setup, or to drive conditional logic in custom integrations and concurrent programs. A representative query returning the count for a specific term is:

  • SELECT term_id, number_of_terms FROM apps.ar_invoice_count_terms_v WHERE term_id = :p_term_id;
  • SELECT term_id, number_of_terms FROM apps.ar_invoice_count_terms_v ORDER BY term_id;
  • SELECT t.term_id, t.name, v.number_of_terms FROM apps.ra_terms_tl t, apps.ar_invoice_count_terms_v v WHERE t.term_id = v.term_id AND t.language = USERENV('LANG');

Because the view is defined only over RA_TERMS_LINES, it reflects term line configuration directly and requires no joins to the header tables unless term descriptive attributes are also needed. The placeholder row for TERM_ID = -1 should be handled explicitly in any consumer that joins to it. Querying the view requires read privileges granted to the APPS object, and, as with all Receivables setup data, results reflect the current state of the underlying term definitions.