How do I specify a sort order on the invoice?
Before you can collect money from your customers, you may send an invoice out to the customer that details all the items the customer is being charged for. Zuora lets you generate invoices and display the invoice details on a pre-defined invoice template. You have the flexibility of defining the information and details you want displayed on the invoice. The invoice template allows you to specify a variety of data in table format.
Solution
Zuora Billing provides default sort ordering on all tables, however, you can use the instructions below to customize the invoice template sort order.
Additional information on customizing your invoice template and establishing a sort order can be found in the invoice template instructions downloadable by going to Billing > Manage Billing Document Configuration.
Add Fields to Control the Sort Order
If you would like to change the sort order on your invoice, you can do so by adding fields to control the sort order*.
Between the fields TableStart and TableEnd, you can add the following fields to control the sort order:
TableSort:FieldName1 [Order], FieldName2 [Order], FieldName3 [Order]....
- FieldName1 is a merge field in the Table.
- Order is ASC for Ascending or DESC means Descending
*Please note that sorting using custom fields is not supported.
Example 1: Sort Charge Number in Descending Order, Then Service Start Date in Ascending Order
The following command “«TableSort:InvoiceItem.ChargeNumber DESC, InvoiceItem.ServiceStartDate ASC» between «TableStart:InvoiceItem» and «TableEnd:InvoiceItem»” will sort the table as follows:
Amount Without Tax |
Charge Number |
Service Start Date |
---|---|---|
8.00 |
C-00000001 |
2009-01-01 |
1.00 |
C-00000002 |
2009-02-01 |
5.20 |
C-00000002 |
2009-03-01 |
Example 2: Sort Charge Number in Descending Order
The following table entries:
Amount Without Tax |
Charge Number |
Service Start Date |
---|---|---|
«TableStart:InvoiceItem» |
«InvoiceItem.ChargeNumber» |
«InvoiceItem.ServiceStartDate» «TableEnd:InvoiceItem»
|
will result in the following order:
Amount Without Tax |
Charge Number |
Service Start Date |
---|---|---|
1.00 |
C-00000002 |
2009-02-01 |
5.20 |
C-00000002 |
2009-03-01 |
8.00 |
C-00000001 |
2009-01-01 |