more VAT types on invoice

  • Posts: 13
  • Thank you received: 0
13 years 7 months ago #13090

Hi,

There are in one order several products with different VAT%.
Is there a way to show these with amounts on the invoice?

A small example:

product A 10
product B 12
---
24
VAT 10% 1
VAT 20% 2,4
---
27,4

thanks in advance.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 7 months ago #13103

Hi,

You will have to edit the file invoice of the view order via the menu Display->Views and calculate the 2 different VATs based on the products in the order. Something like this:

$vat1 = 0;
$vat2 = 0;
$vat1_rate = 10;
foreach($this->order->products as $product){
 if($product->order_product_tax==$product->order_product_price/$vat1_rate){
  $vat1+=$product->order_product_tax*$product->order_product_quantity;
 }else{
  $vat2+=$product->order_product_tax*$product->order_product_quantity;
 }
}
And then use $vat1 and $vat2 to display the two vat lines.

Last edit: 13 years 7 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
13 years 7 months ago #13188

Thank you for your quick response, this is a perfect solution.
In your example a fixed VAT value is used. Is it also possible to use the var for my tax rate? Or is this a too complex solution?

One more question: this is only visible in back-end invoice printing. If my customer wants to print the previous invoice (containing one VAT type) is shown.
Also the logo on the invloice is not shown, though in back-end it is.

Last edit: 13 years 7 months ago by gGuzz.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 7 months ago #13210

For the front end invoice, you will have to edit the file show of the view order in the same manner.

It's not possible to load the info of which tax was used as this information isn't stored in the database for the order so that's not possible to do it automatically.

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
13 years 7 months ago #13337

It is not working correct yet.
My fault. In my example I have set the tax values on easy values.
But low tax = 6% and high is 19%

Now I have a rounding problem (I presume) because I had also set: please look in the file adminsitrator/components/com_hikashop/classes/currency.php in the function addTax near the end of the file. Could you try to remove the line:
$price->price_value = round($price->price_value,$round);

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 7 months ago #13376

You will need to tell us more about your problem. What kind of rounding error do you have ?
If you change back that line of code, does that change anything ?

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
13 years 3 months ago #23151

Hi Nicolas,

Look, I'm kinda lost to try put this working as well...

I understood the idea, but I don't know exactly which file should I change... On the Display > Views I saw already 2 files for ORDER, but I don't know how to do it...


So, what I want, if you could do it for me, just to tell me exactly where I have to replace your code.


Take a look on the picture:




I just need this for the Order on back-end (for some legal reasons we have to divide the VAT taxes)


Thank You :)

Attachments:
Last edit: 13 years 3 months ago by Ventaka.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23171

I explained which file to change in my message:

You will have to edit the file invoice of the view order via the menu Display->Views

You should have more than two files for the view "order", but you should have only one "invoice" file for your back end template.

We can do the modification for you for a small fee. If you're interested, you can use our contact form to request a quote.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum