Results for “rule_generation_type_code”

6 results




AI-generated from documented ETRM metadata — verify critical details on the linked pages.

Overview

AP_ALLOCATION_RULES_V is a reporting view owned by the APPS schema in Oracle E-Business Suite Payables (AP). It presents invoice charge lines together with their associated allocation rules, allowing users and integrators to determine how freight, miscellaneous, and tax charges on an invoice are apportioned across distributions. The view is important because the underlying transaction table AP_ALLOCATION_RULES stores only the rule definition against a charge line, while the descriptive context of that charge line — its amount, type, description, and tax content — resides in AP_INVOICE_LINES. The view joins these sources, decodes lookup values into displayable text, and derives a taxable base amount, making it suitable for reporting, reconciliation, and downstream integration.

The view carries a status of VALID and is exposed in both EBS 12.1.1 and 12.2.2 with essentially identical column semantics. It is a query-only object and is not intended for direct DML; allocation rules are maintained through the Payables application or the public APIs that populate AP_ALLOCATION_RULES.

Underlying Base Objects

The view is defined over the following documented base objects:

  • AP_ALLOCATION_RULES (SYNONYM) — the driving allocation rule records, joined by INVOICE_ID and CHRG_INVOICE_LINE_NUMBER.
  • AP_INVOICE_LINES (SYNONYM) — the invoice charge lines, restricted to line types FREIGHT, MISCELLANEOUS, and TAX.
  • AP_LOOKUP_CODES (VIEW) — used three times to decode the invoice line type (CHARGE_TYPE), the rule generation type (RULE_GENERATION_TYPE), and the allocation status (STATUS).
  • FND_GLOBAL (PACKAGE) — referenced in the documented metadata for session context.

The joins to AP_ALLOCATION_RULES are outer joins (denoted by the (+) operator), so every qualifying charge line from AP_INVOICE_LINES is returned even when no allocation rule has yet been created for it. When no rule exists, the view substitutes default rule values — rule type defaults to PRORATION, rule generation type to USER, and status to PENDING — so that unreleased or unprocessed charge lines are still visible to the report. The lookup joins to RULE_GENERATION_TYPE and STATUS are also outer joins, consistent with the possibility that these values are null.

Key Columns

  • ROW_ID — the ROWID of the parent AP_ALLOCATION_RULES row.
  • INVOICE_ID — the identifier of the invoice to which the charge line and rule belong.
  • CHRG_INVOICE_LINE_NUMBER — the invoice line number of the charge line; this is the column the user searched for and is the principal link between the rule and its charge line.
  • CHRG_TYPE_LOOKUP_CODE — the raw line type code (FREIGHT, MISCELLANEOUS, or TAX).
  • CHARGE_TYPE — the decoded display value of the charge type.
  • DESCRIPTION — the charge line description.
  • CHRG_LINE_AMOUNT — the amount of the charge line.
  • CHRG_LINE_INCLUDED_TAX_AMOUNT — the tax amount included within the charge line (NVL-decoded to zero in the derived expression).
  • CHRG_LINE_APPLICABLE_AMOUNT — the amount subject to allocation, computed as amount minus included tax.
  • RULE_TYPE — the allocation rule type, defaulting to PRORATION.
  • RULE_GENERATION_TYPE_CODE / RULE_GENERATION_TYPE — the generation type code and its decoded display value, defaulting to USER.
  • STATUS_CODE / STATUS — the rule status code and decoded status, defaulting to PENDING.
  • CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN — standard audit columns.

Common Use Cases and Queries

Typical scenarios include reviewing which allocation rules exist for an invoice's charge lines, identifying charge lines still in PENDING status, and reporting the taxable base for freight and tax lines.

  • Retrieve all charge lines and rules for a specific invoice:
    SELECT invoice_id, chrg_invoice_line_number, charge_type,
           chrg_line_amount, chrg_line_applicable_amount,
           rule_type, status
    FROM   apps.ap_allocation_rules_v
    WHERE  invoice_id = :p_invoice_id
    ORDER BY chrg_invoice_line_number;
  • Find charge lines that have no allocation rule yet (status defaulted to PENDING):
    SELECT invoice_id, chrg_invoice_line_number, charge_type, status
    FROM   apps.ap_allocation_rules_v
    WHERE  status = 'PENDING';
  • Summarize applicable amounts by charge type:
    SELECT charge_type, SUM(chrg_line_applicable_amount) applicable
    FROM   apps.ap_allocation_rules_v
    GROUP BY charge_type;

Because CHRG_INVOICE_LINE_NUMBER is the linking key, most integration queries join or filter on it alongside INVOICE_ID to reconcile the rule back to the originating invoice line.