From b40eaaecf835c55ee2b83364896064d4c249a5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Wed, 22 May 2024 12:58:51 +0200 Subject: [PATCH 1/3] disable taxes if previously enabled on disconnect --- src/pages/workspace/accounting/PolicyAccountingPage.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index d6ef27c7b00d..74e13a84c5b7 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -32,6 +32,7 @@ import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper'; import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import type {AnchorPosition} from '@styles/index'; +import * as PolicyAction from '@userActions/Policy'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -369,6 +370,9 @@ function PolicyAccountingPage({policy, connectionSyncProgress, isConnectionDataF isVisible={isDisconnectModalOpen} onConfirm={() => { if (connectedIntegration) { + if (policy?.connections?.xero && policy?.connections?.xero?.config?.importTaxRates) { + PolicyAction.enablePolicyTaxes(policy?.id ?? '', false); + } removePolicyConnection(policyID, connectedIntegration); } setIsDisconnectModalOpen(false); From aff888d333e6a67659d40780bf25d96e187c6302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Wed, 22 May 2024 15:54:32 +0200 Subject: [PATCH 2/3] change logic --- src/pages/workspace/accounting/PolicyAccountingPage.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 74e13a84c5b7..d6ef27c7b00d 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -32,7 +32,6 @@ import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper'; import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import type {AnchorPosition} from '@styles/index'; -import * as PolicyAction from '@userActions/Policy'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -370,9 +369,6 @@ function PolicyAccountingPage({policy, connectionSyncProgress, isConnectionDataF isVisible={isDisconnectModalOpen} onConfirm={() => { if (connectedIntegration) { - if (policy?.connections?.xero && policy?.connections?.xero?.config?.importTaxRates) { - PolicyAction.enablePolicyTaxes(policy?.id ?? '', false); - } removePolicyConnection(policyID, connectedIntegration); } setIsDisconnectModalOpen(false); From 83c3a6c1d90fd1e63ab15463988e2d298f165ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Wed, 22 May 2024 15:54:47 +0200 Subject: [PATCH 3/3] remove taxes in lhn when connecting to QBO --- src/components/ConnectToQuickbooksOnlineButton/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ConnectToQuickbooksOnlineButton/index.tsx b/src/components/ConnectToQuickbooksOnlineButton/index.tsx index 37fea2b957a2..d5e68b722827 100644 --- a/src/components/ConnectToQuickbooksOnlineButton/index.tsx +++ b/src/components/ConnectToQuickbooksOnlineButton/index.tsx @@ -8,6 +8,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import {removePolicyConnection} from '@libs/actions/connections'; import {getQuickBooksOnlineSetupLink} from '@libs/actions/connections/QuickBooksOnline'; import * as Link from '@userActions/Link'; +import * as PolicyAction from '@userActions/Policy'; import CONST from '@src/CONST'; import type {ConnectToQuickbooksOnlineButtonProps} from './types'; @@ -27,6 +28,8 @@ function ConnectToQuickbooksOnlineButton({policyID, shouldDisconnectIntegrationB setIsDisconnectModalOpen(true); return; } + // Since QBO doesn't support Taxes, we should disable them from the LHN when connecting to QBO + PolicyAction.enablePolicyTaxes(policyID, false); Link.openLink(getQuickBooksOnlineSetupLink(policyID), environmentURL); }} isDisabled={isOffline}