Creating New Transaction Tables
When billing usage data, you can configure JustOn Billing & Invoice Management to attach transaction tables to the invoice, either
- including a transaction table in the invoice PDF, or
- saving a transaction CSV file and associating it with the invoice.
In certain cases (like layout errors, text typos etc.) you may have to regenerate the transaction table for open invoices. Depending on whether you print the table to the PDF or attach a CSV to the invoice, the steps to take differ.
Recreating Invoice Transaction Table
Note
Make sure that the checkbox field ON_AddToTransactionTable on the source object is selected.
- Open the invoice for which you want to create a new transaction table.
-
In the Notes & Attachments section, delete the attached transaction table.
This is not necessary with draft invoices.
-
Open an appropriate invoice list view.
- In the invoice list, select the checkbox next to the invoice for which you want to create a new transaction table.
- On top of the invoice list, click to open the list view actions, then select Rebuild Transaction Tables.
- Click Continue to confirm the operation.
- Open the invoice for which you want to create a new transaction table.
-
Click Recreate PDF, then click Continue to confirm and complete the operation.
This creates a new version of the PDF file, which includes the new transaction table.
This is not necessary with draft invoices.
Rebuilding Transaction Tables for Multiple Invoices
You can rebuild the transaction tables for multiple invoices at once from the invoice list view.
Note
Make sure that the Rebuild Transaction Tables button is available in the invoice list view. For details, see Enabling Transaction Table Rebuild.
-
Open the Invoices tab and select an appropriate list view.
The list view
Recently Vieweddoes not display the Rebuild Transaction Tables button. -
Select the checkboxes next to the invoices for which you want to rebuild the transaction tables, or leave all checkboxes unmarked to include all listed invoices.
- Click to open the action menu, then select Rebuild Transaction Tables.
-
Click Continue to confirm the operation.
This starts a batch job that rebuilds the transaction tables for the selected invoices.
For open invoices that print the transaction table to the PDF, you must then recreate the PDF, as described in Recreating Invoice Transaction Table.
Recreating Transaction CSV File
Note
Make sure that the checkbox field ON_AddToCsv on the source object is selected.
- Open the invoice for which you want to create a new transaction CSV file.
- In the Files related list, delete the relevant transaction CSV file.
- Open an appropriate invoice list view.
- In the invoice list, select the checkbox next to the invoice for which you want to create a new transaction CSV file.
-
Click to open the action menu, then select Finalize.
This repeats the batch finalization for the selected invoice, which involves creating a new transaction CSV file.
Recreating transaction CSV using Apex
Instead of rerunning the invoice finalization, you can use Apex to recreate transaction CSV files. In the Execute Anonymous Apex tool of the Developer Console, execute the following code, applying your details:
Set<Id> invoiceIds = new Map<Id, sObject>([SELECT Id FROM ONB2__Invoice__c WHERE <invoice condition>]).keySet();
new ONB2.ChainRunner().execute(
new ONB2.ChainFactory().getForBatchNames(new List<String>{'TransactionCsvBatchRenderHelper'})
.setParameters(
new Map<String, Object>{'invoiceIds' => invoiceIds}
)
);
This creates new transaction CSV files for the selected invoices.