Enabling Expense Import
← Payments in Billing & Invoice Management
JustOn Billing & Invoice Management creates expenses from inbound electronic invoices. Currently, there are two options to register expenses: using an email service or via manual upload and import.
Depending on how your business handles incoming e-invoices, the configuration may involve
Enabling Expense Email Service
JustOn Billing & Invoice Management can create expenses from inbound electronic invoices. It automatically processes incoming e-invoice files received by email.
To this end, the software provides the Apex class EInvoiceEmailService. This class is to be called using a dedicated Salesforce email services.
Expense email service concepts and limitations
JustOn Billing & Invoice Management evaluates the received e-invoice XML file. On successful validation, the software creates the according expense and expense item records.
The following limitations apply:
- The email service will only process emails with one (e-invoice) XML attachment. The XML files must have the file extension
.xml
and the MIME typeapplication/xml
ortext/xml
. - If no or more than one XML files are attached to the email, no expense will be created.
- Any other attachments, like PDF files, will be attached to the produced expense record. If there is no expense created, the attachments will not be saved.
- If a submitted e-invoice fails the validation, JustOn Billing & Invoice Management creates a fallback expense of the type
Undefined
and the e-invoice statusValidation Error
. Nevertheless, the (invalid) e-invoice XML file and the additional attachments will be saved with the expense.
To configure the expense email service:
- Click to enter Setup, then navigate to Custom Code > Email Services.
- Click New Email Service.
-
Specify the details as required.
The minimum required fields include:
- Email Service Name
- Apex Class:
EInvoiceEmailService
- Accept Attachments:
All
- Active:
true
-
Click Save and New Email Address.
-
In the
Email Address
field, specify the local part of the email service address.Salesforce will generate the unique domain part for the email service address. For details, see Define Email Service Addresses.
-
Click Save.
This enables the email service to receive e-invoices and transform them into expenses. Consequently, JustOn Billing & Invoice Management will evaluate emailed e-invoice XML files and, on successful validation, create the according expenses and expense items.
Info
JustOn recommends not to disclose the generated email service address to prevent misuse. Instead, use different email address for external access and set up a (filtered) redirection – either automatically or manually by users.
Enabling Manual Expense Import
For users to be able to upload e-invoice XML files, you must add the Import E-Invoice button to the Expense list view.
- Navigate to the object management settings of the Expense object.
- Click List View Button Layout.
- In the List View row, click , then select Edit.
-
Under Custom Buttons, move
Import E-Invoice
to the Selected Buttons column. -
Click Save.
This adds the button Import E-Invoice to the Expense list view, enabling users to transfer expenses to DATEV.
List View Button Layout not visible?
Under certain circumstances, the option List View Button Layout may not be visible. In this case, make sure that the Expense object is searchable.
- Navigate to the object management settings of the Expense object.
- Click Details > Edit.
- In the Search Status section, select
Allow Search
. - Click Save.