Search Results calculate_quote




Overview

AP_ETAX_PKG is the Oracle Payables package that integrates Payables invoice processing with the E-Business Tax (EBTax / ETRM) engine. Its principal responsibility is to invoke the tax determination and tax calculation services of the E-Business Tax module on behalf of an invoice header, a specific invoice line, or an interface invoice being brought into Payables. In Oracle EBS 12.1.1 and 12.2.2, tax is no longer calculated by legacy Payables routines; instead, Payables must call out to E-Business Tax so that regimes, taxes, tax statuses, rules, and applicable tax rates are resolved and persisted against the invoice and its distributions. AP_ETAX_PKG is the bridge that performs that callout.

The package is declared AUTHID CURRENT_USER, so it executes with the privileges and schema context of the invoking session rather than the defining schema, which matters for Form and concurrent request invocation inside the APPS environment. The header comment identifies the source file as apetaxps.pls. The package also defines several package-level constants—such as the AP application identifier (200), the entity code AP_INVOICES, and event class codes for standard invoices, prepayment invoices, and expense reports—together with a batch limit and assorted collection types used to gather invoice and event-class identifiers for bulk processing.

Key Procedures and Functions

  • CALLING_ETAX — The core function, invoked for a given invoice, and optionally a specific line, a calling mode, an override status, a line to delete, an interface invoice identifier, and an event identifier. It returns a Boolean indicating success or failure and returns an error code to the caller, along with the calling sequence for diagnostics. Because the user's search term was "calling_etax", this function is the primary documented entry point.
  • CALCULATE_QUOTE — Calculates a tax quote (an estimated tax amount) for a prospective transaction. It accepts a calling mode, error message text, and optional invoice header and line records, and returns the computed tax amount, a flag indicating whether tax is included in the amount, and an error code. It is used for tax estimation prior to or independent of final invoice placement.
  • CALLETAX — A wrapper function around CALLING_ETAX intended for JDBC invocation. It mirrors the CALLING_ETAX parameters and returns a numeric status value (rather than a Boolean), making it convenient for external Java/Forms-tier clients that cannot consume PL/SQL Boolean return types.

Tables Accessed

The package references the following tables through APPS synonyms:

  • AP_INVOICES_ALL — Source of invoice header attributes required to identify the transaction and its supplier/legal entity context for tax determination.
  • AP_INVOICE_LINES_ALL — Source of invoice line attributes that drive line-level tax determination and calculation.
  • ZX_TRX_HEADERS_GT — A global temporary table belonging to E-Business Tax, populated with transaction header information so the tax engine can resolve and return applicable taxes.
  • DUAL — Used for scalar lookups and single-value evaluations within the PL/SQL logic.

Usage Notes

AP_ETAX_PKG is not typically invoked directly by end users. It is called from Payables invoice-entry and invoice-workbench forms, from the Invoice Validation and tax-related concurrent programs, and from interface processing when invoices arrive through the Payables Open Interface. The package is also referenced by seventeen other packages within the APPS schema, confirming its role as a foundational, shared service for Payables-to-EBTax communication. Custom code should invoke CALLING_ETAX (or CALLETAX for JDBC/external clients) rather than attempting to manipulate ZX_TRX_HEADERS_GT directly. Callers must supply an appropriate calling sequence string and must handle the returned Boolean or numeric status together with the out error code. Because the package executes AUTHID CURRENT_USER, custom callers should be aware that privilege resolution follows the invoking schema.