-
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
Handle tax for split requests #40240
Conversation
…nto monil-splitBillTaxUpdate
@MonilBhavsar I found the following bug
web-resize.mp4 |
It worked well when I enter the large value at the beginning |
Good catch! I have reproduced. Looking into it |
Typescript checks are broken on main and being fixed here #42256 |
const selectedReportID = useRef<string>(reportID); | ||
|
||
// We need to set selectedReportID if user has navigated back from confirmation page and navigates to confirmation page with already selected participant | ||
const selectedReportID = useRef<string>(participants?.length === 1 ? participants[0]?.reportID ?? reportID : reportID); |
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.
Bug was
- User enters amount
- Selects participants and clicks "Next"
- Goes to confirmation page and see's Category, Tags and Tax fields
- User goes back to 1 and edit's amount(doesn't matter)
- User without selecting a participant clicks "Next" because participant was already selected(This is root cause)
- Goes to confirmation page and doesn't see Category, Tags and Tax fields because reportID and policyID is not properly set from 5 above.
Let me know if you think this is not the correct way and should use separate hook or may be something else. Open to other solutions.
TypeScript checks are passing now |
Bug:
web-resize.mp4 |
if (transaction?.taxAmount && 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 mostly think this was pre optimization. When the user updates transactionAmount, previousTransactionAmount was not being changed, and we we were not setting updated taxAmount in Onyx
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.
No, this introduced a bug where taxAmount is not being updated in draft transaction. looking...
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.
This is fixed now with latest commit - c671c7a
@@ -326,12 +324,6 @@ const IOURequestStepAmountWithOnyx = withOnyx<IOURequestStepAmountProps, IOURequ | |||
return `${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`; | |||
}, | |||
}, | |||
draftTransaction: { |
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.
withFullTransactionOrNotFound()
returns draftTransaction or transaction depending upon condition. So I think we can remove this
@dukenv0307 I have fixed the bug and also noticed bugs with Split scan flow. So also fixed that. Please take a look and let me know what do you think. Thank you! 🙌 |
Thanks for reporting bugs 😄 |
code looks good and tests well |
@jasperhuangg 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] |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 1.4.76-0 🚀
|
I think this caused a few minor deploy blockers in the most recent deploy checklist. |
I reverted this PR locally to see if it would fix #42655 and it appears to. so I think this might have caused a few blockers. |
created a revert PR here #42670 discussion is on going in this thread https://expensify.slack.com/archives/C07J32337/p1716843389797979 |
we did revert this PR and cp'd it to staging |
Just adding a linked bug reported here. I'm going to remove the blocking label though. |
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.76-7 🚀
|
Details
Pass taxCode and taxAmount to Split API commands.
Tracks tax both online and offline optimistically for split expense with policy expense chat
Fixed Issues
$ #39690
PROPOSAL:
Tests
Same as QA steps
Offline tests
Same as QA steps
QA Steps
Prerequisite: Tax is enabled on workspace
Now we repeat by splitting with individuals
Testing split scans
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
Android: Native
See MacOS: Chrome / SafariAndroid: mWeb Chrome
See MacOS: Chrome / SafariiOS: Native
See MacOS: Chrome / SafariiOS: mWeb Safari
See MacOS: Chrome / SafariMacOS: Chrome / Safari
https://drive.google.com/file/d/1C6T9vQ1VwujJJKlCbNNo8cZ_udQZmc3W/view?usp=sharing
MacOS: Desktop
See MacOS: Chrome / Safari