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

Error in recalculating product values when switching currencies in quotes and invoices. #10519

Open
desarrollador20 opened this issue Sep 9, 2024 · 3 comments
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact Status: Team Investigating Labels for issues in which the Core Team are investigating / Intend to Investigate Type: Bug Bugs within the core SuiteCRM codebase

Comments

@desarrollador20
Copy link

desarrollador20 commented Sep 9, 2024

Issue

In the Currency module, create a new currency with the following details:

Currency Name: Colon
Conversion Rate: 526.2700000000
Next, create a product using this currency (COLON) and set its price to 410.00.

When I go to the Quotes module (this also occurs in the Invoice module), I add the product, and with the currency dropdown set to COLON, it correctly displays the price as 410.00. However, if I switch the currency dropdown to another currency and then back to COLON, the price is recalculated as 410.49.
Screenshot from 2024-09-08 14-46-13

Link to the reported error in the community: https://community.suitecrm.com/t/incorrect-calculation-of-product-prices-in-invoices-and-quotes-when-using-a-currency-other-than-the-dollar/

Note: This scenario also occurs in SuiteCRM 7.14.5

Possible Fix

Review the JS function that performs the recalculation for the dropdown.

Steps to Reproduce the Issue

1 - Add a second currency - including a conversion rate
2 - Create a product in the added currency
3 - Create a quote
4 - Switch to the added currency
5 - Add the product
6 - Switch to USD
7 - Switch to the added currency

Context

No response

Version

8.6.2

What browser are you currently using?

Chrome

Browser Version

Version 124.0.6367.60 (Official Build) (64-bit)

Environment Information

PHP: 8.1.29

Operating System and Version

Ubuntu 22.04.4 LTS

@desarrollador20 desarrollador20 added the Type: Bug Bugs within the core SuiteCRM codebase label Sep 9, 2024
@johnM2401
Copy link
Contributor

Hey Folks!
Thank you for getting in touch with this!

I've given this a try locally on both 7.14.5 and 8.6.2, but I'm afraid I've been unable to replicate (so far)

I've created a new Currency (GBP)
I've created two Products, one in USD and one in GBP
I've created a new Quote in GBP, and added both products
If I then change the Quote Currency back and forth between USD and GBP, it appears to convert correctly for both product items.

See gif:
QuotePrices

Is this the correct set of steps to replicate?
Please let me know if I've perhaps missed something / misunderstood something.

Thank you!

@johnM2401 johnM2401 added the Status:Requires Updates Issues & PRs which requires input or update from the author label Sep 9, 2024
@desarrollador20
Copy link
Author

desarrollador20 commented Sep 9, 2024

Hi johnM2401
The error is due to the conversion rate not being a whole number. I suggest using a more precise conversion rate, such as:
Conversion Rate: 526.2700000000

@johnM2401 johnM2401 added Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact and removed Status:Requires Updates Issues & PRs which requires input or update from the author labels Sep 9, 2024
@johnM2401 johnM2401 transferred this issue from salesagility/SuiteCRM-Core Sep 9, 2024
@johnM2401
Copy link
Contributor

Hey!

Thank you for that, I am able to replicate this now.

For reference, I've transfered this ticket over to the SuiteCRM Repo, as this is also replicable in 7.14.5

(Meaning that, any fixes to this bug made on SuiteCRM 7 will then be included in both SuiteCRM 7 and SuiteCRM8)

Thank you again!

@gemartin21 gemartin21 added the Status: Team Investigating Labels for issues in which the Core Team are investigating / Intend to Investigate label Oct 8, 2024
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 Severity: Moderate Key function failed, but no or little impact Status: Team Investigating Labels for issues in which the Core Team are investigating / Intend to Investigate Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

3 participants