fix: Report - Total amount shown as '0,00' when splitting expense offline after currency change#79547
Conversation
…line after currency change
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2de3297810
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppCleanShot.2026-01-20.at.00.47.43.mp4Android: mWeb ChromeCleanShot.2026-01-20.at.00.44.46.mp4iOS: HybridAppCleanShot.2026-01-20.at.00.39.47.mp4iOS: mWeb SafariCleanShot.2026-01-20.at.00.42.55.mp4MacOS: Chrome / SafariCleanShot.2026-01-20.at.00.50.04.mp4CleanShot.2026-01-20.at.00.35.33.mp4 |
lakchote
left a comment
There was a problem hiding this comment.
Small changes requested
…Total-amount-shown-as-0.00-when-splitting-expense-offline-after-currency-change
|
Done @lakchote Thanks! |
|
@TaduJR typescript checks are failing |
…Total-amount-shown-as-0.00-when-splitting-expense-offline-after-currency-change
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.3.6-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.6-4 🚀
|
Explanation of Change
When splitting an expense with a foreign currency, the convertedAmount was being omitted from split transactions, causing calculateGroupTotal to skip them and display "0,00" as the subtotal.
This fix calculates a proportional convertedAmount for each split transaction based on the original conversion rate:
splitConvertedAmount = (originalConvertedAmount × splitAmount) / originalAmount
For example, splitting a $10 USD expense (converted to 36.73 AED) into two $5 splits will give each split a convertedAmount of ~18.36 AED.
Fixed Issues
$ #79442
$ #78814
PROPOSAL: #78814 (comment)
Tests
Test Case: 1
Test Case: 2
Prerequisite: Account has at least one workspace.
Prerequisite 2: Default currency is not USD.
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android-App.mp4
Android: mWeb Chrome
iOS: Native
iOS-App.mp4
iOS: mWeb Safari
iOS-Safari.mp4
MacOS: Chrome / Safari
Macbook-Chrome.mp4