HTML Invoice Templates

Article author
  • Updated


Invoice Templates can be created as HTML documents. To create a new Invoice Template, navigate to the Templates section of Meddbase, select New, followed by Text Document. Assign a type to the new template (this will be discussed later), and click Create:

You can then open your newly created template to begin editing. As with all Meddbase HTML templates, these can contain both static text and images, as well as dynamic content which will change based on the content of the invoice itself. Many templates codes used in invoice templates are discussed elsewhere in the knowledgebase, and this article will discuss some markup specific to invoice templates.

Available Markup

A number of tables are available to use to populate invoice templates, examples of which will be included in this article. A full list of available markup is included here:


Appointment (see AppointmentHtmlService)
Person (see PersonHtmlService)





Company Logos

Small Creditor Logo:

Small Debtor Logo:

Medium Creditor Logo:

Medium Debtor Logo:

Large Creditor Logo:

Large Debtor Logo:

Max Creditor Logo:

Max Debtor Logo:

Default Creditor Logo:

Default Debtor Logo:


This markup can be used in a variety of ways to customise the look and feel of your Invoice Templates. Each of the available formatting options is discussed below

1. Default Tabular Data

Each of the markup source tables above can be output in it's entirety. To do so, use the default Table markup:


Will produce:

2. Specifying columns in a table

Each of the tables above (Billing Items, Credit Notes, and Payments) can have specific columns output instead of the default. These columns can be specified using the Columns markup, as below:

{BillingItems.Columns: Id,Price,SurgeonPrice, AuthCode}

This will pull through 4 defined columns in to a table, excluding all other data from that markup source table:

3. Optional Header Text

With any tabular data, you can choose a new name for any column, as in this example:

{BillingItems.Columns: Id,Price,SurgeonPrice (Surgeon Charge), AuthCode}

You will notice that Surgeon Price has been renamed to Surgeon Charge, by including the new Header Text in brackets next to the column name.

4. Concatenating data

It is also possible to include more than one source column's data within a single table column in your invoice.

{BillingItems.Columns: Id,Price,SurgeonPrice (Surgeon Charge), AuthCode, Person.FullName Person.Email (Patient Name and Email)}

In this example, the Patients name and email address have been concatenated into a single column, and a custom column header applied

5. Tabular Data with Totals

Any time data is included in a tabular format, that table can also include totals for each of the numeric columns. Using the below as an example:

{BillingItems.WithTotals.Columns: Id,Price,SurgeonPrice (Surgeon Charge), AuthCode, Person.FullName Person.Email (Patient Name and Email)}

We can see the invoice template generates a new row at the end of the column, summing all the pricing information included.

6. Reversing row order

By default, all row data will be sorted by date in descending order. This can be reversed using, for our example template:

{BillingItems.WithTotals.Reverse.Columns: Id,Price,SurgeonPrice (Surgeon Charge), AuthCode, Person.FullName Person.Email (Patient Name and Email)}

Which will produce:

Note that the billing items are now displayed in the reverse order.


Invoice Template Use Cases

Invoices can be assigned to one or more entities as discussed below;

  • Invoices - Company (Default): Can be used for any company's invoices, but not patient invoices
  • Invoices - Company(Company Specific): Can be used for only 1 specific company's invoices, and never for patient invoices
  • Invoices - Patient(Default): Can be used for any Patient's invoices, but not company invoices
  • Invoices - Patient(Company Specific): Can be used only for patient invoices, where the patient's payer is a specific company

If you wish to use company specific invoices, you should navigate to the company details page for the company which you want use a specific invoice template for, and disable the 'Allow default invoice templates' option for that company:

You should then add one or more invoice templates to that company. To do so, click Invoice Templates on the Company's home page:

Next, click Add HTML Report :

Finally, choose a previously created invoice template:


Using Logos in Invoice Templates

Invoice templates can include both the debtor and creditor company codes, the markup for which is included above. To use this markup, the relevant company needs to have a logo uploaded against it. To do this, search for the company in question, and click Company Details:

Within the company details page, you will be able to add a logo by clicking Upload underneath the Logo section:

Simply upload a file using the wizard, and this will populate any invoice templates where the relevant markup is used.

Note: the maximum size for a logo image is 300 pixels by 300 pixels.