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

Rounding errors with VAT calculations #4460

Open
tilldoerges opened this issue Oct 28, 2017 · 5 comments
Open

Rounding errors with VAT calculations #4460

tilldoerges opened this issue Oct 28, 2017 · 5 comments
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Type:Bug Bugs within the core SuiteCRM codebase

Comments

@tilldoerges
Copy link

Issue

The VAT total is off due to rounding errors.

I'm not sure how/if this relates to #1234.

Expected Behavior

VAT total should be "342,05 €".

Actual Behavior

VAT total is "342,06 €", which is off by 0.01 €.

Possible Fix

The workaround suggested in https://salesagility.com/index.php/forum/8-aos-5x/2548-vat-calculation (setting 3 significant currency digits) still works.

Steps to Reproduce

  1. Create a quote with line items like these:
    01_quote

Your Environment

  • SuiteCRM Version used: 7.7.8
  • Environment name and version (e.g. MySQL, PHP 7): mariadb-10.0.31-20.7.1
  • Operating System and version (e.g Ubuntu 16.04): openSUSE Leap 42.3
@Dillon-Brown Dillon-Brown added Type:Bug Bugs within the core SuiteCRM codebase Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds and removed Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds labels Nov 2, 2017
@karlsan
Copy link

karlsan commented Apr 6, 2018

Not sure if it's proper form to follow-up on an older issue, but wanted to add my wish for a fix.

We are also experiencing the issue, with smaller amounts getting rounded up, per line, to two decimals. Which then creates the wrong total VAT. If we change to three decimals, the total VAT is correct, but we have too many decimals for PDF outputs.

If you have three items:

€97.50
€65
€32.50

And VAT is 19%, you would get VAT:

€18.525
€12.35
€6.175

Which adds up to:

Price: €195
VAT: €37.05
Total: €232.05

But with "Currency Significant" set to 2, it rounds each line item, so VAT becomes:

€18.53
€12.35
€6.18

Total VAT: €37.06

The VAT amount is off by €0.01. Ideally, we'd like a way to set admin calculations to use a "Currency Significant" of 5, but keep the decimals to 2 on the invoice output. Is that possible?

@karlsan
Copy link

karlsan commented Jun 28, 2018

In case it can help someone, we had someone help us fix this - at least in a way that works for us https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/18559-rounding-vat-on-invoice-total#65548.

@mgx1020
Copy link

mgx1020 commented Nov 6, 2018

Hi. this is still a bug and nearly everyone of our quotes is off by a cent.

Our sales tax is 8.875% which rounds to 8.88% which makes some quotes off by .1

Makes reconciling invoices a nightmare and we just discovered this in Oct. The fix looks interesting. Right now we set 3 digit currency but it looks like we are crazy when we send a quote like this.

@karlsan
Copy link

karlsan commented Nov 6, 2018

Hi @mgx1020 in case it's the same issue that we had, then it might be worthwhile trying the file override fix I link to above? For us this works, at least for invoices, which is what we use. It rounds correctly, but still only shows two digits on invoices.

@mgx1020
Copy link

mgx1020 commented Nov 12, 2018

@karlsan works like a charm, took me a bit to find the bitnami structure .. ended up editing the main file via SSH and then copying it over to /custom

/opt/bitnami/apps/suitecrm/htdocs/modules/AOS_Products_Quotes/line_items.js

cp to

/opt/bitnami/apps/suitecrm/htdocs/custom/modules/AOS_Products_Quotes/line_items.js

Tested on quotes, it works great, I imagine invoices will be similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Type:Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

4 participants