bullywug Posted March 26, 2013 Share Posted March 26, 2013 I've been wrestling with this problem for a while now. Initially my site had all kinds of problems as we worked out the inevitable bugs. One of the more persistent were the tax calculation errors. I was able to run down mistakes in my setup of the shop and also to find bugs in the Prestashop code and everything was fine, for a while. Prestashop has never calculated taxes correctly. To be clear, there are multiple calculation methods for calculating sales tax. Prestashop is rounding differently than either of the two major software accounting packages. This isn't a complaint really, but more to let Prestashop know, "You're doin' it wrong." My question for the friendly community here is this, I've come across this error for the first time in months. What I thought had been the cause must have only been one problem and I'm not certain if this is a bug in Prestashop, my web server or a misconfiguration on my part. I've attached a copy of a customer's receipt (edited) showing what would appear to be Prestashop failing at Jr High math (or is it elementary). Anyhow, if anyone has a suggestion or two on how to fix this, or you've encountered this as well, I'd be greatly appreciative to hear from you. Link to comment Share on other sites More sharing options...
Tomin Posted March 27, 2013 Share Posted March 27, 2013 in 1.5.4 it should be fixed. test on demo installation Link to comment Share on other sites More sharing options...
mrotacon Posted March 27, 2013 Share Posted March 27, 2013 (edited) I will test now - I really hope so lol I've tried rewriting the tax stuff over the last few days - but its so heavily integrated Is tax not calculated completely wrong in prestashop anyhow???? Surely, tax is paid per item not per order? Prestashop works out tax by: Tools::ps_round($row['price'] * (float)$row['cart_quantity'] * (1 + (float)$tax_rate / 100), 2); Which is: Product * Quantity * Tax rate. This is Lazy! Should it not be: (Product * Tax Rate), rounded up 2 decimal places, multiplied by the quantity???? If a product in the UK is £99.31, and vat is 20% - you would not charge the customer £119.172, you would charge them £119.17. It may appear ok to do it like that - but if they ordered 100 items, thats 20p more because of all the 0.002 Pences! If you pay via paypal, there will be an error because the submitted paypal order paid total, will be more than the prestashop stored total required for that order Should this not actually be worked out as: $dave = Tools::ps_round($row['price'] * (1 + (float)$tax_rate / 100), 2); $actualtotal = $dave * (float)$row['cart_quantity']; Maybe someone with an accountancy background instead of a coding background can take a look at it for me - As Logically, my method makes more sense to me Edited March 27, 2013 by mrotacon (see edit history) Link to comment Share on other sites More sharing options...
bullywug Posted March 28, 2013 Author Share Posted March 28, 2013 Prestashop is a French company and has never propperly implemented, nor do I think they fully understand, North American retail policies, practices and laws. Taxes would most likely be their weakest point. We've done a good bit of customizing so we passed up 1.5.3 after testing and finding it didn't fix anything and broke all of our fixes so hopefully 1.5.4 will be better. Tomin, thanks for point that out. We'd been waiting on it to come out and I hadn't noticed it was out yet. We'll give it a go. 1 Link to comment Share on other sites More sharing options...
mrotacon Posted March 28, 2013 Share Posted March 28, 2013 I actually managed to fix cart tax calculation on my 1.5.3.1 site, and will try the same method in 1.5.4 after the Easter weekend is over. Please see my thread POSTED HERE It could probably help you too. I included the code in the Cart.php class extension (/override/classes/Cart.php) There will probably still be tax issues with calculation on invoices, but I can probably fix that too Link to comment Share on other sites More sharing options...
bullywug Posted March 28, 2013 Author Share Posted March 28, 2013 Thank you Mrotacon, I have an engineer coming in this weekend to work on the site and possibly begin the upgrade. I'll show him you post. Link to comment Share on other sites More sharing options...
Tomin Posted April 2, 2013 Share Posted April 2, 2013 anyone has solved this? Link to comment Share on other sites More sharing options...
bullywug Posted April 3, 2013 Author Share Posted April 3, 2013 Hi Tomin, I haven't been able to apply the fix yet because of our shared hosting provider. I'm waiting on a dedicated host to be prepared and I will update you as soon as I know anything. -Charles Link to comment Share on other sites More sharing options...
skorupa Posted January 26, 2016 Share Posted January 26, 2016 Hi, I have simmilar problem in PS 1.6.1.4 did you managed to fix this error somehow? Link to comment Share on other sites More sharing options...
Recommended Posts