I’m trying to access the following variables in my template to no avail: $invoice.due_date and $invoice.po_number.
However the $invoiceDetails variable does contain those two variables.
I also need a field called “Vendor number”. Can I create that somehow using the custom fields logic and reference it in the template? If so, how?
Thanks for your help! Awesome project, keep up the great work
We use camel case for the variable names, try $dueDate and $poNumber. You should be able to add a custom client/invoice field then access it. ie, $client.customValue1.
If you haven’t noticed if you click ‘Help’ you can see a full list of available variables (assuming you’re using a recent version of the app).
Thanks for the variable names, that worked!
As for the help section, I’m at a self-hosted version 2.6.7, and when I press help I only get this text:
We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide's a great way to see the library in action.
You can access a child property using dot notation. For example to show the client name you could use $client.name.
If you need help figuring something out post a question to our support forum with the design you're using.
Note: create your first invoice to see a preview here.
Is there any other way to access the full list of available variables in the template editor?
I have not created any invoices yet, I’m just playing around. Thanks for the list though!
Out of curiosity, how did you generate that list? Some JSON payload captured in one of the requests or otherwise?
Yes, try dueDate and $poNumber. Then you will be able to add a custom invoice field. I faced some problem that’s I always use a backup. Sometime I had to use invoice template from my back up plan.