From c6eecbefdb9a0cd42c5b179cd3865cdf0d8d6fd6 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Tue, 15 Oct 2024 22:58:27 +0200 Subject: [PATCH 1/4] implement advanced screen --- src/CONST.ts | 2 + src/ROUTES.ts | 4 + src/SCREENS.ts | 1 + src/languages/en.ts | 7 ++ src/languages/es.ts | 7 ++ src/libs/API/types.ts | 4 + .../ModalStackNavigators/index.tsx | 2 + .../FULL_SCREEN_TO_RHP_MAPPING.ts | 1 + src/libs/Navigation/linkingConfig/config.ts | 3 + src/libs/Navigation/types.ts | 6 ++ .../actions/connections/QuickbooksDesktop.ts | 28 +++++++ .../QuickbooksDesktopAdvancedPage.tsx | 82 +++++++++++++++++++ src/pages/workspace/accounting/utils.tsx | 4 +- src/types/onyx/Policy.ts | 7 +- 14 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx diff --git a/src/CONST.ts b/src/CONST.ts index 40f3c541b0f7..5f7b36288500 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1492,7 +1492,9 @@ const CONST = { MARK_CHECKS_TO_BE_PRINTED: 'markChecksToBePrinted', REIMBURSABLE_ACCOUNT: 'reimbursableAccount', REIMBURSABLE: 'reimbursable', + AUTO_SYNC: 'autoSync', ENABLE_NEW_CATEGORIES: 'enableNewCategories', + SHOULD_AUTO_CREATE_VENDOR: 'shouldAutoCreateVendor', MAPPINGS: { CLASSES: 'classes', }, diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 7751ce7be4b6..816b3983117f 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -670,6 +670,10 @@ const ROUTES = { route: 'settings/workspaces/:policyID/accounting/quickbooks-online/export/date-select', getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/export/date-select` as const, }, + WORKSPACE_ACCOUNTING_QUICKBOOKS_DESKTOP_ADVANCED: { + route: 'settings/workspaces/:policyID/accounting/quickbooks-desktop/advanced', + getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-desktop/advanced` as const, + }, POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT_DATE_SELECT: { route: 'settings/workspaces/:policyID/accounting/quickbooks-desktop/export/date-select', getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-desktop/export/date-select` as const, diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 3da0f86d651e..5a114f7e2eda 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -317,6 +317,7 @@ const SCREENS = { QUICKBOOKS_ONLINE_ADVANCED: 'Policy_Accounting_Quickbooks_Online_Advanced', QUICKBOOKS_ONLINE_ACCOUNT_SELECTOR: 'Policy_Accounting_Quickbooks_Online_Account_Selector', QUICKBOOKS_ONLINE_INVOICE_ACCOUNT_SELECTOR: 'Policy_Accounting_Quickbooks_Online_Invoice_Account_Selector', + QUICKBOOKS_DESKTOP_ADVANCED: 'Policy_Accounting_Quickbooks_Desktop_Advanced', QUICKBOOKS_DESKTOP_EXPORT_DATE_SELECT: 'Workspace_Accounting_Quickbooks_Desktop_Export_Date_Select', QUICKBOOKS_DESKTOP_EXPORT_PREFERRED_EXPORTER: 'Workspace_Accounting_Quickbooks_Desktop_Export_Preferred_Exporter', QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES: 'Workspace_Accounting_Quickbooks_Desktop_Export_Out_Of_Pocket_Expenses', diff --git a/src/languages/en.ts b/src/languages/en.ts index 58ac38d1856c..054c5d64e680 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2458,6 +2458,13 @@ const translations = { classesDescription: 'Choose how to handle QuickBooks Desktop classes in Expensify.', tagsDisplayedAsDescription: 'Line item level', reportFieldsDisplayedAsDescription: 'Report level', + 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.", + reimbursedReportsDescription: 'Any time a report is paid using Expensify ACH, the corresponding bill payment will be created in the Quickbooks Online account below.', + }, }, qbo: { importDescription: 'Choose which coding configurations to import from QuickBooks Online to Expensify.', diff --git a/src/languages/es.ts b/src/languages/es.ts index 650ccdf5e660..51a6e11f9e00 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2482,6 +2482,13 @@ const translations = { classesDescription: 'Elige cómo gestionar las clases de QuickBooks Desktop en Expensify.', tagsDisplayedAsDescription: 'Nivel de partida', reportFieldsDisplayedAsDescription: 'Nivel de informe', + 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.', + reimbursedReportsDescription: + 'Cada vez que se pague un informe utilizando Expensify ACH, se creará el correspondiente pago de la factura en la cuenta de Quickbooks Online indicadas a continuación.', + }, }, qbo: { importDescription: 'Elige que configuraciónes de codificación son importadas desde QuickBooks Online a Expensify.', diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index 2463fc1cdc0c..a19d63816113 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -259,6 +259,8 @@ const WRITE_COMMANDS = { UPDATE_QUICKBOOKS_ONLINE_EXPORT: 'UpdateQuickbooksOnlineExport', UPDATE_QUICKBOOKS_DESKTOP_EXPORT_DATE: 'UpdateQuickbooksDesktopExportDate', UPDATE_MANY_POLICY_CONNECTION_CONFIGS: 'UpdateManyPolicyConnectionConfigurations', + UPDATE_QUICKBOOKS_DESKTOP_AUTO_CREATE_VENDOR: 'UpdateQuickbooksDesktopAutoCreateVendor', + UPDATE_QUICKBOOKS_DESKTOP_AUTO_SYNC: 'UpdateQuickbooksDesktopAutoSync', UPDATE_QUICKBOOKS_DESKTOP_EXPORT: 'UpdateQuickbooksDesktopExport', UPDATE_QUICKBOOKS_DESKTOP_REIMBURSABLE_EXPENSES_ACCOUNT: 'UpdateQuickbooksDesktopReimbursableExpensesAccount', UPDATE_QUICKBOOKS_DESKTOP_MARK_CHECKS_TO_BE_PRINTED: 'UpdateQuickbooksDesktopMarkChecksToBePrinted', @@ -698,6 +700,8 @@ type WriteCommandParameters = { [WRITE_COMMANDS.UPDATE_QUICKBOOKS_ONLINE_COLLECTION_ACCOUNT_ID]: Parameters.UpdateQuickbooksOnlineGenericTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_EXPORT_DATE]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_MARK_CHECKS_TO_BE_PRINTED]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; + [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_AUTO_CREATE_VENDOR]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; + [WRITE_COMMANDS.UPDATE_QUICKBOOKS_ONLINE_AUTO_SYNC]: Parameters.UpdateQuickbooksOnlineGenericTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_REIMBURSABLE_EXPENSES_ACCOUNT]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_REIMBURSABLE_EXPENSES_EXPORT_DESTINATION]: Parameters.UpdateQuickbooksDesktopExpensesExportDestinationTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_ENABLE_NEW_CATEGORIES]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index c32f63906443..f149d72bc34c 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -323,6 +323,8 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../../pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseEntitySelectPage').default, [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT]: () => require('../../../../pages/workspace/accounting/qbd/export/QuickbooksDesktopExportPage').default, + [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_ADVANCED]: () => + require('../../../../pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage').default, [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_SETUP_MODAL]: () => require('../../../../pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage').default, [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_SETUP_REQUIRED_DEVICE_MODAL]: () => require('../../../../pages/workspace/accounting/qbd/RequireQuickBooksDesktopPage').default, diff --git a/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts b/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts index 552310dceae4..380977e4e06f 100755 --- a/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts +++ b/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts @@ -45,6 +45,7 @@ const FULL_SCREEN_TO_RHP_MAPPING: Partial> = { SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_ADVANCED, SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_ACCOUNT_SELECTOR, SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_INVOICE_ACCOUNT_SELECTOR, + SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_ADVANCED, SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_DATE_SELECT, SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_PREFERRED_EXPORTER, SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES, diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 8f152e2d35de..28d5832e38ed 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -393,6 +393,9 @@ const config: LinkingOptions['config'] = { [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_INVOICE_ACCOUNT_SELECTOR]: { path: ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_INVOICE_ACCOUNT_SELECTOR.route, }, + [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_ADVANCED]: { + path: ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_DESKTOP_ADVANCED.route, + }, [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_DATE_SELECT]: {path: ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT_DATE_SELECT.route}, [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_PREFERRED_EXPORTER]: {path: ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_PREFERRED_EXPORTER.route}, [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT]: { diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index f1d5b38b6f44..90e2d0e0224b 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -436,6 +436,9 @@ type SettingsNavigatorParamList = { [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_EXPORT_PREFERRED_EXPORTER]: { policyID: string; }; + [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_ADVANCED]: { + policyID: string; + }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_DATE_SELECT]: { policyID: string; }; @@ -1401,6 +1404,9 @@ type FullScreenNavigatorParamList = { [SCREENS.WORKSPACE.ACCOUNTING.ROOT]: { policyID: string; }; + [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_ADVANCED]: { + policyID: string; + }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_ADVANCED]: { policyID: string; }; diff --git a/src/libs/actions/connections/QuickbooksDesktop.ts b/src/libs/actions/connections/QuickbooksDesktop.ts index 80f50dce7b8a..d20af8426395 100644 --- a/src/libs/actions/connections/QuickbooksDesktop.ts +++ b/src/libs/actions/connections/QuickbooksDesktop.ts @@ -341,6 +341,21 @@ function updateQuickbooksDesktopExpensesExportDestination( + policyID: string, + settingValue: TSettingValue, +) { + const onyxData = buildOnyxDataForQuickbooksConfiguration(policyID, CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR, settingValue, !settingValue); + + const parameters: UpdateQuickbooksDesktopGenericTypeParams = { + policyID, + settingValue: JSON.stringify(settingValue), + idempotencyKey: String(CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR), + }; + + API.write(WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_AUTO_CREATE_VENDOR, parameters, onyxData); +} + function updateQuickbooksDesktopMarkChecksToBePrinted( policyID: string, settingValue: TSettingValue, @@ -425,9 +440,22 @@ function updateQuickbooksDesktopExportDate(policyID: string, settingValue: TSettingValue) { + const onyxData = buildOnyxDataForQuickbooksConfiguration(policyID, CONST.QUICKBOOKS_DESKTOP_CONFIG.AUTO_SYNC, {enabled: settingValue}, {enabled: !settingValue}); + + const parameters: UpdateQuickbooksDesktopGenericTypeParams = { + policyID, + settingValue: JSON.stringify(settingValue), + idempotencyKey: String(CONST.QUICKBOOKS_DESKTOP_CONFIG.AUTO_SYNC), + }; + API.write(WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_AUTO_SYNC, parameters, onyxData); +} + export { + updateQuickbooksDesktopAutoSync, updateQuickbooksDesktopPreferredExporter, updateQuickbooksDesktopMarkChecksToBePrinted, + updateQuickbooksDesktopShouldAutoCreateVendor, updateQuickbooksDesktopExpensesExportDestination, updateQuickbooksDesktopReimbursableExpensesAccount, getQuickbooksDesktopCodatSetupLink, diff --git a/src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx b/src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx new file mode 100644 index 000000000000..cd54127d3a44 --- /dev/null +++ b/src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx @@ -0,0 +1,82 @@ +import React from 'react'; +import ConnectionLayout from '@components/ConnectionLayout'; +import useLocalize from '@hooks/useLocalize'; +import usePermissions from '@hooks/usePermissions'; +import useThemeStyles from '@hooks/useThemeStyles'; +import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; +import * as ErrorUtils from '@libs/ErrorUtils'; +import Navigation from '@libs/Navigation/Navigation'; +import {settingsPendingAction} from '@libs/PolicyUtils'; +import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections'; +import withPolicyConnections from '@pages/workspace/withPolicyConnections'; +import ToggleSettingOptionRow from '@pages/workspace/workflows/ToggleSettingsOptionRow'; +import {clearQBDErrorField} from '@userActions/Policy/Policy'; +import CONST from '@src/CONST'; +import ROUTES from '@src/ROUTES'; + +function QuickbooksDesktopAdvancedPage({policy}: WithPolicyConnectionsProps) { + const styles = useThemeStyles(); + const {translate} = useLocalize(); + const policyID = policy?.id ?? '-1'; + const qbdConfig = policy?.connections?.quickbooksDesktop?.config; + const {canUseNewDotQBD} = usePermissions(); + + const qbdToggleSettingItems = [ + { + title: translate('workspace.accounting.autoSync'), + subtitle: translate('workspace.qbd.advancedConfig.autoSyncDescription'), + switchAccessibilityLabel: translate('workspace.qbd.advancedConfig.autoSyncDescription'), + isActive: !!qbdConfig?.autoSync?.enabled, + onToggle: (isOn: boolean) => QuickbooksDesktop.updateQuickbooksDesktopAutoSync(policyID, isOn), + subscribedSetting: CONST.QUICKBOOKS_DESKTOP_CONFIG.AUTO_SYNC, + errors: ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.AUTO_SYNC), + pendingAction: settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.AUTO_SYNC], qbdConfig?.pendingFields), + }, + { + title: translate('workspace.qbd.advancedConfig.createEntities'), + subtitle: translate('workspace.qbd.advancedConfig.createEntitiesDescription'), + switchAccessibilityLabel: translate('workspace.qbd.advancedConfig.createEntitiesDescription'), + isActive: !!qbdConfig?.shouldAutoCreateVendor, + onToggle: (isOn: boolean) => { + QuickbooksDesktop.updateQuickbooksDesktopShouldAutoCreateVendor(policyID, isOn); + }, + subscribedSetting: CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR, + errors: ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR), + pendingAction: settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR], qbdConfig?.pendingFields), + }, + ]; + + return ( + Navigation.goBack(ROUTES.POLICY_ACCOUNTING.getRoute(policyID))} + > + {qbdToggleSettingItems.map((item) => ( + clearQBDErrorField(policyID, item.subscribedSetting)} + /> + ))} + + ); +} + +QuickbooksDesktopAdvancedPage.displayName = 'QuickbooksDesktopAdvancedPage'; + +export default withPolicyConnections(QuickbooksDesktopAdvancedPage); diff --git a/src/pages/workspace/accounting/utils.tsx b/src/pages/workspace/accounting/utils.tsx index 7e694babdd5c..cc1dfa1fcd9f 100644 --- a/src/pages/workspace/accounting/utils.tsx +++ b/src/pages/workspace/accounting/utils.tsx @@ -259,7 +259,7 @@ function getAccountingIntegrationData( onImportPagePress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_IMPORT.getRoute(policyID)), onExportPagePress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT.getRoute(policyID)), onCardReconciliationPagePress: () => {}, - onAdvancedPagePress: () => {}, + onAdvancedPagePress: () => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_DESKTOP_ADVANCED.getRoute(policyID)), // TODO: [QBD] Make sure all values are passed to subscribedSettings subscribedImportSettings: [CONST.QUICKBOOKS_DESKTOP_CONFIG.ENABLE_NEW_CATEGORIES, CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CLASSES], subscribedExportSettings: [ @@ -269,7 +269,7 @@ function getAccountingIntegrationData( CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE_ACCOUNT, CONST.QUICKBOOKS_DESKTOP_CONFIG.MARK_CHECKS_TO_BE_PRINTED, ], - subscribedAdvancedSettings: [], + subscribedAdvancedSettings: [CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR, CONST.QUICKBOOKS_DESKTOP_CONFIG.AUTO_SYNC], }; default: return undefined; diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 5ecf9ad8d84f..a1408a6340c5 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -1247,13 +1247,16 @@ type QBDConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<{ /** Configuration of automatic synchronization from QuickBooks Desktop to the app */ autoSync: { - /** TODO: Will be handled in another issue */ + /** Job ID of the synchronization */ jobID: string; - /** Whether changes made in QuickBooks Online should be reflected into the app automatically */ + /** Whether changes made in QuickBooks Desktop should be reflected into the app automatically */ enabled: boolean; }; + /** Whether AutoSync is enabled */ + isAutoSyncEnabled: boolean; + /** Whether a check to be printed */ markChecksToBePrinted: boolean; From e9d31f5440bb6848c131b9f215f8a9f27276eb4f Mon Sep 17 00:00:00 2001 From: Yauheni Date: Tue, 15 Oct 2024 23:05:46 +0200 Subject: [PATCH 2/4] refactor code --- src/languages/en.ts | 1 - src/languages/es.ts | 2 -- src/libs/Navigation/types.ts | 3 --- src/types/onyx/Policy.ts | 2 +- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 054c5d64e680..223fcada3814 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2463,7 +2463,6 @@ const translations = { 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.", - reimbursedReportsDescription: 'Any time a report is paid using Expensify ACH, the corresponding bill payment will be created in the Quickbooks Online account below.', }, }, qbo: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 51a6e11f9e00..90389acf9da9 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2486,8 +2486,6 @@ const translations = { 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.', - reimbursedReportsDescription: - 'Cada vez que se pague un informe utilizando Expensify ACH, se creará el correspondiente pago de la factura en la cuenta de Quickbooks Online indicadas a continuación.', }, }, qbo: { diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 90e2d0e0224b..0bb6964395db 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -1404,9 +1404,6 @@ type FullScreenNavigatorParamList = { [SCREENS.WORKSPACE.ACCOUNTING.ROOT]: { policyID: string; }; - [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_ADVANCED]: { - policyID: string; - }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_ADVANCED]: { policyID: string; }; diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index a1408a6340c5..5f9ecd659a69 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -1247,7 +1247,7 @@ type QBDConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<{ /** Configuration of automatic synchronization from QuickBooks Desktop to the app */ autoSync: { - /** Job ID of the synchronization */ + /** Job ID of the synchronization */ jobID: string; /** Whether changes made in QuickBooks Desktop should be reflected into the app automatically */ From c904c6f9b567b29de824f9341bdd4d6da1aeaf68 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Tue, 15 Oct 2024 23:22:28 +0200 Subject: [PATCH 3/4] fix ts issue --- src/libs/API/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index a19d63816113..53d9ed329969 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -701,7 +701,7 @@ type WriteCommandParameters = { [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_EXPORT_DATE]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_MARK_CHECKS_TO_BE_PRINTED]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_AUTO_CREATE_VENDOR]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; - [WRITE_COMMANDS.UPDATE_QUICKBOOKS_ONLINE_AUTO_SYNC]: Parameters.UpdateQuickbooksOnlineGenericTypeParams; + [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_AUTO_SYNC]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_REIMBURSABLE_EXPENSES_ACCOUNT]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_REIMBURSABLE_EXPENSES_EXPORT_DESTINATION]: Parameters.UpdateQuickbooksDesktopExpensesExportDestinationTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_ENABLE_NEW_CATEGORIES]: Parameters.UpdateQuickbooksDesktopGenericTypeParams; From 31b5d9fefa6bd251acabf9b821ed520197e44537 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Wed, 16 Oct 2024 12:18:31 +0200 Subject: [PATCH 4/4] remove isAutoSyncEnabled --- src/types/onyx/Policy.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 5f9ecd659a69..2bd94bce6da4 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -1254,9 +1254,6 @@ type QBDConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<{ enabled: boolean; }; - /** Whether AutoSync is enabled */ - isAutoSyncEnabled: boolean; - /** Whether a check to be printed */ markChecksToBePrinted: boolean;