Documentation
Project Links
The intention of this modification is to show the Customer (Company) tax number on invoices.
The method used isn't ideal (in that Company name is used instead of ID) but should work fine, unless you happen to get two Companies with identical names. Note that often the same Company uses some means to differentiate themselves. Example: This Company (UK) Ltd and This Company (NZ) Ltd.
On lines 21-22,
include(DIR_WS_CLASSES . 'order.php'); $order = new order($oID);
Insert this below them:
$tax_id_query = tep_db_query("select distinct entry_company_tax_id from " . TABLE_ADDRESS_BOOK . " where entry_company = '" . $order->customer['company'] . "'");
if (tep_db_num_rows($tax_id_query)>0) {
$company_tax_id=tep_db_fetch_array($tax_id_query);
$tax_id=$company_tax_id[entry_company_tax_id];
}
Around about Line 58, edit to read this:
<td class="main"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
</tr>
<tr>
<td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->billing, 1, '', '<br>'); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_COMPANY_TAX_ID; ?><?php echo $tax_id; ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
</tr>
<tr>
<td class="main"><?php echo $order->customer['telephone']; ?></td>
</tr>
<tr>
<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_COMPANY_TAX_ID; ?><?php echo $tax_id; ?></td>
</tr>
This is drawn from the admin core.php language file and if the text doesn't suit then you should add a similar define entry to the bottom. Also, change the position of the displayed information, to suit your needs.