Skip to content

Enabling Pro Forma Billing

Certain business use cases require merchants or suppliers to issue pro forma invoices. Pro forma invoices are commonly used as preliminary invoices with a quotation, for customs purposes, or to give an example of the charged prices. In that sense, the pro forma invoice is exempt from accounting or payment processes.

Info

JustOn supports pro forma billing when billing opportunities and billing arbitrary objects.

Enabling pro forma billing in JustOn involves the following tasks:

Info

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

Pro Forma Billing Concepts

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.

Info

For details about ON fields, see Using the ON Field Mechanism.

Note

When you use pro forma billing, be aware that JustOn does not consider order discounts with the pro forma invoices, but only when generating the final invoices.

Pro Forma Invoice Life Cycle

The following sections describe how to work with pro forma invoices, outlining their life cycle.

Pro Forma Invoice Creation

JustOn generates a pro forma invoice if the field ON_Type on the source object is set to Proforma.

Note

Once you have set the field ON_Type on the source object to Proforma to trigger the pro forma invoice creation, do not modify this field subsequently to make sure that the pro forma billing features operate correctly.

Using a template detail named Proforma, you can provide appropriate texts for the invoice PDF, like the display type or description (see PDF Contents).

After creating the pro forma invoices, JustOn sets the custom field ON_ProformaInvoice on the source objects to the pro forma invoices.

pro-forma_1
Creating a pro forma invoice

Pro Forma Finalization

During invoice finalization a balance of typ Proforma (usually Invoice) is created. This balance type is excluded from the account balance (rollup summary) and the statement of account creation.

Pro Forma Invoice Closure

Before you create the final invoice, you must close the pro forma invoice. To close a pro forma invoice, you use a custom process.

Applying the specific Apex class that JustOn provides for this purpose, your process

  • sets pro forma invoices to the status Closed
  • clears the custom fields ON_Invoice, ON_Type and ON_LastInvoiceRun on the source objects to allow generating the final invoice
  • unregisters any assigned payment balances and sets the balance field RelatedInvoice to the pro forma invoice

pro-forma_2
Closing the pro forma invoice

Info

Usually, JustOn assigns unregistered pro forma payment balances to the corresponding final invoices. Clearing the field RelatedInvoice of the unregistered pro forma payment balance will allow to assign the balance to any matching invoice.

Final Invoice Creation

After you have closed the pro forma invoice, you create the final invoice the same way and based on the same source records as the pro forma invoice.

Doing so

  • registers the balances (if any) that were unregistered from the pro forma invoice by the closing process to the final invoice
  • sets the field RelatedInvoice on the final invoice to the corresponding pro forma invoice

pro-forma_3
Creating the final invoice, linked to the pro forma invoice

Info

JustOn registers a down payment as a payment balance record. As invoices by default show related balance records, the final invoice shows the down payment information. Your business may, however, require to hide this information. In this case, you need a separate invoice template or a specific template detail that is configured to prevent the balance table from being printed. For details, see Hiding Balance Table.

Adding Pro Forma Billing Fields to Source Objects

In order to hold the required pro forma billing 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 specific suffixes to the ON fields, as explained in Creating Recipient-Specific Controlling Fields.

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

    Mandatory fields

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

    Optional fields

    API Name Data Type Description
    ON_DepositRate Percent (3,2) Deposit invoice only. If set, JustOn creates a deposit line item with an amount of Deposit Rate * Total on the deposit invoice.
    If both a deposit rate and a deposit amount is defined, the amount takes precedence.
    ON_DepositAmount Currency (16,2) Deposit invoice only. If set, JustOn creates a deposit line item with the specified amount on the deposit invoice.
    If both a deposit rate and a deposit amount is defined, the amount takes precedence.
    ON_CloseProformaInvoice Checkbox Can be used to trigger the process to close the pro forma or deposit 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, deposit and pro forma invoices need other texts on the printed invoice than the final invoice. You can therefore define a template detail - named Proforma or Deposit, respectively - 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. The process criteria that start the execution depend on your use cases. For example, you can use a custom checkbox field Close Pro Forma Invoice on the source object to trigger the process when the checkbox is selected.

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

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 name and an API name as required.
  4. Set the process to start when A record changes.
  5. Click Save.
  6. Select the object ( Order or Opportunity) whose modifications are to close the pro forma invoice.
  7. Set the process to start when a record is created or edited.
  8. Define the process criteria as required.

    • [<object>].Close Proforma Invoice Is changed True
    • [<object>].Close Proforma Invoice Equals True
    • [<object>].ON_ProformaInvoice__c Is null False

    Combine the conditions with logical AND, that is, select All of the conditions are met.

  9. Select Apex as immediate action, and specify the class Close Proforma Invoice.

  10. Set the following Apex variables:

    • For recordIds, set the Field Reference value [<object>].Id.
    • Optionally, for Suffix, set the String value to the corresponding recipient-specific suffix.

      Suffix is required when using multiple processes for multiple billing configurations.

  11. Click Save.

  12. Click Activate.

    This triggers JustOn to execute the process when the Close Pro Forma Invoice 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).

Info

Depending on your use cases, the process setup and the objects to involve may vary.

For help with setting up processes, see Create a Process in the Salesforce Help, or contact the JustOn support team.

Enabling Pro Forma Billing to 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, however, require billing transactions to multiple parties. To cover these needs, you apply the configuration explained in Enabling Multiple Party Billing.

  1. Create multiple (recipient-specific) sets of ON fields as listed in Adding Pro Forma Billing 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 and 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.

Next steps:

Managing Deposit or Pro Forma Invoices

Return to JustOn Administration.