16 Customizing Billing Care Invoice Presentation

This chapter provides an overview of customizing how Oracle Communications Billing Care retrieves and presents invoices for display.

About Billing Care Invoice Presentation

Billing Care retrieves invoices from external invoice repositories, such as Oracle Business Intelligence Publisher (BIP), and displays the supported invoice formats (for example, PDF and html) in the web browser. When a user views an invoice, Billing Care retrieves the invoice identifier for the active bill unit from Oracle Communications Billing and Revenue Management (BRM) and sends a request to the invoice repository to present the invoice document.

By default, BRM integrates with BIP for generating and storing PDF invoices of customer bill units retrievable in Billing Care. See "Designing and Generating Invoices in Oracle Business Intelligence Publisher 11g" in Oracle Communications Billing and Revenue Management Designing and Generating Invoices for more information on this integration.

Customizing Billing Care Invoice Presentation

Customize Billing Care invoice presentation in the following ways using the Billing Care SDK:

The Billing Care SDK includes sample invoice presentation customizations in the SDK_HOME/BillingCare_SDK/samples/InvoiceRepository directory, where SDK_home is the directory where you installed the SDK. Use the samples as guidelines for developing your own customizations.

Setting Up NetBeans IDE for Customizing Invoice Presentation

Customizing Billing Care invoice presentation requires overriding default view model (BillInvoiceViewModel.js) behavior and adding the custom JavaScript to the customizations shared library deployed to the Billing Care domain. See "About Billing Care Modules" for more information on how view models use JavaScript to perform functions.

See "Setting Up the Development Environment" for information on setting up NetBeans IDE. See "Packaging and Deploying Customizations" for more information on packaging and deploying your invoice presentation changes.

To customize Billing Care invoice presentation:

  1. Create a customModules.properties file in your myproject/web/WEB-INF/classes/custom/ directory, where myproject is your NetBeans IDE project containing your Billing Care customizations. This file will contain a reference to the location of the custom Java classes you create.

  2. Copy the default registry.js file from SDK_HOME/BillingCare_SDK/references to a custom registry file named customregistry.js in your myproject/web/custom directory, where myproject is your NetBeans IDE project containing your Billing Care customizations. This file contains the billInvoice module definition using your custom view model (JavaScript).

  3. Customize invoice presentation by creating the Java classes and necessary resources (JavaScript view model) as described in the following sections.

  4. Add your customization files to your NetBeans IDE project (myproject). Add new JavaScript to support your custom view model in the myproject/web/js/viewmodels/billinvoice directory.

  5. Right-click your NetBeans IDE project and select Clean and Build.

  6. Package and deploy your invoice presentation customizations to your Billing Care domain.

    For more information, see "Packaging and Deploying Customizations".

  7. Verify your changes in Billing Care.

Presenting Invoices in a Dialog Box

The default invoice presentation displays PDF invoices in an iframe (inline frame) within the active Billing Care browser window. Billing Care also supports presentation of invoices in a dialog box.

To present invoices in a dialog box:

  1. In a text editor, open your CustomConfigurations.xml file. This file contains configuration entries for Billing Care behavior. See "Creating a Custom Configuration File" for more information on creating a custom configuration file in your NetBeans IDE project.

  2. Set the value for the billinvoice.use.modaldialog flag to true as shown:

    <flags>
            <key>billinvoice.use.modaldialog</key>
            <value>false</value> 
            <desc>If value is true then displays the bill invoice in a modal
            dialog.</desc>
    </flags>
    
  3. Save the configuration file.

  4. Do one of the following:

    • If you are using an exploded archive for your shared library, log out of and back into Billing Care to see the new theme. See "About Using an Exploded Archive" for more information about using exploded archives.

    • Package your customizations shared library and deploy it to your Billing Care domain. Redeploy Billing Care and login to see the new theme. See "Packaging and Deploying Customizations" for more information on packaging and deploying your customizations.

  5. Verify your changes in Billing Care.

Retrieving Invoices from Third-Party Repositories

By default, Billing Care retrieves invoices from BIP. The logic to retrieve an invoice identifier for the active bill unit and request the PDF invoice from BIP are contained in the PCMBillModule class. This class contains the following methods:

  • getInvoicePDF(String id)

    Contains the code to invoke the worker method to retrieve Invoice ID and template name from bill Id passed from BRM.

  • runReport (String invoiceId,String templateName)

    This method is called from the getInvoicePDF method. It contains the code to retrieve the PDF invoice from BIP using the invoice id and template name by calling the BI Publisher web service.

To use an invoice repository other than BIP, override the getInvoicePDF and runReport methods in the PCMBillModule class.

The override implementation was depend on how your invoice repository's API for retrieving and sending invoices to external clients. A simple REST example is included in the SDK and includes:

  • A sample Java class (CustomPCMBillModule.java), which extends runReport to connect to a basic local invoice file system repository. This class is located in the SDK_HOME/BillingCare_SDK/samples/InvoiceRepository/rest/src/com/oracle directory.

  • A test resource Java class to use with CustomPCMBillModule.java, which provides a local file PDF for retrieval. This class is located in the SDK_HOME/BillingCare_SDK/samples/InvoiceRepository/TestResource/src/com/oracle directory.

To retrieve an invoice from a repository other than BIP:

  1. Create a CustomPCMBillModule.java file in the myproject/src/ directory, where myproject is your NetBeans IDE project containing your Billing Care customizations, to override the original PCMBillModule.

    Use the sample provided in the SDK as an example. Your implementation will depend on your invoice repository's API.

  2. Compile your custom classes using NetBeans IDE.

  3. Add your customization files to your NetBeans IDE project (myproject):

    • Add an entry in the customModule.properties in the myproject/web/WEB-INF/classes/custom folder to override the default billing module as follows:

      billingcare.rest.billing.module=com.company.modules.CustomPCMBillModule

      where company is the company name used in your myproject/src directory.

  4. Right-click your NetBeans IDE project and select Clean and Build.

  5. Package and deploy your invoice presentation customizations to your Billing Care domain.

    For more information, see "Packaging and Deploying Customizations".

  6. Verify your changes in Billing Care.