Discount calculation problem

We have started using dicounts in the shop a little while ago. I didn’t pay much attention to this until now. Now that I’ve looked at it, I’m quite shocked from what I see. Not only is the whole calculation indecipherable to me, but what the client gets to see is very confusing. Have a look at this:

First there is the price with VAT: [B]39.27[/B]
Then the discount: [B]-3.93[/B] (which is ok)
But then there is the final price which is: [B]39.03[/B] (that means final discount is only 0.24!)

After much experimenting I think I found out that the actual deducted amount is the discount value * 0.19 (VAT). This does not make much sense to me. Even if it’s only me who doesn’t understand what is happening here, the client sure gets a very confusing bill…

Also after I have entered my formula for the calculation of the final price to Excel, and played around with it, it turned out, that it only works precisely until I have one low price product in the basket. When the price goes up, I think I run into the rounding problem which I described in this thread: 3267

Hello Sandor,

this is interesting and looks like a bunch of bugs we had in this manner. Just one question: Which version of OXID eShop do you use?

Regards

sry I forgot to mention that: I’m using 4.0.1.0

That means that I may be reporting bugs that have been fixed, but I have to know for sure, if I’m to upgrade. I don’t have much time time to work with the shop, so I’m happy that it works now, and quite afraid to upgrade…

Hello Sandor,

well, to get the bugs away, an update is recommendable. Either you start updating step-by-step beginning here:

or just wait a bit untill the so-called cumulative update procedure is published we are working on presently.

Regards

Thanks for your replies!
I will try to setup a new shop instance with the newest version, and take a look if the bugs are fixed there. I’ve seen that some rounding bug has been fixed, so I hope that will be mine. As for the discount calculation I don’t think it’s a bug, because aside from rounding errors I was able to compile a formula (I try to describe it in more detail) that seems to be what the shop is using. I have a feeling that this behaviour is intentional, I just can’t understand the logic behind it. The formula I deducted is:

B =brutto price
D = B * 0.1 * 0.19 (brutto discount * VAT -this is the part that is really out of place)
N = (B / 119) * 100 (netto price)
BP = N - D (base price: netto price - strange discount value)
V = BP * 0.19 (VAT calculated from previous value)
result = BP + V
result = X + (X * 0.19)