mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Error in recalculating product values when switching currencies in quotes and invoices. #5248
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#5248
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.

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
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
@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:

Is this the correct set of steps to replicate?
Please let me know if I've perhaps missed something / misunderstood something.
Thank you!
@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
@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!