-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[HOLD for payment 2025-01-13] [HOLD for payment 2025-01-02] [$250] Apply tax expense rules associated with category #53220
Comments
Triggered auto assignment to @JmillsExpensify ( |
|
Triggered auto assignment to Design team member for new feature review - @dannymcclain ( |
@dannymcclain sorry for the ping. We are all good here with the design |
Job added to Upwork: https://www.upwork.com/jobs/~021861800756195590066 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
Edited by proposal-police: This proposal was edited at 2024-11-27 16:12:00 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Apply tax expense rules associated with category What is the root cause of that problem?New feature What changes do you think we should make in order to solve the problem?When creating a money request or editing the category in a request, we need to verify if the selected category is associated with any tax using the isMatch function The we can use getCategoryDefaultTaxRate function to get the tax value Line 60 in bd369e7
If getCategoryDefaultTaxRate returns a tax, we will set this value to the tax field in the optimistic data. Additionally, this needs to be updated on the backend as well. What alternative solutions did you explore? (Optional) |
@MonilBhavsar I believe a backend update is necessary to fully resolve this issue. |
Yes, I am working on it |
ProposalPlease re-state the problem that we are trying to solve in this issue.We want to apply the tax expense rules for category. What is the root cause of that problem?Feature request. What changes do you think we should make in order to solve the problem?When selecting the category, we need to handle 3 cases. App/src/pages/iou/request/step/IOURequestStepCategory.tsx Lines 113 to 135 in 9ea0f51
First, set the money request draft tax if the category has the tax associated with it. To do that, first we need to get the associated tax with the category.
The logic above is similar to the logic we have on the amount page. App/src/pages/iou/request/step/IOURequestStepAmount.tsx Lines 285 to 286 in 9ea0f51
For the first case, set the tax here.
For the second case, accept 2 new params called App/src/pages/iou/request/step/IOURequestStepCategory.tsx Lines 121 to 124 in 9ea0f51
Then, add it to the Lines 3202 to 3212 in 9ea0f51
For the last case, it's similar to the 2nd one. The App/src/pages/iou/request/step/IOURequestStepCategory.tsx Lines 115 to 117 in 9ea0f51
|
Thanks for quick proposals! @cretadn22 would be great to get some more details @bernhardoj looks good mostly, instead of getting categoryTaxCode first, can we first see if the category has any matching expense rule?
|
I think that's already handled by Lines 60 to 69 in 10a7be8
|
Got it, thanks! |
@mollfpr mind taking a look, please |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.78-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2025-01-02. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Payment Summary
BugZero Checklist (@JmillsExpensify)
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.80-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2025-01-13. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Payment Summary
BugZero Checklist (@JmillsExpensify)
|
Confirming the payment summary above is correct. |
Both are paid out via NewDot, so I'm closing, though @mollfpr please complete the BZ checklist before requesting payment. |
Requested in ND. |
Payment Summary
|
$250 approved for @bernhardoj |
I think it's no need a BZ checklist since it's a new feature but I suggesting we add a regression test case. Regression Test ProposalA Precondition:
Test
B Precondition:
Test
Do we agree 👍 or 👎 |
$250 approved for @mollfpr |
Also, tests added. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Linked to internal issue https://github.com/Expensify/Expensify/issues/338213
Version Number:
Reproducible in staging?:
Reproducible in production?:
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation (hyperlinked to channel name):
Now that we have tax expense rules for categories, we do want to apply them when user creates an expense with that category or updates any existing expense with a specific category.
The expense rules are stored in
policy_
collection insiderules
>expenseRules
keyWhen user creates or updates an expense associated with a policy and we have expenseRules with
tax
, we want to check and apply them.We do have a
isMatch()
function inexpensify-common
repo and we could utilise it https://github.com/Expensify/expensify-common/blob/302e37e40d9d7e718e7c1c3d98faaa644b51da9d/lib/ExpenseRule.jsx#L40Action Performed:
Break down in numbered steps
Expected Result:
Describe what you think should've happened
Tax rate should change to the tax rate associated with category in step 4 above
Actual Result:
Describe what actually happened
Tax rate does not change
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
None
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
Issue Owner
Current Issue Owner: @JmillsExpensifyThe text was updated successfully, but these errors were encountered: