Setting Up Account Statement Management
← Setting Up Overdue Receivables Management
Account statements are reports that show the billings and payments of a given account for a specific time period.
JustOn Billing & Invoice Management implements account statements using specific statement records that summarize the account's balances.
Understanding account statements
Businesses may want to remind customers of sales that have not yet been paid – but perhaps without expressly stating an overdue receivable and without starting a dunning process. To this end, they create, for example, monthly reports on issued invoices and received payments, and send them out to their customers.
Usually, these statements include all unpaid invoices, even if they are not yet due. In this sense, they are still a collection tool, because they prompt customers to pay.
Implementation details
To support accounting purposes, JustOn Billing & Invoice Management allows for generating account statements – reports that summarize the balances of a given account for a specific time period. PDF copies of the account statements can then be distributed to the corresponding recipients.
Account statements can have different statuses:
- Draft: New account statements have the status
Draft
. You can check draft account statements for correctness and edit them as necessary. - Closed: Finalizing account statements sets them to
Closed
and generates the PDF account statements to be sent out.
There are two ways to create account statements:
- individually for a single account using the function Account Statement,
- for multiple accounts using the Statement Runs functionality.
After reviewing them, you can then distribute the generated account statements.
If the involved balances relate to business entities, JustOn Billing & Invoice Management groups the balances by their business entity and, consequently, creates separate account statements for each account-business entity pair. In this case, you may want to add the field Business Entity
to the list of displayed fields of the Statements list view (see Modifying Page Layouts or Search Layouts) so that the business entity to which an account statement relates will immediately be visible.
When creating an account statement for balances without related business entity, JustOn Billing & Invoice Management will associate the produced account statement with the default business entity (if set).
Setting up account statement management may involve the following tasks:
-
Basic configuration
- Customizing the account statement PDF copy
- Adding the button Account Statement to the account page
- Adding the account statement list to the account page
-
Additional options
- Enabling contact roles for the account statement distribution
- Enabling invoice PDF attachments
- Enabling account statement filters
- Enabling duplicate draft account statements
-
Advanced options for specific use cases
Info
For details about account statement creation and distribution, see Managing Account Statements.
Basic Account Statement Configuration
Customizing Account Statement PDF
JustOn ships a default template detail Account Statement, used to overwrite certain template fields when generating account statements and printing the corresponding PDF files.
Info
If you use account-specific templates (referred to using the ON_Template
field on the account), you need a template-specific Account Statement template detail as well. Use the default Account Statement template detail as a model when creating your custom template details associated to account-specific templates.
As a fallback, make sure to keep the default template (named Default
) and its associated Account Statement template detail.
Configuring the Account Statement template detail according to your organization's requirements may involve:
- Adjusting the account statement table display
- Modifying text building blocks
- Adjusting custom labels
Adjusting Account Statement Table
The account statement is made up of balances, hence the account statement template detail overwrites the balance table definition. As explained in Balance Table Concepts, there are two fields that control the balance table display: Balance Columns
and Balance Types
.
Account Statement Table Concepts
The field Balance Columns
defines the columns for the balance table, where the definition must be a list of balance field API names separated by semicolons. The default value in the Account Statement template detail is:
BalanceTitle;Date__c;OpenAmount;AmountGT
where
OpenAmount
displays the open amount of invoices/credits on the creation date of the account statement,AmountGT
adds an additional row that shows the aggregated amount of all balances before the account statement start date.
Your business may require to display the related invoice of a balance record. To this end, add the field InvoiceNo__c
to the balance table configuration (see Modifying Account Statement Table Columns).
The field Balance Types
specifies a mapping (in JSON notation) of the values defined in the Type
field of the Balance object to some display text (which can include placeholders). The default value for account statements is:
[ {
"type" : "Payment",
"title" : "Payment"
}, {
"type" : "Refund",
"title" : "Refund"
}, {
"type" : "Prepayment",
"title" : "Prepayment"
}, {
"type" : "Payout",
"title" : "Payout"
}, {
"type" : "Clearing",
"title" : "Clearing"
}, {
"type" : "Settlement",
"title" : "Settlement for Invoice [RelatedInvoiceNo]"
}, {
"type" : "Dunning Fee",
"title" : "Dunning Fee"
}, {
"type" : "Invoice",
"title" : "Invoice"
}, {
"type" : "Credit",
"title" : "Credit"
}, {
"type" : "Manual",
"title" : "Manual"
} ]
Types that are not specified in the mapping are not displayed on the account statement.
If required, you can define an aggregation per balance type. This results in a single line on the account statement even if there are multiple balances available. The value aggregation is to be defined using the following pattern:
"aggregate" : {"FIELDNAME1":"FUNCTION","FIELDNAME2":"FUNCTION"}
The following aggregation functions are available:
Function | Supported Data Types | Description |
---|---|---|
SUM | Numeric and string values | Adds up all values, preserves Null values. |
MIN | Numeric, Date and DateTime values | Selects the minimum of all values, preserves Null values. |
MAX | Numeric, Date and DateTime values | Selects the maximum of all values, preserves Null values. |
LAST | Numeric, string and Date values | Selects the last processed value. |
CLEAR | Numeric, string, Date and DateTime values | Allows to explicitly clear fields on the aggregated balance. |
To aggregate, for example, balances of the type Payment
, you can use:
{
"type" : "Payment",
"title" : "Payment",
"aggregate" : {"Amount__c":"SUM", "Reference__c":"SUM"}
}
Modifying Account Statement Table Columns
Depending on your organization's requirements, you must add or remove columns or change their sequence modifying the Balance Columns
field (see Account Statement Table Concepts).
-
Open the relevant Account Statement template detail.
Depending on your use case, you may have to edit the template detail associated to an account-specific template or the one associated to the Default template.
-
In the Information section, click next to the
Balance Columns
field and specify the balance column configuration as required.Alternatively, you can click Edit in the detail view to edit the field.
-
Click Save.
Example: Displaying related invoice
Displaying the number of the related invoice together with a balance record involves the following tasks:
-
Creating a custom formula field (for example,
InvoiceNo
) on the Balance object that retrieves the number of the related invoice using this formula:ONB2__Invoice__r.Name
-
Specifying the required balance column configuration in the
Balance Columns
field of the invoice, likeBalanceTitle;InvoiceNo__c;Date__c;OpenAmount;AmountGT
Modifying Account Statement Type Display
You can configure which balance types are to be displayed in the balance table and modify their display names modifying the Balance Types
field (see Account Statement Table Concepts).
-
Open the relevant Account Statement template detail.
Depending on your use case, you may have to edit the template detail associated to an account-specific template or the one associated to the Default template.
-
In the Information section, click next to the
Balance Types
field and specify the balance type configuration as required.Alternatively, you can click Edit in the detail view to edit the field.
-
Click Save.
Modifying Template Detail Texts
Depending on your organization's requirements, you must modify the text building blocks for the account statement. Usually, the relevant texts are included in the following fields of the Account Statement template detail:
Field | Description | Default Value |
---|---|---|
Display Type | Specifies the type of the document to be printed to the PDF. | Statement of account |
Info Right | Defines an area for printing general information like a page counter and the date above the actual document text. You can use all account and dunning placeholders here. |
Date: [DunningDate] |
Text 1 | Specifies the text to be rendered above the account statement table, can include placeholders. | |
Email Subject | Defines the default email subject, can include placeholders. | Statement of account |
Email Body | Defines the plain text body for the email, can include placeholders. Line breaks are considered. |
|
PDF Name | Specifies the name pattern for the generated PDF file, can include placeholders. | AccountStatement_[AccountName|cut:70].pdf |
To modify the texts:
-
Open the relevant Account Statement template detail.
Depending on your use case, you may have to edit the template detail associated to an account-specific template or the one associated to the Default template.
-
Click next to the relevant field and specify the corresponding text as required.
Alternatively, you can click Edit in the detail view to edit all fields at once.
-
Click Save.
Adjusting Custom Labels
Depending on your organization's requirements, you can modify the labels used in the account statement table. These labels are defined as custom labels in Salesforce.
Custom Label | Default Value |
---|---|
Balance | Balance |
BalanceAggregatedRow | Balance amount up to [BalanceDate] |
AmountGT | Amount |
OpenAmount | Open Amount |
BalanceTitle | Item |
Note
To modify custom labels, you must enable the Translation Workbench. For details, see Enable and Disable the Translation Workbench in the Salesforce Help.
-
Click to enter Setup, then open the Custom Labels list.
In Salesforce Lightning, navigate to User Interface > Custom Labels.
In Salesforce Classic, navigate to Create > Custom Labels.
-
Click the name of the label you want to modify.
- Click New Local Translations/Overrides.
- Select the target language and specify the text as required.
- Click Save.
Info
For help about modifying custom labels, see Create and Edit Custom Labels in the Salesforce Help.
Enabling Account Statement Generation for Single Accounts
To enable the option for individually creating an account statement, add the Account Statement button to the account detail view.
Note
When upgrading JustOn Billing & Invoice Management from a pre-2.97 version, you must remove the deprecated account statement button (labeled Deprecated Account Statement
) from the layout and add the new Account Statement button.
- Navigate to the object management settings of the Account object.
- Click Page Layouts.
- In the Account Layout row, click Edit.
-
Add the Account Statement button to the page layout.
In Salesforce Lightning, drag the button from the Mobile & Lightning Actions palette to the Salesforce Mobile and Lightning Experience Actions section.
In Salesforce Classic, drag the button from the Buttons palette to the Custom Buttons area.
-
Click Save to save the modified page layout.
For help about modifying page layouts, see Managing Page Layouts.
Enabling Account Statement List Display
Optionally, you can enable the display of related account statements on the account detail page using Salesforce's related list functionality (see Work with Related Lists on Records in the Salesforce Help).
- Navigate to the object management settings of the Account object.
- Click Page Layouts.
- In the Account Layout row, click Edit.
- Select the Related Lists palette.
- Drag the Statements list to the Related Lists section.
- Click Save to save the modified page layout.
For help about modifying page layouts, see Managing Pages.
Additional Account Statement Options
Enabling Contact Roles for Account Statement Distribution
You can use contact roles to pre-populate contact and address fields when executing an account statement run. JustOn supports contact roles as defined using the custom picklist field JustOn Contact Role
on the Contact object or on the Account Contact Relationship object.
Depending on your business requirements or use cases, proceed as follows:
- For users with a JustOn license, you add the managed field
JustOn Contact Role
(API nameONB2__ContactRole__c
) to the page layout of the Contact object. -
For users without a JustOn license, the managed Contact field
ONB2__ContactRole__c
is not visible. If you still must support contact roles on contacts, you create the custom fieldJustOnContactRole
on the Contact object, which replicates the behavior ofONB2__ContactRole__c
but is available for other Salesforce users.Once the custom field is defined, it takes precedence over the managed field.
-
If you need the contact role functionality on account–contact relationships, you create the custom field
JustOnContactRole
on the Account Contact Relationship object.
JustOn Contact Role priority
- If both
JustOn Contact Role
on the account–contact relationship andJustOn Contact Role
on the contact are set, the role defined on the account–contact relationship (irrespective of whether it is a primary or secondary relation) has priority over the role defined on the contact. - If
JustOn Contact Role
is set both on a direct and an indirect account–contact relationship, the role defined on the direct account–contact relationship (primary relation) has priority over the role defined on the indirect account–contact relationship. -
JustOn Billing & Invoice Management considers JustOn contact roles defined on primary contacts (related via a direct account–contact relationship) only.
If you need a JustOn contact role on a secondary contact (related via an indirect account–contact relationship), you must define it on the corresponding ACR record.
-
Salesforce allows time limitations and an explicit
Active
status for account–contact relationships. These settings, however, do not have influence on the priority of the assigned JustOn contact roles. If an account–contact relationship is valid on a given date, JustOn Billing & Invoice Management will consider the assigned contact role.You must make sure to not assign two or more contacts with the same role to an account. If this is the case, the system randomly picks one of them, which may produce unwanted results.
-
Contact role settings on the account–contact relationship (ACR) and on the contact can complement each other, as long as they are not in conflict.
- For compatibility reasons, JustOn Billing & Invoice Management still supports existing Salesforce Classic Account Contact Roles. If available, they take general precedence over the values set in the
JustOn Contact Role
fields on the contact or the account–contact relationship.
To keep control simple, use JustOn contact roles either on contacts or on account-contact relationships only. If you decide to use account-contact relationships, JustOn recommends to use JustOn contact roles on account-contact relationships for more flexibility.
The examples in JustOn Contact Role Priority illustrate the behavior.
Using Managed Contact Role Field on Contact
To add the managed field JustOn Contact Role
(API name ONB2__ContactRole__c
) to the page layout of the Contact object:
- Click to enter Setup, then navigate to the object management settings of the Contact object.
- Click Page Layouts.
- In the Contact Layout row, click Edit.
- Drag the
JustOn Contact Role
field to the page layout. -
Click Save.
For help about modifying page layouts, see Managing Pages.
Creating Custom Contact Role Field on Contact
To create the custom field JustOnContactRole
on the Contact object to replicate the behavior of ONB2__ContactRole__c
:
-
Click to enter Setup, then navigate to the fields list of the Contact object.
Open the field configuration for
JustOn Contact Role
in a new browser window or tab for later reference. -
Create the following new field.
Label API Name Data Type Values JustOn Contact Role JustOnContactRole
Picklist (Multi-Select) Copy all picklist entries from JustOn Contact Role
that are needed for your org's uses cases.
Make sure to use the same API names for the picklist entries.For help about creating fields, see Managing Object Fields in the JustOn Documentation or Create Custom Fields in the Salesforce Help.
-
Allow the relevant users access to the new field either by adding it to their assigned profiles or permission sets.
For details, see Set Field Permissions in Permission Sets and Profiles in the Salesforce Help.
-
Allowlist the new field to make it accessible for database queries.
To this end, create the new Field Whitelist record
JustOnContactRole__c
. -
Add the new picklist field (API name
JustOnContactRole
) to the Contact layout.Remove, if necessary, the managed field (API name
ONB2__ContactRole__c
) from the layout.For help about modifying page layouts, see Managing Pages or Page Layouts in the Salesforce Help.
Creating Contact Role Field on Account Contact Relationship
Salesforce allows associating one contact to multiple accounts through the Account Contact Relationship object. For details and configuration instructions, see
- Contacts to Multiple Accounts in the Salesforce Help
-
Set Up Contacts to Multiple Accounts
JustOn recommends to add both the Related Accounts related list to the relevant Contact page layouts and the Related Contacts related list to the relevant Account page layouts.
Once set up accordingly, you can enable JustOn contact roles on account–contact relationships. To this end, you create the custom field JustOnContactRole
on the Account Contact Relationship object:
-
Click to enter Setup, then navigate to the fields list of the Account Contact Relationship object.
Open the field configuration for
JustOn Contact Role
on the Contact object in a new browser window or tab for later reference. -
Create the following new field.
Label API Name Data Type Values JustOn Contact Role JustOnContactRole
Picklist (Multi-Select) Copy all picklist entries from JustOn Contact Role
on the Contact object that are needed for your org's uses cases.
Make sure to use the same API names for the picklist entries.For help about creating fields, see Managing Object Fields in the JustOn Documentation or Create Custom Fields in the Salesforce Help.
-
Allow the relevant users access to the new field either by adding it to their assigned profiles or permission sets.
For details, see Set Field Permissions in Permission Sets and Profiles in the Salesforce Help.
-
Allowlist the new field to make it accessible for database queries.
To this end, create the new Field Whitelist record
JustOnContactRole__c
.If you have already allowlisted the custom field
JustOnContactRole
as created on the Contact object, do not create a second record. A Field Whitelist record allowlists a field, irrespective of its object. -
Add the new picklist field (API name
JustOnContactRole
) to the Account Contact Relationship layout.For help about modifying page layouts, see Managing Pages or Page Layouts in the Salesforce Help.
Once enabled, you can define contact roles for the account statement distribution use cases.
Enabling Invoice PDF Attachments
You can attach the related invoice PDF files to the account statement. To enable the invoice PDF attachment, the feature has to be activated in the global settings.
-
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 Default row.
- Select the checkbox
Attach Invoice PDFs to Account Statement
. - Click Save.
Note
Note that processing large or many PDF files may quickly exceed the Apex heap size limit.
Enabling Account Statement Filters
With each account statement run, JustOn creates statements for all accounts that have balances produced in the selected period. If there are many accounts, the number of produced account statements may become difficult to handle. To prevent this, you can define filters that restrict the statement run scope on an account basis. This helps keeping the account statements separated if you work, for example, with multiple business entities.
Info
The option to create account statement filters is available as of JustOn 2.51.
An account statement filter defines the following fields:
Field Name | Required | Description | Example Value |
---|---|---|---|
Name | A unique name for the filter, will be available as an option value when triggering the statement run. Must not exceed 38 ASCII characters. Special characters like brackets will be URL encoded, which makes them count three, like ( makes %28 . |
Statements for <company name> |
|
Target | Specifies the API name of the target object. For account statement filters, always use Account . |
Account |
|
Condition | Specifies a condition expression as used in an SOQL WHERE clause to restrict the set of included records. Starting with JustOn 2.74, the SOQL expressions in filter conditions must not contain line breaks. |
Tenant__c = '<company name>' |
|
Use Case | Specifies the specific filter use case. For account statement filters, always use AccountStatement . |
AccountStatement |
To create an account statement 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 account statement filter as required.
For help about creating filters, see Filters.
Once you have defined an account statement filter, users can select it when invoking an account statement run.
Info
Note that filters are not available when creating an account statement directly from the account.
Enabling Duplicate Draft Account Statements
By default, JustOn does not allow multiple draft account statements for the same period and filter. Repeatedly executing a statement run with the same parameters will not produce new draft statements.
You can, however, change this behavior enabling the corresponding setting in the global settings:
-
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 Default row.
- Select the checkbox
Multiple Draft Statements
. -
Click Save.
This forces JustOn to create a new account statement with each statement run.
Info
The option to allow duplicate account statements is available as of JustOn 2.51.
Advanced Account Statement Options
Automating Account Statement Email Dispatch
Your organization's business may require to send invoice or statement emails automatically upon finalization when certain conditions become true.
To support this scenario, you add the checkbox AutoSend
to the Invoice or Statement object. You can then apply custom logic to have this checkbox set selectively on specific records or globally on all produced records using a formula, the ON field mechanism or a Salesforce Flow. Remember that for an invoice or statement to be considered in the email distribution, the checkbox Email Invoice
or, respectively, Email Statement
must be selected.
Note
For the auto send feature to work, the custom setting Auto Queue Emails After Finalization
must not be selected.
- Navigate to the fields list of the Invoice or Statement object.
-
Create the following new field.
API Name Data Type Description AutoSend Formula (Checkbox)
CheckboxWhen selected, JustOn Billing & Invoice Management will automatically send the emails on invoice or statement finalization. For help about creating fields, see Managing Object Fields.
Info
If mandatory file attachments are missing (Invoice PDF
or E-Invoice
, if defined accordingly), JustOn Billing & Invoice Management will write an error message to the invoice field Email Error
and exclude the corresponding email from sending.
Defining Balance Sort Order
By default, the entries of the account statement are sorted by the balances on which they originally base. The first order criterion is their type, the second their date. Since the balance's Type
field is a picklist field, which has its own sort order, the resulting display order may not resemble the usual alphabetical or numerical order.
You can, however, define a custom sort order. To do so, you create the custom field CustomSequence__c
on the Balance object. You can then specify your sorting criterion as a formula, which produces a value that is sorted alphabetically or numerically.
- Navigate to the fields list of the Balance object.
-
Create the following new field.
API Name Data Type Description CustomSequence Formula Specifies the sorting criterion, returns a value that is sorted in alphanumeric order. Formula(Text)
values are sorted alphabeticallyFormula(Date)
values are sorted by dateFor help about creating fields, see Managing Object Fields.
The following examples illustrate the behavior:
Criterion | Formula | Return Type | Example Value |
---|---|---|---|
Sort by type, then by amount | TEXT(Type__c) + TEXT(Amount__c) |
Text | Invoice100,00 |
Sort by date | Date__c |
Date | 2017-11-30 |
Sort by invoice record | Invoice__c |
Text | a01000000000001 |
Disabling Manual Account Statement Status Modification
Account statements are supposed to be finalized using the Finalize functionality. Finalizing account statements sets them to Closed
and generates the PDF account statements to be sent out.
To prevent users from accidentally (or incorrectly) changing the account statement status manually, you set the Status
field to Read-Only
.
- Navigate to the object management settings of the Statement object.
- Click Page Layouts.
- In the Dunning Layout row, click Edit.
- Click
next to the
Status
field to open the field properties. - Select the
Read-Only
checkbox. - Click OK to save the field properties.
-
Click Save to save the modified page layout.
For help about modifying page layouts, see Managing Pages.