Author Topic: [BUG] Calculation of taxes in VM 2.0.6  (Read 4783 times)

SUGO

  • Beginner
  • *
  • Posts: 5
[BUG] Calculation of taxes in VM 2.0.6
« on: April 20, 2012, 13:20:26 pm »
Hi,

Sorry for the possible bad translation, the text has been translated with bing.

There is a problem of calculation of taxes in VM coming carry-over from previous versions, not is if you have observed the problem, open this post to discuss the problem and if you have a possible solution.

When VM estimated taxes per product line totals and taxes calculates them correctly, but the calculation in product lines are wrong.

Here is a detail of two orders and make accounts...

****************************************************************
Line by line of product with 5% requested with tax...


The tax of 2.43 where gets it?
(15 * 18) / 100 = 2.7 not 2,43 €

Still invoice totals are correct
****************************************************************
Second option is that I ought to be implemented by the type of store...

Asked by line with 5% and by total of invoice...


(1.138,50*18)/100= 204.93 no 207.48

By most calculations that I do not is where he takes this figure, I guess that it is the sum of total rounding error, from there, totals and other data calculated them wrongly loading the invoice

****************************************************************

In the details of the order, if I put VM in debug mode, is that only stores total, so there is no way to "pass" the calculations of VM and power in the templates fix this error.

Code: [Select]
vmdebug tmpl details_item $item Var1:
stdClass Object
(
[virtuemart_order_item_id] => 129
[product_quantity] => 10
[order_item_name] => Lija resina R/A - Grano: 50
[order_item_sku] => SA-LRA-GR:50
[virtuemart_product_id] => 230
[product_item_price] => 25.00000
[product_final_price] => 26.55000
[product_basePriceWithTax] => 29.50000
[product_subtotal_with_tax] => 265.50000
[product_subtotal_discount] => -29.50000
[product_tax] => 40.50000
[product_attribute] =>
[order_status] => P
[intnotes] =>
[virtuemart_category_id] => 3
)

Array
(
)


Doing hacks in the file of calculations of prices see an error, then it is successive updates because you know the problems that give rise to all these changes.

I open the debate and to see if someone can give me a bit of light, that has me this already of nerves

Best regards
Javier Gómez.

Site URL: www.sugo.es
Joomla! 2.5.4
VM 2.0.6 (stable version?)

Forum at Spanish where I'm trying to give light to this problem.
http://www.webempresa.com/foro/30-VirtueMart-20/47910-Error-en-el-c%C3%A1lculo-de-impuestos-en-VM-206.html

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2313
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #1 on: April 20, 2012, 14:13:34 pm »
Hello Javier

I think it looks alright.

In Sweden we have 25 % VAT. Which means 25 % on the price 20 % of the total price.

In Your example it would be :

1360,14 € = is Your price + 18 % VAT = P + T = P + (P x 0,18) = P x 1,18
P = is Your price without tax
T = is Your VAT 18% = P x 0,18
T = P x 0,18

1,18 x P = 1360,14
P = 1152,66
T = P x 0,18 = 1152,66 x 0,18 = 207,48 €

This is how I understand this

Jörgen @ Kreativ Fotografi



Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

teobgeno

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #2 on: April 20, 2012, 16:36:51 pm »
By regarding this i just notice another issue

In the first example the second product costs 25. The quantity is 10 .So 10 x 25 =250 . The tax 18% so (250*18)/100=45

250+45=295 the total column is ok.

The column impuesto(tax) shows the total tax  but it shows 405 . Is it possible the total tax to have bigger value than the total amount :)
This value must be 45 .The product costs 25 tax is (25*18)/100=4,5    4,5*10=45.
The problem is that the value of total tax per product assigned to the tpl has already been multiplied by the quantity and at the tpl is multiplied again by the quantity

At components/com_virtuemart/views/orders/tmpl/details_items.php

this line
Code: [Select]
<td align="right" class="priceCol"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($item->product_tax ,0$qtt)."</span>" ?></td>

