Best Practice: Setting Up Billing and Invoicing Solution
This article gives a step-by-step instruction on configuring JustOn Billing & Invoice Management. It is aimed at enabling partners or customers to completely set up two major business scenarios in one go: contract-based recurring billing or one-time sales (see Modeling Billing and Invoicing).
This article describes a proven, best-practice approach:
Step 1: Business Entity
↳ Step 2: Tax Handling
↳ Step 3: Templates
↳ Step 4: Modeling Billing and Invoicing
↳ Step 5: Invoice Run
↳ Step 6: Finalization
↳ Step 7: Accounting Support
Info
Your business requirements may vary, so you may not need to complete all tasks, or not necessarily proceed in the outlined order.
For details on how to install and set up JustOn Billing & Invoice Management to make it usable for users in your Salesforce org, see Installing JustOn Billing & Invoice Management.
Step 1: Business Entity
Certain business use cases require a Salesforce organization (the "virtual space" that includes all data and applications of an individual business) to hold specific billing-relevant information or to be further divided in subdivisions. To this end, JustOn has introduced business entities (up to JustOn 2.63, "tenants").
The business entity can hold billing-relevant or accounting-relevant information of your company or company subdivision, like address data, bank data or tax data. When using business entities, you can automatically assign a business entity to an invoice during the invoice creation. Consequently, the business entity information is available for downstream processes that may require it (like bookkeeping data generation or e-invoice creation), and can be printed to the invoice PDF via custom placeholders, like [BusinessEntityName]
or [BusinessEntityIBAN]
.
Info
Although a business entity is, technically, optional for automating your billing and invoicing process, you are very likely to need one – to hold invoicing and accounting relevant data like a VAT ID, SEPA ID, etc.
Depending on your organization's requirements, you must create individual business entities for specific regions, customers or other criteria.
Creating a business entity
Defining business entity
-
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 Business Entity.
- Click New.
-
Specify the details as necessary.
Specify your company's or company subdivision's information in the corresponding fields as necessary.
Custom settings names must not exceed 38 ASCII characters.
Selecting the
Default
checkbox makes JustOn use the current business entity for all invoices. -
Click Save.
This creates the new business entity and makes it available for subscriptions and invoices.
For details, see Business Entities.
Next steps:
Step 2: Tax Handling
Step 3: Templates
Step 4: Modeling Billing and Invoicing
Step 5: Invoice Run
Step 6: Finalization
Step 7: Accounting Support
Step 2: Tax Handling
If you sell products with different tax rates or operate different markets where variable or multiple tax rates apply, you need rules to determine the correct tax rate for an invoice line item. To this end, JustOn Billing & Invoice Management supports tax rules. They provide for tax rate lookups along various combinations of account region, merchant or business entity region, product tax class, product group, etc.
To have JustOn calculate the taxes based on tax rules, you set up the tax rules that meet your business requirements – usually a dedicated tax rule for every applicable tax rate, including one for reverse charge.
Assume the following example: There are four tax situations, for which you need individual tax rules that yield a specific tax rate.
Tax Situation | Tax Rule | Tax Rate | Invoice Region |
---|---|---|---|
Germany, tax ID available or not available | DE-VAT | 19% | DE |
EU country, tax ID not available | EU-VAT | 19% | EU |
Reverse charge applicable, tax ID available | RC | 0% | RC |
Non-EU country, tax ID not available | NON-EU | 0% | NON-EU |
Defining a tax rule to apply 19% VAT for customers in Germany
Defining tax rules
-
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 Tax Rules.
- Click New.
-
Specify the details for each required tax rule as necessary.
# Name Business Entity Invoice Region Tax Rate 1 DE-VAT as created under Business Entity DE 19% 2 EU-VAT as created under Business Entity EU 19% 3 RC as created under Business Entity RC 0% 4 NON-EU as created under Business Entity NON-EU 0% -
Click Save.
Now, the invoice region determines the tax rule to apply for an account. So you must identify the region based on the account's billing country.
To this end, you create the formula field ON_Region
on the Account object.
Creating region formula for a B2B scenario
- Navigate to the fields list for the Account object.
-
Create the following new field.
API Name Data Type Description ON_Region Formula
(Text)Determines the invoice region. The produced value will be copied to the field Region
on the invoice.
In B2B scenarios, you can use the following formula to determine the invoice region (given that ONB2__TaxNumber__c
specifies the tax ID).
With respect to taxation rules and depending on your type of business, you may handle Switzerland or the United Kingdom like EU countries, adding "CH","EU"
or "GB","EU"
to the country list in the formula.
Be aware that this formula is an example. You may have to adjust it according to your business use case.
IF(ISPICKVAL(BillingCountryCode,"DE"), "DE",
IF(CASE(TEXT(BillingCountryCode),
"AT","EU",
"BE","EU",
"BG","EU",
"CY","EU",
"CZ","EU",
"DK","EU",
"EE","EU",
"ES","EU",
"FI","EU",
"FR","EU",
"GR","EU",
"HU","EU",
"IE","EU",
"IT","EU",
"HR","EU",
"LT","EU",
"LU","EU",
"LV","EU",
"MT","EU",
"NL","EU",
"PL","EU",
"PT","EU",
"RO","EU",
"SE","EU",
"SI","EU",
"SK","EU",
"SM","EU",
"NON-EU")
= "NON-EU", "NON-EU",
IF(ISBLANK(ONB2__TaxNumber__c), "EU", "RC")
)
)
Based on the billing country as defined for the account, this formula produces either DE
, EU
, RC
or NON-EU
as the value for the region.
For details, see
Next steps:
Step 3: Templates
Step 4: Modeling Billing and Invoicing
Step 5: Invoice Run
Step 6: Finalization
Step 7: Accounting Support
Step 3: Templates
The template is the model based on which the PDF copy of an invoice, dunning reminder or account statement is rendered. It defines its contents and layout. Produced PDF documents are intended to be distributed via email or postal service to customers, and can be exported and archived.
Combining data with a template to produce an output
In addition to the fields that are printed to the PDF, the templates also include texts for the email that JustOn sends to distribute the rendered PDF documents.
You usually create a dedicated template for each language you want to support (and, possibly, other criteria), as well as the associated template details to cover your use cases.
How to specify which template to use?
Depending on your business scenarios, you may have to use dedicated templates to support, for example,
- different locales (languages),
- specific customer groups,
- individual business entities.
So if there are multiple templates, what is the best way to specify which one to use – for a specific use case or as a fallback?
This is how JustOn Billing & Invoice Management looks for a template:
ON_Template
field on the invoice source records
↳ ON_Template
field on the account
↳ Template
field on the business entity
↳ Default
template
(1) To predefine a specific template for your standard use cases, you usually set it via the ON field ON_Template
on your source records for the invoice generation.
Generally, ON_Template
is a formula field. In the simplest use case, you just name the template to use. If necessary, however, you use a formula that returns a dedicated template according to your specific criteria – target region, business entity, product group, etc.
(2) As a more general setting, you can define a dedicated template per customer – using an ON_Template
field on the account. If the source record does not specify a template, JustOn uses the one set on the account.
(3) In addition, you can set a template per business entity. If there is no template defined on the source record or the account, it is retrieved from the Template
field on the business entity that is related to the target record (invoice or statement).
(4) If neither the source record, the account nor the business entity specify a template to use, JustOn Billing & Invoice Management falls back to the Default
template. Note that you can leave the Default
template shipped with the package untouched and use this as your fallback, or create a custom template according to your needs and name it Default
.
Info
As long as an invoice has the status Draft
, you can assign another template to the invoice.
Preparing templates usually involves the following tasks:
Creating template
To cover multiple targets, like different locales or specific customer groups, you need to create new templates.
JustOn recommends to create one or more custom templates and to leave the default template (named Default
) untouched.
- Open the Templates tab.
- Click New.
-
Specify at least the template name and the template language.
You can edit the other information later as required.
-
Click Save.
This generates the new template, copying the contents of the default template.
Creating template details
Generally, JustOn recommends to use template details to customize specific template parts for different purposes, for example, invoice, credit, cancellation. To create a new template detail:
- Open the template to be edited.
- In the Template Details section, click New Template Detail.
-
Specify at least the template detail name and the parent template assignment.
The template detail name must correspond to an existing invoice type or invoice class or, respectively, to an existing dunning level.
You can edit all other information later as required.
-
Click Save.
Populating common template fields
Usually, your organization has defined a layout model for printed documents. When customizing a template, you must provide information to fields (text blocks) that are empty by default in order to comply with your organization's design specifications. Common header and footer fields to be populated with your custom information include
- Header
- Sender Address
- Footer
For an overview of other fields that are to be filled, their placement etc., see Template Structure and Building Blocks.
To edit header and footer:
- Open the template to be edited.
-
In the Header & Footer section, click next to the
Header
,Sender Address
orFooter
field and specify the information as required.Alternatively, you can click Edit in the detail view and edit all fields at once.
-
Click Save.
Template text blocks can contain plain text, placeholders and HTML code for tables, lists and links. If you use HTML code in template text blocks, make sure to write all code in a single line to avoid line breaks being converted to <br/>
tags.
Editing standard text blocks
In the main content area, the template includes three generic text blocks that you can use for any running text to be rendered in the final document.
- Text 1: Text to be rendered above the invoice line item table, can be used, for example, to edit a letter-like text introducing the invoice that follows.
- Text 2: Text to be rendered below the invoice line item table, can be used, for example, to add payment terms.
- Text 3: Additional text to be rendered below the
Text 2
block.
To edit the generic text blocks:
- Open the template to be edited.
-
In the Texts section, click next to the
Text 1
,Text 2
orText 3
field and specify the information as required.Alternatively, you can click Edit in the detail view and edit all fields at once.
-
Click Save.
Template text blocks can contain plain text, placeholders and HTML code for tables, lists and links. If you use HTML code in template text blocks, make sure to write all code in a single line to avoid line breaks being converted to <br/>
tags.
Modifying email texts
In addition to the fields that are printed to the PDF, the invoice template also includes texts for the email that JustOn can send to distribute the rendered PDF documents. These fields include:
Template Section | Field | Description |
---|---|---|
Email Text | PDF Name | Specifies the name for the generated PDF file. It can contain placeholders, the default is [InvoiceDate]_[InvoiceNo]_[AccountName].pdf . |
Attach Files To Outgoing Email (checkbox) | Controls whether attached files are included in any outgoing email. | |
Email File Types | Defines which file types will be attached to emails (comma separated list of file extensions). For example, pdf,csv sends all PDF and CSV files; if empty (default), all files files are attached except for transaction table HTMLs. |
|
Email Sender | Defines an email sender address. Note that this address must be available as an organization-wide email address. | |
Email Subject | Defines the default email subject. Can include placeholders, like Invoice: [InvoiceNo] (default). |
|
Email Body | Defines the plain text (or HTML source code) body for the email. Can include placeholders, and line breaks are considered. Make sure that the email text includes the placeholder [PaymentPageURL|no-persist] for the recipients to be able to access the payment page of JustOn Cash Management |
|
Email HTML Body | Defines a rich HTML body text for the email. The editing area of this field includes an inline HTML editor. Must not include HTML source code. If you want to use HTML source code for preparing the email body, you use the field Email Body .Make sure that the email text includes the placeholder [PaymentPageURL|no-persist] for the recipients to be able to access the payment page of JustOn Cash Management |
Be aware of the following specifics:
Email Body
is ignored if there is content inEmail HTML Body
.- You must use either
Email Body
orEmail HTML Body
in both the template and its associated template details. Email HTML Body
must not include HTML source code. If you want to use HTML source code for preparing the email body, you use the fieldEmail Body
.
To edit the email contents:
- Open the template or template detail to be edited.
- Click Edit.
- In the Email Text section, modify the fields as required.
- Click Save.
Specifying counter
Invoices, credits, cancellations and dunnings must have unique numbers to comply with legal regulations. In Draft
status, these numbers are temporary and of no legal relevance. When setting them to Open
, however, JustOn creates the unique and unalterable numbers for invoices, credits, cancellations and dunnings based on defined counters. For details, see Counters and Number Ranges.
Customizing templates therefore involves specifying the counter to be used. To do so:
- Open the template or template detail to be edited.
-
In the Information section, click next to the
Counter
field and specify the counter as required.Alternatively, you can click Edit in the detail view to edit the field.
-
Click Save.
Counters defined on templates overwrite counters defined for business entities.
Additional options
Additional options for configuring templates include:
For details, see Working With Templates and Configuring PDF Creation.
Next steps:
Step 4: Modeling Billing and Invoicing
Step 5: Invoice Run
Step 6: Finalization
Step 7: Accounting Support
Step 4: Modeling Billing and Invoicing
Generally, your business model and the nature of your products determine how to set up the billing engine of JustOn Billing & Invoice Management:
If you want to bill recurring items, usage data, etc. on a contractual, regular basis, we recommend to create subscriptions and, consequently, to produce invoices based on them.
For details, see Contract-Based Recurring Billing.
If you sell one-time products, however, you do not need subscriptions – you can directly create invoices from arbitrary objects using the generic invoice run.
For details, see One-Time Sales: Generic Invoice Run.
Contract-Based Recurring Billing
Many business models base on contracts that allow the periodic use or access to a product or service and have customers pay a recurring price – examples include media publishers, phone companies, internet providers, software manufacturers.
Enter subscriptions: vendors use them to combine the contracted conditions – products, prices, terms, renewals, etc. In this sense, subscriptions make up the billing plans for contracts.
Subscriptions
JustOn Billing & Invoice Management implements subscriptions using a dedicated object that represents the periodic billing plan for a contracted product use. See the subscription as a "blueprint" for the future invoice: It combines the account information (buyer name, address, etc.) with the details of the products to be charged, like product name and description, price, price model, applicable discounts, etc.
Creating invoices from subscriptions
The regular, subscription invoice run is always active. That is, JustOn creates draft invoices from all subscriptions within the scope. To limit the scope of subscriptions that are subject to an invoice run, you use subscription filters.
Automatic subscription build
Automatic subscription building helps managing subscriptions if your business requires to deal with a large or variable – read: increasing – number of subscriptions.
The way to set up the subscription builder depends on the nature of your products, your sales use cases and the representation of your source data in Salesforce:
- Billing an account-specific set of products under some account-specific conditions → parent-child relationship
- Billing identical products on equal conditions to multiple accounts → master subscription
Typical Situation
The way to set up the subscription builder depends on the nature of your products, your sales use cases and the representation of your source data in Salesforce.
Used to bill an account-specific set of products under some account-specific conditions
To allow for individually configured items when building subscriptions, you can use objects that are in a parent-child relationship, like orders with order products. If set up accordingly, the subscription builder takes the parent object ( order) to produce the subscription, and the child objects ( order products) to produce the subscription items.
Building subscriptions based on accordingly configured objects
Used to bill identical products on equal conditions to multiple accounts
A master subscriptions is a subscription "model" that is copied for each target. The target is the object whose records are the basis for subscriptions, like accounts, contracts, cases, quotes, etc. If set up accordingly, the subscription builder can generate an individual subscription for each new account, contract, case, quote, etc. that you create.
Building subscriptions based on a master subscription
Configuring Automatic Subscription Build
The subscription builder requires a number of ON fields on the source objects as well as a subscription build filter. Building subscriptions based on master subscriptions requires, in addition, the master subscription.
The typical configuration tasks include:
Configuring parent object
- Navigate to the fields list of the parent object.
-
Create the following new fields.
API Name Data Type Description ON_Account Formula (Text) Specifies the Salesforce account ID or external ID.
The formula uses the API name of the field that links the object to the account, for example,AccountId
.ON_Subscription Lookup (Subscription) Links to the related subscription.
With Salesforce CPQ installed, make sure to relate to the correct Subscription object. For details, see the note below.ON_SubscriptionBuildError Text (255) Shows the error message in case the subscription creation has failed. ON_CurrencyIsoCode Formula (Text) Sets the subscription currency to the source object currency if
a) you use multiple currencies and
b) the account currency differs from the source object currency.
The formula isTEXT(CurrencyIsoCode)
.
Depending on your use case and its requirements, you can add more fields to have them copied to the generated subscriptions, for example, ON_StartDate
. For details, see ON Fields on Objects. For an overview of typically used fields, see Best Practice: Subscription Builder Source Data.
Configuring child object
- Navigate to the fields list of the child object.
-
Create the following new fields.
API Name Data Type Description ON_OrderNo Formula (Text) Key to match source data to a subscription item, must be unique for each detail of the same master. ON_Price Formula (Currency) The net sales price of the item, required if the detail object is defined in a subscription build filter. ON_Quantity Formula (Number) The quantity of the item to be invoiced, required if the detail object is defined in a subscription build filter. ON_Title Formula (Text) The name or title of the item, required if the detail object is defined in a subscription build filter.
Depending on your use case and its requirements, you can add more fields to have them copied to the generated subscription items. For details, see ON Fields on Objects. For an overview of typically used fields, see Best Practice: Subscription Builder Source Data.
Creating master subscription and items
- Open the Subscriptions tab.
- Click New.
-
Specify the details as required.
Do not assign the subscription to an account. The field
Account
may be set as required, however. In this case, navigate to the Subscription page layout, open the field properties for theAccount
field and deselect theRequired
checkbox.The subscription name will be used as an input parameter when configuring the target object. JustOn recommends to prefix the master subscription name with
MASTER
. -
Click Save.
For details, see Creating Subscriptions.
-
In the Items section of the new subscription, click New.
-
Specify the details as required.
Mandatory parameters include
- Title
- Billing Type:
Recurring
,One-Time
orTransactional
, see General Billing Settings - Order No.: Key to match source data to a subscription item
-
Click Save.
This generates the new item. Repeat this step for every item to be cloned.
For details, see Adding Items.
Configuring target object
- Navigate to the fields list of the target object.
-
Create the following new fields.
API Name Data Type Description ON_Account Formula (Text) Specifies the Salesforce account ID or external ID.
The formula uses the API name of the field that links the object to the account, for example,AccountId
.ON_Subscription Lookup (Subscription) Links to the related subscription.
With Salesforce CPQ installed, make sure to relate to the correct Subscription object. For details, see the note below.ON_SubscriptionBuildError Text (255) Shows the error message in case the subscription creation has failed. ON_MasterSubscription Text (255)
or
FormulaSpecifies the name of the master subscription (which serves as a template and will be cloned).
If configured as a formula field, the master subscription name is used for every record.
Depending on your use case and its requirements, you can add more fields to have them copied to the generated subscriptions, for example, ON_StartDate
. For details, see ON Fields on Objects. For an overview of typically used fields, see Best Practice: Subscription Builder Source Data.
Creating subscription build filter
To define which objects and records to include in the subscription build process, you create a new custom filter.
The subscription build job always processes all available subscription build filters. Be aware that this may, consequently, produce multiple subscriptions for an account.
-
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 Filters.
-
Create the following filter for the subscription build.
Field Required Description Example Value Name Specifies the filter name, will be available as an option picklist value when triggering the operation Target Specifies the API name of the target object Order
Opportunity
MyObject__c
Child Relation Specifies the name of the child object ( plural form). Required if you create items based on the child records.
For master-detail relations, use the API name of the detail object. In case of standard Salesforce objects, you can use Workbench to find the correct name.
For lookup relations, use the relationship name of the child object.OrderItems
CO_Order_Line_Items__r
Subchild Relation Specifies the name of the subchild object. Required if you create item price tiers based on custom subchild records.
For master-detail relations, use the API name of the detail object.
For lookup relations, use the relationship name of the child object.CO_Price_Tiers__r
Use Case Specifies the filter use case, must be SubscriptionBuilder
SubscriptionBuilder
Condition Specifies a condition expression as used in an SOQL WHERE clause to restrict the set of included records
For details, see SOQL WHERE clause in the Salesforce Help.
SOQL expressions in filter conditions must not contain line breaks.Status = 'Activated'
For help about creating filters, see Filters.
Enabling subscription generation
Once set up, there are various ways to invoke the subscription building process:
- Manually using a custom button
- Using a local batch job
- Using a custom flow
- Calling the REST web service
Next steps:
Step 5: Invoice Run
Step 6: Finalization
Step 7: Accounting Support
One-Time Sales: Generic Invoice Run
You can create invoices from arbitrary objects that are configured accordingly. Using the generic invoice run, you can completely bypass subscriptions – if you do not need them to model any contractual relations or conditions.
To this end, JustOn Billing & Invoice Management allows for configuring virtually any Salesforce object ( except for Line Item Schedule) to hold the required invoicing data. This may include orders, contracts, opportunities or custom objects. Using custom filters, you then define which objects and records to include in the invoice run.
Creating invoices from arbitrary objects
Typical Situation
The way to set up the generic invoice run depends on the representation of your source data in Salesforce.
Assume the following scenario as an example: You have integrated Salesforce with your back-end or marketplace system. In this environment, there are generated orders, typically with multiple order products. These order products now need to be invoiced without any contractual situation.
Following the example, your source data may be stored in objects that are in a parent-child relationship, like orders and order products. In this case, you set up these objects to hold the invoicing data using the ON field mechanism. JustOn can then produce the invoices based on the parent object and the invoice line items out of its child objects.
Creating invoices based on accordingly configured parent-child objects
Configuring Generic Invoice Run
The invoicing process requires a number of ON fields on both the parent and the corresponding child object as well as an invoice run filter. The typical configuration steps include:
Configuring the parent object
- Navigate to the fields list of the parent object.
-
Create the following mandatory fields.
API Name Data Type Description ON_Account Formula (Text) Specifies the Salesforce account ID or external ID.
The formula uses the API name of the field that links the object to the account, for example,AccountId
.ON_Template Formula (Text) Specifies the Salesforce ID or name of the related template.
The formula can return a dedicated template according to specific criteria – target region, business entity, product group, etc.ON_ServiceDate Formula (Date)
Formula (Date/Time)The record will be invoiced when the date is null
or within the service period of the invoice run.
The formula return type depends on the source field.ON_Invoice Lookup (Invoice) The invoice that resulted from this record.
If the produced invoice is canceled, the object records become subject to the invoice run again.ON_LastInvoiceRun Lookup (Invoice Run) Shows the last invoice run that has processed this object. ON_InvoiceBuildError Text (255) Shows errors that occurred during the last invoice run.
According to your actual requirements, you may have to create additional fields. For details, see Configuring Parent Object.
Configuring the child object
- Navigate to the fields list of the child object.
-
Create the following mandatory fields.
API Name Data Type Description ON_Title Formula (Text) The name or short description of the invoice line item. ON_Quantity Formula (Number) The quantity to be billed for this invoice line item.
Using a formula, you can, if required, set the quantity0
to exclude records from being invoiced if certain conditions are true.
Assume, for example, a checkboxBillable
- to exclude records where the checkbox is not selected, you can use a formula like:IF(Billable = 'false', 0 , Quantity)
ON_UnitPrice Formula (Currency) Either the net or gross price of one unit of this item.
According to your actual requirements, you may have to create additional fields. For details, see Configuring Child Object.
Creating the invoice run filter
To define which records to include in the invoice run, you create a custom filter.
-
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 Filters.
-
Create the filter as required.
Field Description Example Value Name Specifies the filter name, will be available as an option value when triggering the operation. Must be unique. Orders
Target Specifies the API name of the target object.
For JustOn objects, do not append the namespace prefixONB2__
when specifying the target.Order
Child Relation Specifies the name of the child object ( plural form).
For master-detail relations, use the API name of the detail object. In case of standard Salesforce objects, you can use Workbench to find the correct name.
For parent-child relations, use the relationship name of the child object.OrderItems
Use Case Specifies the specific filter use case. Generic
According to your actual requirements, you may have to set additional filter fields. For details, see Creating Invoice Run Filter and Filters Information.
Additional options
Additional options for setting up the generic invoice run include:
- Setting up data mapping
- Enabling invoice run from parent
- [Configuring recurring billing]jo_admin_setup_generic_ir.md#configuring-recurring-billing)
- Enabling pre-payment balance assignment
- Applying invoice criterion
- Hiding invoice line items
- Propagating associated documents
- Enabling multiple party billing
- Enabling lookup to source records
Next steps:
Step 5: Invoice Run
Step 6: Finalization
Step 7: Accounting Support
Step 5: Invoice Run
The invoice run is the core concept of JustOn Billing & Invoice Management: it is the operation that creates invoices based on your configured source data, which may include
- Customer and contract data as stored in the subscription as well as product and price information stored in subscription items, as outlined in Contract-Based Recurring Billing,
- Customer and product data as stored in an arbitrary object, as outlined in One-Time Sales: Generic Invoice Run.
There are two ways to trigger an invoice run:
- Manually, or
- Using a scheduled job to have invoices created automatically on a regular basis.
For details, see Invoice Run.
Executing an invoice run
- Open the Invoice Runs tab.
- Click New.
-
Specify the configuration details as necessary.
- Period Start/Period End: Specifies the period for the invoice run.
- Invoice Date: Specifies the date of issue for all invoices. If left empty, JustOn uses the current date.
-
Select the invoice run filter as required.
To limit the scope of subscriptions that are subject to an invoice run, you can use subscription filters. Subscription filters are presented as radio buttons. If there is one subscription filter, it is always selected. If there are multiple subscription filters, you are prompted to select one of them for the invoice run.
To define which records to include in the invoice run, select one or more generic filters, as described in Configuring Generic Invoice Run. Generic filters are presented as checkboxes. You can select multiple (or no) generic filters.
-
Click Start.
This creates draft invoices from all subscriptions that are set
Active
and that are associated with an active account, as well as from all objects that match the criteria of the selected filters.
For details on scheduling the invoice run, see Scheduling Invoice Run.
Next steps:
Step 6: Finalization
Step 7: Accounting Support
Step 6: Finalization
New invoices have the status Draft
. You can check draft invoices for correctness and edit them as necessary. If you approve of a draft invoice, you Finalize it. This process
- sets the status to
Open
, making the invoice effective, that is, due for payment (and unalterable), - sets a unique final invoice number based on the configured invoice counter, and
-
creates PDF documents.
Find the produced files on Salesforce's Files tab in the group Owned by me, if not configured otherwise (see File Distribution).
You can finalize
- a single invoice individually from its detail view,
- selected invoices from the invoice list view (on the Invoices tab or the invoice run detail view), or
- all listed draft invoices at once.
Note
Once an invoice is finalized, you can no longer change it.
Invoice finalization steps
By default, the invoice finalization involves the following processing steps (see FinalizeInvoiceChain):
- Retrieve external taxes
- Build transaction tables (for missing records)
- Settle (non-related) invoices and credits
- Finalize invoices
- Finalize external taxes
- Create installments
-
Create entries
Is executed after integrating with JustOn Cash Management.
-
Assign (free) payment balances
-
Settle entries
Is executed after integrating with JustOn Cash Management.
-
Get payment links
Is executed after integrating with JustOn Cash Management and a payment service provider for invoices with the payment method
Online Payment
. -
Create PDFs
-
Create e-invoice
Is executed after enabling e-invoices and for invoices with the e-invoice formats
XRechnung UBL
orPeppol BIS Billing UBL
. -
Cancel related entries
Is executed after integrating with JustOn Cash Management to cancel entries that originate from invoices being canceled.
-
Create transaction CSVs
-
Send email
Is executed if the email auto send option is enabled.
Manually finalizing invoices
To finalize a single invoice individually from its detail view:
- Navigate to the Invoices list in the invoice run view or open the Invoices tab.
- Click the invoice number to open the invoice's detail view.
-
Click Finalize.
This launches a screen flow for the finalization.
Users who finalize single invoices individually from their detail view must be allowed to execute flows via a permission set or a profile (see Enabling Access for New Users).
-
Click Finalize to confirm and start the operation.
This executes the finalization process, setting the status
Open
for the current invoice and generating the corresponding PDF document. Find the produced file on Salesforce's Files tab in the group Owned by me, if not configured otherwise (see File Distribution).The screen flow shows the operation progress. After completion, clicking Close & Refresh returns you to the updated detail view of the current invoice.
To finalize invoices from the invoice list view:
-
Navigate to the Invoices list in the invoice run view, or open the Invoices tab and select an appropriate list view.
The list view
Recently Viewed
does not display the Finalize button. -
On the Invoices tab, select the checkboxes next to the invoices you want to finalize, or leave all checkboxes unmarked to include all listed invoices.
- Click to open the action menu, then select Finalize.
-
Click Continue to confirm and complete the operation.
Depending on your selection, this sets the status
Open
for the selected or all invoices and generates the corresponding PDF documents.
Automatically finalizing invoices
You can set up JustOn to finalize draft invoices automatically during an invoice run or using a process when certain conditions become true.
For details, see
Next steps:
Step 7: Accounting Support
Step 7: Accounting Support
JustOn Billing & Invoice Management allows for writing bookkeeping data for revenues and taxes from finalized invoices as well as for payment balances. These records can then be transferred to accounting systems like DATEV, SAP or Microsoft Dynamics.
Booking Account Allocation
Accounting systems allocate booking data to dedicated bookkeeping accounts. To facilitate the initial account allocation, JustOn supports various mechanisms to assign account numbers to booking details.
G/L account or center
Accounting systems usually assign generated revenues to general ledger accounts (G/L accounts, structures that record value movements in defined contexts) or cost centers or profit centers (business subdivisions to which costs or profits are allocated). To support these assignments, JustOn can add G/L account or center information to invoice line items. When generating the bookkeeping data, this information is then populated to the booking details accordingly.
Debtor account
In double-entry bookkeeping, every entry to an account requires a corresponding opposite entry to a contra account (also known as offsetting account), which is credited to offset a debit or debited to offset a credit. To support this scenario, JustOn Billing & Invoice Management can set the contra account number in the Booking Detail field Contra Booking Account
.
For revenue or payment-related bookings, the contra account is usually the relevant business partner, that is, your debtor (or creditor). The way to set the debtor account number depends on your business use cases:
- For customer-specific debtor numbers, you use the optional Account field
ON_DebtorNo
. - To support collective debtors, you use the optional Invoice field
DebtorNo
(for revenue-related bookings) or theBusiness Partner Account
field of the relevant collective account setting (for payment-related bookings).
Collective account
Depending on your business processes, you may create specific bookkeeping data that is not assigned to a revenue-related G/L account. Accounting systems, however, still require an account number. To handle these scenarios, you can use collective accounts. They define account numbers for booking details without dedicated account numbers – primarily, for taxes or deferred revenues, but also for other use cases like payment bookkeeping data.
Typical Situation
As always, the way to set up your booking accounts may vary considerably. For a start, however, the following basic setup can cover the minimum requirements:
Booking Account | Booking Detail Field | Configuration | Example Value |
---|---|---|---|
Revenues | G/L Account Number | G/L account | 8400 |
Taxes | G/L Account Number | Collective account | 1776 |
Receivables/Debtors | Contra Booking Account | Contra account | 11400 |
Bank | G/L Account Number | Collective account | 1200 |
Configuring Account Allocation
Configuring the accounts for the outlined approach involves:
G/L account rule for revenues
-
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 Assignment Rules - G/L Account.
- Click New.
-
Specify the information as necessary.
Following the example, the mandatory information includes:
- Name
- G/L Account (
8400
) - Matching rule criteria according to your use case, like Product Group, Tax Rule or Tax Code
Creating G/L account assignment rule based on product group and business entity -
Click Save.
This creates the new G/L account assignment rule. Consequently, JustOn will assign the G/L account to the invoice line item based on your criteria (fields and values to match).
For details, see Assignment Rules - G/L Account.
Collective account for taxes
-
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.
Following the example, the mandatory information includes:
- Name
- Account (
1776
) - Business Partner Account (
11400
) - Matching rule criteria according to your use case, at least Type (
Tax
)
Creating booking account setting for taxes -
Click Save.
This creates the new collective account setting. Consequently, JustOn will assign the specified account number to the booking details of the type
Tax
.
For details, see Collective Accounts.
Contra account for receivables/debtors
For customer-specific debtor numbers, you use the Account field ON_DebtorNo
.
- Navigate to the fields list of the Account object.
-
Create the following new field.
API Name Data Type Description Example Value ON_DebtorNo Text (255)
or
FormulaSpecifies the contra account number for booking details. If configured as a formula, it can determine the value based on other fields. 11400
To support collective debtors, you use the Invoice field DebtorNo
.
- Navigate to the fields list of the Invoice object.
-
Create the following new field.
API Name Data Type Description Example Value DebtorNo Text (255)
or
FormulaSpecifies the contra account number for booking details. If configured as a formula, it can determine the value based on other fields. 11400
For details, see Enabling Debtor Accounts.
Collective account for payments
-
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.
Following the example, the mandatory information includes:
- Name
- Account (
1200
) - Business Partner Account (
11400
) - Matching rule criteria according to your use case, at least Type (
Payment
)
Creating booking account setting for payments -
Click Save.
This creates the new collective account setting. Consequently, JustOn will assign the specified account number to the booking details of the type
Payment
.
For details, see Collective Accounts.
Example scenario
This example invoice is the base for the accounting scenarios below:
Pos. | Title | Tax Rate | Net Price | |
---|---|---|---|---|
1 | Some Goods | 19% | 1000 | |
Subtotal Net | 1000 | |||
Tax Amount | 190 | |||
Grand Total | 1190 |
Now assume these use cases:
(1) The business issues the invoice.
(2) The customer pays the invoice, the business receives the payment.
- Expected posting records
- From an accounting perspective, these uses cases make the following posting records:
-
# Debit to Account Amount Credit to Account 1 Trade Receivables (Debtors) 1190,00 € 1000,00 € Revenues 190,00 € Taxes 2 Bank 1190,00 € 1190,00 € Trade Receivables (Debtors) - Expected account bookings
- With respect to the individual accounts, the example produces the following bookings:
- Receivables (Debtors)
-
Debit Credit 1190,00 € 1190,00 € -
Revenues
-
Debit Credit 1000,00 € -
Taxes
-
Debit Credit 190,00 € -
Bank
-
Debit Credit 1190,00 €
The common method to handle revenues is to split the net amount from the taxes and to book them to separate accounts. This is why JustOn creates two booking details from the invoice data by default: one for the net revenue, and one for the taxes. A third booking detail is created when the payment is registered.
- Produced booking details
- According to the example, JustOn creates three booking details:
-
# Amount Debit/Credit Flag Account Contra Account 1 1000,00 H
(Credit)Revenues
G/L Account Number8400
Trade Receivables (Debtors)
Contra Booking Account11400
2 190,00 H
(Credit)Taxes
G/L Account Number1776
Trade Receivables (Debtors)
Contra Booking Account11400
3 -1190,00 S
(Debit)Bank
G/L Account Number1200
Trade Receivables (Debtors)
Contra Booking Account11400