diff --git a/src/CONST.ts b/src/CONST.ts index 399535412f0e..f00557914d76 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -5765,6 +5765,14 @@ const CONST = { description: `workspace.upgrade.${this.POLICY.CONNECTIONS.NAME.SAGE_INTACCT}.description` as const, icon: 'IntacctSquare', }, + [this.POLICY.CONNECTIONS.NAME.QBD]: { + id: this.POLICY.CONNECTIONS.NAME.QBD, + alias: 'qbd', + name: this.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.quickbooksDesktop, + title: `workspace.upgrade.${this.POLICY.CONNECTIONS.NAME.QBD}.title` as const, + description: `workspace.upgrade.${this.POLICY.CONNECTIONS.NAME.QBD}.description` as const, + icon: 'QBDSquare', + }, approvals: { id: 'approvals' as const, alias: 'approvals' as const, diff --git a/src/components/ConnectToQuickbooksDesktopFlow/index.tsx b/src/components/ConnectToQuickbooksDesktopFlow/index.tsx index bf1315b452c6..07ca376a7449 100644 --- a/src/components/ConnectToQuickbooksDesktopFlow/index.tsx +++ b/src/components/ConnectToQuickbooksDesktopFlow/index.tsx @@ -1,7 +1,6 @@ import {useEffect} from 'react'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import Navigation from '@libs/Navigation/Navigation'; -import * as PolicyAction from '@userActions/Policy/Policy'; import ROUTES from '@src/ROUTES'; import type {ConnectToQuickbooksDesktopFlowProps} from './types'; @@ -12,8 +11,6 @@ function ConnectToQuickbooksDesktopFlow({policyID}: ConnectToQuickbooksDesktopFl if (isSmallScreenWidth) { Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_SETUP_REQUIRED_DEVICE_MODAL.getRoute(policyID)); } else { - // Since QBD doesn't support Taxes, we should disable them from the LHN when connecting to QBD - PolicyAction.enablePolicyTaxes(policyID, false); Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_SETUP_MODAL.getRoute(policyID)); } }, [isSmallScreenWidth, policyID]); diff --git a/src/languages/en.ts b/src/languages/en.ts index 15efa7947cf7..1b8fd271982e 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2462,8 +2462,7 @@ const translations = { advancedConfig: { autoSyncDescription: 'Expensify will automatically sync with QuickBooks Desktop every day.', createEntities: 'Auto-create entities', - createEntitiesDescription: - "Expensify will automatically create vendors in QuickBooks Desktop if they don't exist already, and auto-create customers when exporting invoices.", + createEntitiesDescription: "Expensify will automatically create vendors in QuickBooks Desktop if they don't exist already.", }, }, qbo: { @@ -3961,6 +3960,11 @@ const translations = { description: `Enjoy automated syncing and reduce manual entries with the Expensify + Sage Intacct integration. Gain in-depth, real-time financial insights with user-defined dimensions, as well as expense coding by department, class, location, customer, and project (job).`, onlyAvailableOnPlan: 'Our Sage Intacct integration is only available on the Control plan, starting at ', }, + [CONST.POLICY.CONNECTIONS.NAME.QBD]: { + title: 'QuickBooks Desktop', + description: `Enjoy automated syncing and reduce manual entries with the Expensify + QuickBooks Desktop integration. Gain ultimate efficiency with a realtime, two-way connection and expense coding by class, item, customer, and project.`, + onlyAvailableOnPlan: 'Our QuickBooks Desktop integration is only available on the Control plan, starting at ', + }, [CONST.UPGRADE_FEATURE_INTRO_MAPPING.approvals.id]: { title: 'Advanced Approvals', description: `If you want to add more layers of approval to the mix – or just make sure the largest expenses get another set of eyes – we’ve got you covered. Advanced approvals help you put the right checks in place at every level so you keep your team’s spend under control.`, diff --git a/src/languages/es.ts b/src/languages/es.ts index f3bfd43c760b..47930bfd3cf0 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2486,7 +2486,7 @@ const translations = { advancedConfig: { autoSyncDescription: 'Expensify se sincronizará automáticamente con QuickBooks Desktop todos los días.', createEntities: 'Crear entidades automáticamente', - createEntitiesDescription: 'Expensify creará automáticamente proveedores en QuickBooks Desktop si aún no existen, y creará automáticamente clientes al exportar facturas.', + createEntitiesDescription: 'Expensify creará automáticamente proveedores en QuickBooks Desktop si aún no existen.', }, }, qbo: { @@ -4006,6 +4006,11 @@ const translations = { description: `Disfruta de una sincronización automatizada y reduce las entradas manuales con la integración Expensify + Sage Intacct. Obtén información financiera en profundidad y en tiempo real con dimensiones definidas por el usuario, así como codificación de gastos por departamento, clase, ubicación, cliente y proyecto (trabajo).`, onlyAvailableOnPlan: 'Nuestra integración Sage Intacct sólo está disponible en el plan Control, a partir de ', }, + [CONST.POLICY.CONNECTIONS.NAME.QBD]: { + title: 'QuickBooks Desktop', + description: `Disfruta de la sincronización automática y reduce las entradas manuales con la integración de Expensify + QuickBooks Desktop. Obtén la máxima eficiencia con una conexión bidireccional en tiempo real y la codificación de gastos por clase, artículo, cliente y proyecto.`, + onlyAvailableOnPlan: 'Nuestra integración con QuickBooks Desktop solo está disponible en el plan Control, que comienza en ', + }, [CONST.UPGRADE_FEATURE_INTRO_MAPPING.approvals.id]: { title: 'Aprobaciones anticipadas', description: `Si quieres añadir más niveles de aprobación, o simplemente asegurarte de que los gastos más importantes reciben otro vistazo, no hay problema. Las aprobaciones avanzadas ayudan a realizar las comprobaciones adecuadas a cada nivel para mantener los gastos de tu equipo bajo control.`, diff --git a/src/pages/workspace/accounting/AccountingContext.tsx b/src/pages/workspace/accounting/AccountingContext.tsx index 6250f99b21f2..98a804d0ba66 100644 --- a/src/pages/workspace/accounting/AccountingContext.tsx +++ b/src/pages/workspace/accounting/AccountingContext.tsx @@ -4,6 +4,7 @@ import type {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; import AccountingConnectionConfirmationModal from '@components/AccountingConnectionConfirmationModal'; import useLocalize from '@hooks/useLocalize'; +import useResponsiveLayout from '@hooks/useResponsiveLayout'; import {removePolicyConnection} from '@libs/actions/connections'; import Navigation from '@libs/Navigation/Navigation'; import {isControlPolicy} from '@libs/PolicyUtils'; @@ -56,6 +57,7 @@ function AccountingContextProvider({children, policy}: AccountingContextProvider const [activeIntegration, setActiveIntegration] = useState(); const {translate} = useLocalize(); const policyID = policy?.id ?? '-1'; + const {isSmallScreenWidth} = useResponsiveLayout(); const startIntegrationFlow = React.useCallback( (newActiveIntegration: ActiveIntegration) => { @@ -67,6 +69,8 @@ function AccountingContextProvider({children, policy}: AccountingContextProvider undefined, newActiveIntegration.integrationToDisconnect, newActiveIntegration.shouldDisconnectIntegrationBeforeConnecting, + undefined, + isSmallScreenWidth, ); const workspaceUpgradeNavigationDetails = accountingIntegrationData?.workspaceUpgradeNavigationDetails; if (workspaceUpgradeNavigationDetails && !isControlPolicy(policy)) { @@ -80,7 +84,7 @@ function AccountingContextProvider({children, policy}: AccountingContextProvider key: Math.random(), }); }, - [policy, policyID, translate], + [isSmallScreenWidth, policy, policyID, translate], ); const closeConfirmationModal = () => { diff --git a/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx b/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx index abc98f1c4d42..1aa80231fc7d 100644 --- a/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx +++ b/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx @@ -15,6 +15,7 @@ import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop' import Navigation from '@libs/Navigation/Navigation'; import type {SettingsNavigatorParamList} from '@libs/Navigation/types'; import LoadingPage from '@pages/LoadingPage'; +import * as PolicyAction from '@userActions/Policy/Policy'; import ROUTES from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; @@ -36,6 +37,9 @@ function RequireQuickBooksDesktopModal({route}: RequireQuickBooksDesktopModalPro }); }; + // Since QBD doesn't support Taxes, we should disable them from the LHN when connecting to QBD + PolicyAction.enablePolicyTaxes(policyID, false); + fetchSetupLink(); // disabling this rule, as we want this to run only on the first render // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps diff --git a/src/pages/workspace/accounting/utils.tsx b/src/pages/workspace/accounting/utils.tsx index cc1dfa1fcd9f..b106a3ca5a89 100644 --- a/src/pages/workspace/accounting/utils.tsx +++ b/src/pages/workspace/accounting/utils.tsx @@ -47,11 +47,22 @@ function getAccountingIntegrationData( integrationToDisconnect?: ConnectionName, shouldDisconnectIntegrationBeforeConnecting?: boolean, canUseNetSuiteUSATax?: boolean, + isSmallScreenWidth?: boolean, ): AccountingIntegration | undefined { const qboConfig = policy?.connections?.quickbooksOnline?.config; const netsuiteConfig = policy?.connections?.netsuite?.options?.config; const netsuiteSelectedSubsidiary = (policy?.connections?.netsuite?.options?.data?.subsidiaryList ?? []).find((subsidiary) => subsidiary.internalID === netsuiteConfig?.subsidiaryID); + const getBackToAfterWorkspaceUpgradeRouteForQBD = () => { + if (integrationToDisconnect) { + return ROUTES.POLICY_ACCOUNTING.getRoute(policyID, connectionName, integrationToDisconnect, shouldDisconnectIntegrationBeforeConnecting); + } + if (isSmallScreenWidth) { + return ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_SETUP_REQUIRED_DEVICE_MODAL.getRoute(policyID); + } + return ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_SETUP_MODAL.getRoute(policyID); + }; + switch (connectionName) { case CONST.POLICY.CONNECTIONS.NAME.QBO: return { @@ -270,6 +281,10 @@ function getAccountingIntegrationData( CONST.QUICKBOOKS_DESKTOP_CONFIG.MARK_CHECKS_TO_BE_PRINTED, ], subscribedAdvancedSettings: [CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR, CONST.QUICKBOOKS_DESKTOP_CONFIG.AUTO_SYNC], + workspaceUpgradeNavigationDetails: { + integrationAlias: CONST.UPGRADE_FEATURE_INTRO_MAPPING.quickbooksDesktop.alias, + backToAfterWorkspaceUpgradeRoute: getBackToAfterWorkspaceUpgradeRouteForQBD(), + }, }; default: return undefined;