-
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 the error with journal entry when tax is enabled #41520
Handle the error with journal entry when tax is enabled #41520
Conversation
Assigning @rojiphil for review since that's who it looks like it should be based on the linked issue, lmk if not! |
@trjExpensify @hayata-suenaga mentioning you here too. PR is ready. |
@trjExpensify That error is there for all the fields that has error or brick road Indicator and that's because I'm not connected to QBO. I believe if you test on your end, you won't find those. |
…ndle-the-error-with-journal-entry
…ndle-the-error-with-journal-entry
I don't understand this comment, sorry. I'm going to create a build. |
O Apologies for getting you lost there. what i meant was, that error was showing because I did not setup QBO on my local. I bypassed to make that fix. But if tested on real data or live it should work as expected without the error. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Turning off the tax import on the backend when the Journal Entry is selected introduces a new pattern that we have not yet considered. This might confuse users, as they do not anticipate these configuration options changing simultaneously. There is an existing error message that has not been used yet. Could it be the one that @teneeto used in the earlier commits of this PR? The message was added in this PR. I suggest we use it now in the event of a misconfiguration. cc: @aldo-expensify and @trjExpensify PS: @trjExpensify, we're discussing this very rare case when the misconfiguration does happen. |
…ndle-the-error-with-journal-entry
I think that sounds reasonable for this edge case. Let's ensure that we apply the "red brick road" to lead to this error though. I.e
|
I got a bit lost on the next steps here. Do we need to update the PR to handle the previous cases that were discussed? |
…ndle-the-error-with-journal-entry
by "previous case", do you mean this one? |
I'll do a more closer code review today |
Got it. Thanks @hayata-suenaga |
I haven’t reviewed the code from this perspective yet. I will do this today and provide an update. |
…ndle-the-error-with-journal-entry
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.
src/pages/workspace/accounting/qbo/import/QuickbooksTaxesPage.tsx
Outdated
Show resolved
Hide resolved
/> | ||
</View> | ||
</OfflineWithFeedback> | ||
</View> | ||
{isJournalExportEntity && <Text style={[styles.mutedNormalTextLabel, styles.pt2]}>{translate('workspace.qbo.taxesJournalEntrySwitchNote')}</Text>} |
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.
The hint text does not seem right for the above-mentioned scenario i.e. when the syncTax
is true
Journal Entry
export is set).
A separate hint text may be better here for this specific scenario
What do you think?
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.
Something like !syncTax && isJournalExportEntity could solve this problem.
Yes I agree.
@teneeto, could you remind me if we have an error message on the frontend side for the rare case of Journal Entry is selected while the syncTax
is on (when the configuration was changed in Expensify Classic, etc).
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.
@teneeto, could you remind me if we have an error message on the frontend side for the rare case of Journal Entry is selected while the syncTax is one (when the configuration was changed in Expensify Classic, etc).
Checked the code, and we display this error message when the above misconfiguration happens here. Should we do the same for the Tax toggle, too on the QuickbooksTaxesPage
? (instead of displaying the hint text)?
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.
@teneeto, or do we already have an error message for the above case, too?
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.
Let me confirm
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.
There are no error fields here. should we add here?
Please see the comment below 😄
we will probably move the error handling to the backend. We don't have to do this on the front end. Please ignore this 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.
Is there any change I'll need to make?
Thank you for reminding where the UI copy came from. I agree with @rojiphil on the following point:
The hint text does not seem right for the above-mentioned scenario i.e. when the syncTax is true
Journal Entry export is set).
I think we should have the same condition as what @rojiphil suggested -> !syncTax && isJournalExportEntity
to display this hint message
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.
ok
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.
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.
it's rare case anyway, so I gonna address this change when I make a backend change to handle errors on the backend side 👍
@teneeto, could you update the testing steps in the OP to mention that the tester needs to use a UK QBO account? |
…ndle-the-error-with-journal-entry
I'm not sure if we should handle these errors in the front end. If we're going to display errors, we have to create the complete RBR flow (Tom explained this here). For now, I'd say we don't account for the edges cases that can happen because the user changes some configurations on Expensify Classics). Let's rely on the front end safeguard for now. We can follow up with the backend change (return an error if the invalid configuration combination is attempted to made). And we can display the error returned from the backend following the RBR pattern that Tom described here) I created a follow-up backend issue here (internal link) |
Working on the checklist 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.
LGTM. And tests well too.
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.4.75-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.75-1 🚀
|
Details
This PR allows to warn the user of the error that happens when Journal Entry is selected as the out-of-pocket expense export destination while tax is enabled.
Screen.Recording.2024-05-02.at.17.55.11.mov
Fixed Issues
$: 41042
PROPOSAL: issuecomment
Tests
Case When Journal is selected as Export entity
Export
settingsExport out-of-pocket expenses as
Export as
and chooseJournal
as the export entity type.Import
settings.Taxes
Expectation: when Journal is selected as an export entity type, you should not be able to enable taxes, and there should be a hint text about why you can't enable taxes.
Case When Tax is enabled
Import
settingsExport
settingsExport out-of-pocket expenses as
Export as
Expectation: Notice how you can't find
Journal
amongst the export options and there should be a hint text about why you don't have theJournal
option.Offline tests
Case When Journal is selected as Export entity
Export
settingsExport out-of-pocket expenses as
Export as
and chooseJournal
as the export entity type.Import
settings.Taxes
Expectation: when Journal is selected as an export entity type, you should not be able to enable taxes, and there should be a hint text about why you can't enable taxes.
Case When Tax is enabled
Import
settingsExport
settingsExport out-of-pocket expenses as
Export as
Expectation: Notice how you can't find
Journal
amongst the export options and there should be a hint text about why you don't have theJournal
option.QA Steps
Case When Journal is selected as Export entity
Export
settingsExport out-of-pocket expenses as
Export as
and chooseJournal
as the export entity type.Import
settings.Taxes
Expectation: when Journal is selected as an export entity type, you should not be able to enable taxes, and there should be a hint text about why you can't enable taxes.
Case When Tax is enabled
Import
settingsExport
settingsExport out-of-pocket expenses as
Export as
Expectation: Notice how you can't find
Journal
amongst the export options and there should be a hint text about why you don't have theJournal
option.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
MacOS: Chrome / Safari
Screen.Recording.2024-05-02.at.17.55.11.mov
iOS: Native
Android: Native
Android: mWeb Chrome
iOS: mWeb Safari
MacOS: Desktop