Skip to content
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

New Feature: "When to export" selector for auto-sync for Quickbooks Online #57522

Open
yuwenmemon opened this issue Feb 27, 2025 · 14 comments
Open
Assignees
Labels
External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2

Comments

@yuwenmemon
Copy link
Contributor

yuwenmemon commented Feb 27, 2025

We need to build the same selector we made for NetSuite in this issue, but for Quickbooks Online (QBO).

The selection should be saved under the property accountingMethod in the QBO config object.

If there is no accountingMethod property set in the QBO config, the selector should default to CASH

Linked Expensify Issue: https://github.com/Expensify/Expensify/issues/474822

Issue OwnerCurrent Issue Owner: @suneox
@yuwenmemon yuwenmemon added the External Added to denote the issue can be worked on by a contributor label Feb 27, 2025
@yuwenmemon yuwenmemon self-assigned this Feb 27, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 27, 2025
Copy link

melvin-bot bot commented Feb 27, 2025

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

@yuwenmemon yuwenmemon added Daily KSv2 NewFeature Something to build that is a new item. labels Feb 27, 2025
Copy link

melvin-bot bot commented Feb 27, 2025

Triggered auto assignment to @mallenexpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Feb 27, 2025
Copy link

melvin-bot bot commented Feb 27, 2025

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

Copy link

melvin-bot bot commented Feb 27, 2025

Triggered auto assignment to Design team member for new feature review - @dannymcclain (NewFeature)

@twilight2294
Copy link
Contributor

hey @yuwenmemon can i work on this? i worked on the issue you mentioned in the OP

@mkzie2
Copy link
Contributor

mkzie2 commented Feb 27, 2025

Proposal

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

"When to export" selector for auto-sync for Quickbooks Online

What is the root cause of that problem?

This is a new feature

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

  1. Remove the autoSync from the list toggle setting item here and add a new menu item for this.
<MenuItemWithTopDescription
    title={qboConfig?.autoSync?.enabled ? translate('common.enabled') : translate('common.disabled')}
    description={translate('workspace.accounting.autoSync')}
    shouldShowRightIcon
    onPress={() => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QBO_AUTO_SYNC.getRoute(policyID))}
    brickRoadIndicator={areSettingsInErrorFields([CONST.QUICKBOOKS_CONFIG.AUTO_SYNC, CONST.QUICKBOOKS_CONFIG.ACCOUNTING_METHOD], qboConfig?.errorFields) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
    hintText={(() => {
        if (!qboConfig?.autoSync?.enabled) {
            return undefined;
        }
        return translate(
            `workspace.qbo.advancedConfig.accountingMethods.alternateText.${accountingMethod ?? COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD.CASH}` as TranslationPaths,
        );
    })()}
    style={[styles.ph0]}
/>

  1. Create two new pages QuickbooksAutoSyncPage and QuickbooksAccountingMethodPage follow the same page for netsuite here and here

  2. When we toggle the auto-sync toggle in the QuickbooksAutoSyncPage we will call UpdateQuickbooksOnlineAutoSync

  3. When we select an accountingMethod, we will call the API to update this data. We need to wait the endpoint from internal team.

The test branch: https://github.com/mkzie2/App/tree/mkzie2-issue/57522

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

NA

Result

Screen.Recording.2025-02-27.at.14.37.33.mov

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 27, 2025
@twilight2294
Copy link
Contributor

Proposal

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

"When to export" selector for auto-sync for Quickbooks Online

What is the root cause of that problem?

Feature request

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

  1. Like we did for Netsuite, we should remove the current toggle in the advanced page and instead use menuitem:
    Remove the toggle:

const qboToggleSettingItems = [
{
title: translate('workspace.accounting.autoSync'),
subtitle: translate('workspace.qbo.advancedConfig.autoSyncDescription'),
switchAccessibilityLabel: translate('workspace.qbo.advancedConfig.autoSyncDescription'),

Instead add it as a menu item below:

const AccordionMenuItems = [
{
title: selectedQboAccountName,
description: translate('workspace.qbo.advancedConfig.qboBillPaymentAccount'),
onPress: waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_ACCOUNT_SELECTOR.getRoute(policyID))),
subscribedSettings: reimbursementOrCollectionAccountIDs,

  1. Then we need to create a new page to show the toggle and on the basis of it is activated or not we will show the dropdown to select the When to export item which will open a new page, the page will be named as QuickBooksAutoSyncPage

Same layout as the one used in this file of the PR:
https://github.com/Expensify/App/pull/51949/files#diff-181b730e28ea85639008e58bc26d7f242354f7158153fd09cce37a3eef610991R22

  1. Then finally have QuickBooksAccountingMethodPage:
    Like we have here https://github.com/Expensify/App/pull/51949/files#diff-d8d7774cbb8ba08b0c7a68a16afaae91f16ffeb7ce82e179848a5e91320e8a87R25

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

@yuwenmemon
Copy link
Contributor Author

Yeah @twilight2294 happy to have you do it again since you did the last one!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 27, 2025
@twilight2294
Copy link
Contributor

@yuwenmemon what is the new API endpoint to enable the when to export selector ? PR is ready below just need the endpoint to connect to the backend

@yuwenmemon
Copy link
Contributor Author

@twilight2294 it's not live yet but it will be called UpdateQuickbooksOnlineAccountingMethod and you will pass it accountingMethod just like last time.

@dylanexpensify dylanexpensify moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Mar 4, 2025
@yuwenmemon
Copy link
Contributor Author

@twilight2294 The API is on prod and staging.

@twilight2294
Copy link
Contributor

Thank you @yuwenmemon , I will test and complete the videos tomorrow morning (it's late for me now)

@twilight2294
Copy link
Contributor

PR has been opened for review

Copy link

melvin-bot bot commented Mar 14, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

6 participants