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:
- Adding new fields to the source object to hold the required pro forma invoice data
- Configuring pro forma invoice display
- Creating a process for closing the pro forma invoice
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, which can be
- any object if you use the generic invoice run for billing arbitrary objects, or
- the Opportunity object in case of opportunity billing.
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.
- Navigate to the fields list of the source object.
Create the following new fields.
API Name Data Type Description ON_Type Text (255) Must be set to
Proformain 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.
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.
The following fields are relevant on the template and the template detail:
|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.||
|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.
|Deposit Description||Long description of the nature of the deposit||Template|
- Open the template or template detail to be edited.
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.
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).
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:
- in case of arbitrary object billing, select the corresponding object, for example, Order,
- in case of opportunity billing, use the Opportunity object
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:
In Setup, open Process Builder.
In Salesforce Lightning, navigate to Process Automation > Process Builder.
In Salesforce Classic, navigate to Create > Workflow & Approvals > Process Builder.
- Specify a (descriptive) process name.
- Set the process to start when
A record changes.
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 Class The Apex class to be executed, must be
Close Proforma Invoice
Set Apex Variables Invocable variables for the Apex class
Object Idspecifies the reference to the ID field of the original object
Suffixstring value that specifies a recipient-specific suffix, required when using multiple processes for multiple billing configurations
For help about creating processes, see Lightning Process Builder in the Salesforce Help.
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|
(2) Set up the process as follows:
|The process starts when||A record changes|
|Start the process||when a record is created or edited|
|Criteria for Executing Actions||Conditions are met|
All of the conditions are met
|Apex Class||Close Proforma Invoice|
|Set Apex Variables||
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.
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.
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 Proforma Buy checkbox
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.
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
Allow Pro Forma / Deposit Dunnings.
- Click Save.