Completing Optional E-Invoice Configuration
DE E-Rechnung
FR e-facture
Enabling the e-invoice support in JustOn Billing & Invoice Management may include additional – optional or potentially required – tasks. They may be necessary for specific business use cases or if you have upgraded JustOn Billing & Invoice Management from an older version.
Make sure to complete the common e-invoice setup before executing additional tasks.
Optional tasks may include:
- Configuring custom e-invoice field mappings
- Enabling the E-Invoice Provider notification display
- Setting the e-invoice file as email attachment
- Enabling support for embedding additional documents
- Enabling the display of e-invoice statuses to users
- Disabling e-invoice validation warnings
- If applicable, enabling e-invoice statuses
- If applicable, enabling e-invoice provider statuses
Configuring Custom E-Invoice Field Mappings
Custom field mapping lets you override individual e-invoice fields by business term without a code change. You manage mapping configurations in the JustOn Billing Configuration app on the E-Invoice Field Mapping tab.
Configuring field mappings involves
- Identifying the business terms to override
- Creating the custom mapping configuration
- Activating the configuration
Prerequisites
- The common e-invoice setup is complete.
- The business entity to which the mapping will apply is fully prepared, in particular with respect to its sender address, address scheme identifier and e-invoice format.
- The invoices that should use the custom mapping have the fields
Business EntityandE-Invoice Formatpopulated. The system uses these two fields to look up the matching custom mapping at generation time. - You have administrator access to the JustOn Billing Configuration app, with permission to read and edit Configuration records.
Identifying Business Terms to Override
The custom mapping is expressed in terms of EN 16931 business terms (BT-#) and business groups (BG-#). Before creating the configuration, outline the required mapping:
- List the business terms that you need to override and the source of each value.
-
For each business term, define the intended target.
Decide one of the following:
Decision Use Case Required Information Map from a Salesforce field The value lives in a Salesforce field – either an existing standard field or a custom field on the Invoice or another object involved in the invoice generation. API names of the object and the field Set a static value The value is the same for every invoice generated for this business entity and format. The exact value to use Disable temporarily You want to keep the custom mapping rule but temporarily fall back to the standard mapping for this business term. none Exclude from the output The business term should not appear in the generated e-invoice at all, even if the standard mapping provides a value. none
For details on which business term is mapped to which JustOn Billing & Invoice Management field in the standard mapping, see Default Mapping.
Info
The allowed source objects for each business term depend on the business group context of that business term in the standard mapping. For instance, fields used for the BG-4 Seller group are typically read from Tenant__c, while fields used for the BG-7 Buyer group are typically read from Invoice__c or related account objects. The system validates that the chosen object is appropriate for the business term's business group when the mapping is applied.
Creating Custom Mapping Configuration
To create a new configuration record:
- Click to access the App Launcher, and select JustOn Billing Configuration.
- Open the E-Invoice Field Mapping tab.
- Click New Custom Mapping.
-
Select the e-invoice format and the business entity to which the new mapping should apply, then click Create.
This creates an empty mapping configuration record for the business entity/e-invoice format pair.
-
Click + Custom Mapping.
This creates an empty custom mapping configuration entry. New mapping entries are automatically set
Active. -
Search and select the relevant business term.
This displays the standard object and standard field for this business term, as well as the options to replace the standard mapping.
-
Select the mapping method and specify the required information.
Mapping Method Required Information Notes FieldSource ObjectFieldSpecifies the object and field from which to retrieve the relevant data for the e-invoice field. StaticStatic ValueProvides the exact value for the e-invoice field. RemoveRemoves the field from the e-invoice.
Use this option with extreme caution because some business terms are mandatory and cannot be removed. -
Optionally, provide a comment.
Explain why the change was done and for what purpose so that you can refer back to it in future.
-
Click Save.
This saves the configuration entry, defining the business term override.
Info
JustOn Billing & Invoice Management validates the configuration entries before saving. If a business term is not in the EN 16931 catalog, or a Salesforce field reference does not exist on the selected object, the system does not save the configuration and shows an error.
Activating Configuration
Note
Make sure that any previously active configuration for the same business entity/e-invoice format pair is inactive.
To activate a custom mapping configuration:
- Click to access the App Launcher, and select JustOn Billing Configuration.
- Open the E-Invoice Field Mapping tab.
- In the row of the (inactive) custom mapping, click to open the action menu, then select Activate.
-
Confirm the activation.
This enables the custom mapping. For every e-invoice created for an invoice whose business unit and e-invoice format match the active configuration, JustOn Billing & Invoice Management will apply the active overrides on top of the default mapping.
Only active custom mapping records with active custom mapping entries will produce a result.
Temporarily Deactivating Configuration
For testing or troubleshooting purposes, you may want to temporarily deactivate a configuration entry. To do so:
- Click to access the App Launcher, and select JustOn Billing Configuration.
- Open the E-Invoice Field Mapping tab.
- In the row of the custom mapping, click to open the action menu, then select Deactivate.
-
Confirm the activation.
This disables the custom mapping, pausing the included custom mapping entries without losing them. You can reactivate it at any time.
Individually deactivating custom mapping entry
Instead of deactivating the complete business entity/e-invoice format pair, you may want to pause an individual mapping entry. To do so:
-
In the row of the custom mapping, click to open the action menu, then select Open Custom Mapping.
This displays the list of the related mapping entries.
-
In the row of the custom mapping entry, toggle the
Activeswitch.This deactivates (or activates) the individual custom mapping entry.
Testing and Troubleshooting Configuration
JustOn recommends running an end-to-end test before relying on the new mapping for real outbound traffic. To do so:
- Create a test account and a test invoice with
Business EntityandE-Invoice Formatmatching your configuration. -
Finalize the invoice.
For details, see Preparing E-Invoice Data and Creating E-Invoices.
-
Review the resulting
E-Invoice Status,E-Invoice Provider StatusandE-Invoice Errorfields on the invoice, and download the generated XML to confirm that the overridden business terms carry the expected values.
Troubleshooting
For troubleshooting purposes, you may need to access the actual Configuration records directly. To do so:
-
Click to access the App Launcher, and select Configurations.
This displays the list of configuration records of all types.
Custom e-invoice field mappings are of the type
EN 16931 Custom Mapping. TheSubtypeandBusiness Entitycolumns indicate the business entity/e-invoice format pair. -
Click the name of the relevant record.
This opens the detail view. It displays all fields, disclosing the raw data, like the actual JSON configuration in the
Datafield.
All custom mapping errors abort e-invoice generation and prevent the invoice from being sent.
| Error | Likely Cause | Resolution |
|---|---|---|
Custom mapping configuration is invalid |
The JSON in the Data field cannot be parsed. |
Fix the JSON syntax in the Configuration record. |
Multiple active custom mapping configurations found for Business Entity and Format |
More than one Configuration record with the type EN 16931 Custom Mapping is active for the same business entity/e-invoice format. |
Deactivate the duplicates so that exactly one configuration is active for the pair. |
Invalid method value |
A mapping entry uses a value other than field, static or "". |
Correct the entry. |
| Missing required field | A method: field entry is missing obj or field, or a method: static entry is missing value. |
Add the missing field. |
| Source field not found | obj or field refer to a Salesforce object or field that does not exist or is not accessible. |
Correct the object or field names. |
| UBL or format validation error | The generated XML fails UBL 2.1 schema validation or the format-specific validator (KoSIT for XRechnung UBL and Peppol BIS Billing UBL; the ZUGFeRD validator for ZUGFeRD). | Review the validation report attached to the invoice, then adjust the source data or the mapping accordingly. |
In every error case, the invoice receives the e-invoice status Validation Error, the E-Invoice Error field is populated with the detailed message, and the invoice is not sent to the recipient or the distribution provider. This is intentional: silent fallback to the standard mapping is suppressed to make sure that you are aware of configuration issues.
Enabling E-Invoice Provider Notification Display
If you distribute e-invoices via the Peppol Network or Avalara ELR, you will receive notifications about the distribution status from the provider. JustOn Billing & Invoice Management stores this information in dedicated notification records, which are related to the original invoice.
If required, you can list related notification records on the invoice detail view. To do so:
- Navigate to the object management settings of the Invoice object (
ONB2__Invoice__c). - 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 Listfield 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.
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 Typesremains empty, JustOn Billing & Invoice Management assumesInvoice PDFas 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-InvoiceYour 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 Typesfield, specifyE-Invoice. - Click Save.
Enabling Supporting Document Embedding
Optionally, JustOn Billing & Invoice Management can embed the files that are attached to invoice records in the e-invoice XML files, such as the produced invoice PDF, files linked from source records or files uploaded manually by users. Any type of file you potentially want to embed in the e-invoice XML must be defined as a content version type – that is, they must be specified in the Type field of the Content Version object. Files produced by JustOn Billing & Invoice Management are already assigned a proper type, like Invoice PDF. If required, you can define a custom content version type to embed also other files in the e-invoice generation.
In addition, you define the files to be embedded in the e-invoice. To do so, you specify their content version type in the Invoice field Supporting Document Types. This field can be populated on invoice creation from other records using the following fallback mechanism:
ON_SupportingDocumentTypes from the account or invoice source record
↳ Supporting Document Types from the template
↳ Supporting Document Types from the business entity
Supporting document embedding specifics
When configuring the files to be embedded in e-invoice XML files, be aware of the following specifics:
-
Once the Invoice field
Supporting Document Typesis set, no other business process will overwrite it.However, users can change the value as long as the invoice is not finalized.
-
If
Supporting Document Typesis left empty, JustOn Billing & Invoice Management will not embed any invoice attachments. - If
Supporting Document Typescontains the stringALL, all invoice attachments with or without a defined content version type will be embedded in the e-invoice. -
If
Supporting Document Typescontains the stringBLANK, all invoice attachments where the content version type is empty will be embedded in the e-invoice.Use
ALLorBLANKwith extreme caution to avoid disclosing confidential information by mistake. -
The number of supporting documents must not exceed 200.
- The allowed file types for supporting documents include PDF, PNG, JPG, JPEG, CSV, XLSX, ODS.
- Base64 encoding causes an overhead of about one third compared to the size of the original binary data (see Base64).
- The cumulated size (Base64 encoded) must not exceed 11 MB. That is, the original attachment size must not exceed 8 MB approx.
- The overall XML size must not exceed 15 MB.
For more details, see Technische Informationen zu den Nutzungsbedingungen DE.
If you use supporting documents for both embedding in e-invoices and attaching to accounting documents, the maximum size of the produced XML file must not exceed 3,76 MB.
Defining Content Version Type
To define a custom content version type:
- Click to enter Setup, then navigate to the object management settings of the Content Version object.
- Click Fields & Relationships.
- Click the name of the
Typefield. -
In the Values section, click New.
Add the required content version types, like
Signed PDF,Supporting DocumentorT&C, each in a new line.
-
Click Save.
For help about editing picklists, see Modifying Picklist Values.
Defining Preselected Supporting Documents
To define the preselected supporting documents to be embedded in the e-invoice 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 Value Supporting Document Types ON_SupportingDocumentTypes Text(255)
Formula (Text)comma-separated list of content version types 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 the preselected supporting documents to be embedded in the e-invoice from the template or the business entity:
- Open the relevant template or business entity.
- Click Edit.
-
In the
Supporting Document Typesfield, specify the content version types as necessary.The field can contain multiple values in a comma-separated list.
Typical use cases for embedding files may include:
- invoice PDF file:
Invoice PDF - invoice PDF file and invoice-related source documents:
Invoice PDF,Supporting Document - invoice PDF file and terms and conditions:
Invoice PDF,T&C
- invoice PDF file:
-
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.
Drag the
Invoice Process Statescomponent (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.
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 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 Statusfield. -
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
Avalara Processing Complete
In Avalara 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 Statusfield. -
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
Completed -
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.