-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix approve report partially shows wrong owes amount in LHN #49279
Fix approve report partially shows wrong owes amount in LHN #49279
Conversation
src/libs/actions/IOU.ts
Outdated
@@ -7044,6 +7045,7 @@ function approveMoneyRequest(expenseReport: OnyxEntry<OnyxTypes.Report>, full?: | |||
key: `${ONYXKEYS.COLLECTION.REPORT}${expenseReport?.reportID}`, | |||
value: { | |||
...expenseReport, | |||
total, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But let's not update the total, as that total is meant for the total that was approved and not for what's left as total to be paid.
@s77rt I still don't understand this comment, can you explain more?
Offline test web.offline.mp4 |
For the IOU report, there is no approval. It seems like the flow is quite broken as shown in the video below. web.pay.mp4List of problems:
I'm not sure how to proceed with this IOU report. I only update the IOU report total optimistically, the same way it's done on when approving an expense report. |
@bernhardoj Is there a reason why we are not going with the other suggested solution which is to sum the hold transactions? |
Because it's simpler to subtract between the total instead of iterating through all transactions. I see the other code also relies on total and unheldTotal. Line 7017 in 7139a40
|
@bernhardoj Iterating over the transactions is simpler in terms of the needed code. Also, I think the calculated |
I see. Updated. |
@bernhardoj Can you please revert the rest of the changes? For this issue all we need is the |
There are 3 main changes here:
The first one as explained in my proposal is so the last message is updated dynamically when the IOU report total is updated. I can revert the 2nd one if you agree. |
@bernhardoj I'm not sure I can reproduce the bug you are referring to regarding the last message text. Can you please share a video on that? |
That's the original bug in the OP, wrong amount is shown, but even after we receive the BE response, the amount is still wrong (not updated). If you only apply 1, then the amount will be updated to the correct one after receiving the BE response. |
@bernhardoj I'm not able to reproduce the bug after applying just (3) Screen.Recording.2024-09-18.at.8.29.27.PM.mov |
Based on your video, looks like you applied 3 too because on
I've reverted the rest to keep this moving forward. |
I mistyped, I meant that I applied (3) only |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemweb-chrome.moviOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
✋ 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/robertjchen in version: 9.0.39-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.0.39-5 🚀
|
Details
When approving report partially, the owes amount on the LHN last message is wrong.
Fixed Issues
$ #48760
PROPOSAL: #48760 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4