This chapter describes how to customize Oracle Communications Billing Care to support disabling of event adjustment options based on customer service representatives (CSRs) roles.
By default, the following options in the Event Adjustment dialog box are enabled and CSRs can select these options to adjust events:
Adjust amount and tax
Adjust amount only
Adjust tax only
CSRs can also backdate an adjustment if required. You can customize Billing Care using the SDK to disable the adjustment and backdate options based on the user roles.
You can customize the Event Adjustment dialog box using the SDK and Oracle Entitlements Server (OES) to disable or enable the event adjustment options.
To disable the event adjustment or backdate options in the Event Adjustments dialog box:
Define a new ResourceType and Resource for event adjustment options in the OES server. For example, EventAdjustmentResourceType, EventAdjustmentResource.
Define the following as corresponding actions for the ResourceType in the OES server as required:
AmountAndTax
AmountOnly
TaxOnly
backDateEventAdjustment
Associate the new Resource to the new ResourceType in the OES server.
Add the new ResourceType to the CustomConfigurations.xml file. For example:
<keyvals> <key>authorizationResourceTypes</key> <value>EventAdjustmentResourceType</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>
Create a custom view model to disable the options in the Event Adjustment dialog box based on the user role. See "Creating a Custom View Model for Disabling Adjustment Options" for more information.
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 Disabling Event Adjustment Options" for more information.
Deploy your customizations using one of the methods described in "Using an Exploded Archive during Customization" or "Packaging and Deploying Customizations".
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 to customize the display of event adjustment or backdate options in the Event Adjustment dialog box.
See "About View Models" for more information about Billing Care view models.
To create a custom model for disabling event adjustment or backdate options:
Create or update the customEventAdjustmentViewModel.js file in myproject/web/custom/viewmodels directory, where myproject is the folder containing your NetBeans IDE project.
To disable the amount and tax adjustment options based on the user role, add the following code in the customEventAdjustmentViewModel.js file using a text editor:
define(['jquery', 'underscore', 'knockout', 'knockout-mapping', 'viewmodels/ARActions/adjustments/EventAdjustmentViewModel' ], function ($, _, ko, komapping, EventAdjustmentViewModel) { function CustomEventAdjustmentViewModel() { EventAdjustmentViewModel.apply(this, arguments); $(function() { var myVar= setInterval(function() { if($('#lblAdjustAmountAndTax').length>0) { if(!util.isGrantedResourceAction('AmountAndTax','EventAdjustmentResource')) { $('#lblAdjustAmountAndTax').parent().hide(); } if(!util.isGrantedResourceAction('AmountOnly','EventAdjustmentResource')) { $('#lblAdjustAmountOnly').parent().hide(); } if(!util.isGrantedResourceAction('TaxOnly','EventAdjustmentResource')) { $('#lblAdjustTaxOnly').parent().hide(); } clearInterval(myVar); } }, 20); }); } customViewModel.prototype = new EventAdjustmentViewModel(); return CustomEventAdjustmentViewModel; });
To disable the backdate option based on the user role, 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); $(function() { var myVar1 = setInterval(function() { if ($('#eventAdjustmentEffectiveDate').length > 0) { if (!util.isGrantedResourceAction("backDateEventAdjustment", "customResource")) { $('#eventAdjustmentEffectiveDate').attr('disabled', true); $("#eventAdjustmentEffectiveDate").next("img").off("click") } clearInterval(myVar1); } }, 40); }); } CustomEventAdjustmentViewModel.prototype = new EventAdjustmentViewModel(); return CustomEventAdjustmentViewModel; });
Save the file in your NetBeans IDE project.
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:
Create a customRegistry.js file in myproject/web/custom/ directory.
Define the custom event adjustment view model entry in this file. For example:
eventAdjustment: { viewmodel: 'custom/viewmodels/customEventAdjustmentViewModel.js' }
Save the file in your NetBeans IDE project.