Search Results print_g_rail_rec




Overview

OKS_TAX_UTIL_PVT is a private (PVT) PL/SQL package body in the APPS schema that provides the internal tax calculation and tax-defaulting machinery for Oracle Service Contracts (OKS) and its shared contract repository (OKC). Service Contracts must apply the correct tax treatment to each contract header and line: determining the applicable tax regime, resolving customer tax status, exemption certificates, tax classification codes, and the receivables transaction type used when billing. OKS_TAX_UTIL_PVT encapsulates that logic so that the public Service Contracts APIs, concurrent programs, and the Contracts authoring UI do not need to re-implement tax derivation rules. The package is classified as private because its procedures are invoked from other ETRM engine packages rather than being called directly by external integrations.

The package body opens with a set of private cursors declared so they are not exposed through the specification. These cursors drive the derivation of tax attributes: OKC_HDR_CSR and OKS_HDR_CSR read the contracting header and the OKS tax header respectively; OKC_LINE_CSR and OKS_LINE_CSR read the corresponding line-level records. Together these cursors supply the IDs, currency, conversion attributes, customer account and site use identifiers, payment terms, dates, and tax columns consumed by the utility routines.

Key Procedures and Functions

  • TAX_MIGRATION — supports migration of tax data across releases so that contract tax attributes remain consistent after upgrade or data conversion.
  • THAT — an internal helper referenced in the documented procedure list; it participates in the tax utility processing flow used by the migration and manager routines.
  • UPDATE_TAX_BMGR / UPDATE_TAX_HMGR — update tax information at the buyer/header manager level, writing derived tax values back to the contract header records.
  • UPDATE_TAX_BWKR / UPDATE_TAX_HWKR — counterpart worker routines that perform the bulk of the header tax update processing, invoked by the manager procedures.
  • GET_CUST_TRX_TYPE_ID — returns the Receivables transaction type identifier applicable to the contract, based on AR system parameters and transaction type defaults.
  • GET_LEGAL_ENTITY_ID — returns the legal entity (organization) identifier associated with the contract, used to determine the correct tax registration and reporting entity.

An internal diagnostics procedure, PRINT_G_RAIL_REC, formats a record of type RA_REC_TYPE for debugging and logging during tax processing.

Tables Accessed

The package reads contract header and line data from OKC_K_HEADERS_ALL_B, OKC_K_LINES_B, OKC_K_ITEMS, OKS_K_HEADERS_B, and OKS_K_HEADERS_BH. Customer and party data come from HZ_CUST_ACCOUNTS, HZ_CUST_ACCT_SITES_ALL, HZ_CUST_SITE_USES_ALL, HZ_PARTY_SITES, HZ_PARTIES, and HZ_LOCATIONS. Tax-office determination relies on HR_ALL_ORGANIZATION_UNITS and HR_ALL_ORGANIZATION_UNITS_TL. Currency defaults are resolved from FND_CURRENCIES, the receivables transaction type default from AR_SYSTEM_PARAMETERS_ALL, and legal entity resolution from the HR organization tables. All are accessed through APPS synonyms.

Usage Notes

OKS_TAX_UTIL_PVT is referenced by nine other packages and is invoked during contract authoring, tax defaulting, and tax recalculation on save, as well as during concurrent tax migration processing. Because it is a PVT package, it should not be called directly from customer extensions; developers should instead use the public Service Contracts APIs. The package name is often encountered indirectly when tracing references to OKS_CONTRACTS-related tax columns or when diagnosing tax discrepancies on contract headers and lines.