Enabling JustOn Cash Management
Your business may use JustOn Cash Management to directly integrate Salesforce CRM with German or other European banks as well as payment service providers.
Info
The integration with JustOn Cash Management as outlined below is available as of JustOn Billing & Invoice Management 2.76.
Integration Concepts
The payment functionality shipped with JustOn Cash Management is centered around entries (see Receivables/Payables Concepts). These records hold all information with respect to an amount of money owed to or requested by a business partner, based on statements that justify the corresponding request.
In JustOn Billing & Invoice Management, the produced invoices or – if set up and used – installments represent payment requests. Now integrating JustOn Billing & Invoice Management with JustOn Cash Management provides for both
- the creation of the relevant entry records upon invoice finalization or installment creation, and
- the creation of the relevant balance records for a registered money flow (where the field
Origin
is set toJPAY1
).
Creating entries on invoice finalization or installment creation, creating balances for payments
Balance creation details
In JustOn Cash Management, registering a money flow for a payment record results in a modified amount value of the payment. "Translating" this to JustOn Billing & Invoice Management means to create or update balance records.
In the simplest use case, there are 1:1 relations – one invoice (or installment) makes one entry, and one payment for this entry makes one balance record associated to the invoice.
JustOn Cash Management can, however, relate entries with payments in an n:m relationship. This allows, for example, to distribute one money transfer to multiple entries or to settle one entry with multiple money transfers.
The integration with JustOn Billing & Invoice Management provides for the creation of the relevant balances. The system takes the registered payment amount per entry and compares it to the existing payment balance (with Origin
= JPAY1
) of the original invoice – producing new payment balance records in the amount of the difference, associated to the original invoices or, in case of overpayments, to the related account.
The following examples illustrate this behavior.
Multiple payments for one invoice
# | Step | Payment Amount | Settled Amount per Entry | Existing Balance | Produced Balances |
---|---|---|---|---|---|
1 | Finalize invoice I1 100 |
0 | I1: 0 | ||
2 | Partial payment P1 80 |
80 | 80 | I1: 0 | I1: Payment P1 -80 |
3 | Partial payment P2 20 |
20 | 100 | I1: -80 | I1: Payment P2 -20 |
Multiple payments for multiple invoices
# | Step | Payment Amount | Settled Amount per Entry | Existing Balance | Produced Balances |
---|---|---|---|---|---|
1 | Finalize invoice I1 100 |
0 | I1: 0 | ||
2 | Finalize invoice I2 100 |
0 | I2: 0 | ||
3 | Partial payment P1 180 |
180 | I1: 100 I2: 80 |
I1: 0 I2: 0 |
I1: Payment P1 -100 I2: Payment P1 -80 |
3 | Partial payment P2 20 |
20 | I1: 100 I2: 100 |
I1: -100 I2: -80 |
I2: Payment P1 -20 |
Multiple payments for an invoice with installments
# | Step | Payment Amount | Settled Amount per Entry | Existing Balance | Produced Balances |
---|---|---|---|---|---|
1 | Finalize invoice I1 100 4 installments |
0 0 0 0 |
I1: 0 | ||
2 | Partial payment P1 80 |
80 | 25 25 25 5 |
I1: 0 | I1: Payment P1 -80 |
3 | Partial payment P2 20 |
20 | 25 25 25 25 |
I1: -80 | I1: Payment P2 -20 |
Overpayment, producing a "free" balance on the account A1
# | Step | Payment Amount | Settled Amount per Entry | Existing Balance | Produced Balances |
---|---|---|---|---|---|
1 | Finalize invoice I1 100 |
0 | I1: 0 | ||
2 | Payment P1 120 |
120 | I1: 100 | I1: 0 | I1: Payment P1 -100 A1: Payment P1 -20 |
Preconditions
The integration requires JustOn Cash Management to be set up properly. For details, see Setting Up JustOn Cash Management.
The integration requires the payment method SEPA
to be set up in JustOn Billing & Invoice Management. For details, see Payment Method SEPA
.
Configuring Data Relations
Enabling Lookup
As entries are always linked to the original statements, you must allow for relating the produced entries with the original invoices or statements. To this end, you create lookup fields on the Entry object.
- Navigate to the fields list of the Entry object.
-
Create the following new fields.
Label API Name Data Type Description Invoice Invoice Lookup (Invoice) Links to the related invoice.
Must be writable.Installment Payment Lookup (Payment) Links to the related installment (Payment object).
Must be writable.
Enabling PDF Preview
Entries provide a public link to the PDF of the original statement. To support this, you must set up the corresponding public file link generation for invoices. This involves enabling the content distribution and creating the PDF preview URL field.
To enable the content distribution:
-
In Setup, 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 Default row.
- Select the checkbox
Always Create Content Distribution
. - Click Save.
To create the PDF preview URL field:
- Navigate to the fields list of the Invoice object.
-
Create the following new field.
API Name Data Type Description ContentDistributionUrl URL Specifies the public link to the PDF preview.
Make sure to grant edit access for all users who finalize invoices.
Once set up, this will copy the value from the Content Distribution URL
field on the invoice to the Statement Distribution URL
on the produced entry.
Activating Integration
To activate the integration with JustOn Cash Management, enable the corresponding global setting:
-
In Setup, 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 Default row.
- Select the checkbox
Enable JustOn Cash Management
. - Click Save.
Enabling Balance Creation
Registering a money flow for a payment record results in a modified amount value of the payment (see Integration Concepts). This modification can be used to trigger a flow that creates or updates relevant balances of the related invoices (or, if applicable, the accounts).
To this end, configure a custom flow that calls the appropriate Apex class Create payment balances
provided by JustOn.
- In Setup, navigate to Process Automation > Flows.
- Click New Flow.
- Select
Record-Triggered Flow
and click Create. -
Configure the Start element.
Option Value Object Payment
(JPAY1__Payment__c)Trigger A record is created or updated
Conditions JPAY1__SettledAmount__c
Is Changed
{!$GlobalConstant.True}
Optimize for Actions and Related Records
-
Click and add the following Action element.
Option Value Action Create payment balances
Input Values {!$Record.Id}
Specify a label and an API name as required.
-
Click Save, then Activate.
When the defined conditions are met, JustOn creates the payment balances with the field
Origin
set toJPAY1
.For help about creating flows, see Flows in the Salesforce Help.
Data Mapping
Entries hold all information with respect to an amount of money owed to or requested by a business partner. The entries' data is based on invoice data or on installments data and, if applicable, on already received payments. If a payment plan is modified after the invoice finalization producing new installments, the existing entry records are deleted, and new entry records are created accordingly.
The following fields are set on entry creation:
Data Category | Entry Field | Invoice Source Field | Installment Source Field | Default Value/Notes |
---|---|---|---|---|
General | Type | Debit for positive amountCredit for negative amount |
||
Title | Invoice: custom label with invoice number Installment: custom label with title and invoice number |
|||
Payment Reference | String built as defined in the Payment Reference field of the template, see Configuring Payment Reference Text |
|||
Business Entity | Tenant |
Invoice__r.Tenant |
The business entity record in JustOn Cash Management is modified or created on entry record creation using the values given by the invoice. | |
Requests | Requested Payment Method | PaymentMethod |
Invoice__r.PaymentMethod |
|
Requested Payment Provider | RequestedPaymentProvider |
Invoice__r.RequestedPaymentProvider |
Optional lookup to JPAY1__PaymentProvider | |
Requested Payment Instrument | RequestedPaymentInstrument |
Invoice__r.RequestedPaymentInstrument |
Optional lookup to JPAY1__PaymentInstrument | |
Requested Bank Account | RequestedBankAccount |
Invoice__r.RequestedBankAccount |
Optional lookup to JPAY1__BankAccount | |
Customer Data | BP Number | DebtorNo orAccount__r.ON_DebtorNo |
Invoice__r.DebtorNo orInvoice__r.Account__r.ON_DebtorNo |
Optional |
BP Type | Debtor |
|||
Account | Account |
Invoice__r.Account |
||
Account Name | AccountName |
Invoice__r.AccountName |
||
Contact | EmailContact |
Invoice__r.EmailContact |
||
Statement Data | Statement Type | Invoice | Installment |
||
Statement Description | ||||
Statement No | Name |
Invoice__r.Name |
||
Invoice | Id |
Invoice |
Lookup to entry source | |
Installment | Id |
Lookup to entry source | ||
Statement Distribution URL | ContentDistributionUrl |
Invoice__r.ContentDistributionUrl |
||
Dates | Statement Date | Date |
Invoice__r.Date |
|
Statement Payment Due Date | NextPaymentDueDate |
Date |
||
Service Period Start | ServicePeriodStart |
ServicePeriodStart |
||
Service Period End | ServicePeriodEnd |
ServicePeriodEnd |
||
Amount | Status | Status |
PaymentStatus |
Open → Open Paid → Balanced |
Open Amount | NextPaymentDue |
OpenPaymentAmount |