Invert amount money request amount from negative to positive and vice-versa #18783
Conversation
|
@luacmartins @sobitneupane One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| if (moneyRequestReport) { | ||
| return moneyRequestReport.total; | ||
| } |
There was a problem hiding this comment.
Is this right? Don't we still want to run the logic below for moneyRequestReports?
There was a problem hiding this comment.
Ahh yes. You're right!
|
I see some unit tests failing too |
|
@mollfpr unit tests are failing |
|
@luacmartins Fixed the failing Jest! |
|
@mollfpr conflicts 😢 |
|
Minor conflict fixed 🚀 |
Reviewer Checklist
Screenshots/VideosAdding only Web WebScreen.Recording.2023-05-12.at.1.16.45.PM.movMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
|
@mollfpr can we update this new line too? The ReportPreview is showing the wrong amount |
|
@luacmartins Great find! Yes, we can use the |
|
✋ 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/luacmartins in version: 1.3.14-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.14-14 🚀
|
| state: CONST.REPORT.STATE.SUBMITTED, | ||
| stateNum: CONST.REPORT.STATE_NUM.PROCESSING, |
There was a problem hiding this comment.
Lol, the state and stateNum set optimistically are not the same
There was a problem hiding this comment.
I think we are not really using state, are we?
There was a problem hiding this comment.
Wrong PR to leave this comment

Details
Based on the information, the negative values for the Expense report total will be displayed as a positive values and vice-versa. For the IOU report total remains the same.
In building the Expense report optimistic data, the total amount should be negative too.
Also, in the IOU actions we should subtract the total for the Expense report when requesting money. In this way, we will not see the total reduced for a few seconds before getting the correct total from the database.
Screen.Recording.2023-05-11.at.22.06.44.mov
Fixed Issues
$ #18749
Tests
Prerequisite
Offline tests
Same as the Tests
QA Steps
Same as the Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Web
18749.Web.mov
Mobile Web - Chrome
18749.mWeb.Chrome.mov
Mobile Web - Safari
18749.mWeb.Safari.mp4
Desktop
18749.Desktop.mov
iOS
18749.iOS.mp4
Android
18749.Android.mov