Enabling Bookkeeping Data for Unbilled Revenue
When billing subscriptions, the invoice creation may be "decoupled" from the subscription's service period for several reasons, like
- your AR team waits for a purchase order before issuing the invoice,
- your business usually issues invoices at the end of a service period, or
- a quarterly invoice run.
Your accounting, however, may still require bookkeeping data for those items before they are actually invoiced. To support this scenario, JustOn Billing & Invoice Management can generate preliminary bookkeeping data based on active subscriptions. This bookkeeping data is of the type Unbilled Revenue
.
When creating and finalizing the corresponding invoices, the existing subscription-based bookkeeping data is reverted. Consequently, the reverted bookkeeping data offsets the previous unbilled revenue. The actual revenue bookkeeping data for the invoice is generated in addition.
Data structure
Bookkeeping data is structured in booking periods and booking details, where booking periods represent bookkeeping months, and booking details represent the records in an accounting ledger.
Technically, booking periods and booking details are in a master-detail relationship.
A booking period represents one month in bookkeeping. Hence, it aggregates the booking details produced for this month. Booking periods are grouped by business entities.
Be aware that the booking period status finally decides the booking detail allocation:
- Open: A booking period with the status
Open
aggregates the booking details produced for this month. -
Closed: A booking period with the status
Closed
is ignored. Any booking details produced for this period are moved to the next open booking period.
Booking detail allocation with closed booking periods
Note
Make sure to establish business processes to close booking periods according to your requirements.
A booking detail represents a record in an accounting ledger. JustOn creates one booking detail per subscription item. Basically, it holds the same data as a booking detail produced from an invoice line item, except for
- Invoice
- Invoice Line Items
- Invoice No
These fields are not set since there is no invoice produced yet.
Booking details cannot be modified once they have been created.
Workflow
To create unbilled revenue bookkeeping data, JustOn provides the Unbilled Revenue Job. This job "simulates" a monthly invoice run, creating the unbilled revenue bookkeeping data based on subscriptions for each past month if there are no corresponding invoices yet. When started on 2021-10-01, for example, JustOn creates unbilled revenue bookkeeping data up to September.
With respect to the unbilled revenue bookkeeping data generation, be aware of the following specifics:
-
JustOn generates booking details for subscription items of the following types:
Recurring
,Recurring Prorated
,Recurring Prorated AVG
,One-Time
andMinimum Fee
.The following items are ignored: transactional items, one-time items without billing unit and billing period, and items without start time (or relevant subscription start time).
-
Unbilled revenue always produces two types of bookkeeping data:
Revenue
– to be booked on the usual revenue accountUnbilled Revenue
– to be booked on a dedicated receivables account
The produced booking details (of both types) are marked as preliminary, that is, the checkbox
Is Preliminary
is selected. -
For unbilled revenue, JustOn does not separate booking details for the account and the contra account.
-
Once the invoices are created and finalized, the subscription-based bookkeeping data is completely reverted, offsetting the previous bookings. This includes all unbilled revenue bookings that are created up to the invoice's service period end and that are not yet associated to an invoice.
The resulting reverse and reversed booking details are marked as
Reversal
(see Bookkeeping Data Reversal).The actual revenue bookkeeping data for the finalized invoice is generated in addition.
-
Unbilled revenue bookkeeping data is always created on a monthly base. That is, they may differ from the invoice bookkeeping data if you use longer (or shorter) billing periods or invoice run periods. JustOn makes sure, however, that the subscription-based bookkeeping data is properly reverted upon invoice finalization.
- For the simulated invoice run, JustOn ignores the lead time and the billing practice.
- If there is no unbilled revenue bookkeeping data for a subscription, JustOn creates the corresponding bookkeeping data from the subscription start up to the previous month.
- The start date is either the subscription start date, the earliest item start date (as long there is no item without start date) or the date of the last invoice created for the subscription. If none of these dates is available, the subscription is ignored.
- You can set account numbers or business partner account numbers for unbilled revenue bookkeeping data using a Collective Accounts custom setting of the type
Unbilled Revenue
. - You can control whether the bookkeeping data for a subscription is created or not using the custom field
CreateUnbilledRevenue
on the subscription, see Enabling Unbilled Revenue Creation on Subscription Basis. - For periods for which invoices have already been issued, JustOn does not generate subscription bookkeeping data.
JustOn stores the start date for the next booking detail generation in the Item field Next Booking Detail Start
. This field is used to determine the start date for generating new booking details when the bookkeeping data creation job is started.
When updating unbilled revenue data with existing invoices, Next Booking Detail Start
is set to the value of the Item field Next Service Period Start
(see Item-Specific Billing Periods).
If you cancel an invoice that has been created from a subscription, JustOn recreates the unbilled revenue data for the service period of the canceled invoice – up to the date set in Next Booking Detail Start
without changing it.
For more information about subscription bookkeeping data, see Bookkeeping Data for Unbilled Revenue.
Enabling Bookkeeping Data Generation
In order to enable the creation of bookkeeping data, the feature must be activated in the global settings.
-
Click to enter Setup, then open Custom Settings.
In Salesforce Lightning, navigate to Custom Code > Custom Settings.
In Salesforce Classic, navigate to Develop > Custom Settings.
-
Click Manage in the row of Global Settings.
- Click Edit in the Default row.
- Select the checkbox
Create Bookkeeping Data
. -
Click Save.
Once enabled, the subscription bookkeeping data is generated upon job execution.
Info
Once created, the booking details can no longer be modified or deleted.
Defining Collective Account for Unbilled Revenue
In order to allocate subscription-based booking data (unbilled revenue) to a specific bookkeeping account, you need a dedicated Collective Accounts setting.
-
Click to enter Setup, then open Custom Settings.
In Salesforce Lightning, navigate to Custom Code > Custom Settings.
In Salesforce Classic, navigate to Develop > Custom Settings.
-
Click Manage in the row of Collective Accounts.
- Click New.
-
Specify the information as necessary.
Field Required Description Name A unique name for the custom setting record, describes the purpose of the collective account.
JustOn recommends to use a descriptive name for the setting.Account Specifies the intended booking account number as given by the accounting system. Type Specifies the type of the collective account, directly corresponds to the type of the booking detail.
For unbilled revenue, setUnbilled Revenue
.Business Partner Account Specifies, if necessary, the intended business partner account number (contra account) as given by the accounting system. For more details, see Collective Accounts Concepts.
-
Click Save.
This creates the new collective account setting.
Configuring Unbilled Revenue Tax Handling
The global setting Unbilled Revenue Tax
controls the tax handling when generating unbilled revenue bookkeeping data. There are three options:
Option | Description |
---|---|
Net (or empty) |
Creates net booking details for both Unbilled Revenue and Revenue |
Gross |
Creates gross booking details for both Unbilled Revenue and Revenue |
Net+Tax |
Creates net booking details for Revenue and Tax , and gross booking details for Unbilled Revenue |
Depending on your requirements, you specify the appropriate option. This allows, for example, support for automatic accounts (Automatikkonten) in DATEV.
-
Click to enter Setup, then open Custom Settings.
In Salesforce Lightning, navigate to Custom Code > Custom Settings.
In Salesforce Classic, navigate to Develop > Custom Settings.
-
Click Manage in the row of Global Settings.
- Click Edit in the Default row.
- Specify the required option in the field
Unbilled Revenue Tax
. - Click Save.
Enabling Unbilled Revenue Creation on Subscription Basis
By default, JustOn creates unbilled revenue bookkeeping data for all active subscriptions. Certain circumstances may require, however, to exclude specific subscriptions. To support this scenario, you can create the custom checkbox CreateUnbilledRevenue
on the Subscription object. If configured, you use it to control whether the bookkeeping data for a subscription is created or not.
- Navigate to the fields list of the Subscription object.
-
Create the following new field.
API Name Data Type Description CreateUnbilledRevenue
Checkbox
Formula(Checkbox)Controls whether to include ( true
) or exclude (false
) the subscription on unbilled revenue data creation. Using a formula, you can apply custom logic to have the checkbox selected automatically when certain conditions are met.For help about creating fields, see Managing Object Fields.
-
Allow the users who execute the unbilled revenue job read access to the
CreateUnbilledRevenue
checkbox field by adding it to their assigned profiles or permission sets.For details, see Set Field Permissions in Permission Sets and Profiles in the Salesforce Help.
Once created, this checkbox controls whether to include or exclude the current subscription on unbilled revenue data creation.
Info
If the CreateUnbilledRevenue
checkbox is not available, JustOn creates unbilled revenue bookkeeping data for all subscriptions.
Scheduling Unbilled Revenue Job
To create unbilled revenue bookkeeping data based on subscriptions, you schedule the Unbilled Revenue Job.
The unbilled revenue job does not require additional parameters. That is, you can set up the job directly for the corresponding Apex class ScheduledSubscriptionBooking
. For details, see Scheduling Concepts.
Info
JustOn recommends to execute the unbilled revenue data creation as early as possible on the first day of each month.
To schedule the unbilled revenue job, you can use either JustOn's Scheduled Jobs page or Salesforce's Schedule Apex functionality. For details, see Scheduling a Job.
Via JustOn's Scheduled Jobs page:
-
Open the Scheduled Jobs page.
Use the following URL
https://login.salesforce.com/apex/ONB2__JobsSetup
, or, if you are already logged in, appendapex/ONB2__JobsSetup
to your org's domain name.You can access the Scheduled Jobs page via the JustOn configuration app ( > JustOn Configuration > Jobs Setup).
-
From the
Apex Job
drop-down list, selectUnbilled Revenue Job
.The
Job Name
field is automatically set toScheduledSubscriptionBooking
. -
From the
Start Time
drop-down list, select the preferred execution time. - Optionally, edit the displayed cron expression to adjust the execution time.
-
Click Schedule.
This sets up the unbilled revenue data generation to be executed at the specified time.
Info
From the Scheduled Jobs page, you can also run the job immediately.
Via Salesforce's Schedule Apex functionality:
-
Click to enter Setup, then open Apex Classes.
In Salesforce Lightning, navigate to Custom Code > Apex Classes.
In Salesforce Classic, navigate to Develop > Apex Classes.
-
Click Schedule Apex on top of the list.
-
Specify the details as required.
- Job Name
- Apex Class:
ScheduledSubscriptionBooking
- Frequency:
Weekly
orMonthly
(with an according weekday or day of month setting) - Start
- End
- Preferred Start Time
-
Click Save.
This sets up the unbilled revenue data generation to be executed at the specified time.
For more details about job scheduling, see Scheduling a Job in the JustOn documentation and Schedule Apex in the Salesforce Help.
Enabling Unbilled Revenue Update
Under certain circumstances, your business may require to update unbilled revenue bookkeeping data. This may be the case, for example, when the start date or the end date of an item has been changed. Ultimately, your business requirements determine based on which modifications to subscriptions or subscription items you must update the unbilled revenue bookkeeping data.
The update of the unbilled revenue bookkeeping data relies on the Unbilled Revenue Job. To perform the update, the job requires the dedicated checkbox UpdateUnbilledRevenue
on the subscription to be set. Depending on your business requirements, you can either have users select the checkbox manually, or create a custom flow to have it set automatically when certain conditions apply.
Configuring the update usually requires the following steps:
- Creating the checkbox
UpdateUnbilledRevenue
- Creating a flow to set the checkbox
Creating Update Checkbox
To trigger the bookkeeping data update, the Unbilled Revenue Job checks for the UpdateUnbilledRevenue
checkbox. You create this field on the Subscription object:
- Navigate to the fields list of the Subscription object.
-
Create the following new field.
API Name Data Type Description UpdateUnbilledRevenue
Checkbox If set true
, the Unbilled Revenue Job updates the preliminary bookkeeping data for the current subscription.
The checkbox is intended to be set by a Salesforce Flow or Salesforce Process.For help about creating fields, see Managing Object Fields.
Once created, this checkbox controls whether to update the preliminary bookkeeping data for the current subscription.
Creating Flow
You can either have users select the checkbox manually, or create a custom flow to have it set automatically when certain conditions apply. For example, you can have the flow triggered to set the checkbox UpdateUnbilledRevenue
when either the item start date or end date is modified, but not if the previous and new date values are in the future (because this does not require updating the existing bookkeeping data).
Note
Remember that your business requirements determine based on which modifications to subscriptions or subscription items you must update the unbilled revenue bookkeeping data. So the flow setup and the objects and fields to involve will vary.
- Click to enter Setup, then navigate to Process Automation > Flows.
- Click New Flow.
- Select
Record-Triggered Flow
and click Create. -
Configure the Start element.
Option Value Object Item
(ONB2__Item__c)Trigger A record is updated
Condition Requirements Any Condition Is Met (OR)
Condition 1 ONB2__StartDate__c
Is Changed
{!$GlobalConstant.True}
Condition 2 ONB2__EndDate__c
Is Changed
{!$GlobalConstant.True}
Optimize for Actions and Related Records
-
Click and add the following Decision element.
Specify labels and API names for the decision node (
Check dates
) and the outcome path (Modified dates
) as required.Option Value Condition Requirements Custom Condition Logic Is Met
Condition Logic (1 AND (2 OR 3)) OR (4 AND (5 OR 6))
Condition 1 {!$Record.ONB2__StartDate__c}
Is Changed
{!$GlobalConstant.True}
Condition 2 {!$Record.ONB2__StartDate__c}
Less Than or Equal
{!$Flow.CurrentDate}
Condition 3 {!$Record__Prior.ONB2__StartDate__c}
Less Than or Equal
{!$Flow.CurrentDate}
Condition 4 {!$Record.ONB2__EndDate__c}
Is Changed
{!$GlobalConstant.True}
Condition 5 {!$Record.ONB2__EndDate__c}
Less Than or Equal
{!$Flow.CurrentDate}
Condition 6 {!$Record__Prior.ONB2__EndDate__c}
Less Than or Equal
{!$Flow.CurrentDate}
In order to not overload the decision logic in one node, you may move the conditions to check for the end date into a second, parallel decision node.
-
On the modified outcome path of the decision node, click and add the following Update Records element.
Specify a label and API name as required, for example
Set update BD checkbox
.Option Value How to Find Records Specify conditions to identify records, and set fields individually
Object Subscription
(ONB2__Subscription__c)Condition Requirements All Conditions Are Met (AND)
Condition Id
Equals
{!$Record.ONB2__Subscription__c}
Set Field Values UpdateUnbilledRevenue__c
←{!$GlobalConstant.True}
The flow may look like this:
Example flow to set the update unbilled revenue checkbox -
Click Save, then Activate.
When item start dates or end dates are modified, JustOn selects the checkbox UpdateUnbilledRevenue
, which will trigger the Unbilled Revenue Job to update the preliminary bookkeeping data for the current subscription on the next scheduled execution.
For help about creating flows, see Flows in the Salesforce Help.