The draft usage rating enables you to see the forecasted billable amount for the submitted usage inputs before you actually rate them.

This helps you to

  • Edit the quantity, add more inputs, etc., before you perform the actual rating. 
  • Use this amount as a source for your Revenue Forecast requirements.

 Once you are comfortable with the draft computed data, you can process them to get the rated amount. 

Processing Draft Usage Rating

You can process a single usage input from the Usage Input Detail page, or process multiple usage inputs from the list view, by running a batch job, or by calling an API.

Single Usage Input

  1. Go to the Usage Input Detail page.
  2. Click the (Draft) Process Usage Input button to display the (Draft) Calculate Rated Amount page, which shows the message, "Usage Input can be draft computed only if it has a status Loaded. The current status is Loaded."
  3. Click Process.
    The Usage Input Detail page opens, showing the forecasted amount against the (Draft) Rated Amount field. 

    The Status of the draft processed Usage Input remains as Loaded.




The Usage Inputs related lists are updated with the new usage inputs and corresponding (Draft) Rated Amount.

Input idAsset No.StatusQuantityRated AmountUasge DateProduct UOM(Draft) Rated Amount
IN-00007052akdsjsLoaded20.00
6/5/2023EachUSD 4000.00
IN-00007053akdsjsLoaded10.00
7/8/2023EachUSD 2000.00

The (Draft) Rated Quantity and (Draft) Fee Amount are updated on the Usage Schedule.

Schedule idFee AmountBilling ScheduleActual QuantityPeriod Start DatePeriod End DateStatusType(Draft) Rated Quantity(Draft) Fee Amount
US-00008316USD 0.00BS-013118200.006/1/20236/30/2023Pending BillingUsage20.00USD 4000.00
US-00008317USD 0.00BS-013118210.007/1/20237/31/2023Pending BillingUsage10.00USD 2000.00


Once you are satisfied with the forecasted values in the above-mentioned fields you can process the usage input.

Click Process Usage Input. The forecasted amount is rated and updated in the Rated Amount field. The corresponding billing schedule reflects the rated amount as the fee amount to be billed.

Multiple Usage Inputs

You can submit multiple usage inputs that are in Rated or Loaded status for draft rating.

Restriction

  • For multiple usage inputs, every time a set of usage inputs are processed they will be honored as fresh usage inputs and only the rated amount for those set of usage inputs will be forecasted and posted on the Usage Schedule. The old forecasted data on the Usage Schedule will be overwritten by the next forecast run. 

You must process ALL the usage inputs of the same asset line item at once. If partial usage inputs are processed then the output data will be incorrect.

Through the usage input list view

You can process multiple usage inputs at once from the UI list view. 

  1. Create a list view of the usage inputs.
  2. Click the "select all" checkbox above the usage inputs. For example, if an asset line item has 500 usage inputs, with 100 in Rated status, 150 Draft-Rated, and the remaining yet to be Draft-Rated, you must select all the usage inputs of this asset line item for draft rating.
    The system processes all the usage inputs that are in Loaded status and ignores the ones in Rated status.

    As the number of usage inputs increases with time, you must select all the usage inputs for draft rating them

  3. Click (Draft) Process Usage Input(s) to raise the Process Usage Rating page showing the message "Usage inputs with status as Loaded will be draft computed" and the list of usage inputs to be processed.
  4. Click Process Usage Input.
    The Usage inputs list view opens showing the rated amount updated in the (Draft) Rated Amount field.
  5. The draft-rated usage inputs remain in the Loaded status, even after processing. The draft amount is updated in the (Draft) Rated Amount field. Check the (Draft) Rated Amount field to learn if the processing is successful. If required, you can edit the data of the draft computed usage inputs and re-submit them for processing. 

The (Draft) Rated Quantity and (Draft) Fee Amount fields are updated on the Usage Schedule. The Usage Inputs related lists are updated with the new usage inputs and corresponding (Draft) Rated Amount.

Once you are satisfied with the forecasted values in the above-mentioned fields you can process the usage input. Click Process Usage Input. The forecasted amount is rated and updated in the Rated Amount field. The corresponding billing schedule reflects the rated amount as the fee amount to be billed.

By executing a Batch Job

You can run a batch job to draft rate usage inputs that are in Loaded status.

You can schedule the call from the Schedule Apex button on the Apex Classes page or using the following cron expression.

Apttus_Billing.DraftUsageRatingJob job = new Apttus_Billing.DraftUsageRatingJob();
String cronExpression = ‘0 0 0 ? * * *’;
System.schedule(‘Draft Rating Job’, cronExpression, job);
CODE

You get the following results by passing different parameters.

ParameterResult

Apttus_Billing.DraftUsageRatingJob job = new Apttus_Billing.DraftUsageRatingJob(); Database.executeBatch(job);


If you run the batch job without any parameters, then it processes all draft usage inputs of the org. You will be notified when processing is complete.

Set<Id> usageIds = new Set<Id>();
Set<Id> aliIds = new Set<Id>{'a093m00001ocy2I', 'a093m00001octXV', 'a093m00001nvtW4'};
for(Apttus_Billing__UsageInput__c ui : [Select Id From Apttus_Billing__UsageInput__c Where Apttus_Billing__AssetLineItemId__c IN: aliIds]){
	usageIds.add(ui.Id);
}
Apttus_Billing.DraftUsageRatingJob job = new Apttus_Billing.DraftUsageRatingJob(usageIds, null);
Database.executeBatch(job);
CODE
Process selected draft usage inputs. You must pass all the usage input IDs pertaining to one or more asset line items. You will be notified when processing is complete.
Set<Id> aliIds = new Set<Id>{'a093m00001ocy2I', 'a093m00001octXV', 'a093m00001nvtW4'};
Apttus_Billing.DraftUsageRatingJob job = new Apttus_Billing.DraftUsageRatingJob(null, aliIds);
Database.executeBatch(job);
CODE
Process draft usage inputs of selected asset line item IDs. It processes all the usage inputs pertaining to the asset line item IDs. You will be notified when processing is complete.

On completion of the batch job, the (Draft) Rated Quantity and (Draft) Fee Amount fields are updated on the usage schedule. The usage inputs related lists are updated with the new usage inputs and corresponding Rated Amounts.

Once you are satisfied with the forecasted values in the above-mentioned fields you can process the usage input. The old forecasted data will be overwritten by the next forecast run. 

By calling an API

You can draft rate usage inputs in bulk by calling the draftPendingUsageInput API. This API supports processing 1000 usage inputs in the synchronous mode. The API gives no response about the result of processed or errored-out usage inputs. If the usage inputs are processed in batch mode, an email containing processed usage input information is sent to the user. If the usage inputs are processed synchronously then the user can verify the result by looking into individual usage input records.

There are four different flavors of this API.


ParameterResult

Apttus_Billing.BillingService.draftPendingUsageInput();


If you do not pass any parameter and call this API, it runs in batch mode and draft rates all the usage inputs present in the system. You will be notified when processing is complete.

Apttus_Billing.BillingService.draftPendingUsageInput(Set<Id> usageInputIds);


This API processes the specified usage inputs in batch mode. You must pass all the usage input IDs pertaining to one or more asset line items. You will be notified when processing is complete.

Apttus_Billing.BillingService.draftPendingUsageInput(Set<Id> usageInputsIds, Boolean processSynchronously);


This API processes the specified usage inputs either in batch mode or synchronously, depending on the flag value. You will get no email notification when the processing is complete.

Apttus_Billing.BillingService.draftPendingUsageInputRelatedToALIs (Set<Id> assetLineItemIds);


This API processes all usage inputs of specified asset line items in batch mode. You will be notified when processing is complete.

The (Draft) Rated Quantity and (Draft) Fee Amount are updated on the Usage Schedule. The Usage Inputs related lists are updated with the new usage inputs and corresponding (Draft) Rated Amount.

Once you are satisfied with the forecasted values in the above-mentioned fields you can process the usage input. You can call the API to Process Usage Input. The forecasted amount is rated and updated in the Rated Amount field. The corresponding billing schedule reflects the rated amount as the fee amount to be billed.

Effect of Asset Amendment on Forecasted Usage Input

The forecasted usage inputs are vulnerable to asset amendments. If you amend the asset line item, the billing schedules and usage schedules are superseded and new billing schedules are created with Pending Billing status. The values in the (Draft) Rated Amount and Rated Amount fields are reset to zero for the usage inputs.

Let us understand this effect with the help of an example.

Example:

Suppose you are a billing administrator of a company selling computer hardware 'Internet Plans’ and you have already invoiced the customer. The details are summarized in the following table:

Start Date

End Date

First Billing Date

Selling Frequency

Billing Frequency

Price Type

List Price

TCV

1/1/202312/3/20231/1/2023YearlyHalf YearlyUsageUSD 100USD 0.00

Define tire prices as follows:

0-20 = 200

21-40 = 400

Define usage inputs for the dates

6/5/2023 - 20 quantity

7/8/2023 -10 quantity and draft rate them.

Initiate billing, you will get the following results:

Billing will generate the billing schedules as follows:

Billing Schedule ID

Period Start Date

Period End Date

Fee Amount

Ready for Invoice Date

Type

Status

BS-0011/1/20236/31/2023$0.007/1/2023ContractedPending Billing
BS-0027/1/202312/3/2023$0.001/1/2024ContractedPending Billing

The Usage Inputs related lists are updated with the new usage inputs and corresponding (Draft) Rated Amount.

Input idAsset No.StatusQuantityRated AmountUasge DateProduct UOM(Draft) Rated Amount
IN-00007052akdsjsLoaded20.00
6/5/2023EachUSD 400.00
IN-00007053akdsjsLoaded10.00
7/8/2023EachUSD 200.00

The (Draft) Rated Quantity and (Draft) Fee Amount are updated on the Usage Schedule.

Schedule idFee AmountBilling ScheduleActual QuantityPeriod Start DatePeriod End DateStatusType(Draft) Rated Quantity(Draft) Fee Amount
US-00008316USD 0.00BS-013118200.006/1/20236/30/2023Pending BillingUsage20.00USD 400.00
US-00008317USD 0.00BS-013118210.007/1/20237/31/2023Pending BillingUsage10.00USD 200.00

Amend the asset line. You will get the following results:

  • Existing billing schedules are superseded and new billing schedules are created with Pending Billing status.
  • Draft rated Amount of all the existing usage inputs is set to zero.
  • Existing Usage schedule Draft Fee Amount will remain as it is. New schedules that are created will not have any Draft Fee Amount.

Existing billing schedules are superseded and new billing schedules are created with Pending Billing status as shown:

Billing Schedule ID

Period Start Date

Period End Date

Fee Amount

Ready for Invoice Date

Type

Status

Superseded

BS-013118201/1/20236/31/2023$0.007/1/2023ContractedSupersededYes
BS-013118217/1/202312/3/2023$0.001/1/2024ContractedSupersededYes
BS-013118221/1/20236/31/2023$0.007/1/2023ContractedPending Billing
BS-013118237/1/202312/3/2023$0.001/1/2024ContractedPending Billing

Draft rated Amount of all the existing usage inputs is set to zero.

Input idAsset No.StatusQuantityRated AmountUasge DateProduct UOM(Draft) Rated Amount
IN-00007052akdsjsLoaded20.00USD 0.006/5/2023EachUSD 0.00
IN-00007053akdsjsLoaded10.00USD 0.007/8/2023EachUSD 0.00

Existing Usage schedule Draft Fee Amount will remain as it is. New schedules that are created will not have any Draft Fee Amount as shown:

Schedule idFee AmountBilling ScheduleActual QuantityPeriod Start DatePeriod End DateStatusType(Draft) Rated Quantity(Draft) Fee AmountSuperseded
US-00008316USD 0.00BS-013118200.006/1/20236/30/2023SupersededUsage20.00USD 400.00Yes
US-00008317USD 0.00BS-013118210.007/1/20237/31/2023SupersededUsage10.00USD 200.00Yes
US-00008318USD 0.00BS-013118220.006/1/20236/30/2023Pending BillingUsage


US-00008319USD 0.00BS-013118230.007/1/20237/31/2023Pending BillingUsage


Hence, if you amend the asset line item, the associated usage inputs are reset to zero.