Knowledge Center

Knowledge Center > Billing and Payments > Invoices > Creating a Custom Invoice Template > Display Previous Transactions Data

Display Previous Transactions Data

Invoice Adjustment transaction is deprecated on Production.

How to Display Transaction History on an Invoice

You can display transaction history on invoices with a Previous Transactions table. The Previous Transactions table shows your customers all the transactions that apply to their invoices.

Zuora recommends that you use the Previous Transactions table instead of the separate Payments and Adjustments table on your invoices to show the complete view of all transactions.

Filtering Transactions by Date

You can configure the Previous Transactions table to include only transactions from a specified date range. There are two filters that let you do this:

  • FromLastInvoice: Displays transactions with transaction dates that fall from the date the last invoice was posted to the date the current invoice is posted. The field code as as follows: 

{ MERGEFIELD TableFilter:FromLastInvoice \* MERGEFORMAT }

  • UpToDaysOld: Displays transactions with transaction dates from the specified number of days ago to the date the current invoice is posted. The following example field code displays transactions that are up to 90 days old:

{ MERGEFIELD "TableFilter:UpToDaysOld 90" \* MERGEFORMAT }

Note that the UpToDaysOld table filter parameter is enclosed in quotation marks. When a parameter contains a space, you must enclose the parameter in quotation marks, otherwise it will not be processed correctly.

If the current invoice is in draft status, the filters use the date the current invoice file is created instead of its posted date.

The date range filters use the date and exact time a transaction or invoice is posted or created, for example, "01/12/2014 13:00:00".

Example 1: Display Transaction History Since the Last Invoice

This example shows you how to use the FromLastInvoice filter to display transactions with transaction dates after the date of the last invoice.

Two invoices are posted:

  • INV00000001: The invoice is posted on 01/15/2012, a processed payment and payment date on 01/18/2012, a processed adjustment and adjustment date on 01/22/2012.
  • INV00000002: Invoice posted on 02/15/2012.

Customize the Template

The following example illustrates how to configure the Previous Transactions table with the filter FromLastInvoice

PREVIOUS TRANSACTIONS
Transaction Date Transaction Number Transaction Type Description Amount Account Balance Impact

<<TableStart:PreviousTransaction>>

<<TableFilter:FromLastInvoice>>

<<Transaction.TransactionDate>>

<<Transaction.
TransactionNumber>>

<<Transaction.
TransactionType>>

<<Transaction.
TransactionDescription>>

<<Transaction.
TransactionAmount>>

<<Transaction.
AccountBalanceImpact>><<TableEnd:PreviousTransaction>>

View the Invoice

Open INV00000002 in PDF format, the table will show transactions by the filter FromLastInvoice:

PREVIOUS TRANSACTIONS
Transaction Date Transaction Number Transaction Type Description Amount Account Balance Impact
01/15/2012 INV00000001 Invoice Invoice $900.00 $900.00
01/18/2012 P00000001 Credit Card Payment Pay invoice $500.00 ($500.00)
01/22/2012 IA00000001 Invoice Adjustment Adjust invoice ($35.00) ($35.00)

Example 2: Display Transaction History From a Specified Date Range

This example shows you how to use the UpToDaysOld filter to display transactions from a specified number of days ago.

Two invoices are posted:

  • INV00000001: Invoice is posted on 02/10/2012, a processed payment and payment date on 02/12/2012, a processed adjustment and adjustment date on 02/17/2012.
  • INV00000002: Invoice is posted on 03/01/2012.

Customize the Template

The following table shows the UpToDaysOld filter in the Transaction Date column, which will display transactions up to 60 days old (default value). The maximum value is 180 days.

To display transactions up to a specific number of days:

  • 90 days old, replace the default string <<TableFilter:UpToDaysOld>> with <<TableFilter:UpToDaysOld 90>>.
  • 30 days old, replace the default string <<TableFilter:UpToDaysOld>> with <<TableFilter:UpToDaysOld 30>>.
Previous Transactions

Transaction Date

Transaction Number

Transaction Type

