[CP Staging] Fix bug when updating tax rate to zero#42065
Conversation
|
@DylanDylann 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: NativeScreen.Recording.2024-05-14.at.12.25.28.movAndroid: mWeb ChromeScreen.Recording.2024-05-14.at.01.37.20.moviOS: NativeScreen.Recording.2024-05-14.at.01.40.09.moviOS: mWeb SafariScreen.Recording.2024-05-14.at.01.36.09.movMacOS: Chrome / SafariScreen.Recording.2024-05-14.at.01.27.43.movMacOS: DesktopScreen.Recording.2024-05-14.at.01.29.31.mov |
|
@DylanDylann I hope you're on it 😄 |
|
I am working on it. I will complete the checklist in an hour |
| if (transaction?.taxAmount && previousTransactionAmount === transaction?.amount && previousTransactionCurrency === transaction?.currency) { | ||
| return IOU.setMoneyRequestTaxAmount(transaction?.transactionID, transaction?.taxAmount, true); | ||
| if (transaction?.taxAmount !== null && previousTransactionAmount === transaction?.amount && previousTransactionCurrency === transaction?.currency) { | ||
| return IOU.setMoneyRequestTaxAmount(transactionID, transaction?.taxAmount ?? 0, true); |
There was a problem hiding this comment.
I think we need to revert the change in this file: src/components/MoneyRequestConfirmationList.tsx
I am not sure why we need to apply this change but It causes this bug:
The Tax amount is 0 when creating a new money request
Screen.Recording.2024-05-14.at.00.32.17.mov
There was a problem hiding this comment.
I think this is because of currency. Could you try with another currencies like GBP, EUR, USD and such
There was a problem hiding this comment.
I am not sure why we need to apply this change but It causes this bug:
transaction?.taxAmount check is wrong because if taxAmount is zero, it doesn't work
There was a problem hiding this comment.
Screen.Recording.2024-05-14.at.00.39.41.mov
This bug still reproduces with other currencies, I checked the RCA and the reason is that we added the null check in this PR
There was a problem hiding this comment.
App/src/components/MoneyRequestConfirmationList.tsx
Lines 377 to 381 in 5c619c7
In this case, transaction?.taxAmount is 0 so we need to use amountInSmallestCurrencyUnits to update taxAmount
There was a problem hiding this comment.
I'll check this
There was a problem hiding this comment.
Okay, I'll revert for now, but I'm pretty sure this is responsible for an undiscovered bug
There was a problem hiding this comment.
done, and thank you for thorough test!
|
@MonilBhavsar Bump on this one #42065 (comment) |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
CPing 👍 |
[CP Staging] Fix bug when updating tax rate to zero (cherry picked from commit d646a30)
|
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 1.4.73-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.73-7 🚀
|
Details
Fixed Issues
$ #42052
PROPOSAL:
Tests
Same as QA
Offline tests
Same as QA
QA Steps
0PR 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
Screen.Recording.2024-05-13.at.7.13.38.PM.mov
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop