35 Customizing Billing Care to Disable Links in the Bills Tab

This chapter describes how to customize Oracle Communications Billing Care to disable the Charges not related to services link and the link to child accounts in the Bills tab, My Charges area, and Payment Details dialog box.

About Disabling Link to Child Accounts

By default, Billing Care displays the link to child accounts in the Bills tab, My Charges area, and Payment Details dialog box to navigate to the child accounts and the Charges not related to services link in the My Charges area to view the account-level charges.

However, you can customize Billing Care to disable these links displayed in the parent account by using the Billing Care SDK.

Disabling Links in the Bills Tab

You can customize Billing Care using the Billing Care SDK to disable the following:

  • Link to the child accounts in the Bills tab and Payment Details dialog box.

  • Charges not related to services link in the My Charges area in the Bills tab.

To customize Billing Care to disable links in the Bills tab:

  1. Create a custom ResourceType and Resource in the OES server for disabling links. For example, BillsResourceType, BillsResource.

  2. Define the corresponding action for the custom ResourceType in the OES server.

    You can specify Reason ID as the action name when you define the actions.

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

    <keyvals> 
    <key>authorizationResourceTypes</key> 
    <value>BillsResourceType</value> 
    <desc>Add comma separated OES Resource Types(values) for authorization. 
    Also these resource types should be defined in OES. 
    Please note that the key should not be changed here. 
    </desc> 
    </keyvals>
    
  4. Create custom view models containing overrides to hide the link in the Bills tab. See "Creating the Custom Event Adjustment View Model" 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, Charges, and Payment Detail 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 the Custom Event Adjustment View Model

Billing Care uses view model to define the display of the Bills tab, My Charges area, and Payment Details dialog box. You must create or update the custom view models, CustomPaymentDetailsViewModel , CustomBillDetailsViewModel, and CustomBillChargesViewModel, containing overrides to disable Charges not related to services link and link to child accounts in these screens.

See "About View Models" for more information about Billing Care view models.

To create custom view models to disable links in the Bills tab:

  1. Create or update the customPaymentDetailsViewModel.js , customBillDetailsViewModel.js , and customBillChargesViewModel.js files in myproject/web/custom/viewmodels directory, where myproject is the folder containing your NetBeans IDE project.

  2. To disable link to child accounts, do the following:

    1. Add the following code in the customPaymentDetailsViewModel.js file using a text editor:

      define(['jquery', 'knockout', 
          'viewmodels/payment/allocations/PaymentDetailsViewModel' ],         function($, ko, PaymentDetailsViewModel) { 
                  function customPaymentDetailsViewModel() { 
                      PaymentDetailsViewModel.apply(this, arguments); 
                      $(function() { 
                          var myVar = setInterval(function() { 
                              if ($("strong:contains(Associated to)").length > 0) 
                              { 
                                  if 
      (!util.isGrantedResourceAction("parentAccountLink", "customResource")){ 
                                     $("strong:contains(Associated 
      to)").each(function() { 
                                          $(this).next().off("click"); 
                                      }); 
                                  } 
                                  clearInterval(myVar); 
                              } 
                          }, 20); 
                      }); 
                  } 
           customPaymentDetailsViewModel.prototype = new
       PaymentDetailsViewModel(); 
                  return  customPaymentDetailsViewModel; 
              }); 
      
    2. Save the file in your NetBeans IDE project.

    3. Add the following code in the customBillDetailsViewModel.js file using a text editor:

      define(['jquery', 'knockout', 
          'viewmodels/billtab/BillDetailsViewModel' 
      ], 
              function($, ko, BillDetailsViewModel) { 
                  function customBillDetailsViewModel() { 
                      BillDetailsViewModel.apply(this, arguments); 
                      $(function() { 
                          var myVar = setInterval(function() { 
                              if ($("a#childAccountLink").length > 0) 
                              { 
                                  if 
      (!util.isGrantedResourceAction("parentAccountLink", "customResource")) { 
                                     
       $("a#childAccountLink").each(function(index) 
      {                                     $(this).off("click"); 
                                      }); 
                                  } 
                                  clearInterval(myVar); 
                              } 
                          }, 20); 
                      }); 
                  } 
                  customBillDetailsViewModel.prototype = new 
      BillDetailsViewModel(); 
                  return  customBillDetailsViewModel; 
              }); 
      
    4. Save the file in your NetBeans IDE project.

    5. 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) 
                              { 
      
                                if
       (!util.isGrantedResourceAction("parentAccountLink", "customResource")) { 
                                      if ($("a#parentAccountLink").length > 0) {
                                           $("a#parentAccountLink").off("click"); 
                                     });  
                                  } 
                                  clearInterval(myVar); 
                              } 
                          }, 20); 
                      }); 
                  } 
                  customBillChargesViewModel.prototype = new 
      BillChargesViewModel(); 
                  return  customBillChargesViewModel; 
              }); 
      
    6. Save the file in your NetBeans IDE project.

  3. To disable Charges not related to services link in the My Charges area, do the following:

    1. Update the code in the customBillChargesViewModel.js file using a text editor as shown below:

      define(['jquery', 'knockout', 
          'viewmodels/billtab/BillChargesViewModel' 
      ], 
          
          function($, ko, BillChargesViewModel) { 
                  function customBillChargesViewModel() { 
                      BillChargesViewModel.apply(this, arguments); 
                      $(function() { 
                          var myVar = setInterval(function() { 
                              if ($('#adjustbillListMenu').length > 0 ||
       $("a#parentAccountLink").length > 
      0)  
                              { 
      
                                if
       (!util.isGrantedResourceAction("parentAccountLink", "customResource")) {
                                       if ($("a#parentAccountLink").length > 0) {
                                           $("a#parentAccountLink").off("click"); 
                                     });  
                                  } 
                                  clearInterval(myVar); 
                              } 
                          }, 20); 
                      }); 
                      $(function() {
                           var myVar = setInterval(function() { 
                              if ($('#accountChargesHeader').length > 0 )
                               { 
                              if (!util.isGrantedResourceAction("otherCharges", "customResource")){ 
                                          $('#accountChargesHeader').remove(); 
                                          $('#accountCharges').remove(); 
                                      } 
                                          clearInterval(myVar);
                                       } 
                                  }, 40);
       
                              }); 
                               
                      $(function() { 
                          var myVar = setInterval(function() { 
                              if ($('#otherAccountChargesHeader').length > 0 ) 
                                      { 
                              if (!util.isGrantedResourceAction("otherCharges", "customResource")){ 
                                          $('#otherAccountChargesHeader').remove(); 
                                          $('#otherAccountCharges').remove(); 
                                      }       
                                          clearInterval(myVar); 
                                      } 
                                  }, 40); 
                              }); 
                  } 
                  customBillChargesViewModel.prototype = new 
      BillChargesViewModel(); 
                  return  customBillChargesViewModel; 
              }); 
      
    2. Save the file in your NetBeans IDE project.

    3. Add the following code in the customBillDetailsViewModel.js file using a text editor:

      self.openChildAccount = function(data, event) { 
                          if (!util.isGrantedResourceAction("parentAccountLink", "customResource")) { 
                              return false; 
                          } 
                          self.__proto__.openChildAccount(data, event); 
                      }; 
      
    4. Save the file in your NetBeans IDE project.

Configuring Custom Bill, Charges, and Payment Detail View Models in the Registry

After creating or updating the CustomPaymentDetailsViewModel , CustomBillDetailsViewModel, and CustomBillChargesViewModel view models, create the custom view model entries in the customRegistry.js file to use the custom view models when displaying bill, charges, and payment details. Billing Care uses the custom bill tab, bill charges, and payment details view models instead of the default entries when displaying the bills, charges, and payment details.

To create the bill tab, bill charges, and payment details view model entries in the registry:

  1. Create a customRegistry.js file in myproject/web/custom.

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

    billTab: {
            
            billChargesViewModel:
    'custom/js/viewmodel/customBillChargesViewModel.js'
            
            billDetailsViewModel: 
    'custom/js/viewmodels/CustomBillDetailsViewModel.js' 
        }
     
     allocatePaymentDetails: { 
            viewmodel: 'custom/js/viewmodels/CustomPaymentDetailsViewModel.js' 
        } 
    
  3. Save the file in your NetBeans IDE project.