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

Open
opened 2026-02-20 16:31:56 -05:00 by deekerman · 3 comments
Owner

Originally created by @desarrollador20 on GitHub (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

Originally created by @desarrollador20 on GitHub (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](https://github.com/user-attachments/assets/49bfb462-b62e-4005-bed1-47642f92e7a9) 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 ```bash 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
Author
Owner

@johnM2401 commented on GitHub (Sep 9, 2024):

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 commented on GitHub (Sep 9, 2024): 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](https://github.com/user-attachments/assets/211f9e9c-7168-4b4c-80de-09151c004b54) Is this the correct set of steps to replicate? Please let me know if I've perhaps missed something / misunderstood something. Thank you!
Author
Owner

@desarrollador20 commented on GitHub (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

@desarrollador20 commented on GitHub (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
Author
Owner

@johnM2401 commented on GitHub (Sep 9, 2024):

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!

@johnM2401 commented on GitHub (Sep 9, 2024): 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!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5248
No description provided.