22 Customizing Billing Care to Display Only Event Adjustments

Learn how to customize Oracle Communications Billing Care to display only event adjustments in the Bills section for performing adjustments.

Topics in this document:

About Displaying Event Adjustments

By default, Billing Care display all the adjustment options, such as bill, item, and event, for performing adjustments. However, you can customize Billing Care to display only the list of event adjustment options and hide bill and item adjustment options by using the Billing Care SDK. This lets you perform only event adjustments for the selected account.

Customizing Billing Care to Display Only Event Adjustments

You can customize Billing Care using OPSS policies to display only event adjustments for performing adjustments.

To customize Billing Care to display only event adjustments:

  1. Create a custom ResourceType and Resource for event adjustments in the OPSS server. For example, AdjustmentResourceType, AdjustmentResource.

  2. Define Make as the corresponding action for the custom ResourceType in the OPSS server.

  3. Add the new ResourceType to the CustomConfigurations.xml file. For example:

            <key>authorizationResourceTypes</key> 
            <value>customResourceType</value> 
            <desc>Add comma separated OPSS Resource Types(values) for 
    authorization. 
                Also these resource types should be defined in OPSS. 
                Please note that the key should not be changed here. 
            </desc> 
        </keyvals> 
    

    See "Editing the Billing Care Configuration File" for customization of the configurations.xml file.

  4. Create custom view models containing overrides to hide bill and item adjustments. See "Creating Custom View Models to Display Only Event Adjustments" for more information.

  5. Create a customRegistry.js file configuring Billing Care to use the custom view models that you created. See "Configuring Custom Bill and Bill Item View Models in the Registry" for more information.

  6. Deploy your customizations using one of the methods described in "Using an Exploded Archive during Customization" or "Packaging and Deploying Customizations".

Creating Custom View Models to Display Only Event Adjustments

Billing Care uses view model to define the display of the Item Adjustment, Bill Adjustment, and Event Adjustment dialog boxes. You must create the custom view models, CustomBillItemChargesViewModel and CustomBillChargesViewModel, containing overrides to hide bill and item adjustments. See "About View Models" for more information about Billing Care view models.

To create custom view models to display only event adjustments:

  1. Create the customBillItemChargesViewModel.js and customBillChargesViewModel.js files in the myproject/web/custom/js/viewmodels directory, where myproject is the folder containing your NetBeans IDE project.
  2. Add the following code in the customBillItemChargesViewModel.js file using a text editor:
    define(['jquery', 'knockout', 
        'viewmodels/billMainPanel/BillItemChargesViewModel' 
    ], 
            function($, ko, BillItemChargesViewModel) { 
    
                function CustomBillItemChargesViewModel() { 
                    BillItemChargesViewModel.apply(this, arguments); 
                    self = this; 
                    self.showARActionMenu = function(data, event) { 
    
                         self.__proto__.showARActionMenu(data,event); 
         
                        // write custom action name and resource. Item adjustment 
    can be hide by not granting make permission to customResource. 
                        if (!util.isGrantedResourceAction("make", 
    "customResource")){ 
                            $("#billItemFlyoverNewAdjustment").hide(); 
                        } 
                    }; 
    
                } 
                CustomBillItemChargesViewModel.prototype = new 
    BillItemChargesViewModel(); 
                return  CustomBillItemChargesViewModel; 
            }); 
    
  3. Save the file in your NetBeans IDE project.
  4. Add the following code in the customBillChargesViewModel.js file using a text editor:
    define(['jquery', 'knockout', 
        'viewmodels/billtab/BillChargesViewModel' 
    ], 
            function($, ko, BillChargesViewModel) { 
                function customBillChargesViewModel() { 
                    BillChargesViewModel.apply(this, arguments); 
                    $(function() { 
                        var myVar = setInterval(function() { 
                            if ($('#adjustbillListMenu').length > 0) 
                            { 
    
                                // write custom action name and resource. Bill 
    adjustment 
                                //can be hide by not granting make permission to 
    customResource. 
                                if (!util.isGrantedResourceAction("make", 
    "customResource")) { 
                                   $('#adjustbillListMenu').remove(); 
    
                                     if 
    ($("#actionsmenu").next().children("li.ui-menu-item").length < 1) { 
                                     $("#actionsmenu").children("span").remove(); 
                                    } 
                                clearInterval(myVar); 
                            } 
                        }, 20); 
    
                    }); 
    
                } 
                customBillChargesViewModel.prototype = new 
    BillChargesViewModel(); 
                return  customBillChargesViewModel; 
            }); 
  5. Save the file in your NetBeans IDE project.

Configuring Custom Bill and Bill Item View Models in the Registry

After creating CustomBillItemChargesViewModel and CustomBillChargesViewModel view models, create custom view model entries in the customRegistry.js file to use when performing adjustments. Billing Care uses the custom bill tab view model and bill item charges view model instead of the default entries when rendering the Adjustments screen.

To create custom view model entries in a customRegistry.js file:

  1. Create a customRegistry.js file in myproject/web/custom by copying the reference registry file.

  2. Define the entries referencing the custom view models in this file. For example:

    billTab: { 
             
             
    billChargesViewModel:'custom/js/viewmodels/customBillChargesViewModel.js' 
             
        }, 
         
         billItemCharges: { 
             
            viewmodel: 'custom/js/viewmodels/customBillItemChargesViewModel.js' 
        } 
  3. Save the file in your NetBeans IDE project.