-
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
Apply tax rule when selecting category #53332
base: main
Are you sure you want to change the base?
Apply tax rule when selecting category #53332
Conversation
This should be fixed soon
Interesting, I'll take a look. Is it an existing bug? |
This is now on server. @bernhardoj could you please test and let me know |
Yes, it's fixed now.
Looks like it's a new issue. I tested by selecting a category with the default tax rate (0%) and change the tax rate manually to 5% and it works. |
Could you please clarify steps in detail. I am not completely getting it |
I have a workspace A with categories A and B. Category A has a tax rate of 5%, while category B has the default tax rate, 0%. This works fine:
This doesn't work fine
|
Okay thanks! Going to test that case on your branch |
Sorry, I was on wrong version |
Okay reproduced the bug, thanks! Checking... |
@bernhardoj I noticed, it is because taxAmount is passed negative number when categorizing. Do you please mind updating here? |
@MonilBhavsar Ah, I got it now. Updated |
Thanks! @mollfpr this can be reviewed and tested now |
Reviewer Checklist
Screenshots/VideosAndroid: NativeManual 53332.-.Android.-.Manual.mp4Split 53332.-.Android.-.Split.mp4Categorize 53332.-.Android.-.Categorize.mp4Android: mWeb ChromeManual 53332.-.mWeb-Chrome.-.Manual.mp4Split 53332.-.mWeb-Chrome.-.Split.mp4Categorize 53332.-.mWeb-Chrome.-.Categorize.mp4iOS: NativeManual Split Categorize iOS: mWeb SafariManual Split Categorize MacOS: Chrome / SafariManual 53332.-.Web.-.Manual.mp4Split 53332.-.Web.-.Split.mp4Categorize 53332.-.Web.-.Categorize.mp4MacOS: DesktopManual 53332.-.Desktop.-.Manual.mp4Split 53332.-.Desktop.-.Split.mp4Categorize 53332.-.Desktop.-.Categorize.mp4 |
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.
LGTM!
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.
Thanks!
@bernhardoj can we please add unit tests? |
@MonilBhavsar I was thinking about how we can test this and I realize we can only test this through a UI test and I feel there is something wrong with it because the logic to apply the tax rule is tied to the UI (the category page in this case). What do you think of adding the tax rule to each function:
This tax rule logic will be put on a function so it's reusable between those 3 functions. This way, we untie the logic from the UI and we can test each function to verify that the tax is selected automatically when the rule is enabled. |
Like the idea of combining logic in a function, reusing and testing it |
@MonilBhavsar updated |
Some checks are failing. |
@MonilBhavsar Yup, retesting it now! |
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.
Test well 👍
Explanation of Change
Fixed Issues
$ #53220
PROPOSAL: #53220 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Prerequisite:
Manual:
Split:
7. Go back to workspace chat
8. Create a manual split request with the category A/B
9. Press the split preview and verify the tax rate is the tax rate of the selected category
10. Create a scan split request with the category A
11. Press the split preview and verify the tax rate is the tax rate A
12. Change the category to B and verify the tax rate changes to tax rate B
13. Split the scan request
14. Press the split preview again and verify the tax rate is the tax rate B
Categorize:
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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