I don't follow you. That's a link to a matter that was addressed in v1.3.9 already.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
It's marked as it was, but seems like it's has been reverted/changed at some point since the bugs are back again. Found also more posts like this, also some about rounding issues.
Just found it weird. No need to follow. ;)
Anyhow, seems to me it could be wise to make more notes in the code. To avoid reverting fixes etc.
Btw! Have you looked at my fix on in last post on previous site?
Also that fix in post linked to above seems to cover it, but it's not fully in 1.3.9h, in ot modules.
Don't know if there is any progress done one all the rounding and calculation issues, since the dev repos is closed for public, but have done some new tests on a new fresh 1.3.9h ...
- New Zen Cart 1.3.9h installation
- Uploaded Norwegian language pack
- Installed SQL Patch (attached) to localize some values
- Changed sort order for ot_tax to 998
- Added a test category
- Added a test product with Tax Class 'Høy sats 25%' and price '104' (ex tax) + a stock value.
- Added a Discount Coupon 'TEST' with 15% off
- Done config, now of for shopping.
- Add 3 x Test Product to Cart
- Checkout Using 'Check/Money Order' and Coupon Code 'TEST'
- Checkout will then display:
Totalt produkter: NOK390,-
Flat takst (Fastpris): NOK68,-
Rabattkoder: TEST : -NOK56,-
25% MVA er inkl. med: NOK80,-
Total ordresum: NOK402,-
Now, how can the discount be 56 – where did that number come from?
390 x 15 / 100 = 58,50 so it should display 59 …?!
If removing tax from product total you'll get:
312 x 15 / 100 = 46,80
If changing config in ot_coupon to Include Tax 'true' and Re-calculate Tax 'None' you'll get a discount of 70 …
Re-calculate Tax should btw be set to 'None' in ot_coupon, in order to show the correct tax amount of 92 in the example above.
Regarding the overall rounding issues it's seems like the issue is that ALL calculation is based on values with decimals, even if no decimals is used/showed.
It's even stored with decimals in the order_total table, and that's an issue from my point of view. Also if integrating the store to an accounting system, you need to do rounding of the values pulled out of the database in order to get the same amount in both systems.
Products: 650Gift Card - ot_gv
This module is installed: true
Sort Order: 840
Queue Purchases: true
Include Shipping: true
Include Tax: true
Re-calculate Tax: None
Tax Class: --none--
Credit including Tax: false
Set Order Status: standard
Shipping: 68
Fee: 69
Gift Card: - 100
25% Tax: 144
Total: 687
650 + 68 + 69 = 787
787 – 100 = 687 – Total is fine :)
687 / 1.25 = 549,6
687 – 549,6 = 137,4 – Tax is NOT fine
How did you get 144 ??
Changing to include tax false has no effect, changing other values only result in wrong total (gift cards)!
Last edited by rued; 18 Apr 2011 at 03:14 PM.
lol ... if the shipping is free (0) everything is fine in the amounts.
Issue might be that the shipping tax is removed twice in ot_gv.php
Last edited by rued; 27 May 2011 at 06:39 PM.
In your coupon example above, what tax rate do you have applied to the Shipping.
Bookmarks