Using a Custom Invoice Template to Support VAT

If you use Event Espresso outside of the United States, you are probably already aware of the limitation of the invoicing system that prevents a surcharge to be applied to the invoices produced by Event Espresso. In the past, we have provided an invoice template that supports a percent surcharge to be used as VAT that was given to us by one of our customers, but due to some changes in the Event Espresso core codebase, this file has been deprecated and no longer works. As such, we’ve made some changes to the file and provided it for free on GitHub. Here’s what you need to know and how to use it.

Get the file

You can download the file from the GitHub Gist page. Click on the Download File button to get a zipped version of the file.

Extract that file to get the actual  template.php file.

Make some changes (required)

Out of the box there is one thing you should do right off the bat. The template file will display your VAT id, but for the security and privacy of the original author of the file, we’ve replaced their VAT id with XX’s. You can choose to display your VAT id (or not) by either replacing the XX’s or commenting out the line entirely. You can do this by opening the `template.php` file in a plain text editor and either going to line 198 or doing a search for “VAT registration number”:

		$this->Cell(155, 10, 'Total:', 0, 0, 'R');
		$this->Cell(35, 10, html_entity_decode($currency, ENT_QUOTES, 'ISO-8859-15') . number_format($total_cost,2, '.', ''), 0, 1, 'C');
		$this->Ln(20);
		$this->Cell(190, 10, 'VAT registration number: XXX XXXX XX.', 0, 0, 'R'); // replace with your VAT ID or comment this line out
	
Tip: It’s best to use an editor that’s actually designed for code so you can see line numbers. While Notepad (for Windows) and TextEdit (for Mac) will work, we recommend using an actual Sublime Text, Notepad++, or NetBeans.

That’s all you  need to change. By default, the invoice hides the “Pay Online” link that takes users to the payment page on your site to pay for their registration. If you want to show this, you will need to uncomment line 284:

$pdf->SetFont('Arial','BU',20);
//$pdf->Cell(200,20,'Pay Online',0,1,'C',0,$payment_link);//Set payment link
	

Upload the template

Once you’re done editing, save and upload the file to  /wp-content/uploads/espresso/gateways/invoice/. You will likely need to create this directory if you have not been using a modified invoice template already. The only thing you should have in this folder at the end of this is the template.php file. Once it’s uploaded, Event Espresso will use your customized invoice template instead of the default invoice template.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us