Handle the error with journal entry when tax is enabled#41520
Handle the error with journal entry when tax is enabled#41520hayata-suenaga merged 21 commits intoExpensify:mainfrom
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
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.
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.
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.
@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.
@teneeto, or do we already have an error message for the above case, too?
There was a problem hiding this comment.
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.
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.
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 |
rojiphil
left a comment
There was a problem hiding this comment.
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
ExportsettingsExport out-of-pocket expenses asExport asand chooseJournalas the export entity type.Importsettings.TaxesExpectation: 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
ImportsettingsExportsettingsExport out-of-pocket expenses asExport asExpectation: Notice how you can't find
Journalamongst the export options and there should be a hint text about why you don't have theJournaloption.Offline tests
Case When Journal is selected as Export entity
ExportsettingsExport out-of-pocket expenses asExport asand chooseJournalas the export entity type.Importsettings.TaxesExpectation: 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
ImportsettingsExportsettingsExport out-of-pocket expenses asExport asExpectation: Notice how you can't find
Journalamongst the export options and there should be a hint text about why you don't have theJournaloption.QA Steps
Case When Journal is selected as Export entity
ExportsettingsExport out-of-pocket expenses asExport asand chooseJournalas the export entity type.Importsettings.TaxesExpectation: 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
ImportsettingsExportsettingsExport out-of-pocket expenses asExport asExpectation: Notice how you can't find
Journalamongst the export options and there should be a hint text about why you don't have theJournaloption.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
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