[CP Staging] Use selected currency when utilising tax rate#42064
[CP Staging] Use selected currency when utilising tax rate#42064lakchote merged 5 commits intoExpensify:mainfrom
Conversation
|
@allroundexperts Please 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] |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid build not working locally Android: mWeb ChromeScreen.Recording.2024-05-14.at.12.29.53.AM.moviOS: NativeScreen.Recording.2024-05-14.at.12.21.52.AM.moviOS: mWeb SafariScreen.Recording.2024-05-14.at.12.19.05.AM.movMacOS: Chrome / SafariScreen.Recording.2024-05-13.at.11.47.37.PM.movMacOS: DesktopScreen.Recording.2024-05-14.at.12.13.12.AM.mov |
|
@ShridharGoel TS errors. |
| }; | ||
|
|
||
| function getTaxAmount(transaction: OnyxEntry<Transaction>, policy: OnyxEntry<Policy>, isEditing: boolean): number | undefined { | ||
| function getTaxAmount(transaction: OnyxEntry<Transaction>, policy: OnyxEntry<Policy>, currency: string | undefined, isEditing: boolean): number | undefined { |
There was a problem hiding this comment.
Can you pass currency from all function usages also, please
There was a problem hiding this comment.
Passing currency from src/pages/iou/request/step/IOURequestStepAmount.tsx might fix #42049 NVM
|
Updating |
|
Should we pass currency to |
|
Yes, I think we should update all usages |
|
We don't have currency in |
|
Looks like |
There was a problem hiding this comment.
@MonilBhavsar Added here as well, does this look fine?
There was a problem hiding this comment.
This doesn't look good to me as currency is related to mileage rate or policy default currency. const currency = (mileageRate as MileageRate)?.currency ?? policyCurrency;
We should either use selected currency or transaction currency
👍 we can leave it. Thanks for checking! |
|
@allroundexperts over to you |
|
Hm... isn't the lint failing? |
|
@ShridharGoel could you please fix the lint errors |
|
I found another bug which we can fix in this, updating it. |
|
Just a small feedback, as a reviewer force pushing commits make difficult to know what has been updated since last commit as it deletes commit history. |
|
@ShridharGoel Are you done? |
|
The issue which I'm trying to fix: When we change the currency for the first time, on the money request confirmation page it starts showing the max tax amount instead of the amount set by the user. This happens because we have a diff tax calculation logic in |
|
Updated. |
Screen.Recording.2024-05-13.at.11.18.14.PM.mov |
I believe it is already the case. Looking... |
|
It's a regression from https://github.com/Expensify/App/pull/40159/files |
|
@MonilBhavsar No, it's actually from #40443 only. |
|
But actually we should always have |
|
Nice, thanks! |
|
The changes have been completed. Summary:
|
|
Thanks for letting us know. I'm on the review. |
|
@ShridharGoel Can you please update the screen recordings? |
|
On it. |
|
Changing the currency resets the tax amount. Is that expected? |
|
I think yes since the tax percent changes. |
Can you please explain "reset". Perhaps with an example |
|
Added all videos except native Android where I have some build issues. Can we start an adhoc build? |
|
Also, I think older tax amount doesn't make sense when the currency is changed so it gets calculated again. |
|
@MonilBhavsar Notice how the tax amount changes from 5 to 5.76 after I change the currency at the end. Screen.Recording.2024-05-14.at.12.13.12.AM.mov |
|
Yes, Expected |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
[CP Staging] Use selected currency when utilising tax rate (cherry picked from commit 2304a1f)
|
CPing 👍 |
…ng-42064-1 🍒 Cherry pick PR #42064 to staging 🍒
|
🚀 Deployed to staging by https://github.com/lakchote in version: 1.4.73-3 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.73-7 🚀
|
Details
Use selected currency when utilising tax rate.
Fixed Issues
$ #42047
PROPOSAL: #42047 (comment)
Tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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: mWeb Chrome
Screenrecording_20240514_002141.mp4
iOS: Native
Screen.Recording.2024-05-14.at.12.16.13.AM.mov
iOS: mWeb Safari
Screen.Recording.2024-05-14.at.12.18.08.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-13.at.11.18.14.PM.mov
MacOS: Desktop
Screen.Recording.2024-05-14.at.12.28.01.AM.mov