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

Customize the TaxJar API rate response in Magento 2 to round off from two decimal points to four decimal points. #374

Open
3 tasks
mohitgohel80 opened this issue Jun 11, 2024 · 0 comments

Comments

@mohitgohel80
Copy link

mohitgohel80 commented Jun 11, 2024

Description

We are currently encountering an issue with our Magento 2 store's tax calculations, specifically regarding the integration with the TaxJar sales tax extension from GitHub. After thorough analysis, we have identified a discrepancy between the tax rates in Magento and QuickBooks.

Upon inspecting the API response from TaxJar, we noticed that the combined_tax_rate is returned as 0.08 after two decimal points. However, for accurate synchronization with our systems, we require the combined_tax_rate to be rounded to four decimal points.

To ensure consistency between Magento and QuickBooks, we need assistance in customizing the API response to display the combined_tax_rate with four decimal points. This modification will enable us to align our tax calculations accurately.

Could you please guide us on how to modify the combined_tax_rate to display four decimal points in Magento 2? Any instructions or support you can provide on implementing this customization would be greatly appreciated.

Expected Result

Tax rate is 8.1250%

How does Taxjar calculate sales tax? Please refer to the following equations.

Total Product Price : 19.99 × 0.08 = 1.5992
Shipping Cost : 10.75 × 0.08 = 0.86
Tax : 1.5992 + 0.86 = 2.4592 Roundup 2.46

How does Quickbook calculate sales tax? Please refer to the following equations.

Total Product Price : 19.99 × 0.08125 = 1.6241875
Shipping Cost : 10.75 × 0.08125 = 0.8734375
Tax : 1.6241875 + 0.8734375 = 2.497625 roundup 2.50

Actual Result

So the above calculation is a mismatch form Taxjar and QuickBooks due to Taxjar API response of two decimal points like 0.08 instance of 0.08125.

Versions

  • Magento 2.3
  • Magento Open Source (fka Magento 2 Community Edition)
  • PHP 7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant