and no one bothers to answer the question about displaying the Tax ID in the invoice?
Hi,
to display the taxid in the invoice either you can edit the ordering code so the taxid is included in the order information posted to the order table (would be better in future zen core) or you can get the taxid from customer table using the customer info from the order info as the reference.
I found the code for the second option by accident and I preferred it as it leaves the base code intact.
So, in admin/invoice.php add this query at line 28
$oID = zen_db_prepare_input($_GET['oID']);
//THESE LINES ADDED TO GET INFO FROM CUSTOMERS TABLE
$sql = "SELECT o.customers_id, c.customers_taxid from " . TABLE_ORDERS . " o, " . TABLE_CUSTOMERS . " c WHERE c.customers_id= o.customers_id and o.orders_id = '" . $oID . "'";
$chk_customers_taxid = $db->Execute($sql);
$customers_taxid = $chk_customers_taxid->fields['customers_taxid'];
so now you can use the $customers_taxid variable where you want, for example in one of the table cells
<?php echo ENTRY_TAXID_NUMBER; ?></b><?php echo ' ' . $customers_taxid; ?>
regards
Steve
thank you very much steve/torvista, that worked
but there's one more problem - tax id is now 'always on'
for my purposes (and I presume many others) it would be ideal if taxid would show up in the invoice only when company name is displayed
I have managed to make zc display Tax ID line in create account only when company name is set to 'true' in admin-configuration-customer details
and it was simple: just added this to create_account.php
if (ACCOUNT_COMPANY == 'true') $taxid = zen_db_prepare_input($_POST['taxid']);
but I dont know how to do the same thing for the invoice
any ideas?
bump...
I posted this back in Sept, but not had any response. It's a huge pain for us, so I was really hoping someone had an idea.
I've got a bit of a weird problem. The field added very easily and the instructions were great.
However, I added my field right below the phone and fax numbers called "customsid". When a customer does not fill in his fax number (which is not required) but fills in this customsid, in admin it shows the customs id in the fax field. If he fills in the fax field, then it puts it in the correct place.
Any ideas what I did wrong? Either way I get the number, but I have to manually move it down to the customs id box from Admin and it's huge pain.
This is where it puts it in the admin when they don't fill out the fax number and we have to manually cut and paste it into the correct field.
![]()
Thanks, Colleen
www.af-company.com
To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978
Hi I had a similar mix up problem, to fix it go into admin/tools/developers tool box, go to the bottom where it says "look up in all files" and type in "Your field Name", ie: customsid select all files catalogue/admin and you should get a long list of files with that name included, when it comes up carefully check all the lines of code with your fieldname in and make sure that customers_fax is not mixed up anywhere in your customsid lines of code and vise versa.
Good luck and hope you fix it !
Cheers
J#xx
(Scott Perry)
Thank you so much Scott!! That worked. Really need to pay more attention when doing these things!!
Thanks, Colleen
www.af-company.com
To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978
No problem !, glad it works !
Cheers
J#xx
(Scott Perry)
I changed 'fax' to "company description" and moved it up the create account page
But it echo's in a one line text field, but I want it to echo in a multiline text area, or just eco as text in the admin customers information.
For the create account page, I just changed;
<?php echo zen_draw_input_field('fax', '', 'id="fax"') . (zen_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?>
to
<textarea name="fax" id="fax"></textarea>
and this send the information fine, but when it is viewed in the admin customers information, is shows in a small one line box
anyone know how to echo it in a multiline text area, or just echo in the customers information as text
PHP Code:<tr>
<td class="main"><?php echo 'Tax ID:'; ?></td>
<td class="main">
<?php
if ($processed == true) {
echo $cInfo->customers_taxid . zen_draw_hidden_field('customers_taxid');
} else {
echo zen_draw_input_field('customers_taxid', $cInfo->customers_taxid, zen_set_field_length(TABLE_CUSTOMERS, 'customers_taxid', 15));
}
?>
</td>