Search Results company_agent




Overview

JL_ZZ_AP_AWT_DEFAULT_PKG is an Oracle E-Business Suite localization package owned by the APPS schema and classified as a component of Oracle Financials for Brazil (the "JL" prefix denotes Latin American localization objects). Its business purpose is to manage withholding tax (imposto retido) defaults on Oracle Payables invoice distributions. When invoices, invoice lines, and invoice distributions are created or adjusted through the Payables entry flow, the package determines whether supplier withholding applies, computes the appropriate withholding type and supplier withholding code, and inserts or removes withholding distribution rows in JL_ZZ_AP_INV_DIS_WH. The header comment ("R12 KI") and the module name confirm that the code was reworked for the R12 architecture, where withholding logic moved from invoice-level to distribution-level processing. This package is the defaulting engine, not the tax calculation engine: it establishes the default withholding aura around a distribution so that the runtime tax engine can subsequently compute the withheld amount. The 12.1.1 and 12.2.2 releases share the same source lineage (the $Header shows file version 120.15), so functionality is consistent across both versions.

Key Procedures and Functions

  • INSERT_AWT_DEFAULT — Inserts a default withholding record for a given invoice distribution, keyed by invoice identifier, distribution identifier, supplier withholding code, and organization.
  • VER_TERRITORIAL_FLAG — Returns a boolean indicating whether the territorial (regional) withholding flag applies for a supplied province code.
  • GET_VENDOR_ID — Derives the vendor (supplier) identifier from the tax payer identifier stored in the distribution's global attribute and the invoice identifier.
  • COMPANY_AGENT — Returns a boolean indicating whether the transaction is a company-agent relationship for the supplied withholding type code and invoice.
  • VALIDATE_LINE_TYPE — Validates that the distribution line type is eligible for withholding for the supplied tax code.
  • PROVINCE_ZONE_CITY — Resolves the zone, province, and city code from a ship-to location identifier, supporting geography-based withholding rules.
  • DEL_WH_DEF — Deletes the withholding default row associated with an invoice distribution.
  • SUPP_WH_DEF_LINE — Applies supplier withholding defaults at the invoice line level, using invoice, distribution, tax payer, ship-to location, line type, and vendor identifiers.
  • SUPP_WH_DEF — The principal driver: applies supplier withholding defaults for an invoice, line number, distribution, and calling module, with an optional parent distribution for prepayment or correction scenarios.
  • CARRY_WITHHOLDINGS_PREPAY — Carries withholding defaults forward from prepayment applications to the resulting invoice distributions.
  • SUPP_WH_REDEFAULT — Re-applies withholding defaults after changes to invoice or distribution attributes.
  • UPD_DIST_GDF — Updates the descriptive flexfield attributes on the distribution that store withholding-related values.

Tables Accessed

The package reads AP_INVOICES_ALL and AP_INVOICES, AP_INVOICE_LINES_ALL, AP_INVOICE_DISTRIBUTIONS_ALL, and AP_TAX_CODES_ALL to obtain the invoice, line, distribution, and tax code context. It reads HR_LOCATIONS_ALL to resolve ship-to geography and JL_AR_AP_PROVINCES to validate province codes. Withholding configuration and defaults are read from JL_ZZ_AP_AWT_TYPES, JL_ZZ_AP_SUP_AWT_CD, JL_ZZ_AP_COMP_AWT_TYPES, and HZ_GEOGRAPHIES. The primary write target is JL_ZZ_AP_INV_DIS_WH, which stores the withholding rows created, updated, or deleted by the defaulting procedures.

Usage Notes

The package is invoked internally by Oracle Payables localization logic rather than directly by end users. It is called from the invoice workbench during invoice entry, from the Payables Open Interface and Invoice Import concurrent programs, and during prepayment application and distribution adjustment. Because it is referenced by four other packages, it functions as a shared defaulting service. Customizations and extensions should call SUPP_WH_DEF and DEL_WH_DEF rather than manipulating JL_ZZ_AP_INV_DIS_WH directly, and should always pass the correct calling sequence and org identifier so that multi-org security and audit trails remain intact.