Enabling E-Invoice Creation
← Setting Up Invoice Distribution
When operating certain markets, your business may require to distribute electronic invoices – structured invoice data that is exchanged electronically between trading partners in order to automate accounts payable processing.
In particular, public institutions in the EU and, to an increasing extent, enterprises are required to accept and process electronic invoices. A set of common specifications and standards (Peppol) provides for interoperability between issuers and recipients across Europe.
To support enterprise and public e-invoicing, JustOn Billing & Invoice Management can prepare electronic invoices and credits.
Note
Be aware of the following feature preconditions:
-
To prevent data incompatibility issues, creating and distributing e-invoices requires JustOn Billing & Invoice Management v2.101 or newer.
-
Creating and distributing e-invoices involves Salesforce API access and therefore requires at least the Salesforce Enterprise Edition.
Currently, JustOn Billing & Invoice Management supports the following e-invoice formats:
- Peppol BIS Billing (with UBL syntax) for electronic invoicing across Europe
- XRechnung (with UBL syntax) for electronic invoicing within Germany
Businesses can send e-invoice files to the Peppol Network, from where the e-invoices will be distributed to their recipients, or create e-invoice files and send these documents to their recipients via an invoice submission portal or email.
The involved tasks for actually configuring your JustOn Billing & Invoice Management instance to support e-invoicing differ depending on whether you use the Peppol Network or just create e-invoice files:
- Requesting e-invoice onboarding
- Defining your e-invoice sender address
- Enabling platform integration
- Adding the Send E-Invoice action to the invoice page layout
- Optionally, enabling the Peppol notification display
- Enabling access to the connected app JustOn Platform
- Preparing the e-invoice source data
Requesting E-Invoice Onboarding
Prior to creating and distributing e-invoices, make sure to contact JustOn Support for your e-invoice onboarding.
-
File a corresponding ticket in the JustOn Support Portal.
If you want to send e-invoices via Peppol, your organization must contract with JustOn for this service and request the technical activation via JustOn Support. Be aware that the registration and activation of your organization may take two to three business days.
As part of the activation with JustOn, you usually select an appropriate e-invoice sender address and determine the corresponding address scheme identifier. The two values must be specified in your business entity (see Defining Sender Address).
Defining Sender Address
Organizations that send or receive electronic invoices must have a unique e-invoice address, which is codified using a specific address scheme identifier. Generally, e-invoice addresses are subject to the Electronic Address Scheme ("EAS") defined by the European Union. The two values must be specified in your relevant business entity setting.
Info
You usually select the e-invoice sender address and the corresponding address scheme identifier as part of the e-invoice activation with JustOn.
When participating in the Peppol Network (as both sender and recipient), the address must be one of the participant identifier schemes allowed by Peppol, as described in E-Invoice Address and Scheme. You can check the Peppol Directory for existing addresses and IDs.
-
Specify the e-invoice sender address and the corresponding address scheme identifier in your relevant business entity setting.
Example 1: Using French SIREN code
Business Entity Field Example Value E-Invoice Sender Address 732829320
E-Invoice Sender Scheme Id 0002
Example 2: Using German VAT number
Business Entity Field Example Value E-Invoice Sender Address DE123456789
E-Invoice Sender Scheme Id 9930
Peppol-Specific Configuration
The following tasks are required only if you want to distribute e-invoices via the Peppol Network.
- Enabling platform integration
- Adding the Send E-Invoice action to the invoice page layout
- Optionally, enabling the Peppol notification display
In addition to these specific tasks, make sure to apply the common e-invoice configuration as well.
Enabling Platform Integration
JustOn Billing & Invoice Management acts as the "user interface" for managing e-invoices and controls the data management. However, significant parts of the business logic to produce e-invoices run on the Heroku-based platform. This is why you must define a platform integration user. This is a (technical) user that is employed for the communication between Salesforce and Heroku whenever a real user triggers relevant business logic.
Defining a platform integration user requires access to the Global Configuration dialog. Hence, enabling the platform integration is a two-step task:
Enabling Global Configuration Access
In addition to be assigned the System Administrator profile, users who intend to access the global configuration must be explicitly allowed to access the Global Configuration dialog – preferably, using a dedicated permission set.
To enable the access to the Global Configuration dialog:
-
Create a dedicated permission set.
For details, see Create Permission Sets in the Salesforce Help.
-
In the new permission set, click Flow Access in the Apps section.
- Click Edit.
-
Select
ONB2.Global Configuration
and move it to the Enabled Flows column. -
Click Save.
-
Assign the permission set to the relevant users.
For details, see Assign Permission Sets to a Single User in the Salesforce Help.
Together with the System Administrator profile, this makes the Global Configuration dialog available for the selected users.
Defining Platform Integration User
The platform integration user is a (technical) user that is required for the communication between Salesforce and Heroku whenever a real user triggers relevant business logic.
To define an integration user:
-
Create a dedicated technical user for the integration or prepare a "real" user accordingly.
The integration user
- does not necessarily need to be associated with a real person
- must be assigned the permission set JustOn Read/Write
- must be enabled to use the Salesforce API via a profile or a permission set
To check for the API access in profiles or permission sets, click to enter Setup, then navigate to Users > Profiles | Permission Sets > Profile/Permission Set Name > System Permissions, and make sure that
API Enabled
is selected. -
Click to access the App Launcher, and select JustOn Configuration.
-
Open the Global Configuration tab.
Users who intend to access the global configuration must be assigned the System Administrator profile and explicitly allowed accessing the Global Configuration dialog.
-
Click Edit.
This launches a screen flow that shows the global configuration input fields.
-
In the Platform Integration section, select the intended integration user in the
New User
field. - Click Save to save your settings, then Finish to complete the screen flow.
Enabling Send E-Invoice Action
Enabling Send E-Invoice Action for Single Invoices
To enable the option for sending an e-invoice to Peppol from the invoice detail view, add the Send E-Invoice action to the invoice record page.
Info
Using dynamic actions, you can generally show or hide actions depending on specific record conditions. With respect to the Send E-Invoice action on invoices, you must explicitly exclude invoices from displaying this action that have the statuses Draft
, Pre-Draft
and Pre-Open
as well as the e-invoice status In Peppol Queue
.
-
Open the Invoice record detail page in the Lightning App Builder.
- Navigate to an invoice.
- Click to open the Setup menu, then select Edit Page.
-
Select the top panel ("Highlights").
- Click Add Action and select the action
Send E-Invoice
. -
Click Add Filter and set the action visibility.
Record > Status Not Equal Draft
Record > Status Not Equal Pre-Draft
Record > Status Not Equal Pre-Open
Record > E-Invoice Status Not Equal In Peppol Queue
Under Show components when, select
All filters are true
. -
Click Done on the action window, then Save in the Lightning App Builder.
For more details, see Create Dynamic Actions in Lightning App Builder in the Salesforce Help.
Enabling Send E-Invoices Action for Multiple Invoices
To enable the option for sending multiple e-invoices to Peppol, add the Send E-Invoice button to the Invoice list view.
- Click to enter Setup, then navigate to the object management settings of the Invoice object.
- Click List View Button Layout.
- In the List View row, click , then select Edit.
-
Under Custom Buttons, move
Send E-Invoices
to the Selected Buttons column. -
Click Save.
This adds the button Send E-Invoices to the Invoice list view, enabling users to send multiple e-invoices.
Enabling Peppol Notification Display
As Peppol transfers the e-invoices to the recipients, the sender will receive notifications about the distribution status. JustOn Billing & Invoice Management stores this information in dedicated Peppol Notification records, which are related to the original invoice.
If required, you can display related Peppol notifications on the invoice detail view. To do so:
- Navigate to the object management settings of the Invoice object.
- Click Page Layouts.
- In the Invoice Layout row, click to open the action menu, then select Edit.
- From the Related Lists palette, drag the Peppol Notifications list to the Related Lists section.
- Click Save.
- In the object management settings of the Invoice object, click Lightning Record Pages.
- Open the Invoice page details, and click Edit.
- Drag the Related List - Single component to an appropriate location of the Invoice record page.
- In the
Related List
field of the component properties, selectPeppol Notifications
. - Click Save.
-
Click Activate.
This makes the customized record page available to users.
For help about modifying page layouts, see Managing Pages.
E-Invoice Creation-Specific Configuration
The following tasks are required only if you want to create e-invoice files to be distributed manually.
- Adding the Create E-Invoice action to the invoice page layout
- Optionally, setting the e-invoice file as email attachment
In addition to these specific tasks, make sure to apply the common e-invoice configuration as well.
Enabling Create E-Invoice Action
To enable the option for creating an e-invoice XML file from the invoice detail view, add the Create E-Invoice action to the invoice record page.
Info
Using dynamic actions, you can generally show or hide actions depending on specific record conditions. With respect to the Create E-Invoice action on invoices, you must explicitly exclude invoices from displaying this action that have the statuses Draft
, Pre-Draft
and Pre-Open
.
-
Open the Invoice record detail page in the Lightning App Builder.
- Navigate to an invoice.
- Click to open the Setup menu, then select Edit Page.
-
Select the top panel ("Highlights").
- Click Add Action and select the action
Create E-Invoice
. -
Click Add Filter and set the action visibility.
Record > Status Not Equal Draft
Record > Status Not Equal Pre-Draft
Record > Status Not Equal Pre-Open
Under Show components when, select
All filters are true
. -
Click Done on the action window, then Save in the Lightning App Builder.
For more details, see Create Dynamic Actions in Lightning App Builder in the Salesforce Help.
Setting E-Invoice XML as Email Attachment
To send produced e-invoice XML files as email attachment, you specify the content version type E-Invoice
in the Invoice field Email File Types
. This field can be populated on invoice creation from other records like this:
ON_EmailFileTypes
from the account or invoice source record
↳ Email File Types
from the template
↳ Email File Types
from the business entity
Info
Be aware of the following specifics:
- If
Email File Types
remains empty, JustOn Billing & Invoice Management assumesInvoice PDF
as mandatory, making it preselected as email attachment. - If you want the invoice PDF to be preselected as email attachment in addition to the e-invoice XML file, set the two relevant content version types in
Email File Types
, likeInvoice PDF, E-Invoice
.
To define e-invoice XML files as email attachments from the invoice sources:
- Click to enter Setup, then navigate to the object management settings of the Account object or the source object.
- Click Fields & Relationships.
-
Create the following new field.
Field Label API Name Data Type Intended Value Email File Types ON_EmailFileTypes Text(255)
Formula (Text)E-Invoice
Your business may require to automatically set the intended file types depending on certain conditions. In this case, create a formula field with the return type
Text
, where the formula represents the intended logic. Otherwise, create a simple text field and let users specify the value manually.
To define e-invoice XML files as email attachments from the template or the business entity:
- Open the relevant template or business entity.
- Click Edit.
- In the
Email File Types
field, specifyE-Invoice
. - Click Save.
Common E-Invoice Configuration
The following tasks are required in any case, irrespective of whether you use the Peppol Network or just create e-invoice XML files.
- Enabling access to the connected app JustOn Platform
- Preparing the e-invoice source data
- Optionally, disabling e-invoice validation warnings
- If applicable, enabling e-invoice statuses
- If applicable, enabling e-invoice provider statuses
Enabling App Access for JustOn Platform
To prepare your JustOn Billing & Invoice Management instance to generate valid e-invoice XML files, you must enable access to the connected app JustOn Platform for all relevant user profiles.
JustOn Platform concepts
Generally, the data management and user interaction with JustOn Billing & Invoice Management take place on the Salesforce Platform. For this purpose, the software is installed in the operator's Salesforce environment. Some business logic, however, runs on the Heroku-based platform. JustOn Billing & Invoice Management provides a dedicated connected app, JustOn Platform, to integrate the Salesforce and Heroku parts.
Setting up JustOn Billing & Invoice Management involves enabling access to the connected app JustOn Platform. The access is controlled using profiles. So when creating the users who will work with JustOn Billing & Invoice Management, you must assign the relevant profile to each of them. You can use the standard profiles or create custom profiles.
To enable access to the connected app JustOn Platform for all relevant profiles:
- Click to enter Setup, then navigate to Apps > Connected Apps > Manage Connected Apps.
- Click Edit in the row of JustOn Platform.
-
In the
Permitted Users
field, selectAdmin approved users are pre-authorized
.Confirm the selection when prompted.
-
Click Save.
This will prevent all users from accessing JustOn Platform, including org admins.
-
On the Connected Apps list, click JustOn Platform.
This displays the app detail page.
-
Add the intended profile.
- In the Profiles section, click Manage Profiles.
- Select the relevant profile, at least,
System Administrator
. - Click Save.
Note
JustOn Billing & Invoice Management allows only users with the associated profile to access the app, which relies on the option Admin approved users are pre-authorized
in the Permitted Users
field. Leaving the default value All users may self-authorize
will prevent users from accessing the app and produce the following error when they try to execute relevant business logic:
Platform not available, please contact customer support if the problem persists!
Preparing E-Invoice Source Data
The following conditions must be met for JustOn Billing & Invoice Management to successfully create e-invoice XML files.
-
Prepare your business entity as required.
The fields that hold e-invoice-specific data include
Company
,Tax ID
,Street
,City
,Postal Code
,Country Code
,Phone
,Email Sender
,IBAN
, as well asE-Invoice Sender Address
andE-Invoice Sender Scheme Id
(see Defining Sender Address).E-invoice recipients may request additional information, which you will then have to provide in corresponding fields.
-
Prepare quantity units as required.
The quantity unit must define a code for the measurement unit applicable to the quantity. The value from the
Code
field is copied to the Invoice Line Item fieldUnit Code
. The code is expected to be one of the codes listed in UNECE Recommendation No. 20 "Codes for Units of Measure Used in International Trade" or UNECE Recommendation No 21 "Codes for Passengers, Types of Cargo, Packages and Packaging Materials", see UNECE Code List Recommendations.Typical unit codes include, for example:
Measurement Unit Unit Code Piece H87 Hour HUR Kilowatt Hour KWH (Page) Impression IM Persons IE Kilometre KMT -
Prepare tax rules as required.
The fields that hold e-invoice-specific data include
Tax Rate
,Business Entity
andVAT Category Code
.The VAT category code is a code for categorizing VAT regulations. The value is copied to
VAT Category Code
on the invoice line item. The code is expected to be one of the codes listed in the code list 5305 of the United Trade Data Interchange Directory (UNTDID), see UNTDID 5305 Duty or tax or fee category code.Typical VAT category codes for businesses in Europe include:
Name VAT Category Code Standard rate S Lower rate AA Higher rate H VAT reverse charge AE Free export, no tax G Zero rated goods Z Services outside scope of tax O
Not supported with XRechnungMargin scheme (second-hand goods) F Margin scheme (travel agents) D -
Prepare the invoice data as required.
The fields that hold e-invoice-specific data include
Invoice No.
,Date
,Business Entity
,Buyer Reference
,Account Name
,Billing City
,Billing Postal Code
,Billing Street
,Billing Country Code
,E-Invoice Format
, as well asE-Invoice Recipient Address
andE-Invoice Recipient Scheme Id
.To avoid typos, have users use the button Set Business Entity, see Setting Business Entity.
The buyer reference is a unique identification of the invoice recipient. When doing business with German public authorities (B2G scenarios), the buyer reference usually holds the Leitweg-ID (a unique identification of the invoice recipient, see ZFB | eRechnung). In B2B scenarios, you need to agree on a buyer reference with your business partner.
The e-invoice format is taken from
ON_EInvoiceFormat
on the invoice source record orE-Invoice Format
on the related business entity, or can be determined evaluatingBilling Country Code
on the invoice andCountry Code
on the business entity, as described in E-Invoice Formats. Allowed values includePeppol BIS Billing UBL
andXRechnung UBL
.When using Peppol, the e-invoice recipient address and the address scheme identifier are subject to the conditions for Peppol Network participants, as described in E-Invoice Address and Scheme.
E-invoice recipients may request additional information, which you will then have to provide in corresponding fields.
When using Liquid templates for PDF rendering, make sure to keep the relevant information texts in the corresponding template fields.
-
Prepare the invoice line item data as required.
The fields that hold e-invoice-specific data include
Sequence
,Quantity
,Unit
,Unit Code
,Unit Price
,Tax Rate
.The available values for
Tax Rate
must be defined using tax rules.The available values for
Unit
must be defined as quantity units, which, if prepared accordingly, also setUnit Code
.JustOn recommends to set the unit on the invoice line item source using
ON_Unit
(when billing subscriptions, on the item, respectively).
Disabling E-Invoice Validation Warnings
Optionally, you can disable e-invoice validation warnings. This way, JustOn Billing & Invoice Management will ignore e-invoice validation warnings and set the e-invoice status to Created
, even if the validation has produced warnings.
-
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 row of Default.
- Select the
Ignore EInvoice Validation Warnings
. - Click Save.
Enabling E-Invoice Status Display
Users may require to easily assess the current status of the creation and distribution of an e-invoice in a graphical representation. To this end, JustOn Billing & Invoice Management provides a dedicated status component, which you can, optionally, add to the invoice record page.
To do so:
-
Open the Invoice record detail page in the Lightning App Builder.
- Navigate to an invoice.
- Click to open the Setup menu, then select Edit Page.
-
Modify the page layout.
Add the
Invoice Process States
component (under Custom - Managed) to an appropriate region of the record page. -
Click Save.
-
Click Activate.
This makes the customized record page available to users, enabling them to easily assess the current e-invoice status on the invoice detail view.
For more details about editing Lightning pages, see Create and Configure Lightning Experience Record Pages in the Salesforce Help.
Enabling E-Invoice Statuses
To enable correct e-invoice handling, you may have to add the required status values manually if you have upgraded JustOn Billing & Invoice Management from an older version. To do so:
- Click to enter Setup, then navigate to the object management settings of the Invoice object (
ONB2__Invoice__c
). - Click Fields & Relationships.
- Click the name of the
E-Invoice Status
field. -
In the Values section, click New.
Add the relevant status values, each in a new line. The required values include
Not created
Validation Error
Created
Created With Warnings
Distribution Error
In Peppol Queue
-
Click Save.
This saves the specified status values as required.
For details about modifying the values of picklist fields, see Modifying Picklist Values or Add or Edit Picklist Values in the Salesforce Help.
Enabling E-Invoice Provider Statuses
To enable correct e-invoice handling, you may have to add the required provider status values manually if you have upgraded JustOn Billing & Invoice Management from an older version. To do so:
- Click to enter Setup, then navigate to the object management settings of the Invoice object (
ONB2__Invoice__c
). - Click Fields & Relationships.
- Click the name of the
E-Invoice Provider Status
field. -
In the Values section, click New.
Add the relevant status values, each in a new line. The required values include
Queued
Validation Error
Conversion Error
Send Error
Sent
Receiver Error
Received
-
Click Save.
This saves the specified status values as required.
For details about modifying the values of picklist fields, see Modifying Picklist Values or Add or Edit Picklist Values in the Salesforce Help.