Custom invoice template and variales

Hi,

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 :slight_smile:

Cheers!

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?

Cheers!

Have you created any invoices yet?

{
  "invoiceNumber": "0001",
  "discount": "0.00",
  "poNumber": "",
  "invoiceDate": "0000-00-00",
  "dueDate": null,
  "terms": "Et amet autem quia aut minus ducimus. In odio reiciendis occaecati quaerat tenetur.",
  "publicNotes": "",
  "taxName1": "",
  "taxRate1": "0.000",
  "amount": "0.00",
  "balance": "0.00",
  "invoiceDesignId": "4",
  "invoiceTypeId": "1",
  "customValue1": "0.00",
  "customValue2": "0.00",
  "customTaxes1": "0",
  "customTaxes2": "0",
  "isAmountDiscount": null,
  "invoiceFooter": "",
  "partial": null,
  "hasTasks": false,
  "customTextValue1": null,
  "customTextValue2": null,
  "hasExpenses": false,
  "taxName2": null,
  "taxRate2": "0.000",
  "client": {
    "currencyId": "1",
    "name": "test client",
    "address1": "814 Micaela Harbor Apt. 813",
    "address2": "Apt. 026",
    "city": "Tillmanberg",
    "state": "Virginia",
    "postalCode": "37977-6716",
    "countryId": "840",
    "workPhone": "",
    "paymentTerms": "0",
    "customValue1": null,
    "customValue2": null,
    "vatNumber": "",
    "idNumber": ""
  },
  "documents": [],
  "expenses": []
}

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?

Once you create your first email this is shown when you click help.

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.

Hello,

$poNumber isn’t working. That’s too bad, PO number are something usualy important to remind in emails.

Regards,

The variables will most likely be added in the next major release.