Post by Getting There » Mon Mar 11, 2013 8:16 pm

Why is there no means of having my VAT number appear on invoices?

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.

Newbie

Posts

Joined
Fri Mar 08, 2013 10:11 am

Post by chrisranjana.com » Wed Mar 13, 2013 2:00 pm

I did a quick hack for the latest current version i.e 1.5.5.1.

****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.:';
Add the following line somewhere near line 205 in the file /catalog/controller/account/order.php

Code: Select all

$this->data['text_our_vat_id'] = $this->language->get('text_our_vat_id');
next to the already present line

Code: Select all

$this->data['text_invoice_no'] = $this->language->get('text_invoice_no');
also add these lines

Code: Select all

			if (OUR_VAT_ID) {
				$this->data['our_vat_id'] = OUR_VAT_ID;
			} else {
				$this->data['our_vat_id'] = '';
			}
after these lines in the same file

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');
Add the following lines somewhere near line 18 in the file catalog/view/theme/default/template/account/order_info.tpl

Code: Select all

<?php if ($our_vat_id) { ?>
          <b><?php echo $text_our_vat_id; ?></b> <?php echo $our_vat_id; ?><br />
          <?php } ?>
after the lines

Code: Select all

<?php if ($invoice_no) { ?>
          <b><?php echo $text_invoice_no; ?></b> <?php echo $invoice_no; ?><br />
          <?php } ?>
enter the following lines in the file somewhere near line number 28 admin/view/template/sale/order_info.tpl

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 } ?>
after the existing lines

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>
In the file admin/view/template/sale/order_invoice.tpl add

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 } ?>
after

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 } ?>

IN the file admin/language/english/sale/order.php

add

Code: Select all


$_['text_our_vat_id']                           = 'Our Vat ID:';
after

Code: Select all

$_['text_order_id']                           = 'Order ID:';
IN the file admin/controller/sale/order.php somewhere near 1350

add

Code: Select all

$this->data['text_our_vat_id'] = $this->language->get('text_our_vat_id');
after

Code: Select all


$this->data['text_order_id'] = $this->language->get('text_order_id');
somewhere near line 1540

Code: Select all

			if (OUR_VAT_ID) {
							$this->data['our_vat_id'] = 

OUR_VAT_ID;
			} else {
				$this->data['our_vat_id'] = '';
			}
after

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');
after

Code: Select all

$this->data['text_order_id'] = $this->language->get('text_order_id');
somwhere near line 2415

Code: Select all

if (OUR_VAT_ID) {
					$our_vat_id = OUR_VAT_ID;
				} else {
					$our_vat_id = '';
				}  

AFTER

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>
after

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:';
after

Code: Select all

$_['text_new_order_id']         = 'Order ID:';
In the file catalog/model/checkout/order.php near line 269 add

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');
		
near line 300 add

Code: Select all

			if (OUR_VAT_ID)
			{
			$template->data['our_vat_id'] = OUR_VAT_ID;
			}
			else
			{
			$template->data['our_vat_id'] = '';
			}
after

Code: Select all

$template->data['order_id'] = $order_id;
and there you go !

Chris, Opencart Developers and Programmers,
Opencart Developers Opencart Programmers
https://www.chrisranjana.com


User avatar
Active Member

Posts

Joined
Thu Feb 26, 2009 2:23 am
Location - chennai, India

Post by Getting There » Fri Jun 07, 2013 2:42 am

Whoa chrisranjana that was some reply! Not that I would ever say it was over the top because you have obviously put some considerable time into it. My workaround was a lot simpler... I added a few blank lines below the address and put it there, it shows on everything printed and looks fine.

Thanks all the same 8)

Newbie

Posts

Joined
Fri Mar 08, 2013 10:11 am

Post by chrisranjana.com » Fri Jun 07, 2013 11:58 am

Getting There wrote:Whoa chrisranjana that was some reply! Thanks all the same 8)
Thanks for the appreciation. I just seemed to find some time to do this.

Chris, Opencart Developers and Programmers,
Opencart Developers Opencart Programmers
https://www.chrisranjana.com


User avatar
Active Member

Posts

Joined
Thu Feb 26, 2009 2:23 am
Location - chennai, India

Post by mike420 » Sun Aug 04, 2013 3:45 am


Newbie

Posts

Joined
Sun Aug 04, 2013 3:43 am

Post by globaliweb » Mon Apr 17, 2017 1:58 pm

Hi,
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 :o :o :o
Domain Hosting
Connect Me: Facebook


Newbie

Posts

Joined
Mon Apr 17, 2017 1:44 pm
Who is online

Users browsing this forum: No registered users and 34 guests