Jump to content

unit tax rate on invoice


stexi

Recommended Posts

Hi guys,

 

I'm selling products with different tax rates. For this reason i've to display unit prices excl. VAT and unit tax rates on my invoices.

 

For example:

 

Name                      Price excl. VAT           VAT %            Qty          Total incl. VAT

 

Very nice Doll          CHF  100.00                 8.0%              1            CHF 108.00

Very nice Book        CHF    50.00                 2.5%              1            CHF   51.25

 

 

Already modified the "invoice.tpl" file to my needs, the only thing i'm missing is the unit tax rate.

 

Do you know how i can display unit tax rates?  Please let me know!

 

Greets Steven

Link to comment
Share on other sites

I think there is no easy way. You would create a method to grab the tax rate from order items returned by the $this->order_invoice->getProducts() method.

Thanks for your answer. I've another solution to grab the tax rate from order items, formatted with one decimal (easy to change to zero, ore more than one decimal):

 

{number_format([spam-filter][spam-filter]$order_detail.unit_price_tax_incl+$order_detail.reduction_amount_tax_incl}/$order_detail.product_price}-1}*100}, 1, ',', ' ')}%

 

Maybe not pretty, but it works

Link to comment
Share on other sites

Thanks for your answer. I've another solution to grab the tax rate from order items, formatted with one decimal (easy to change to zero, ore more than one decimal):

 

{number_format([spam-filter][spam-filter]$order_detail.unit_price_tax_incl+$order_detail.reduction_amount_tax_incl}/$order_detail.product_price}-1}*100}, 1, ',', ' ')}%

 

Maybe not pretty, but it works

 

I'm sorry, but it doesn't work in either case. Under specific conditions (e.g. price reduction) a wrong tax percentage is displayed. My own workaround was more simple but far from perfect as well: Rechnung eleazar.zip

 

But today I found  a better way to create a variable for the unit. It's described here: http://stackoverflow.com/questions/24042397/how-to-check-tax-rules-in-the-invoice-page-of-prestashop-1-6

 

Works like a charm for 1.5 and 1.6. If you simply need the changes for the invoice, you just have to override the OrderInvoice.php file. In this case an additional override of OrderDetail.php isn't necessary.

Edited by eleazar (see edit history)
Link to comment
Share on other sites

I'm sorry, but it doesn't work in either case. Under specific conditions (e.g. price reduction) a wrong tax percentage is displayed. My own workaround was more simple but far from perfect as well:

 

But today I found  a better way to create a variable for the unit. It's described here: http://stackoverflow.com/questions/24042397/how-to-check-tax-rules-in-the-invoice-page-of-prestashop-1-6

 

Works like a charm for 1.5 and 1.6. If you simply need the changes for the invoice, you just have to override the OrderInvoice.php file. In this case an additional override of OrderDetail.php isn't necessary.

Thanks for the link, it works fine!

Link to comment
Share on other sites

What do you mean by tax rate of the order date?

In case someone downloads a invoice today, the product tax rates of today will be on the invoice. That's not correct in case the tax rates have changed between order and download.

 

Also, when changing the 'invoice.tpl', the already existing invoices may not change. All information and layout of existing invoices should remain 100% unchanged. This seems me not the case in Prestashop?

Link to comment
Share on other sites

In case someone downloads a invoice today, the product tax rates of today will be on the invoice. That's not correct in case the tax rates have changed between order and download.

 

Right, because the variable should be based on the product's tax_rate stored in order_detail. But as a matter of fact Prestashop developers ignore this database field  which is currently waste and not used, and they retrieve the tax rate from the product table. This is a software related problem.

 

But even if it would be retrieved from the order_detail table I'd regard this as a minor problem for Europe where the product's tax rates normally doesn't change for years. It may be different for US countries, but I suppose the Prestashop database design and core is Europe-orientated and not prepared for date effective taxes anyway.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...