PDF Templates
PDF generation for invoices, statements, and work tickets is done using the handlebars library.
Using HTML and embedding variables in {{my_variable}} format, you can fully customize the PDF templates.
How to update the default PDF templates
Go to PDF Templates in Settings.
Click the template you want to update.
Update the template using your custom HTML and the variables provided.
Click Save.
How to use Handlebars syntax
Nested variables
To access nested variables, use dot (.) notation.
Example — accessing case_number in the Work Ticket template:
{{case.case_number}}Arrays
To access variables in an array, iterate using #each.
Example — accessing case_line_items in the Work Ticket template:
{{#each case.case_line_items}} <tr> <td>{{this.name}}</td> <td>{{this.quantity}}</td> <td>{{this.notation}}</td> <td>{{this.shade}}</td> </tr> {{/each}}Work Ticket Template
Algorithm
If the left page exceeds 750px in height:
We find the section at the 750px mark.
Every section at that location and below moves to the next page (right side).
If the right side overflows, the overflow moves to the next page.
A section is defined as any <div></div> that is a direct child of:
<div class="ticket-left" id="content-left">
Work Ticket Variables
Each variable below is nested under its parent object.
For example:
case_numberis accessed as:{{case.case_number}}patient_nameis accessed as:{{case.patient_name}}
Case
Variable | Notes |
|
|
| patient |
|
|
|
|
| casePan |
|
|
|
|
|
|
|
|
| shippedDate |
| createdAt |
| Notation graphic |
| Where the order came from, e.g. "iTero". Empty on manual cases |
| Order number in that source |
|
|
| e.g. "Tuesday" |
| Round number, or |
| Count of valid scan files in version 1 |
QR Code:
<div id="qrcode"></div>
Case Production Tasks — {{case.case_production_tasks}} (Array)
Variable |
|
|
|
|
|
{{#each case.case_production_tasks}} {{name}} {{idBarcodeUrl}} {{/each}}Customer — {{case.customer.*}}
Variable |
|
|
|
|
|
|
|
| Array of live email addresses |
| Comma-separated string |
| Total cases for the customer |
| Array, same shape as |
| Array: |
Clinical Preferences — {{case.customer.clinical_preferences}} (Array)
Variable |
|
|
|
|
|
|
|
|
|
|
|
Doctor — {{case.doctor.*}}
Variable |
|
|
|
|
|
|
|
|
|
|
|
Office — {{case.office.*}}
Variable |
|
|
|
|
|
|
|
|
|
|
|
Billing Account — {{case.billing_account.*}}
Variable |
|
|
|
|
|
|
|
|
|
Billing Lab — {{case.billing_lab.*}}
Variable |
|
|
|
Case Line Items — {{case.case_line_items}} (Array)
Variable |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{{#each case.case_line_items}} {{name}} {{notation}} {{quantity}} {{/each}}Custom Fields
{{case.custom_fields}}Case Tags
Format | Variable |
Array |
|
Comma-separated string |
|
Scanner Order — {{case.scanner_order.*}}
Variable |
|
|
|
|
|
|
|
|
|
|
|
Linked Case — {{case.linked_case.*}}
If a linked case exists:
Variable |
|
|
|
|
|
|
|
| Comma-separated list of techs on production tasks |
|
|
|
|
|
|
| Array: |
Case Notes — {{case.case_notes.*}}
If a linked case exists:
Variable |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QR code for linked case:
<div id="qrcode-linked-to-case-url"></div>
Scanner Order — {{case.scanner_order.*}}
Variable |
|
|
|
|
|
|
|
|
|
|
|
|
|
Case Production Tasks — {{case.case_production_tasks.*}}
Variable |
|
|
|
|
|
|
|
|
|
Organization
Variable |
|
|
|
|
|
|
|
| Line 1 plus line 2 |
|
|
|
|
System Variables
Variable |
|
|
|
| Current day, in the org's time zone |
Invoice Template
Invoice Variables
Variable | Notes |
|
|
| patient |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Office
Variable |
|
|
|
|
|
Doctor
Variable |
|
|
|
Billing Account — {{invoice.billing_account.*}}
Variable |
|
|
|
|
|
|
|
|
|
Case Line Items (Array)
Variable |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Organization
Variable |
|
|
|
|
|
|
|
Statement Template
Statement Variables
Variable | Notes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Calculated as |
| Calculated as |
Doctor
Variable |
|
|
|
Office
Variable |
|
|
|
|
|
Billing Account — {{statement.billing_account.*}}
Variable |
|
|
|
|
|
|
|
| Full address |
|
|
|
|
|
|
|
|
|
|
Billing Lab
Variable |
|
|
|
|
|
Statement Lines (Array)
Variable |
|
|
|
|
|
|
|
|
|
|
|
| Nested |
| Nested |
Invoices (Array)
Variable |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Doctor
Variable |
|
|
|
Office
Variable |
|
|
|
|
|
Case Line Items (Array)
Variable |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Organization
Variable |
|
|
|
|
|
|
|
|
|
