Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.53k stars 2.88k forks source link

[$250] QBD - Admin is not selected as default Preferred exporter after connecting to QBD #52134

Open lanitochka17 opened 1 day ago

lanitochka17 commented 1 day ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.58-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5184323 Email or phone of affected tester (no customers): applausetester+dqbd7@applause.expensifail.com Issue reported by: Applause - Internal Team

Action Performed:

Precondition: Have a workspace connected to QBD

  1. Navigate to Workspace > Accounting
  2. Click on Export
  3. Click Preferred exporter

Expected Result:

Admin is selected as default Preferred exporter after connecting to QBD

Actual Result:

Admin(owner) is not selected as default Preferred exporter after connecting to QBD

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/1084f55d-46de-4aa8-a17e-68c5c4d687c7

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021854584654634877527
  • Upwork Job ID: 1854584654634877527
  • Last Price Increase: 2024-11-07
Issue OwnerCurrent Issue Owner: @hoangzinh
melvin-bot[bot] commented 1 day ago

Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

ZhenjaHorbach commented 1 day ago

Edited by proposal-police: This proposal was edited at 2024-11-06 20:19:47 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

QBD - Admin is not selected as default Preferred exporter after connecting to QBD

What is the root cause of that problem?

The main problem is that by default exporter is equal to an empty string

And since in order to use the owner as a spare value exporter must be undefined or null (specifics of ?? operator) We will never be able to use owner value

https://github.com/Expensify/App/blob/e267aa6cb86e5be42d6d5afd910070e42adba9fb/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopExportPage.tsx#L34

https://github.com/Expensify/App/blob/e267aa6cb86e5be42d6d5afd910070e42adba9fb/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopPreferredExporterConfigurationPage.tsx#L48

What changes do you think we should make in order to solve the problem?

To fix this bug we can replace ?? with || So that we can use owner if exporter is empty

And I suppose we need to check QBO just in case Since the code for QBO and QBD are very similar to make sure there is no similar bug there

What alternative solutions did you explore? (Optional)

NA

Additional I found an additional bug:

  1. If we add an user and assign them as admins
  2. Then we will select them as an Preferred exporter
  3. Then removed from admins
  4. It will still be selected as a preferred exporter

To fix this we can do an additional check for the current exporter and check if it is in the list of admins using the getAdminEmployees function And in case of its absence we can again use owner as the current exporter

Or make a more complex solution and in case of connected integration and removal of admins from workspace we can make additional requests to save a preferred exporter as owner

And we will also need to check the QBO (and possibly other integrations)

melvin-bot[bot] commented 15 hours ago

Job added to Upwork: https://www.upwork.com/jobs/~021854584654634877527

melvin-bot[bot] commented 15 hours ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (External)