Search Results call_calc_bill_amount




Overview

PA_BILLING is the core Oracle Projects billing engine package in Oracle E-Business Suite, residing in the APPS schema and defined with AUTHID CURRENT_USER. It encapsulates the PL/SQL logic that drives the generation of draft invoices for project billing, coordinating the interaction between billing assignments, agreements, events, expenditures, and the draft invoice tables. The package is invoked by the Billing Generation process responsible for producing invoice and revenue records that ultimately flow to Oracle Receivables and Oracle General Ledger.

The package header is dated 2012 and carries the identifier PAXIBILS.pls, placing it in the 12.1.1 and 12.2.2 code lines. It maintains a package-level record type, GlobalVars, that holds the runtime context for a billing run, including project, task, billing assignment, request ID, accrual-through date, bill-through date, GL date, GL period, PA period, invoice set, and flags supporting multicurrency billing (MCB), retention enhancements, and revenue in foreign currency. A single instantiation, GlobVars, is exposed for callers to populate. Two package globals, G_ORG_ID and G_INV_NZ_LINES, support multi-org and negative-line handling introduced through bug fixes.

Key Procedures and Functions

  • GETINVOICENZ — returns the indicator controlling invoice negative-line behavior.
  • SETMASSGEN / GETMASSGEN — set and retrieve the mass generation flag used during batch billing.
  • GETPADATE, GETINVOICEDATE, GETGLDATE, GETGLPERIODNAME, GETPAPERIODNAME, GETBILLTHRUDATE — accessor functions returning the billing context dates and periods, many with RESTRICT_REFERENCES pragmas for purity.
  • GETBILLINGASSIGNMENTID, GETREQID, GETPROJID, SETPROJID, GETCALLPLACE, GETCALLPROCESS, GETBILLINGEXTENSIONID — accessors and mutators for the identifying attributes and calling context of the current billing invocation.
  • BILL_EXT_DRIVER — drives billing extension processing.
  • CCREV — supports revenue processing in the billing flow, including foreign currency revenue.
  • DELETE_AUTOMATIC_EVENTS — removes automatically generated events associated with billing, typically during regeneration.
  • CALL_CALC_BILL_AMOUNT — invokes bill amount calculation logic for the billing assignment.

Tables Accessed

The package reads and writes the principal Projects billing tables through APPS synonyms. PA_BILLING_ASSIGNMENTS, PA_AGREEMENTS_ALL, and PA_BILLING_EXTENSIONS provide the billing configuration and extension definitions. PA_EVENTS and PA_EVENT_TYPES supply the billable event and revenue event structures, while PA_CUST_EVENT_RDL_ALL and PA_CUST_EVENT_REV_DIST_LINES hold customer event revenue distribution detail. Expenditure input is read from PA_EXPENDITURE_ITEMS_ALL. Output and revenue records are written to PA_DRAFT_INVOICES, PA_DRAFT_INVOICES_ALL, PA_DRAFT_INVOICE_ITEMS, PA_DRAFT_REVENUES, PA_DRAFT_REVENUES_ALL, and PA_DRAFT_REVENUE_ITEMS. PA_IMPLEMENTATIONS provides installation-level settings.

Usage Notes

PA_BILLING is normally invoked indirectly by Projects billing concurrent programs and by the Billing Generation logic that populates GlobVars before calling the internal billing routines. It is referenced by 23 other packages, indicating its role as a shared billing library. Custom code should treat the documented functions as read-only accessors for the current billing context and avoid direct manipulation of the draft invoice and draft revenue tables, which remain the responsibility of the standard billing process.