Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Explain tax calculation
(1 viewing) (1) Guest
Support forum for customers who have purchased this product. Archive only, no new post can be added.

NOTE: This category has been locked. If you have purchased paid version, please, use our Support Ticket system instead. If you are using free edition, please see the Community Support section.
  • Page:
  • 1

TOPIC: Explain tax calculation

Explain tax calculation 12 years, 1 month ago #33818

Who can help me, left is the mail send by VM. And right is the invoice. Somehow the tax is calculated wrong...

tax.png
The topic has been locked.

Re: Explain tax calculation 12 years, 1 month ago #33820

I have noticed the sum:
tax of 1 product = total tax

original total tax - tax of 1 product + total product row.

So in below it is:
0,14 = total tax

1,40 - 0,14 = 1,26
1,26 + 23,60 = 24,86

See picture:
tax2.png
The topic has been locked.

Re: Explain tax calculation 12 years ago #33871

Regarding to this topic i also clicked "refresh" on my backend management. Then also my TAX jumps to -other-. Strange... still looking for the answer to this critical fault...

refresh.png
The topic has been locked.

Re: Explain tax calculation 12 years ago #33898

While working for Sjors, i found a bug in Artio vmInvoice code running on VM2 latest:

file:
/administrator/components/com_vminvoice/getter.php

search for:
 
$sql = 'SELECT item.*,item.`virtuemart_order_item_id` AS `order_item_id`,
item.`virtuemart_product_id` AS `product_id`,
item.`virtuemart_vendor_id` AS `vendor_id`,
item.product_item_price,
item.product_basePriceWithTax AS product_price_with_tax,
item.product_subtotal_discount/product_quantity AS product_price_discount,
item.product_tax/product_quantity AS product_tax,
item.product_subtotal_with_tax/product_quantity AS product_subtotal_with_tax,
 
lang.product_s_desc, lang.product_desc, product.product_weight, product.product_weight_uom
 
FROM `#__virtuemart_order_items` AS item
LEFT JOIN `#__virtuemart_products` AS product ON item.virtuemart_product_id = product.virtuemart_product_id
LEFT JOIN '
.self::getVm2LanguageTable('#__virtuemart_products').' AS lang ON item.virtuemart_product_id = lang.virtuemart_product_id
WHERE '
.
($orderId ? '`virtuemart_order_id` = ' . (int)$orderId : ' `virtuemart_order_item_id` IN ('.implode(',',(array)$orderItemsIds).')').
' ORDER BY item.`'.$orderCol.'` '.$orderDir;
 


replace with:
 
$sql = 'SELECT item.*,item.`virtuemart_order_item_id` AS `order_item_id`,
item.`virtuemart_product_id` AS `product_id`,
item.`virtuemart_vendor_id` AS `vendor_id`,
item.product_item_price,
item.product_basePriceWithTax AS product_price_with_tax,
item.product_subtotal_discount/product_quantity AS product_price_discount,
item.product_tax/product_quantity AS product_tax2,
item.product_subtotal_with_tax/product_quantity AS product_subtotal_with_tax,
 
lang.product_s_desc, lang.product_desc, product.product_weight, product.product_weight_uom
 
FROM `#__virtuemart_order_items` AS item
LEFT JOIN `#__virtuemart_products` AS product ON item.virtuemart_product_id = product.virtuemart_product_id
LEFT JOIN '
.self::getVm2LanguageTable('#__virtuemart_products').' AS lang ON item.virtuemart_product_id = lang.virtuemart_product_id
WHERE '
.
($orderId ? '`virtuemart_order_id` = ' . (int)$orderId : ' `virtuemart_order_item_id` IN ('.implode(',',(array)$orderItemsIds).')').
' ORDER BY item.`'.$orderCol.'` '.$orderDir;
 


As you can see the product_tax is loaded twice here and is incorrectly calculated. The VM2 (latest) stores the product tax per item not per whole product subtotal and thus dividing it with the quantity leads to incorrect results.

Best Regards,
Stan, RuposTel.com
Last Edit: 12 years ago by sscholtz.
The topic has been locked.
  • Page:
  • 1
User Login Empty