VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Kuubs on April 05, 2022, 14:57:48 PM

Title: Calculate final price in combination with DATax and VatTax
Post by: Kuubs on April 05, 2022, 14:57:48 PM
I found a bug in the calculation final price checkmark when using DATax and VatTax. When you use the Calculate final price option, the calculation is done wrong. When using Cost price and thus calculating it by hand, the pricing goes correct. I think the calculation in the core code is wrong.
Title: Re: Calculate final price in combination with DATax and VatTax
Post by: Jörgen on April 05, 2022, 15:12:26 PM
Once again, any screenshots to show the problem ?

Jörgen
Title: Re: Calculate final price in combination with DATax and VatTax
Post by: Kuubs on April 06, 2022, 14:15:30 PM
Yes. These are the rules:

(https://i.imgur.com/yLGATSo.png)

Multiple discounts from a fixed price (5, 10, 15, 20)

Then at product settings this is the good price:

(https://i.imgur.com/z8DkQly.png)

When I try to calculate the cost price with the checkmark:

(https://i.imgur.com/Kx7jfCn.png)

When I just calculate the cost price myself so that the final price is correct then it works. But calculating the cost price for me inputting the final price is not working correctly. It probably calculates the discount in wrong.
Title: Re: Calculate final price in combination with DATax and VatTax
Post by: Kuubs on June 29, 2022, 18:51:21 PM
Any updates on this?


This seems like a oversight in the calculation of the price. For now I have added some custom javascript code to make sure that the price is not being calculated if there are discounts applied, but this seems like a major bug that needs to be solved.
Title: Re: Calculate final price in combination with DATax and VatTax
Post by: hazael on June 30, 2022, 17:49:34 PM
Once, I reported a similar problem, but as usual, someone decided that it was not a problem...

Look here:
https://forum.virtuemart.net/index.php?topic=146546.msg521789

This error is in the calculation rules. The system miscalculates "DATax" if the rule is only the name of the manufacturer. I had to create a special additional category for the products to make it work.

Create a hidden category and add products to it. Then associate the cost rule with this category.