Skip to content

Setting Up Balance Management Options

JustOn creates balances for invoices, credits, payments, refunds, dunning fees, etc. Setting up balance management options involves the following tasks:

Enabling Balance Overpayment

In order to enable balance overpayment, the feature has to be activated in the global settings.

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Global Settings.

  3. Click Edit in the Default row.
  4. Select the checkbox Allow Overpayments.
  5. Click Save.

Enabling Automatic Balance Write-Off

In order to enable the automatic balance write-off, the feature has to be activated in the global settings.

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Global Settings.

  3. Click Edit in the Default row.
  4. Specify the write-off settings as required.

    The following global settings control the behavior of the automatic write off:

    Field Type Description
    Write-Off Threshold Percent (13,5) Defines a percentage for the threshold that triggers the automatic creation of a write-off balance when a payment is registered.
    Write-Off Cap Amount Number (13,5) Defines an amount for the threshold that triggers the automatic creation of a write-off balance when a payment is registered.
    Finalization Write-Off Amount Number (13,5) Defines an amount for the threshold that triggers the automatic creation of a write-off balance when an invoice is finalized.
    Write-Off Currency Text (3) Specifies the ISO code of the currency to be used for a threshold amount.

    Info

    For creating write-off balances after payment, you can combine the percentage and the absolute amount. In this case, JustOn limits the calculated threshold to the specified amount.

    Creating write-off balances on finalization supports absolute amounts only.

  5. Click Save.

Modifying Balance Write-Off Reasons

Depending on your business requirements, you may have to modify the reasons for the (manual) balance write-off. To this end, you edit the value picklist for the Write-Off Reason field of the Balance object.

  1. Navigate to the Write-Off Reason field of the Balance object.
  2. In the Values section, modify the picklist values as necessary.

    • To create a new value, click New.
    • To edit an existing value, click Edit in the row of the value to be edited.

    Note

    Do not modify the picklist values Missing amount below threshold and Invoice below threshold because JustOn uses them when automatically creating write-off balances.

  3. Specify the details as required, then click Save.

  4. To delete a value, click Del in the row of the value to be removed, and confirm the operation.

Configuring Balance Table on Invoices

With an existing invoice balance, JustOn automatically prints the balance to the invoice PDF.

Balance Table Concepts

An invoice balance usually alters the payment amount - this is why the balance records are not printed as a separate table but as part of the invoice table between the invoice grand total and the final payment amount, like illustrated below:

Pos Title Quantity Tax Rate Unit Price Pos Total
1 Product 1 0,00% 25,00 25,00
Subtotal (net) 25,00
Tax (0,00%) 0,00
Grand Total 25,00
Prepayment 2017-03-02 -10,00
Payment Amount 15,00

There are two template fields that control the display of the corresponding balance information:

Template Field Description
Balance Columns Defines the columns for the balance table. The definition must be a list of balance field API names separated by semicolons. If BalanceTitle is used, the column will display the text defined in the field Balance Types.
The default definition is BalanceTitle;Date__c;Amount__c
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).
Types that are not specified in the mapping are not displayed on the invoice.

The default balance type mapping 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"
} ]

Modifying Balance Table Columns

Depending on your organization's requirements, you must add or remove columns or change their sequence.

  1. Open the template to be edited.
  2. In the Information section, double-click 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.

  3. Click Save.

Info

You can use any balance field. Note that the specified order defines the column sequence.

Modifying Balance Type Display

You can configure which balance types are to be displayed in the balance table and modify their display names.

  1. Open the template to be edited.
  2. In the Information section, double-click 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.

  3. Click Save.

Hiding Balance Table

Depending on your business requirements, you may need to prevent the balance table from being printed. There are two ways to hide the balance table:

  • emptying the Balance Types field,
  • using a custom CSS rule.

Hiding Balance Table Clearing Balance Types

You can prevent the balance table from being printed, clearing the field contents. This takes advantage of the fact that balance types that are not specified in the Balance Types field are not displayed on the invoice.

  1. Open the template to be edited.
  2. In the Information section, double-click the Balance Types field and clear its contents.

    Alternatively, you can click Edit in the detail view to edit the field.

  3. Click Save.

Hiding Balance Table Using CSS

Alternatively, you can apply a custom CSS rule that hides the balance table:

  1. Open the template to be edited.
  2. In the Layout & Design section, double-click the Custom CSS field and specify the following CSS code:

    tr.balances {
        display: none;
    }
    
  3. Click Save.

Scheduling Balance Assignment

You can set up a job in order to have balances automatically assigned to open invoices on a regular basis.

The balance assignment job does not require additional parameters. That is, you can set up the job directly for the corresponding batch chain AssignBalancesChain. For details, see Scheduling Concepts.

To schedule the balance assignment batch chain, you can use either JustOn's Scheduled Jobs page or Salesforce's Schedule Apex functionality. For details, see Scheduling a Job.

