action.skip

Can I display usage data on invoices produced on GIR?

← Billing & Invoice Management FAQ ← PDF and Email FAQ

Your business may require to display usage data on an invoice produced by a generic invoice run. Assume you do not need to actually calculate the usage data – you just want some additional records to be listed as "parts" that make up an invoice line item. That is, you do not rely on proper usage data billing.

Ideally, you hold the usage data using a dedicated object that is a child to the object used to produce the invoice line items. Including the relevant records in the transaction table requires the following configuration tasks:

  • Adding an invoice lookup and the ON_AddToTransactionTable checkbox to the usage data object
  • Creating a flow that sets the invoice on the usage data records
  • Configuring the Transaction Records field on the relevant template

Proceed as follows:

  1. Create an invoice lookup on the usage data object.

    API Name Data Type Description
    ON_Invoice Lookup (Invoice) Links the usage data record to the related invoice.
  2. Add the ON_AddToTransactionTable checkbox to the usage data object.

    API Name Data Type Description
    ON_AddToTransactionTable Checkbox Determines whether to show the usage data record on the invoice.
    Must be selected.
  3. Create a flow to fill ON_Invoice on the usage data records.

    Configure the flow according to your needs, for example, like:

    Flow Element Option Value
    Start Object <invoice_line_item_source>
    Trigger A record is created or updated
    Conditions All Conditions Are Met (AND)
    ON_Invoice__c Is changed {!$GlobalConstant.True}
    Action Action Update Related Records
    How to Find Records Update records related to the <invoice_line_item_source> record that triggered the flow
    Select Related Records {!$Record.<usage_data_object>__r}
    Set Field Values ON_Invoice__c{!$Record.ON_Invoice__c}

    Once set up, this flow will copy any new or changed value from ON_Invoice on the invoice line item source record to ON_Invoice on the usage data record.

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

  4. Configure the Transaction Records field on the relevant invoice template to display the usage data as required.

    Specify at least the following keys:

    Key Data Type Description
    active Boolean If set true, activates the current configuration.
    title String Specifies the text to be printed above the transaction table.
    name String Specifies the API name of the usage data object.
    fields List of strings A comma-separated list of field API names that specify the transaction table columns and their order to be rendered.

    For details, see Displaying Transaction Records on Invoices.

Once set up as required, this triggers JustOn Billing & Invoice Management to create the usage data table and print it to the invoice PDF.