8 Generating Invoices

Learn how to generate invoices in Oracle Communications Billing and Revenue Management (BRM).

Topics in this document:

To customize how invoices are generated, use the PCM_OP_INV_POL_POST_MAKE_INVOICE and PCM_OP_INV_POL_PREP_INVOICE opcodes. See "Invoice Opcode Workflows" in BRM Opcode Guide.

Generating Invoices Automatically

Typically, you generate invoices automatically as part of running the pin_bill_day billing script. This script runs several utilities, including pin_inv_accts, the invoicing utility. For more information on pin_bill_day, see "Running the Billing Scripts" in BRM Configuring and Running Billing.

If you configured BRM to use a separate database schema for invoices, pin_inv_accts uses dm_invoice to store invoices in the separate schema. See "Storing Invoices in a Separate Database Schema".

Generating Invoices Manually

To generate invoices manually:

  1. Run the other billing utilities.

    For information about the other utilities, see "About the Billing Utilities" in BRM Configuring and Running Billing.

  2. (Optional) To store invoices in their own database schema, follow the procedures in "Storing Invoices in a Separate Database Schema".

  3. Go to a directory with a valid invoicing configuration file. See "Connecting BRM Utilities" in BRM System Administrator's Guide.

  4. Run pin_inv_accts and specify any necessary parameters. For example, to generate detailed invoices for bills that have the summary flag set, use the -detail parameter.

    Note:

    If bill suppression is enabled on an account that has a paying parent bill unit and the nonpaying bill unit threshold of an account that owns the corresponding nonpaying child bill unit is exceeded, invoicing fails. This occurs because nonpaying child bill units, which use the bill number of their paying parent bill unit, are generated even when billing for the parent bill unit is suppressed. In such cases, they do not contain bill numbers, which invoices require. To exclude invoicing for these bills, run pin_inv_accts with the -skip_blank_billnos parameter. (Nonpaying child bill units contain bill numbers only when their paying parent bill unit is billed.) See "Invoicing for Hierarchical Bill Units".

For more information on the syntax and parameters for pin_inv_accts, see "pin_inv_accts".

Generating Detailed Invoices from an External File

To generate detailed invoices from bills contained in an external file, run pin_inv_accts with the -file parameter:

pin_inv_accts -file filename

The file contents must be in pin_flist format. For example:

0 PIN_FLD_RESULTS      ARRAY [0]
1   PIN_FLD_POID        POID [0] 0.0.0.1 /bill 26011 0
0 PIN_FLD_RESULTS      ARRAY [1]
1   PIN_FLD_POID        POID [0] 0.0.0.1 /bill 26091 0

For more information, see "About Formats for Storing Invoices".

This operation overwrites the PIN_FLD_INVOICE_OBJ value in the /bill object.

Note:

When pin_inv_accts processes bills for parent accounts in account hierarchies, it searches BRM for the nonpaying child bill units whose paying parent bill units are owned by the parent accounts and generates their invoices automatically. In general, the file should not contain the bills for nonpaying bill units; however, if they are present, invoices for the nonpaying bill units are generated.

Generating Invoices for Non-Invoice Payment Methods

To generate invoices for non-invoice payment methods, run pin_inv_accts with the -pay_type parameter:

pin_inv_accts -pay_type payment_method_ID

where payment_method_ID is the element ID of the payment method.

For a list of payment methods and their element IDs, see "Default Payment Methods" in BRM Configuring and Collecting Payments.

For example, to generate invoices for credit cards, run the utility with the following command:

pin_inv_accts -pay_type 10003

Note:

This generates detailed invoices. To generate summary invoices, customize the PCM_OP_INV_POL_SELECT policy opcode to pass the summary value in the PIN_FLD_FLAGS field on its input flist (PIN_FLD_FLAGS = 0x0002). You can also run pin_inv_accts with -summary parameter to generate summary invoices. See "Invoice Opcode Workflows" in BRM Opcode Guide for more information.

Exporting Invoices

You can export the invoices in your database to files in any of these formats: pin_flist, XML, HTML, or DOC1.

Note:

If you use DOC1 invoice software, you can export BRM invoices in DOC1 format and then open them in the DOC1 program.

To export invoices to files:

  1. Change to a directory with a valid invoicing configuration file, for exampleBRM_home/apps/pin_inv. See "Connecting BRM Utilities" in BRM System Administrator's Guide.

  2. Open the pin.conf file and find the pin_inv_export entries.

    1. If you are exporting to a format other than pin_flist, edit the invoice_fmt entry. Enter one of the following that corresponds to the format you want to use for the invoice files:

      • text/pin_flist

      • text/xml

      • text/html

      • text/doc1

      For example, to create HTML invoice files, enter:

      - pin_inv_export  invoice_fmt text/html

      If you do not edit this entry, pin_inv_export creates files in pin_flist format.

    2. In the export_dir entry, enter the directory in which to store the files. You can enter a complete path or a path relative to the directory where you run pin_inv_export:

      - pin_inv_export  export_dir ./invoice_dir 
  3. To export summary invoices for regular bills only, run the pin_inv_export utility with no parameters:

    pin_inv_export

    This creates a separate file for each regular invoice in the database.

  4. To export regular invoices for a specified date range:
    pin_inv_export -start startDate -end endDate
    See "pin_inv_export" for more information about how to use these parameters.
  5. To export summary invoices for trial bills only, run the following command:

    pin_inv_export -verbose -trial
  6. To export detailed invoices for both trial and regular bills, run the following command:

    pin_inv_export -verbose -detail filename

    where filename is the name of the file that specifies the bills for which invoices are to be generated.

Note:

  • When invoices for parent paying accounts are exported, and the invoices for the nonpaying bills were not consolidated into the paying account's invoice, a separate invoice file for each nonpaying bill unit and the paying bill unit is exported.

    The file-naming convention is accountPOID_billPOID_date.ext.

    If a nonpaying invoice or parent invoice fails during generation, nonpaying invoices are not exported.

  • To determine which invoice file is the parent account invoice, customize the appropriate invoice format policy opcode to generate another file containing the parent invoice file name for a given bill.

  • You cannot use the -detail parameter to export detailed invoices for only regular bills or only trial bills.

For a description of this utility's syntax and parameters, see "pin_inv_export".