Display previous transactions data in Word
The Invoice Adjustment transaction is deprecated on Production.
Supported Transactions
You can use the Previous Transactions table to display the following types of transactions:
- Invoice
- Adjustment
- Invoice Item Adjustment
- Invoice Applied to Credit Balance
- Credit Balance Applied to Invoice
- Credit Balance Refund
- Payment Refund
- Payment (The specific name of type depends on the payment method type, for example, Credit Card Payment or Debit Card Payment.)
If you have the Invoice Settlement enabled, the following types of transactions are supported:
- Credit Memo
- Debit Memo
- Credit Memo Refund
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 successfully processed 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 when a transaction is created or an invoice is posted, for example, "01/12/2014 13:00:00". The date and time is not the Transaction Date.
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. |
<<Transaction. |
<<Transaction. |
<<Transaction. |
<<Transaction. |
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 | 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: |
<<Transaction. |
<<Transaction. |
<<Transaction. |
<<Transaction. |
<<Transaction. |
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 | 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 n 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: <<TableFilter: <<TableFilter:HideTransactionType Invoice>> <<Transaction. |
<<Transaction. |
<<Transaction. |
<<Transaction. |
<<Transaction. |
<<Transaction. |
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 | 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
andAccount.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 | Payment | $250.00 | ($250.00) |
01/22/2012 | IA00000001 | Adjustment | Adjustment | ($50.00) | ($50.00) |
INVOICE SUMMARY | |||||
---|---|---|---|---|---|
Starting Balance | $0.00 | ||||
Invoice (INV00000001) | $500.00 | ||||
Credit Card Payment (P00000001) | ($250.00) | ||||
Adjustment (IA00000001) | ($50.00) | ||||
Your Previous Balance | $200.00 | ||||
New Charges | $200.00 | ||||
Your Account Balance | $400.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>> |
<<Transaction.AccountBalanceImpact>> |
||||
Your Previous Balance | <<Account.PreviousBalance>> | ||||
New Charges | <<Invoice.Balance>> | ||||
Your Account Balance | <<Account.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 FromLastInvoice
. Including 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
|
With
|