Skip to content

Bookkeeping Data for Subscriptions

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 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.

Info

The support for subscription bookkeeping data is available as of JustOn 2.58.

Data structure

Bookkeeping data is structured in booking periods and booking details. 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_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.

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 and Minimum 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 account
    • Unbilled Revenue – to be booked on a dedicated receivables account
  • 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 the Collective Accounts custom setting.
  • 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.

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.

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Global Settings.

  3. Click Edit in the Default row.
  4. Select the checkbox Create Bookkeeping Data.
  5. 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.

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.

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Global Settings.

  3. Click Edit in the Default row.
  4. Specify the required option in the field Unbilled Revenue Tax.
  5. 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.

  1. Navigate to the fields list of the Subscription object.
  2. 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.

  3. 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:

  1. Open the Scheduled Jobs page.

    Use the following URL https://login.salesforce.com/apex/ONB2__JobsSetup, or, if you are already logged in, append apex/ONB2__JobsSetup to your org's domain name.

    As of JustOn 2.52, you can access the Scheduled Jobs page via the JustOn configuration app (App Launcher > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select Unbilled Revenue Job.

    The Job Name field is automatically set to ScheduledSubscriptionBooking.

  3. From the Start Time drop-down list, select the preferred execution time.

  4. Optionally, edit the displayed cron expression to adjust the execution time.
  5. 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:

  1. In Setup, open Apex Classes.

    In Salesforce Lightning, navigate to Custom Code > Apex Classes.

    In Salesforce Classic, navigate to Develop > Apex Classes.

  2. Click Schedule Apex on top of the list.

  3. Specify the details as required.

    • Job Name
    • Apex Class: ScheduledSubscriptionBooking
    • Frequency: Weekly or Monthly (with an according weekday or day of month setting)
    • Start
    • End
    • Preferred Start Time
  4. 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 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:

  1. Navigate to the fields list of the Subscription object.
  2. 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.

  1. In Setup, navigate to Process Automation > Flows.
  2. Click New Flow.
  3. Select Record-Triggered Flow and click Create.
  4. 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
  5. 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.

  6. 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:

    book_subscr_update_flow
    Example flow to set the update unbilled revenue checkbox

  7. 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.