Via JustOn's Scheduled Jobs page:

  1. Open the Scheduled Jobs page.

    Use the following URL https://login.salesforce.com/apex/ONB2__JobsSetup, or, if you are already logged in, append apex/ONB2__JobsSetup to your org's domain name.

    As of JustOn 2.52, you can access the Scheduled Jobs page via the JustOn configuration app (App Launcher > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select Batch Chain Job.

  3. In the Job Name field, specify AssignBalancesChain.
  4. From the Start Time drop-down list, select the preferred execution time.
  5. Optionally, edit the displayed cron expression to adjust the execution time.
  6. Click Schedule.

    This sets up the balance assignment to be executed at the specified time.

Info

From the Scheduled Jobs page, you can also run the batch chain immediately.

Via Salesforce's Schedule Apex functionality:

  1. In Setup, open Apex Classes.

    In Salesforce Lightning, navigate to Custom Code > Apex Classes.

    In Salesforce Classic, navigate to Develop > Apex Classes.

  2. Click Schedule Apex on top of the list.

  3. Specify the details as required.

    • Job Name: AssignBalancesChain
    • Apex Class: ScheduledBatchChain
    • Frequency: Weekly or Monthly (with an according weekday or day of month setting)
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the balance assignment to be executed at the specified time.

For more details about job scheduling, see Scheduling a Job in the JustOn documentation and Schedule Apex in the Salesforce Help.

Enabling Balance Tab Access

JustOn 2.61 has introduced the tab Balances. If you have upgraded JustOn from an earlier version, you must specifically allow accessing the new tab.

  1. Open the permission set for which you want to allow access to the Balances tab.
  2. Click Object Settings > Balances > Edit.
  3. In the Tab Settings section, select Available and Visible as intended.
  4. Click Save.

    For details, see View and Edit Tab Settings in Permission Sets and Profiles in the Salesforce Help.

Enabling Balance Export

Your business may require to export SEPA bank transfer orders for account balances that are not assigned to invoices.

SEPA XML export

Your organization's business may require to export bank transfer orders for invoices or account balances. These payment orders can then directly be used by banks for triggering the corresponding payment operations.

JustOn supports two common implementations of (interchangeable) bank transfer orders:

For open invoices whose payment method is either Bank Transfer or Direct Debit, you use the invoice export mechanism to produce SEPA XML files for debits or credits (depending on whether the invoice states a positive or a negative amount).

Invoice export history

In addition to the actual export file (CSV or SEPA XML, according to the applied export setting), the export operation produces an Invoice Export History record for each exported invoice. The history holds the following information:

  • Export time
  • Effective payment due date (for installment invoices)
  • File name and link to the exported file
  • Flag stating whether a payment balance has been created
  • Flag that controls whether to prevent repeated exports
  • Flag stating whether an invoice has been exported more than once (forced export)

    The Times Exported field on the invoice shows the export count.

You can also export SEPA transfer orders from account balances that are not assigned to an invoice. Upon export, balances of the types Refund or Payout produce SEPA Direct Debit orders, and balances of the types Payment or Prepayment produce SEPA Credit orders. When exporting account balances, the exported balances as well as generated reverse balances (if set up to do so) are locked. Locked balances are exempt from certain business processes like (further) exports or automatic balance assignment.

Enabling this functionality involves these tasks:

Info

For information about configuring the SEPA XML export, see Configuring SEPA Direct Debit Export and Configuring SEPA Credit Export.

Adding Export Button

To add the Export button the Balances related list:

  1. Navigate to the object management settings of the Account object.
  2. Click Page Layouts.
  3. In the Account Layout row, click Edit.
  4. Scroll to the Balances list in the Related Lists section, and click to open the list properties.
  5. Open the Buttons section.
  6. Under Custom Buttons, move Export to the Selected Buttons column.

    rel_list_prop
    Adding a custom button to a related list

  7. Click OK to save the list properties.

  8. Click Save to save the modified page layout.

    For help about modifying layouts, see Managing Pages.

Enabling Balance List Display

You enable the display of related balance records on the account detail page using Salesforce's related list functionality (see Work with Related Lists on Records in the Salesforce Help).

  1. Navigate to the object management settings of the Account object.
  2. Click Page Layouts.
  3. In the Account Layout row, click Edit.
  4. Select the Related Lists palette.
  5. Drag the Balances list to the Related Lists section.
  6. Click Save to save the modified page layout.

    For help about modifying page layouts, see Managing Pages.

Enabling Custom Collective Account Rule

Collective accounts

Depending on your business processes, you may create specific invoice bookkeeping data, payment bookkeeping data or subscription bookkeeping data that are not assigned to a revenue-related G/L account. Accounting systems like DATEV or SAP, however, still require an account number. To handle these scenarios, you can use collective accounts. They define account numbers for booking details without dedicated account numbers - primarily, for taxes or deferred revenues, but also for other use cases like payment bookkeeping data.

By default, JustOn determines the best matching collective account based on available criteria like Business Entity, Payment Provider, etc. (see Collective Account Concepts). In addition, you can use a custom rule, which takes precedence over other criteria. To this end, you create the custom formula field CollectiveAccountRule__c on the Balance object. This way, you can apply certain logic to determine the criterion by which a collective account is associated to a balance and, consequently, to the exported booking detail.

  1. Navigate to the fields list of the Balance object.
  2. Create the following new field as required.

    Field API Name Data Type Description
    CollectiveAccountRule Formula (Text) Determines the criterion by which a collective account is associated to a balance.

    For help about creating fields, see Managing Object Fields.

Next steps:

Managing Balances

Return to JustOn Administration.