Implemented the iDEAL module in Magento 1.3.2.2, but getting a problem when people order more then 1 of a product.
iDEAL gives an error message; ‘Totaalbedrag niet correct!’ (Total amount not correct).
Another users makes a note of this in the Reviews. So hopefully it can be fixed soon.
I believe the issue is being caused by invalid tax calculations.
My client is entering prices including tax in their magento system.
Now, when proceeding to the checkout procedures, magento calculates the tax amounts. The issue comes down to rounding issues.
For example: I have a product which costs 109,95 including tax of which two are being ordered.
The last step in the single checkout phase is displaying:
Subtotal: € 184,79
Tax: € 35,11
End total: € 219,90
Which is in itself correct.
Now when we review the totals in the iDeal params, I notice the following:
if ($order->getBaseTaxAmount() > 0) { /* hack by adam to avoid ‘Totaalbedrag niet correct!’ error */ $tax = $order->getBaseTaxAmount()*100; $diff = ($order->getBaseGrandTotal()*100) - ($total + $order->getBaseTaxAmount()*100); /* end hack */ $fields = array_merge($fields, array( "itemNumber".$i => 'Tax', "itemDescription".$i => '', "itemQuantity".$i => 1, "itemPrice".$i => $order->getBaseTaxAmount()*100 + $diff )); $i++; }
basically, what it does is add the difference of what it should be compared to what it is (1 cent or so) to the tax, fixing the calculation on the Ideal side
I allso have this problem not only with iDEAL but also with Paypal.
This occurs due to a bug in Magento that still is not repaired and posted ages ago to the bugtracker.
Magento does the stupid thing of rounding the amounts before adding them together.
e.g
This is the way it should be:
Ordered items= 52.50
Shipping costs=13.10
Subtotal ex tax=65.60
tax VAT 19% = 12.464
Totaal Incl tax=78.064 = rounded 78.06
Magento calculates it like this:
Ordered Items + 19% = 62.475 = rounded 62.48
Shipping cost + 19% = 15.589 = rounded 15.59
The two rounded amounts give a total of 78.07
now we have a difference of 0.01
just look here in the bugtracker: http://www.magentocommerce.com/bug-tracking/issue?issue=5454
I think if you round the amounts of ideal the same way the problem must be gone. Never tried it because in my opinion the bug needs to be repaired.
I tried it but there are so many files in the core that needs changed. I had the roundings corrected in my orders but not in invoices, shipping, creditnotes, so i missed a few files to change.
If i change so many files then at the first update the will be gone and it crazy to make a seperate extension for it.
The simple thing is that the rounding only needs to be done on the Grant-Total and not in calculations before that. Calculations need 4 decimals and then rounding at the end.
Hij werkt bij mij niet. In Dreamweaver is een groot deel van de code ook rood gekleurd ipv groen en blauw (in de originele versie met de eerste hek is het namelijk wel met groen en blauw).
Lijkt voor mij ook niet te werken. iDeal blijft aangeven dat het totaalbedrag niet correct is na de aanpassing van Morningtime wanneer ik een order doe met een kortingscode erbij.
Ik gebruik geen BTW, wellicht ligt het daar aan?
Gek genoeg pakt hij voor \"amount\" wel de goede waarde maar niet voor \"itemPrice1\" volgens de foutmelding die ik per email van iDeal terug krijg.
Iemand hier al een oplossing voor? Heb klanten die dus willen bestellen met de kortingscode en ideal laat het nu afweten (magento 1.4.1.1). Alvast dank,.
Waar staat bij ideal de korting?
Als ik bij het formulier info van ideal kijk (http://www.rabobank.nl/images/handleiding_ideal_lite_2966321.pdf - bijlage A) zie ik nergens een kortings veld.
Als ik het goed begrijp geeft ideal een \\\"Totaal bedrag niet correct!\\\” fout als amount niet gelijk is aan de som van de delen.
Neem ik nu het error mailtje van McHummer dan kom je tegen
295 +495 = 790 wat niet gelijk is aan 760.... dus een fout…
Ik had hier een &itemPrice3;=-30 verwacht.. maar die is er niet.....
Ook wordt er geen 30 cent ingehouden op artikel of verzendkosten dus hoe moet iDeal weten dat er korting is gegeven?
Hopefully someone can benefit from my experience. But I am not a programmer so I cannot guarantee if it is a 100% solution.
We are using the iDeal Basic extension (old version, not 1.4 version) of J!Code on a 1.4.1.1. shop of a client.
First of all the total amount bug appeared and was fixed by applying the hack mentioned on the forum.
Then some orders would generate the “Bedrag moet een geldig nummer zijn” error on the iDeal site. Maybe it is a combination of a migrated catalog or something else but for a fact, there was an item which appeared in the source code of the iDeal site just before entering the error state with the following value:
<input id=\"itemPrice1\" name=\"itemPrice1\" value=\"2220.25\" type=\"hidden\"/>
Which resulted in the total ammount being incorrect, meaning:
<input id=\"amount\" name=\"amount\" value=\"66030.25\" type=\"hidden\"/>
Basically, what I did was not apply the \’floor\’ or \’ceil\’ option but I used the \’round\’ function for every price, before it was calculated to cents: