- Posts: 68
- Thank you received: 8
Rounding Errors
- MumsHealth
-
Topic Author
- Offline
-- Joomla version -- : 3.2
-- PHP version -- : 5.3.3
-- Browser(s) name and version -- : N/A
-- Error-message(debug-mod must be tuned on) -- : N/A
There appears to be a rounding mismatch with the paypal payment rounding and hikashops rounding. In hikashop the tax ($2.9375) is rounded down to $2.93. When I have "Send details of the order" on in the paypal payment option the figure that is sent to paypal is rounded up to $2.94. The problem with this is because the payments don't match hikashop automatically cancels the order.
Please Log in or Create an account to join the conversation.
- MumsHealth
-
Topic Author
- Offline
- Posts: 68
- Thank you received: 8
2 products $24.95 each
Shipping $8.75
+ 5% tax on everything
Please Log in or Create an account to join the conversation.
The issue is with PayPal which doesn't round properly the calculations. You have two potential solutions:
1. Turn back off the "send order details" option of the payment method as it is the case by default so that PayPal directly uses the total amount.
2. Toggle the "calculations rounding" option of the configuration so that HikaShop calculations are done the way PayPal does them.
Please Log in or Create an account to join the conversation.
- MumsHealth
-
Topic Author
- Offline
- Posts: 68
- Thank you received: 8
The only problems I am having now are with the reports. When I try to do a sales report none of the prices are rounded. It just adds them all together and the final figure is quite far off from the actual amount of money collected. Is there any way to get the reports to round each transaction down (like it originally did when they were charged) or do I have to go into each individual order and change the amounts manually?
Please Log in or Create an account to join the conversation.
- MumsHealth
-
Topic Author
- Offline
- Posts: 68
- Thank you received: 8
0 SQL=SELECT SUM(prod.order_product_tax*prod.order_product_quantity) as Total, a.order_currency_id FROM jos_hikashop_order AS a LEFT JOIN jos_hikashop_order_product AS prod ON a.order_id=prod.order_id AND prod.order_product_tax > 0 LEFT JOIN jos_hikashop_order_product AS prod ON a.order_id=prod.order_id WHERE a.order_type='sale' AND a.order_created > 1384020571 AND a.order_created < 1386612571 GROUP BY a.order_currency_id
Please Log in or Create an account to join the conversation.
Please use the "mysqli" driver for your Joomla 3, this database driver have some patch which give you a precise error message for the SQL query (the patch for the "mysql" driver will be in another Joomla 3 release).
Like that I don't see any particular problem in the query so the database error message will give us some precious information.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- MumsHealth
-
Topic Author
- Offline
- Posts: 68
- Thank you received: 8
1066 Not unique table/alias: 'prod' SQL=SELECT SUM(prod.order_product_tax*prod.order_product_quantity) as Total, a.order_currency_id FROM jos_hikashop_order AS a LEFT JOIN jos_hikashop_order_product AS prod ON a.order_id=prod.order_id AND prod.order_product_tax > 0 LEFT JOIN jos_hikashop_order_product AS prod ON a.order_id=prod.order_id WHERE a.order_type='sale' AND a.order_created > 1384282128 AND a.order_created < 1386874128 GROUP BY a.order_currency_id
Please Log in or Create an account to join the conversation.
Thanks to try to edit the file "administrator/components/com_hikashop/classes/widget.php" function "data()"
And add the code:
Please Log in or Create an account to join the conversation.
- MumsHealth
-
Topic Author
- Offline
- Posts: 68
- Thank you received: 8
I probably just did it wrong as I know nothing about php.
Here is lines 616-623
And here are lines 631-639
Please Log in or Create an account to join the conversation.
Sorry for this very late reply.
Do you have solved the issue or found a way of doing what you want ?
If it is, sharing the solution could help the other users
Please Log in or Create an account to join the conversation.
- MumsHealth
-
Topic Author
- Offline
- Posts: 68
- Thank you received: 8
Please Log in or Create an account to join the conversation.