You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We discovered the following issue with some orders:
> Could not create Mollie order, error: Error executing API call (422: Unprocessable Entity):
> Order line 3 is invalid. VAT amount is off.
> Expected VAT amount to be -€0.54 (-€3.95 × (16.00% / 116.00%)), got -€0.55.
> Field: lines.3.vatAmount.
This is the corresponding shopping cart in our shopware 6:
I have debugged the data sent to mollie API. This numbers are sent to mollie:
This means that Mollie calculates the VAT of the 5% discount from the unit price and not from the VAT Amount of the main article!
Here again the mathematics behind it:
Shopware
-€10.90 × (5.00% / 100.00%) = -€0.55
Molly
-€3.95 × (16.00% / 116.00%) = -€0.54
As a result, Mollie refuses this order. The order does not reach Mollie. It is not visible in the dashboard. In the shopware these orders are stored with the payment status "Open" and without Mollie Order ID.
so first of all,...we do only maintain the Shopware 5 plugin. the shopware 6 is done by another agency
that means the issue would belong here: https://github.com/mollie/Shopware6
still i have some (good) news for you
we had that also in one of our shopware 6 shops.
the problem is indeed more related to shopware as it seems. because values store the full float, so instead of 23.12 it has 23.120000005 stored in the DB. that means the overall sum could then differ...
so the vertical and horizontal configuration has to match of course...which is...yeah...it is like it is...
but even if they are the same, it can still differ
a fix we did in a customer project was, to do a live calculation in the mollie shopware 6 plugin. so we dont use the pre calculated sums from the database, but calculate it live with correct rounding...its not perfect but it worked...
We discovered the following issue with some orders:
This is the corresponding shopping cart in our shopware 6:
I have debugged the data sent to mollie API. This numbers are sent to mollie:
This means that Mollie calculates the VAT of the 5% discount from the unit price and not from the VAT Amount of the main article!
Here again the mathematics behind it:
As a result, Mollie refuses this order. The order does not reach Mollie. It is not visible in the dashboard. In the shopware these orders are stored with the payment status "Open" and without Mollie Order ID.
The problem of different mathematics seems to be the "horizontal VAT" or "vertical VAT". calculation. More information about this here https://rolandtapken.de/blog/2008-08/mwst-berechnung-von-lexware-buero-easy (only german)
However, this is the only way to determine the sum of the individual VAT amounts. values is correct. So 10,90€ - 0,33€ -0,55€ = 10,02€
The error is therefore to be found in Mollie or the Shopware6 plugin from Mollie and probably not in the Shopware itself.
Temporarily I changed the math in shopware core in this file to get rid of this error:
https://github.com/shopware/platform/blob/master/src/Core/Checkout/Cart/Price/PercentagePriceCalculator.php#L46
But this will only help in case of percentage discounts and is far away from perfekt!
The text was updated successfully, but these errors were encountered: