Search Results get_invoice_qty




Overview

APPS.POS_QUANTITIES_S is a server-side PL/SQL package body in Oracle E-Business Suite that provides quantity calculation and retrieval services for the Purchasing (PO) module, with particular emphasis on receipt, receiving, and invoice matching activities. Its primary business purpose is to centralize the logic used to determine available, tolerable, and invoice-relevant quantities for purchase order line locations. The package acts largely as a thin wrapper layer over the Receiving module's quantity engine, delegating the actual numeric derivation to rcv_quantities_s.get_available_quantity and then returning the specific value the caller requires. This design shields Purchasing forms and APIs from the complexity of receiving quantity calculations while ensuring consistent behavior across the application. The package is classified as API classification OTHER in the ETRM metadata, indicating that it is intended primarily for internal application use rather than as a formally published public API, although customizations and extensions may still reference it. Three documented functions are exposed, and the package is referenced by four other packages, reflecting its role as a shared utility within the Purchasing and Receiving integration layer.

Key Procedures and Functions

The package body exposes three documented functions:

  • GETAVAILABLEQUANTITY — Returns the available quantity for a given purchase order line location. It is a PL/SQL wrapper around rcv_quantities_s.get_available_quantity, invoked with the transaction type RECEIVE and a source of VENDOR, and it returns only the available quantity component from the underlying call. Its typical purpose is to support forms and logic that must know how much of a line location remains available to receive.
  • GETTOLERABLEQUANTITY — Returns the tolerable quantity for a given purchase order line location, using the same underlying rcv_quantities_s.get_available_quantity call as the previous function but returning the tolerable quantity component instead. This supports over-receipt and tolerance handling rules configured for the receiving transaction.
  • GET_INVOICE_QTY — The function most relevant to the user's search term "get_invoice_qty." It returns a quantity value used in invoice-related processing, accepting inputs that include a line location identifier, an ASN unit of measure, an item identifier, and a quantity. Internally it performs unit of measure conversion, resolving the ASN unit of measure code and the purchase order unit of measure code by querying MTL_UNITS_OF_MEASURE, so that the returned quantity is expressed consistently for downstream invoice matching. This makes it a key helper for reconciling ASN or receiving quantities against invoice quantities across differing units of measure.

Tables Accessed

The documented package references three tables, accessed through APPS synonyms:

  • MTL_UNITS_OF_MEASURE — Queried within GET_INVOICE_QTY to resolve unit of measure codes (the ASN unit of measure code and the purchase order unit of measure code) so that quantity conversion between the ASN and PO units of measure can be performed.
  • PO_LINES_ALL — The purchasing line definition table, used to obtain purchase order line attributes such as the item and unit of measure associated with a line.
  • PO_LINE_LOCATIONS_ALL — The line location (shipment) table, used to resolve the line location context and related quantity and unit of measure information for the calculations performed by the functions.

No additional tables are documented by ETRM, so the package's direct data footprint is limited to these purchasing and unit of measure entities, with the remaining receiving quantity logic handled inside rcv_quantities_s.

Usage Notes

POS_QUANTITIES_S is typically invoked from the Purchasing forms and from other server-side PL/SQL packages during receipt, receiving, and invoice matching flows. Because it is referenced by four other packages, it functions as a shared dependency rather than a standalone entry point. Callers are most likely to use GET_INVOICE_QTY when they need a quantity expressed in a common unit of measure for invoice validation against received or ASN quantities, and GETAVAILABLEQUANTITY or GETTOLERABLEQUANTITY when they need receipt tolerance checks. The functions propagate exceptions by calling po_message_s.sql_error and then re-raising, so custom code invoking these functions should be prepared to handle propagated errors and should respect the internal API classification. Developers customizing or extending Purchasing logic should prefer calling these wrappers rather than directly invoking rcv_quantities_s, to preserve consistent behavior and error messaging within the PO module.