How do I Include Custom Fields on my PDFs?

For this article, you need to know the prefix of the user you're trying to enter the details for. Below you have a table of which users you can add custom fields to which document for.

Document Type

User

Prefix

Attendance Report Template

Client

client

Lesson Report Template

Client

client

Lesson Report Template

Student

recipient

Credit Note Template

Client

client

Payment Order Template

Tutor

payee

Invoice Template

Client

client

Available Balance History Statement Template

Client

payee

Invoice Balance History Report Template

Client

payee

In this example, we will be adding a custom field from a clients profile onto an 'Invoice Template':

  • The first thing you will want to set up will be a custom field for the information you want to display, check out this link for information on Custom Fields.

  • Set this Custom Field to apply to 'Clients'.

  • Once you have set up your Custom Field, go to System > Settings > Custom Fields and check the "Machine Name" associated with that Custom Field.

  • Go to System > Settings > HTML Templates, for general information about HTML Templates, follow this link.

  • You will then need to create an 'Invoice Template' and then choose to edit the content on this.

  • At the point in the HTML at which you want to display this Custom Field information, you need the role prefix, which can be got from the table above, and the Custom Field's machine name which you can get from the Custom Field in TutorCruncher. You will then need to make sure that you add <br> at the end of that line of HTML.

  • For instance, if I was using the Custom Field for a tutor called 'Tax Number' on a Invoice, then I would use the format {{ client_tax_number }}.

  • - NB: This is one to watch, wherever there is a hyphen/dash (ie. "-") in your Machine Name, you will need to put an underscore (ie. "_").

  • Save your template and now you are done, your Invoices will now show your Custom Field information!

Did this answer your question?