My business primarily invoices to other VAT registered customers who for tax purposes require a tax invoice. Of course VAT cannot be charged without having been VAT registered therfore it seems strange that there is no means of recording my number on the opencart system.
****Use it at your own risk. No guarantees. No warranties. Whatsoever.****
Add the following line in the file /catalog/language/english/account/order.php
Code: Select all
$_['text_our_vat_id'] = 'Our VAT ID.:';
Code: Select all
$this->data['text_our_vat_id'] = $this->language->get('text_our_vat_id');
Code: Select all
$this->data['text_invoice_no'] = $this->language->get('text_invoice_no');
Code: Select all
if (OUR_VAT_ID) {
$this->data['our_vat_id'] = OUR_VAT_ID;
} else {
$this->data['our_vat_id'] = '';
}
Code: Select all
if ($order_info['invoice_no']) {
$this->data['invoice_no'] = $order_info['invoice_prefix']
. $order_info['invoice_no'];
} else {
$this->data['invoice_no'] = '';
}
enter the following line in both the files /admin/config.php and config.php
Code: Select all
define('OUR_VAT_ID', 'ENTER YOUR YOURVATID HERE');
Code: Select all
<?php if ($our_vat_id) { ?>
<b><?php echo $text_our_vat_id; ?></b> <?php echo $our_vat_id; ?><br />
<?php } ?>
Code: Select all
<?php if ($invoice_no) { ?>
<b><?php echo $text_invoice_no; ?></b> <?php echo $invoice_no; ?><br />
<?php } ?>
Code: Select all
<?php if ($our_vat_id) { ?>
<tr>
<td><?php echo $text_our_vat_id; ?></td>
<td>
<?php echo $our_vat_id; ?>
</td>
</tr>
<?php } ?>
Code: Select all
<tr>
<td><?php echo $text_invoice_no; ?></td>
<td><?php if ($invoice_no) { ?>
<?php echo $invoice_no; ?>
<?php } else { ?>
<span id="invoice"><b>[</b> <a id="invoice-generate"><?php echo
$text_generate; ?></a> <b>]</b></span>
<?php } ?></td>
</tr>
Code: Select all
<?php if ($order['our_vat_id']) { ?>
<tr>
<td><b><?php echo $text_our_vat_id; ?></b></td>
<td><?php echo $order['our_vat_id']; ?></td>
</tr>
<?php } ?>
Code: Select all
<?php if ($order['invoice_no']) { ?>
<tr>
<td><b><?php echo $text_invoice_no; ?></b></td>
<td><?php echo $order['invoice_no']; ?></td>
</tr>
<?php } ?>
add
Code: Select all
$_['text_our_vat_id'] = 'Our Vat ID:';
Code: Select all
$_['text_order_id'] = 'Order ID:';
add
Code: Select all
$this->data['text_our_vat_id'] = $this->language->get('text_our_vat_id');
Code: Select all
$this->data['text_order_id'] = $this->language->get('text_order_id');
Code: Select all
if (OUR_VAT_ID) {
$this->data['our_vat_id'] =
OUR_VAT_ID;
} else {
$this->data['our_vat_id'] = '';
}
Code: Select all
if ($order_info['invoice_no']) {
$this->data['invoice_no'] = $order_info['invoice_prefix']
. $order_info['invoice_no'];
} else {
$this->data['invoice_no'] = '';
}
somewhere near line 2363
Code: Select all
$this->data['text_our_vat_id'] = $this->language->get('text_our_vat_id');
Code: Select all
$this->data['text_order_id'] = $this->language->get('text_order_id');
Code: Select all
if (OUR_VAT_ID) {
$our_vat_id = OUR_VAT_ID;
} else {
$our_vat_id = '';
}
Code: Select all
if ($order_info['invoice_no']) {
$invoice_no = $order_info['invoice_prefix'] .
$order_info['invoice_no'];
} else {
$invoice_no = '';
}
in the file catalog/view/theme/default/template/mail/order.tpl near line 27
add
Code: Select all
<?php if ($our_vat_id) { ?>
<b><?php echo $text_our_vat_id; ?></b> <?php echo $our_vat_id; ?>
<?php } ?><br>
Code: Select all
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid
#DDDDDD; text-align: left; padding: 7px;"><b><?php echo $text_order_id; ?></b> <?php echo
$order_id; ?><br />
IN the file catalog/language/english/mail/order.php near line 8 add
Code: Select all
$_['text_our_vat_id'] = 'Our VAT ID:';
Code: Select all
$_['text_new_order_id'] = 'Order ID:';
Code: Select all
$template->data['text_our_vat_id'] = $language->get('text_our_vat_id');
after
Code: Select all
$template->data['text_order_id'] = $language->get('text_new_order_id');
Code: Select all
if (OUR_VAT_ID)
{
$template->data['our_vat_id'] = OUR_VAT_ID;
}
else
{
$template->data['our_vat_id'] = '';
}
Code: Select all
$template->data['order_id'] = $order_id;
Chris, Opencart Developers and Programmers,
Opencart Developers Opencart Programmers
https://www.chrisranjana.com
Thanks all the same
Thanks for the appreciation. I just seemed to find some time to do this.Getting There wrote:Whoa chrisranjana that was some reply! Thanks all the same
Chris, Opencart Developers and Programmers,
Opencart Developers Opencart Programmers
https://www.chrisranjana.com
Simply add VAT / TIN or any information for invoice go to
System >> Setting >> Address text area put your VAT in this box
It will be display on invoice
Global I Web
Domain Hosting
Connect Me: Facebook
Users browsing this forum: No registered users and 34 guests