VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: Kuubs on March 22, 2022, 11:33:21 AM

Title: Discount after tax but the tax need to be lessened as well
Post by: Kuubs on March 22, 2022, 11:33:21 AM
I have a weird situation that I cannot seem to resolve with Virtuemart calculations.

Let's say I have a product of 100 euro. And I have 21% tax. This means that the product is 121 euro. Now when i apply a discount the final salesprice becomes 111 euro.  The tax of this product is 19,26. But my VatTax rule is not applied correctly. It is essentially calculating tax of that 100 euro, and then doesn't recalculate when a discount happens. How can I fix this?
Do I need to use another calculation method? Tax per invoice or something? But then the tax of the specific prodcut is not calculated. I find it all very weird.

I am using coupons for the discount!
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 22, 2022, 12:18:05 PM
Please tell is what You use, dbtax, datax and all your calculated data. This should work.
Jörgen
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: pinochico on March 22, 2022, 15:05:10 PM
QuoteThe tax of this product is 19,26. But my VatTax rule is not applied correctly. It is essentially calculating tax of that 100 euro, and then doesn't recalculate when a discount happens. How can I fix this?

This bug is long time, sorry, we had to fix for every shops, which use invoice from VM (not for shops connected to ERP).
I remember how Max furiously defended the mistake in some discussion (I solved it in 2015, but it didn't solve it).
Since then, I have lost the illusion of a remedy and we always program the hack ourselves, unfortunately.
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 22, 2022, 15:57:05 PM
Hmm, once again, in my shop it works, How do you do it? I have still not seen all the numbers.

Org price: 95 sek (inkl VAT)
Vat: 25 %
Discount 50%
end price 47,50 sek
vat 9,50 sek = 20 % of 47,50 this is OK

Where is the problem ?

I do not see any problems.

Jörgen
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: pinochico on March 22, 2022, 19:06:04 PM
Jörgen:

For acountant, the VAT must be still 25% after discount == then calculation for VAT for discount is wrong == must be recalculate after discount again
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 22, 2022, 21:03:19 PM
Did You Read My figures
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: pinochico on March 22, 2022, 22:08:09 PM
To Jorgen:

I Read Your Figure

Quote
Org price: 95 sek (inkl VAT)
Vat: 25 %
Discount 50%
end price 47,50 sek
vat 9,50 sek = 20 % of 47,50 this is OK

And our accountant put this in my head and say - what the hell is your shop? I created, then my shop and my mistake :)
Is totaly wrong and calculating not function for financial goverments.

100 - basic price
121 - sales price with 21%VAT
111 - final price with discount 10 EUR

basic price - must be recalculate - 91,735537190082645 (111 * 100 / 121)
vat after discount (21%) - must be recalculate - 19,264462809917355 - finally not really in VM

Your example - change VAT from 25 to 20. And this is big mistake :)
But for us is not mother, we fixed in ERP and if some clients wants invoice from VM, then we recomended external online invoicing, not VM
We don't waiting. Not anymore, otherwise we would never see it, sorry.
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 23, 2022, 11:19:23 AM
You really did not read my figures.

VAT is 25 % to be added on price without VAT which equals 20 % of total customer price.

Original VAT = 20% OF price = 19 sek (25 % added on price without VAT)
VAT after discount = 20% of discounted price = 9,5 sek (25 % added on discounted price without VAT)

Please do not waste my time any more.  >:(

Jörgen
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Kuubs on March 23, 2022, 13:22:00 PM
Quote from: Jörgen on March 22, 2022, 12:18:05 PM
Please tell is what You use, dbtax, datax and all your calculated data. This should work.
Jörgen

I use the following:

VatTax.

And I also have DATax discount in the VM itself. But it's going wrong when people use Coupons!
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 23, 2022, 13:30:04 PM
OK, this is new information, native VM coupons or AwoCoupon?

I can not remember I have had any problems with AwoCoupon.

Jörgen @ Kreativ Fotografi
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Kuubs on March 23, 2022, 14:00:28 PM
Quote from: Jörgen on March 23, 2022, 13:30:04 PM
OK, this is new information, native VM coupons or AwoCoupon?

I can not remember I have had any problems with AwoCoupon.

Jörgen @ Kreativ Fotografi
Native coupons! I thought I was clear in my OP, lets double check taht again.
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 23, 2022, 14:33:29 PM
Sorry missed that.

I only read, added discount.

Jörgen
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 23, 2022, 14:40:04 PM
Tested with 10 % native coupon.

Works for me

Screenshots would probably help.

Jörgen
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Kuubs on March 24, 2022, 10:40:11 AM
Quote from: Jörgen on March 23, 2022, 14:40:04 PM
Tested with 10 % native coupon.

Works for me

Screenshots would probably help.

Jörgen

What kind of screenshots?

I have a product with 21% VatTax. I also have a DATax discount code of 15 euro. When I add a discount code for 10% the Tax is wrong. Please let me know what kind of screenshots you need!
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 24, 2022, 11:21:34 AM
A screenshot of the checkout that shows the figures that are wrong. It is hard to guess, since my figures all seem to show correctly  8)

Jörgen
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Kuubs on March 29, 2022, 13:31:22 PM
Quote from: Jörgen on March 24, 2022, 11:21:34 AM
A screenshot of the checkout that shows the figures that are wrong. It is hard to guess, since my figures all seem to show correctly  8)

Jörgen

Okay, I did some testing and it seems that using DATax as the normal discount and VatTax as the tax per product calculates the right Vat per product with discount code.
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 29, 2022, 13:52:12 PM
OK, nice to hear that this is all fine, what is not calculated correctly ?

Jörgen
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: pinochico on March 30, 2022, 04:15:27 AM
I must apologize to Jorgen for my ignorance and thank you for your patience and explanation.
Nice job.
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on March 30, 2022, 08:17:01 AM
@rudolf

You are welcome  8), it is sometimes easy to stare in the wrong direction.

Jörgen @ Kreativ Fotografi
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Kuubs on April 01, 2022, 17:31:45 PM
Quote from: Jörgen on March 29, 2022, 13:52:12 PM
OK, nice to hear that this is all fine, what is not calculated correctly ?

Jörgen
No everything works great in the end. I think I used "Tax" before instead of VatTax, I think thats where the problem was.
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Kuubs on April 05, 2022, 14:12:44 PM
Ok, I found the issue.

When I change the Tax to VatTax the price calculation is not working right. So if I am calculating the cost price again with VatTax instaed of Tax, the actual price is wrong. But when I use Tax to set the final price, and then change it to VatTax in the calculation rules, the price stays correct but when I try to calculate the cost price again it's not working correctly.

EDIT: Figured it out. When using VatTax the calculation is not done correctly in combination with DATax, when in the article admin page using the check Calculate Final Price. When you dont use that feature and calculate it by hand (using Cost price) the pricing goes correctly. So I think this is a core issue.
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Jörgen on April 05, 2022, 15:10:40 PM
Soooo, this is an admin calculation problem ?
Any screenshots please ?

Jörgen
Title: Re: Discount after tax but the tax need to be lessened as well
Post by: Kuubs on April 06, 2022, 14:16:29 PM
Quote from: Jörgen on April 05, 2022, 15:10:40 PM
Soooo, this is an admin calculation problem ?
Any screenshots please ?

Jörgen

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.