action.skip

How to create deposit invoice and final invoice from different sources?

← Billing & Invoice Management FAQ

Your business may require to create a deposit invoice from one source object and the related final invoice from another – using the generic invoice run in both cases. Think of the Salesforce CPQ process, for example: You can create the deposit invoice from a quote, and the final invoice from a CPQ subscription that is based on this quote.

Configuration

In addition to the original deposit invoicing configuration, this approach involves the following steps:

  1. Set the deposit invoice fields on the two source objects.

    The first source object – the one from which you create the deposit invoice – requires these fields to hold the relevant deposit invoice data:

    API Name Description
    ON_Type Must be set to Deposit in order to create the deposit invoics.
    ON_ProformaInvoice Lookup the related deposit invoice.
    ON_DepositRate |
    ON_DepositAmount
    Used to set or calculate the price of the deposit line item to be created.

    The second source object – the one from which you create the final invoice – requires the following fields:

    API Name Description
    ON_Type Must be set to Final in order to create the final invoice.
    ON_ProformaInvoice Lookup the related deposit invoice.

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

    For details, see Adding Deposit Invoice Fields to Source Objects.

  2. Relate the deposit invoice with the second source object.

    The lookup field ON_ProformaInvoice on the second source record must point to the deposit invoice created from the first source record.

    According to your project requirements, this relation can be set

    • automatically using a dedicated custom flow (or an additional action in the deposit invoice closing flow)
    • automatically using other automation means on record creation, depending on the involved object
    • manually through user input

Other required tasks include:

Workflow Outline

Once set up, the solution may work as follows:

deposit_2_sources
Creating deposit invoice and final invoice from different sources

(1) JustOn generates a deposit invoice if the field ON_Type on the first source record is set to Deposit. Using the fields ON_DepositRate or ON_DepositAmount, you set the price of the deposit line item to be created. The field ON_ProformaInvoice on the source record points to the deposit invoice.

On payment registration, JustOn assigns the corresponding payment balance to the deposit invoice.

(2) When appropriate, you close the deposit invoice. In particular, this

  • unassigns the payment balance from the deposit invoice, and
  • creates the lookup between the second source record and the deposit invoice, that is, sets ON_ProformaInvoice on the second source record.

(3) With both ON_Type set to Final and ON_ProformaInvoice pointing to the deposit invoice on the second source record, JustOn generates the final invoice. It registers the payment balance, which has been previously unassigned from the deposit invoice, with the final invoice. Doing so reduces the final payment amount.

For details on deposit invoice concepts and workflow, see Deposit Invoice Concepts.