Post by Psmeg » Fri Oct 24, 2014 9:17 pm

Hi all,

I have a client using Opencart for their eCommerce website and they need to have the invoice generated in the admin to show itemised VAT (tax) on a per item basis.

At the moment it simply shows the QTY / Unit Price / Total (per item) and a general overall VAT for the order. They need it to show QTY / Unit Price / VAT Total / Total (inc VAT).

Is there any way to achieve this? I've looked at various extension and none of them seem to offer what I need. They either show the price inc / ex VAT or some other method that would still require some manual calcualtion to work out the VAT per item.

Thanks in advance for any help.

Regards

Paul

Newbie

Posts

Joined
Fri Jul 22, 2011 5:52 pm

Post by SXGuy » Sat Oct 25, 2014 12:36 am

It should be easy enough to add.

admin/controller/sale/order

find

Code: Select all

$this->data['column_price'] = $this->language->get('column_price');
add below

Code: Select all

$this->data['column_tax'] = $this->language->get('column_tax'); 
find

Code: Select all

$product_data[] = array(
						'name'     => $product['name'],
						'model'    => $product['model'],
						'option'   => $option_data,
						'quantity' => $product['quantity'],
						'price'    => $this->currency->format($product['price'] + ($this->config->get('config_tax') ? $product['tax'] : 0), $order_info['currency_code'], $order_info['currency_value']),
						'total'    => $this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value'])
					);
replace with

Code: Select all

					$product_data[] = array(
						'name'     => $product['name'],
						'model'    => $product['model'],
						'option'   => $option_data,
						'quantity' => $product['quantity'],
						'price'    => $this->currency->format($product['price'], $order_info['currency_code'], $order_info['currency_value']),
						'tax'      => $this->currency->format($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0),
						'total'    => $this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value'])
					);
admin/view/template/sale/order_invoice.tpl

find

Code: Select all

      <td align="right"><b><?php echo $column_price; ?></b></td>
add below

Code: Select all

      <td align="right"><b><?php echo $column_tax; ?></b></td>
find

Code: Select all

      <td align="right"><?php echo $product['price']; ?></td>
add below

Code: Select all

      <td align="right"><?php echo $product['tax']; ?></td>
and finally

admin/language/yourlanguage/sale/order.php

find

Code: Select all

$_['column_price']                            = 'Unit Price';
add below

Code: Select all

$_['column_tax']                            = 'VAT';
Last edited by SXGuy on Sat Oct 25, 2014 3:33 pm, edited 1 time in total.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by i2Paq » Sat Oct 25, 2014 3:36 am

This should be default in OC.

Does this work for 2.0 to?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by SXGuy » Sat Oct 25, 2014 3:32 pm

Not tested in 2.0. Just rough mod to a localhost 1.6.5.4

Order total TD's need to be cell spaced more for it all to align better, and if the op wants to show the unit total including vat, then the sub total also needs amending to reflect this.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by giovanni.davi » Tue Mar 17, 2015 10:58 pm

Hi all, sorry for pushing up this old post, but maybe someone can help me,
I added the column with the vat and it works properly, now I'm trying to add another column next to it with the tax class of that specific product.
I tried adding this lines in admin/controller/order.php

Code: Select all

$productInfo = $this->data['product_info'];

$product_data[] = array(
[...]
'tax-class'      => $productInfo['tax_class_id'],
);
but tons of errors :-[

Any suggest is super appreciated THANKS A LOT

Newbie

Posts

Joined
Mon Jun 06, 2011 2:56 pm
Who is online

Users browsing this forum: No registered users and 67 guests