Skip to content

Enabling Pro Forma Invoices

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.

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

Info

JustOn 2.47 has introduced pro forma invoices with an option for deposit invoicing. As of JustOn 2.54, deposit invoices and pro forma invoices are available as separate features.

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, which can be

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.

  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

You can add more fields using the ON field mechanism.

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. Double-click 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 Process for Closing Pro Forma Invoices

Closing pro forma invoices requires a process 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 process setup and the objects to involve will vary.

The source object for the process depends on the object that is used for pro forma invoicing:

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 process with an individual trigger for each configuration.

Set up the process as follows:

  1. In Setup, open Process Builder.

    In Salesforce Lightning, navigate to Process Automation > Process Builder.

    In Salesforce Classic, navigate to Create > Workflow & Approvals > Process Builder.

  2. Click New.

  3. Specify a (descriptive) process name.
  4. Set the process to start when A record changes.
  5. Configure the process as required.

    Step Option Description
    Add Object Object The original object whose modifications are to close the pro forma invoice
    Start the process The type of record change that triggers the process, either creation only or creation and modification
    Add Criteria Criteria for Executing Actions The type of criteria, determines whether to check for specific field values or to evaluate records using a formula
    Set Conditions | Build Formula The use case-specific criteria, either the filter conditions for evaluating field values or the formula
    Add Action Action Type The type of action to be executed, must be Apex
    Apex Class The Apex class to be executed, must be Close Proforma Invoice
    Set Apex Variables Invocable variables for the Apex class
    Object Id specifies the reference to the ID field of the original object
    Suffix string value that specifies a recipient-specific suffix, required when using multiple processes for multiple billing configurations
  6. Click Save.

  7. Click Activate.

    For help about creating processes, see Lightning Process Builder 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 process

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

(1) Create the custom checkbox:

API Name Data Type
ON_CloseProformaInvoice Checkbox

(2) Set up the process as follows:

Option Value
The process starts when A record changes
Object Order
Start the process when a record is created or edited
Criteria for Executing Actions Conditions are met
Set Conditions [Order].Close Proforma Invoice Is changed True
[Order].Close Proforma Invoice Equals True
[Order].ON_ProformaInvoice__c Is null False
All of the conditions are met
Action Type Apex
Apex Class Close Proforma Invoice
Set Apex Variables Object Id Field Reference [Order].Id

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

Enabling Pro Forma Invoices for Multiple Parties

Generally, JustOn 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 process 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. 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. 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 Pro Forma / Deposit Dunnings.
  5. Click Save.