Description

Amount

Account Balance Impact

<<TableStart:
PreviousTransaction>> <<TableFilter:
UpToDaysOld>><<Transaction.
TransactionDate>>

<<Transaction.
TransactionNumber>>

<<Transaction.
TransactionType>>

<<Transaction.
Description>>

<<Transaction.
TransactionAmount>>

<<Transaction.
AccountBalanceImpact>> <<TableEnd:
PreviousTransaction>>

View the Invoice

The following transactions are displayed when viewing INV0000002 in PDF format:

Previous Transactions
Transaction Date Transaction Number Transaction Type Description Amount Account Balance Impact
02/10/2012 INV00000001 Invoice Invoice $700.00 $700.00
02/12/2012 P00000001 Credit Card Payment Pay invoice $200.00 ($200.00)
02/17/2012 IA00000001 Invoice Adjustment Adjust invoice ($15.00) ($15.00)

Filtering Transactions by Type

The Previous Transactions table shows all previous transactions (invoice, payments, adjustments, refunds) since the last invoice or for the last number of days. The table filter <<TableFilter:HideTransactionType Invoice>> lets you hide all the transactions of type invoice. The field code is as follows:

{ MERGEFIELD "TableFilter:HideTransactionType Invoice" \* MERGEFORMAT }

The HideTransactionType filter can only hide transactions of type Invoice. It cannot currently be used to hide other transaction types such as Payment or Adjustment.

Example 3: Display Transaction History Without Invoice Transactions

This example shows you how to use the HideTransactionType filter to display a Previous Transactions table without invoice transactions.

Two invoices are posted:

  • INV00000001: Invoice is posted on 02/10/2012, a processed payment and payment date on 02/12/2012, a processed adjustment and adjustment date on 02/17/2012.
  • INV00000002: Invoice is posted on 03/01/2012.

Customize the Template

The Transaction Date column in the following table contains the HideTransactionType filter.

Previous Transactions

Transaction Date

Transaction Number

Transaction Type

Description

Amount

Account Balance Impact

<<TableStart:
PreviousTransaction>>

 <<TableFilter:
UpToDaysOld>>

<<TableFilter:HideTransactionType Invoice>>

<<Transaction.
TransactionDate>>

<<Transaction.
TransactionNumber>>

<<Transaction.
TransactionType>>

<<Transaction.
Description>>

<<Transaction.
TransactionAmount>>

<<Transaction.
AccountBalanceImpact>> <<TableEnd:
PreviousTransaction>>

View the Invoice

View INV0000002 in PDF format. The invoice transaction is hidden:

Previous Transactions
Transaction Date Transaction Number Transaction Type Description Amount Account Balance Impact
02/12/2012 P00000001 Credit Card Payment Pay invoice $200.00 ($200.00)
02/17/2012 IA00000001 Invoice Adjustment Adjust invoice ($15.00) ($15.00)

How to Display the Starting Balance on an Invoice

You can include the Starting Balance on your invoice template so your customers can see how the current invoice affects their account balance.

Displaying the Starting Balance

There are two merge fields that enable you to show the starting balance based on the transactions in the Previous Transactions table and the impact these transactions have on the current invoice:

  • Account.PreviousTransactionImpactTotal: The sum of all rows in the Previous Transactions table.
  • Account.PreviousTransactionStartAmount: The difference of Account.PreviousBalance and Account.PreviousTransactionImpactTotal.

The Previous Transactions table must be present in the invoice to show the starting balance and impact from previous transactions. If this is a customer's first invoice, no previous transaction data will exist and the table will be empty. In this case, the Starting Balance Amount and Previous Transaction Impact Total will show as zeros on the invoice.

Example 4: Display the Starting Balance in an Invoice Summary

This example shows you how to use the Account.PreviousTransactionStartAmount merge field to display a Starting Balance in an Invoice Summary.

Two invoices are posted:

  • INV00000001: Invoice is posted on 01/15/2012 with the following transactions:
    • One processed payment on 01/18/2012
    • One processed adjustment on 01/22/2012
  • INV00000002: Invoice is posted on 02/15/2012.

