{source}<?php
$invoice_id = 18;
//get the invoice data
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('id', 'customer', 'status', 'invoice_number', 'amount', 'tax', 'total_due', 'jobs_description')));
$query->from($db->quoteName('invoices'));
$query->where($db->quoteName('id') . ' = ' . $db->quote('$invoice_id'));
$db->setQuery($query);
$invoice = $db->loadAssoc();
var_dump($company);
?>
{/source}