From 11fb6b9747a3d230e463e313457f669592c5730b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 8 Jul 2024 12:52:59 +0200 Subject: [PATCH 1/4] fix disconnect QBO on native devices --- .../ConnectToQuickbooksOnlineButton/index.native.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx b/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx index bd9b623bcfb4..e05011e85809 100644 --- a/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx +++ b/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx @@ -17,6 +17,8 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {Session} from '@src/types/onyx'; import type {ConnectToQuickbooksOnlineButtonProps} from './types'; +import * as PolicyAction from '@userActions/Policy/Policy'; + type ConnectToQuickbooksOnlineButtonOnyxProps = { /** Session info for the currently logged in user. */ @@ -59,6 +61,8 @@ function ConnectToQuickbooksOnlineButton({ {shouldDisconnectIntegrationBeforeConnecting && integrationToDisconnect && isDisconnectModalOpen && ( { + // Since QBO doesn't support Taxes, we should disable them from the LHN when connecting to QBO + PolicyAction.enablePolicyTaxes(policyID, false); removePolicyConnection(policyID, integrationToDisconnect); setIsDisconnectModalOpen(false); setWebViewOpen(true); From 7f170946fa0bc7ff3cbd5250532f0c814d5211ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 8 Jul 2024 13:20:08 +0200 Subject: [PATCH 2/4] fix lint --- src/components/ConnectToQuickbooksOnlineButton/index.native.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx b/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx index e05011e85809..d8068cfba859 100644 --- a/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx +++ b/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx @@ -1,4 +1,5 @@ import React, {useRef, useState} from 'react'; +import * as PolicyAction from '@userActions/Policy/Policy'; import type {OnyxEntry} from 'react-native-onyx'; import {withOnyx} from 'react-native-onyx'; import {WebView} from 'react-native-webview'; @@ -17,7 +18,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {Session} from '@src/types/onyx'; import type {ConnectToQuickbooksOnlineButtonProps} from './types'; -import * as PolicyAction from '@userActions/Policy/Policy'; type ConnectToQuickbooksOnlineButtonOnyxProps = { From 993f8066e36555e33bcafc1195917c560f776946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 8 Jul 2024 13:30:49 +0200 Subject: [PATCH 3/4] fix prettier --- .../ConnectToQuickbooksOnlineButton/index.native.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx b/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx index d8068cfba859..0d7f27674ae0 100644 --- a/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx +++ b/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx @@ -1,5 +1,4 @@ import React, {useRef, useState} from 'react'; -import * as PolicyAction from '@userActions/Policy/Policy'; import type {OnyxEntry} from 'react-native-onyx'; import {withOnyx} from 'react-native-onyx'; import {WebView} from 'react-native-webview'; @@ -14,12 +13,12 @@ import useNetwork from '@hooks/useNetwork'; import useThemeStyles from '@hooks/useThemeStyles'; import {removePolicyConnection} from '@libs/actions/connections'; import getQuickBooksOnlineSetupLink from '@libs/actions/connections/QuickBooksOnline'; +import * as PolicyAction from '@userActions/Policy/Policy'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {Session} from '@src/types/onyx'; import type {ConnectToQuickbooksOnlineButtonProps} from './types'; - type ConnectToQuickbooksOnlineButtonOnyxProps = { /** Session info for the currently logged in user. */ session: OnyxEntry; @@ -62,7 +61,7 @@ function ConnectToQuickbooksOnlineButton({ { // Since QBO doesn't support Taxes, we should disable them from the LHN when connecting to QBO - PolicyAction.enablePolicyTaxes(policyID, false); + PolicyAction.enablePolicyTaxes(policyID, false); removePolicyConnection(policyID, integrationToDisconnect); setIsDisconnectModalOpen(false); setWebViewOpen(true); From f3774aa7c69b71b401e3d47bc3d29b43a976d2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Tue, 9 Jul 2024 09:07:27 +0200 Subject: [PATCH 4/4] make taxes disabled on first connection to QBO --- src/components/ConnectToQuickbooksOnlineButton/index.native.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx b/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx index 0d7f27674ae0..2b2c53eaaa18 100644 --- a/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx +++ b/src/components/ConnectToQuickbooksOnlineButton/index.native.tsx @@ -50,6 +50,8 @@ function ConnectToQuickbooksOnlineButton({ setIsDisconnectModalOpen(true); return; } + // Since QBO doesn't support Taxes, we should disable them from the LHN when connecting to QBO + PolicyAction.enablePolicyTaxes(policyID, false); setWebViewOpen(true); }} text={translate('workspace.accounting.setup')}