Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ecotax rounded twice #7581

Merged
merged 1 commit into from Feb 20, 2017
Merged

Conversation

@maximebiloe
Copy link
Contributor

maximebiloe commented Feb 20, 2017

Questions Answers
Branch? 1.6.1.x
Description? If taxes are turned on on ecotax, ecotax used to be rounded twice. Once after fetching the DB value and the second time after multiplying it with the tax rate. Now it's only rounded after taxes. Example: If you want an ecotax of 10 (with 21% VAT), the ecotax in database is 8.264463 (because 8.264463 * 1.21 = 10). But without this fix, PrestaShop would round the ecotax DB value to 8.26, then multiply it 8.26 * 1.21 = 9.99 (wrong, one cent too little)
Type? bug fix
Category? FO
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? Test a product with an ecotax of 10 and tax rate of 21% on ecotax, before and after this patch

Cherry-pick of #7448

If taxes are turned on on ecotax, ecotax used to be rounded twice. Once after fetching the DB value and the second time after multiplying it with the tax rate. Now it's only rounded after taxes.
Example: If you want an ecotax of 10 (with 21% VAT), the ecotax in database is 8.264463 (because 8.264463 * 1.21 = 10). But without this fix, PrestaShop would round the ecotax DB value to 8.26, then multiply it 8.26 * 1.21 = 9.99 (wrong, one cent too little)
@maximebiloe maximebiloe added this to the 1.6.1.12 milestone Feb 20, 2017
@maximebiloe

This comment has been minimized.

Copy link
Contributor Author

maximebiloe commented Feb 20, 2017

Thanks @evertdtc

@maximebiloe maximebiloe merged commit 4e493ea into PrestaShop:1.6.1.x Feb 20, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@maximebiloe maximebiloe deleted the maximebiloe:evertdtc-1.6.1.x branch Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.