should modified to

Code: [Select]
<td align="right" class="priceCol"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($item->product_tax ,01)."</span>" ?></td>

As for the problem with the wrong tax calculation testing on joomla 1.5.26 VM 2.0.6 no such an issue


SUGO

  • Beginner
  • *
  • Posts: 5
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #3 on: April 21, 2012, 21:30:19 pm »
There is still an error of calculation in the totals when the invoice with VAT per invoice, look at the two totals, of the second order is wrong, the total does not calculate it well.

marub

  • Beginner
  • *
  • Posts: 9
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #4 on: April 22, 2012, 10:36:11 am »
I have the same problem with wrong tax if you have more than one qty.
see picture below

[attachment cleanup by admin]

SUGO

  • Beginner
  • *
  • Posts: 5
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #5 on: April 22, 2012, 21:11:58 pm »
Hi,

I think that the guys from development should focus its work in these areas, a shop that does not calculate well the lines or the totals on invoices is a disaster for all users.

Without encouragement to create controversy, I see no intention to explain how and when may solve these problems.

best regards
Javier Gomez

simbus82

  • Jr. Member
  • **
  • Posts: 109
    • Simbus82 Web & Tech
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #6 on: April 23, 2012, 12:02:46 pm »
Hi,

I think that the guys from development should focus its work in these areas, a shop that does not calculate well the lines or the totals on invoices is a disaster for all users.

Without encouragement to create controversy, I see no intention to explain how and when may solve these problems.

best regards
Javier Gomez


too much weeks that we know this problem.

a broken calculation system is equal to a full broken ecommerce.

Stop adding features plaese (klarna?systempay? bha!!!), stay on correcting this issue!!!
Joomla! 2.5.16 & VM 2.0.24b

teobgeno

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #7 on: April 23, 2012, 16:53:47 pm »
I would like to make a question to anyone who has this issue.
Did you have this calculation problem at 2.0.4 ?

marub

  • Beginner
  • *
  • Posts: 9
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #8 on: April 23, 2012, 19:23:15 pm »
it works fine at 2.0.4

teobgeno

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #9 on: April 23, 2012, 19:39:11 pm »
ok but i seems that you have not the same problem as simbus82 and SUGO . Their problem is that tax calculation is completely wrong even for 1 quantity. Yours is that the tax clculation is correct for 1 quantity but is wrong for > 1 quantity . Check my reply above with the code modification i  made maybe it will help solve your problem. Actually i am waiting a reply from someone with the kind of error like simbus82 - SUGO described.

Namit

  • Beginner
  • *
  • Posts: 24
    • Tomold.pl
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #10 on: May 20, 2012, 22:44:06 pm »
Thank You, teobgeno
Your way to solve this problem is working fine. :)

ScooterStrick

  • Beginner
  • *
  • Posts: 4
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #11 on: May 21, 2012, 05:26:13 am »
Not sure if this can shed a lite... I had problems also until I selected to tax the entire order(not individual products) and I couldn't use decimal as I thought I should. This being using % of 'Tax Per Bill'. I am in US, so needed 6% for my state. Simply input 'Tax Per Bill', '+%', and '6' for 6% on dollar. I do have rounding up, but 7.9999999 is pretty much '8'. Works no matter how many items are in cart. Hope this makes sense and helps!

awdsas

  • Beginner
  • *
  • Posts: 2
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #12 on: June 13, 2012, 16:23:24 pm »
Hi - the solution suggested by teobgeno have to be applied to the invoice_order.php template that can be found at:

$webdir/components/com_virtuemart/views/invoice/tmpl/


My .02€,

Andrea

awdsas

  • Beginner
  • *
  • Posts: 2
Re: [BUG] Calculation of taxes in VM 2.0.6
« Reply #13 on: June 13, 2012, 16:26:01 pm »
I did a mistake - the correct template name is invoice_items.php.

Sorry about that.


- ANdrea