21 Restricting Debit and Credit Event Adjustment Options

Learn how to customize Oracle Communications Billing Care to restrict debit and credit adjustment options in the Event Adjustment dialog box based on user roles.

Topics in this document:

About Debit and Credit Event Adjustments

To perform debit or credit event adjustments, you enter the adjustment amount in the Adjustment field in the Event Adjustment dialog box. For credit adjustment, you enter a positive amount or percentage. For debit adjustment or to increase the amount due, you enter a negative amount. You can restrict the debit or credit event adjustments based on user roles by customizing Billing Care using the SDK and OPSS policies.

Restricting Debit and Credit Adjustment for Events

You can customize the Event Adjustment dialog box using OPSS policies to restrict the debit and credit adjustment options for events based on user roles.

To customize debit and credit adjustment options in the Event Adjustment dialog box:

  1. Define a new ResourceType in the OPSS Server. For example, AdjustmentActionResourceType.
  2. Define the debit and credit options as corresponding actions for the ResourceType in the OPSS Server.
  3. Add the new ResourceType to the CustomConfigurations.xml file. For example:
    <keyvals> 
    <key>authorizationResourceTypes</key> 
    <value>AdjustmentActionResourceType</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>
  4. Create a custom view model to define the display of Event Adjustment dialog box. See "Creating a Custom View Model for Restricting Debit and Credit Adjustments" for more information.
  5. Create a customRegistry.js file to configure Billing Care to use the custom view model that you created. See "Configuring the Custom View Model for Debit and Credit Adjustments" 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 a Custom View Model for Restricting Debit and Credit Adjustments

Billing Care uses view model to define the display of the screens in Billing Care. You must create or update the custom view model, CustomEventAdjustmentViewModel, and add the details containing the logic to check if the adjustment is a debit or credit adjustment and determine if that adjustment is allowed for the specific user role.

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

To create a custom model for customizing debit and credit event adjustment options:

  1. Create or update the customEventAdjustmentViewModel.js file in myproject/web/custom/viewmodels directory, where myproject is the folder containing your NetBeans IDE project.
  2. Add the following code in the customEventAdjustmentViewModel.js file using a text editor:
    define(['jquery', 'knockout', 
        'viewmodels/ARActions/adjustments/EventAdjustmentViewModel' 
    ], 
            function($, ko, EventAdjustmentViewModel) { 
    
                function customEventAdjustmentViewModel() { 
                    EventAdjustmentViewModel.apply(this, arguments); 
                    self = this; 
                    self.isValid = function () { 
                        var actionName; 
                        if (self.adjustmentAmount().indexOf(')') > -1) 
                            actionName = "Debit"; // write debit action name 
    created in OPSS 
                        else 
                            actionName = "Credit";  // write credit action name 
    created in OPSS 
                        if (self.note.isValid() && self.validator && 
    self.validator.form()) { 
    //Write resourcename which include credit and debit actions 
                            if (!util.isGrantedResourceAction(actionName, 
    "customResource")) 
                            { 
                                alert(actionName + " adjustment is not allowed"); 
                                return false; 
                            } 
                            return true; 
                        } 
    
    
                        return false; 
                    }; 
                } 
                customEventAdjustmentViewModel.prototype = new EventAdjustmentViewModel(); 
                return  customEventAdjustmentViewModel; 
            }); 
  3. Save the file in your NetBeans IDE project.

Configuring the Custom View Model for Debit and Credit Adjustments

After creating or updating the required custom view model, ensure that the custom event adjustment view model entry is created in the customRegistry.js file. Billing Care uses the custom event adjustment view model instead of the default event adjustment view model during adjustments and renders the Event Adjustment dialog box containing your customization.

To create the custom event adjustment view model entry in the registry:

  1. Create a customRegistry.js file in myproject/web/custom/ directory.
  2. Define the custom event adjustment view model in this file. For example:
    eventAdjustment: { 
           viewmodel: 'custom/viewmodels/customEventAdjustmentViewModel.js' 
       } 
  3. Save the file in your NetBeans IDE project.