Results for “commit_invoice”
8 results
AI-generated from documented ETRM metadata — verify critical details on the linked pages.
Overview
PA_IC_INV_UTILS is a PL/SQL utility package owned by the APPS schema that supports the Oracle Projects Intercompany Invoice Generation process. Intercompany invoicing in Oracle EBS governs the billing that occurs when one operating unit or project-owning organization provides goods or services to another, requiring the generation of draft invoices, the application of distribution rules, and the reconciliation of costs across organization boundaries. The package encapsulates common processing routines — initialization of session globals, draft invoice numbering, error marking, lock management, and multi-organization access checks — so that the intercompany billing engine, concurrent programs, and dependent packages can share consistent logic.
The package specification declares a set of global variables (G_LAST_UPDATE_LOGIN, G_REQUEST_ID, G_PROGRAM_APPLICATION_ID, G_PROGRAM_ID, G_LAST_UPDATED_BY, G_CREATED_BY, and G_DEBUG_MODE) that carry standard "Who" audit context and concurrency request context across calls within a session. These globals are populated by the INIT procedure and reused by subsequent routines, which is a common EBS pattern for batch intercompany processing.
Key Procedures and Functions
The package exposes twelve documented procedures/functions:
- INIT — Initializes the package-level global variables (audit columns, request/program identifiers, debug flag, set of books, organization, and functional currency) that govern downstream processing.
- GET_NEXT_DRAFT_INV_NUM — Returns the next draft invoice number to be assigned to a newly created invoice header, providing controlled numbering for the intercompany invoice flow.
- COMMIT_INVOICE — Commits the invoice transaction, persisting the header, items, and detail rows created during generation.
- UPDATE_SPF — Updates summarized project funding information in support of intercompany cost distribution and funding reconciliation.
- MARK_INV_ERROR — Flags failed invoice records with error status, enabling downstream reporting and exception handling.
- MARK_EI_AS_BILLED — Marks expenditure items as billed once they have been swept into an intercompany invoice, preventing duplicate billing.
- SET_USER_LOCK and RELEASE_USER_LOCK — Acquire and release a user-level lock to serialize access to intercompany invoice processing and avoid concurrent conflicts.
- CHECK_IF_UNRELEASED_INVOICE — Determines whether an unreleased invoice exists, supporting release and re-processing decisions.
- UPDATE_DI_FOR_MRC — Updates draft invoice data for Multi-Reporting Currency (MRC) environments, propagating accounting entries to secondary sets of books.
- GET_ACTIVE_SITES — Retrieves active site information (typically the customer/party sites and site uses relevant to intercompany billing) so that the invoice generation logic can resolve the correct bill-to or ship-to site. This routine is the object most frequently sought by users searching for "get_active_sites".
- LOG_MESSAGE — Writes diagnostic or informational messages to the concurrent request log, particularly useful when G_DEBUG_MODE is enabled.
Tables Accessed
The package interacts with the following APPS-synonym tables:
- PA_DRAFT_INVOICES and PA_DRAFT_INVOICES_ALL — the draft invoice header tables that hold intercompany invoice records.
- PA_DRAFT_INVOICE_ITEMS and PA_DRAFT_INVOICE_DETAILS — line-level and detail-level invoice data generated for intercompany transactions.
- PA_EXPENDITURE_ITEMS_ALL — source expenditure items that are evaluated and subsequently marked as billed.
- PA_SUMMARY_PROJECT_FUNDINGS — summarized funding records updated during distribution processing.
- PA_DISTRIBUTION_WARNINGS — warnings generated when distribution rules cannot be satisfied.
- HZ_CUST_SITE_USES and HZ_CUSTOMER_PROFILES — Trading Community Architecture tables supplying customer site and profile information, which is directly relevant to GET_ACTIVE_SITES.
Usage Notes
PA_IC_INV_UTILS is an internal utility package rather than a public API. It is referenced by five other packages and is invoked primarily from Oracle Projects concurrent programs that generate intercompany invoices and from related PL/SQL routines during batch invoice creation. Because it manipulates package globals through INIT and relies on COMMIT_INVOICE for transactional control, custom code that calls these routines must ensure INIT is executed first within the session and must honor the commit boundaries. As with all EBS-seeded PL/SQL, modifications should be avoided; extensions should call the documented procedures rather than alter the package body. Developers diagnosing intercompany invoice errors will find LOG_MESSAGE and MARK_INV_ERROR especially useful for tracing failures in the concurrent request log.