action.skip

Enabling Pro Forma Invoices

← Setting Up Invoice Management

Certain business use cases require merchants or suppliers to issue statements that specify the value of a sale transaction without being an actual payment request. To this end, JustOn allows for creating pro forma invoices.

JustOn Billing & Invoice Management supports pro forma invoices when billing arbitrary objects.

Basically, the creation of a pro forma invoice is controlled using the ON field ON_Type on the source object. If this field is set to Proforma, JustOn generates a pro forma invoice.

For details on pro forma invoices in JustOn, the usual workflow, etc., see Pro Forma Invoices.

Enabling pro forma invoices in JustOn involves the following tasks:

If required, you can optionally

Adding Pro Forma Invoice Fields to Source Objects

In order to hold the required pro forma invoice data, you must add new fields to the source object. Remember that JustOn Billing & Invoice Management supports pro forma invoices when billing arbitrary objects, so the source object can be any object if you use the generic invoice run.

Info

You add the pro forma invoice fields to the source object in addition to the fields required for billing arbitrary objects.

  1. Navigate to the fields list of the source object.
  2. Create the following new fields.

    API Name Data Type Description
    ON_Type Text (255) Must be set to Proforma in order to create pro forma invoices. Is cleared automatically when the pro forma invoice is closed.
    ON_ProformaInvoice Lookup (Invoice) Shows the related pro forma invoice.

    For help about creating fields, see Managing Object Fields.

Info

If you need multiple billing configurations when billing arbitrary objects, JustOn must distinguish between different sets of field configurations using control field suffixes. To this end, append recipient-specific suffixes to the ON fields, as explained in Enabling Pro Forma Invoices for Multiple Parties.

Configuring Pro Forma Invoice Display

Usually, a pro forma invoice needs other texts on the printed document than the final invoice. You can therefore define a template detail – named Proforma – to provide appropriate texts.

For further information about template details and invoice PDF contents, see Configuring Template Details and PDF Contents.

The following fields are relevant on the template and the template detail:

Field Description Example Target
Display Type Specifies the type of the invoice to be printed to the PDF. It should reflect the nature of the pro forma or deposit invoice. Advance Invoice Template Detail
Text 2 Text to be rendered below the invoice line item table. Use it, for example, to describe how the deposit can be made (bank account etc.) and to specify the payment terms. Template Detail
Deposit Title Short description of the nature of the deposit
This field is mandatory if you have set a deposit rate or a deposit amount.
Advance Payment (50%) Template
Deposit Description Long description of the nature of the deposit Template
  1. Open the template or template detail to be edited.
  2. Click next to the intended field and specify the corresponding text as required.

    Alternatively, you can click Edit in the detail view to edit all fields at once.

  3. Click Save.

Creating Flow for Closing Pro Forma Invoices

Closing pro forma invoices requires a flow that calls the appropriate Apex class provided by JustOn. It closes the pro forma invoice and prepares the source object for creating the final invoice (for details, see Pro Forma Invoice Closure).

Note

Depending on your use cases, the flow setup and the objects to involve will vary.

The source object for the flow depends on the object that is used for pro forma invoicing. For arbitrary object billing, select the corresponding object, for example, Order.

Info

You can use multiple billing configurations when billing arbitrary objects with different sets of field configurations using recipient-specific suffixes. In this case, create an individual flow with an individual trigger for each configuration.

Set up the flow as follows:

  1. Click to enter Setup, then navigate to Process Automation > Flows.
  2. Click New Flow.
  3. Select Record-Triggered Flow and click Create.
  4. Configure the Start element.

    Option Description
    Object The object whose record modifications are to close the pro forma invoice
    Trigger The type of record change that triggers the flow
    Conditions The use case-specific trigger conditions, one or more filter criteria for evaluating certain field values
    Optimize for Actions and Related Records
  5. Click and add the following Action element.

    Option Description
    Action The Apex class to call, must be Close Proforma Invoice
    Input Values Invocable variables for the Apex class
    Object Id: the ID field of the original object, like {!$Record.Id}
    Suffix: string value that specifies a recipient-specific suffix, required when using multiple flows for multiple billing configurations

    Specify a label and an API name as required.

  6. Click Save.

    Specify a label and an API name as required.

  7. Click Activate.

    When the defined conditions are met, JustOn closes the pro forma invoice and prepares the source record for creating the final invoice.

    For help about creating flows, see Flows in the Salesforce Help.

Note

Make sure that closing a pro forma invoice from its detail view using the Close button does not trigger the configured process for closing pro forma invoices from source records. This may produce errors.

Example use case: Set a checkbox to start the close flow

Assume you create invoices from orders. You can, for example, use a custom checkbox field ON_CloseProformaInvoice on the order to trigger the flow when the checkbox is selected.

(1) Create the custom checkbox:

API Name Data Type
ON_CloseProformaInvoice Checkbox

(2) Set up the flow as follows:

Flow Element Option Value
Start Object Order
Trigger A record is updated
Conditions All Conditions Are Met (AND)
1: Close Proforma Invoice Equals {!$GlobalConstant.True}
2: Close Proforma Invoice Is changed {!$GlobalConstant.True}
3: ON_ProformaInvoice__c Is null {!$GlobalConstant.False}
Action Action Close Proforma Invoice
Input Values Object Id: {!$Record.Id}

This triggers JustOn to execute the flow when the ON_CloseProformaInvoice checkbox is selected: It closes the pro forma invoice and prepares the source record for creating the final invoice (for details, see Pro Forma Invoice Closure).

Enabling Pro Forma Invoices for Multiple Parties

Generally, JustOn Billing & Invoice Management is set up to issue invoices to one recipient, usually via the account associated to the corresponding source record. Certain business use cases require billing to multiple parties, however – like, for example, in a marketplace scenario.

  1. Create multiple (recipient-specific) sets of ON fields as listed in Adding Pro Forma Invoice Fields to Source Objects.

    For details, see Creating Recipient-Specific Controlling Fields.

  2. Create an individual closing flow with an individual trigger for each configuration set, specifying the corresponding recipient-specific suffix as an Apex variable.

    Process Name Trigger Control Field Suffix
    Close Proforma Merch checkbox Close_Merch Merch
    Close Proforma Buy checkbox Close_Buy Buy

Enabling Dunning Reminders for Pro Forma Invoices

By default, pro forma invoices and deposit invoices are exempt from dunning processes. When users try to create dunning reminders for pro forma invoices or deposit invoices, JustOn shows the following error message:

Error: Only invoices that are due for payment are subject to dunning processes.

If your business, however, requires issuing reminders for pro forma invoices or deposit invoices, you must explicitly enable this option using the corresponding global setting Allow Pro Forma / Deposit Dunnings.

  1. 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.

  2. Click Manage in the row of Global Settings.

  3. Click Edit in the Default row.
  4. Select the checkbox Allow Pro Forma / Deposit Dunnings.
  5. Click Save.