-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saw similar bug here #40443 (comment)
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App/src/components/MoneyRequestConfirmationList.tsx
Lines 377 to 381 in 5c619c7
if (transaction?.taxAmount && previousTransactionAmount === transaction?.amount && previousTransactionCurrency === transaction?.currency) { | |
return IOU.setMoneyRequestTaxAmount(transaction?.transactionID, transaction?.taxAmount, true); | |
} | |
IOU.setMoneyRequestTaxAmount(transactionID, amountInSmallestCurrencyUnits, true); |
In this case, transaction?.taxAmount is 0 so we need to use amountInSmallestCurrencyUnits to update taxAmount
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.
I'll check this
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
0
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
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