Fix: Time expenses are created with tax#87993
Fix: Time expenses are created with tax#87993dominictb wants to merge 7 commits intoExpensify:mainfrom
Conversation
|
@hoangzinh 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] |
| const submitButton = screen.getByText(/create.*expense/i); | ||
| fireEvent.press(submitButton); | ||
| await waitForBatchedUpdatesWithAct(); | ||
|
|
There was a problem hiding this comment.
❌ CONSISTENCY-5 (docs)
The eslint-disable-next-line @typescript-eslint/no-unsafe-member-access comment lacks an explanation of why the rule is being disabled. ESLint disables without justification can mask underlying issues and make it harder for future developers to understand the exception.
Add a comment explaining why the disable is needed, for example:
// We need to access mock call args dynamically and TypeScript cannot infer the type safely
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-accessReviewed at: 2dd1cea | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
| @@ -320,7 +318,7 @@ function IOURequestStepConfirmation({ | |||
| const isEditingReceipt = hasReceipt(transaction); | |||
| const customUnitRateID = getRateID(transaction) ?? ''; | |||
| const defaultTaxCode = getDefaultTaxCode(policy, transaction); | |||
| const transactionTaxCode = (transaction?.taxCode ? transaction?.taxCode : defaultTaxCode) ?? ''; | |||
| const transactionTaxCode = isTimeRequest ? '' : ((transaction?.taxCode ? transaction?.taxCode : defaultTaxCode) ?? ''); | |||
There was a problem hiding this comment.
Instead of only checking isTimeRequest, should we also verify isTaxTrackingEnabled to address this issue more broadly?
Explanation of Change
Time expenses, without tax support, are created with the workspace's default tax rate because we always fallback to:
App/src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Line 323 in 25bfe2a
We currently only hide it away from the UI so they appear as no tax but the
transactionitself still hastaxCode,taxValueandtaxAmount.This PR avoids creating time expenses with the default tax fallback.
Fixed Issues
$ #87600
PROPOSAL:
Tests
Preconditions:
Workspace currency defaultandForeign currency defaultto a non-zero tax rateOffline tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari