Search Results cancel_invoice




Overview

PA_IC_INV_CNL is an Oracle Projects intercompany invoicing utility package whose documented entry point is the CANCEL_INVOICE procedure. Its purpose is to cancel a specific draft intercompany invoice that has been generated for a project, releasing the associated expenditure items and reversing the transfer-price accounting that had been staged against the invoice. The package operates within the Oracle EBS 12.1.1 and 12.2.2 code lines and carries the header revision $Header: PAICCNLB.pls 120.6 2011/04/28 18:38:53 apaul ship $, confirming it is a shipped, supported component of the Applications (APPS) schema.

Intercompany billing in Oracle Projects arises when work performed by one operating unit against a project is charged to another. Before such costs can be invoiced, the system creates draft intercompany invoices and links them to expenditure items. When those invoices must be withdrawn — because of pricing errors, agreement changes, or reversed intercompany relationships — the draft invoice and its detail lines must be removed cleanly and the source expenditure items unlinked so they can be reprocessed. PA_IC_INV_CNL encapsulates that logic, sparing callers from manipulating the underlying draft invoice tables directly.

Key Procedures and Functions

The ETRM metadata documents exactly one procedure for this package:

  • CANCEL_INVOICE — Performs cancellation of a specified draft intercompany invoice for a project. It accepts the project identifier and the draft invoice number as its required inputs, identified internally as P_PROJECT_ID and P_DRAFT_INV_NUM. The procedure locates the invoice, removes the associated draft invoice detail lines, and re-establishes the linkage on the affected expenditure items. Internal declarations visible in the body — such as l_new_draft_inv_num, l_agreement_id, and the bulk collections l_draft_invoice_detail_id, l_expenditure_item_id, and l_EI_upd_cnt — indicate that the routine copies or recreates draft invoice structures and updates expenditure items in bulk. Transfer-price columns (denomination currency, transfer price, accounting rate type and date, exchange rate, bill rate, markup percentages, and compiled set identifiers) show that pricing attributes are preserved or recomputed as part of the cancellation. Debugging is controlled through the PA_DEBUG_MODE profile option.

Tables Accessed

The package reads and writes the core intercompany invoicing tables, referenced through APPS synonyms:

  • PA_DRAFT_INVOICES — the header record for the draft invoice being cancelled; the procedure identifies and validates the invoice here.
  • PA_DRAFT_INVOICE_DETAILS — the invoice lines; the procedure removes or rebuilds these detail rows and uses a pa_draft_invoice_details%rowtype structure to process them line by line.
  • PA_DRAFT_INVOICE_ITEMS — the linkage between draft invoice details and the expenditure items they bill; cleared so items are no longer tied to the cancelled invoice.
  • PA_EXPENDITURE_ITEMS — the project cost transactions; updated to release them from the cancelled invoice and make them eligible for re-invoicing.
  • PA_PROJECTS — the project definition, used to resolve and validate the project context supplied in P_PROJECT_ID.

Usage Notes

PA_IC_INV_CNL is an internal utility rather than a standalone concurrent program. It is typically invoked from the Oracle Projects intercompany invoicing forms, from concurrent programs that manage intercompany invoice generation and reprocessing, or from corrective scripts and custom extensions that must undo a draft intercompany invoice. Because the package performs irreversible data revisions on both invoice and expenditure records, it should be called within a controlled transaction with the project identifier and draft invoice number validated by the caller. The ETRM metadata records no dependent packages that call it, so its invocations are expected to originate from the Projects application UI, concurrent processing, or bespoke code. Debug output can be enabled by setting the PA_DEBUG_MODE profile option, which is useful when diagnosing cancellation failures in a development environment.