Customize the Template

The following table provides an example for setting up an Invoice Summary in your invoice template: 

INVOICE SUMMARY
Starting Balance <<Account.PreviousTransactionStartAmount>>
<<TableStart:PreviousTransaction>>
<<TableFilter:FromLastInvoice>>
<<Transaction.TransactionType>>
<<Transaction.AccountBalanceImpact>>
<<TableEnd:PreviousTransaction>>
Your Previous Balance <<Account.PreviousBalance>>
New Charges <<Invoice.Balance>>
Your Account Balance <<Account.PreviousBalance>> + <<Invoice.Balance>>

View the Invoice

INV00000002 in PDF format displays the following information, where the rows in the Previous Transactions table are the result from the filter FromLastInvoice.

PREVIOUS TRANSACTIONS
Transaction Date Transaction Number Transaction Type Description Amount Account Balance Impact
01/15/2012 INV00000001 Invoice Invoice $500.00 $500.00
01/18/2012 P00000001 Credit Card Payment Pay invoice $250.00 ($250.00)
01/22/2012 IA00000001 Adjustment Adjust invoice ($50.00) ($50.00)

 

INVOICE SUMMARY
Starting Balance $300.00
Invoice (INV00000001) $500.00
Credit Card Payment (P00000001) ($250.00)
Adjustment (IA00000001) ($50.00)
Your Previous Balance $500.00
New Charges $200.00
Your Account Balance $700.00

Displaying the Starting Balance and Filtering Out Invoice Transactions

When you filter out invoice transactions with the HideTransactionType filter, you can use <<Account.PreviousTransactionStartAmount>> to automatically include the amounts from these transactions in the Starting Balance. The result is a more intuitive Starting Balance, that is, the balance from your previous invoice, which includes all the unpaid invoices for that account.

Example 5: Display the Starting Balance and Filter Out Invoice Transactions

This example shows you how to filter out invoice transactions from previous invoices and add the amounts to the Starting Balance.

Two invoices are posted:

  • INV00000001: Invoice is posted on 01/15/2012 with the following transactions:
    • One processed payment on 01/18/2012
    • One processed adjustments on 01/22/2012
  • INV00000002: Invoice is posted on 02/15/2012.

Customize the Template

The invoice summary table contains a previous transactions table (the yellow rows) that includes the HideTransactionType filter.

INVOICE SUMMARY
Starting Balance <<Account.PreviousTransactionStartAmount>>

<<TableStart:PreviousTransaction>>
<<TableFilter:FromLastInvoice>>
<<TableFilter:HideTransactionType Invoice>>
<<Transaction.TransactionType>>

<<Transaction.AccountBalanceImpact>>
<<TableEnd:PreviousTransaction>>

Your Previous Balance <<Account.PreviousBalance>>
New Charges <<Invoice.Balance>>
Your Account Balance <<Account.PreviousBalance>> + <<Invoice.Balance>>

View the Invoice

INV00000002 in PDF format displays the following information, where the rows in the Previous Transaction table are the result from the filter FromLastInvoiceIncluding the HideTransactionType filter causes the invoice transaction line to be hidden, and the starting balance from <<Account.PreviousTransactionStartAmount>> (the green row) to increase by the amount of the hidden transaction.

Without HideTransactionType Invoice table filter:

INVOICE SUMMARY
Starting Balance $300.00
Invoice (INV00000001) $500.00
Credit Card Payment (P00000001) ($250.00)
Adjustment (IA00000001) ($50.00)
Your Previous Balance $500.00
New Charges $200.00
Your Account Balance $700.00

With HideTransactionType Invoice table filter:

INVOICE SUMMARY
Starting Balance $800.00
Credit Card Payment (P00000001) ($250.00)
Adjustment (IA00000001) ($50.00)
Your Previous Balance $500.00
New Charges $200.00
Your Account Balance $700.00

 

Last modified
21:30, 5 May 2016

Tags

Classifications

(not set)