From db992fde5bf2abb1f1bd2913d47bcca477025e28 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Thu, 23 May 2024 19:02:07 +0100 Subject: [PATCH 1/3] Add explicit description for each export entity --- src/languages/en.ts | 7 +++- src/languages/es.ts | 6 ++++ ...oksOutOfPocketExpenseAccountSelectPage.tsx | 32 ++++++++++++++++--- ...oksOutOfPocketExpenseConfigurationPage.tsx | 31 ++++++++++++++---- 4 files changed, 63 insertions(+), 13 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index f8d122f3b69a..4f6400bac9cd 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1977,11 +1977,16 @@ export default { exportPreferredExporterNote: 'This can be any workspace admin, but must be a Domain Admin if you set different export accounts for individual company cards in Domain Settings.', exportPreferredExporterSubNote: 'Once set, the preferred exporter will see reports for export in their account.', exportOutOfPocketExpensesDescription: 'Set how out-of-pocket expenses export to QuickBooks Online.', + exportCheckDescription: "We'll create a single itemized check for each Expensify report. You can write the check from your bank account of choice (below).", + exportJournalEntryDescription: "We'll create a single itemized journal entry for each Expensify report. You can post the offset entry to your account of choice (below).", exportVendorBillDescription: "We'll create a single itemized vendor bill for each Expensify report. If the period of the bill is closed, we'll post to the 1st of the next open period. You can add the vendor bill to your A/P account of choice (below).", - accountsPayable: 'Accounts payable', account: 'Account', + accountDescription: 'This is your chosen account to post the journal entry offset for each report.', + accountsPayable: 'Accounts payable', accountsPayableDescription: 'This is your chosen A/P account, against which vendor bills for each report are created.', + bankAccount: 'Bank account', + bankAccountDescription: 'This is your chosen bank account to write checks from.', optionBelow: 'Choose an option below:', companyCardsLocationEnabledDescription: 'Note: QuickBooks Online does not support a field for Locations as Tags on Vendor Bills exports. As you import Locations from, this this export option is unavailable.', diff --git a/src/languages/es.ts b/src/languages/es.ts index 536a6182f393..4267b4e13d8e 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1996,11 +1996,14 @@ export default { exportInvoicesDescription: 'Las facturas se exportarán a esta cuenta en QuickBooks Online.', exportCompanyCardsDescription: 'Establece cómo se exportan las compras con tarjeta de empresa a QuickBooks Online.', account: 'Cuenta', + accountDescription: 'Esta es la cuenta elegida para contabilizar la compensación de la entrada de diario de cada informe.', vendor: 'Proveedor', defaultVendor: 'Proveedor predeterminado', defaultVendorDescription: 'Establece un proveedor predeterminado que se aplicará a todas las transacciones con tarjeta de crédito al momento de exportarlas.', accountsPayable: 'Cuentas por pagar', accountsPayableDescription: 'Esta es la cuenta de cuentas por pagar elegida, contra la cual se crean las facturas de proveedores para cada informe.', + bankAccount: 'Cuenta bancaria', + bankAccountDescription: 'Esta es la cuenta bancaria elegida para emitir cheques.', optionBelow: 'Elija una opción a continuación:', companyCardsLocationEnabledDescription: 'Nota: QuickBooks Online no admite un campo para Ubicaciones como etiquetas en las exportaciones de facturas de proveedores. A medida que importa ubicaciones, esta opción de exportación no está disponible.', @@ -2008,6 +2011,9 @@ export default { 'Puede ser cualquier administrador del espacio de trabajo, pero debe ser un administrador de dominio si configura diferentes cuentas de exportación para tarjetas de empresa individuales en la configuración del dominio.', exportPreferredExporterSubNote: 'Una vez configurado, el exportador preferido verá los informes para exportar en tu cuenta.', exportOutOfPocketExpensesDescription: 'Establezca cómo se exportan los gastos de bolsillo a QuickBooks Online.', + exportCheckDescription: 'Crearemos un único cheque desglosado para cada informe de Expensify. Puedes emitir el cheque desde la cuenta bancaria que elijas (más abajo).', + exportJournalEntryDescription: + 'Crearemos una única entrada de diario desglosada para cada informe de Expensify. Puedes enviar la compensación de la entrada de diario a la cuenta que elijas (más abajo).', exportVendorBillDescription: 'Crearemos una única factura de proveedor detallada para cada informe de Expensify. Si el período de la factura está cerrado, lo publicaremos en el día 1 del siguiente período abierto. Puede agregar la factura del proveedor a la cuenta A/P de tu elección (a continuación).', outOfPocketTaxEnabledDescription: diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx index ebac7546341a..29b378c6bfc4 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx @@ -27,18 +27,40 @@ function QuickbooksOutOfPocketExpenseAccountSelectPage({policy}: WithPolicyConne const {reimbursableExpensesExportDestination, reimbursableExpensesAccount} = policy?.connections?.quickbooksOnline?.config ?? {}; + const [title, description] = useMemo(() => { + let titleText: string | undefined; + let descriptionText: string | undefined; + switch (reimbursableExpensesExportDestination) { + case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.CHECK: + titleText = translate('workspace.qbo.bankAccount'); + descriptionText = translate('workspace.qbo.bankAccountDescription'); + break; + case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY: + titleText = translate('workspace.qbo.account'); + descriptionText = translate('workspace.qbo.accountDescription'); + break; + case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.VENDOR_BILL: + titleText = translate('workspace.qbo.accountsPayable'); + descriptionText = translate('workspace.qbo.accountsPayableDescription'); + break; + default: + } + + return [titleText, descriptionText]; + }, [translate, reimbursableExpensesExportDestination]); + const data: CardListItem[] = useMemo(() => { let accounts: Account[]; switch (reimbursableExpensesExportDestination) { case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.CHECK: accounts = bankAccounts ?? []; break; - case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.VENDOR_BILL: - accounts = accountPayable ?? []; - break; case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY: accounts = journalEntryAccounts ?? []; break; + case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.VENDOR_BILL: + accounts = accountPayable ?? []; + break; default: accounts = []; } @@ -70,9 +92,9 @@ function QuickbooksOutOfPocketExpenseAccountSelectPage({policy}: WithPolicyConne featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} > - + {translate('workspace.qbo.accountsPayableDescription')}} + headerContent={{description}} sections={[{data}]} ListItem={RadioListItem} onSelectRow={selectExportAccount} diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx index 861f7d416902..6aca5f4af8a6 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, {useMemo} from 'react'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; @@ -24,6 +24,27 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne const shouldShowTaxError = isTaxesEnabled && reimbursableExpensesExportDestination === CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY; const shouldShowLocationError = isLocationEnabled && reimbursableExpensesExportDestination !== CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY; const hasErrors = Boolean(errorFields?.reimbursableExpensesExportDestination) || shouldShowTaxError || shouldShowLocationError; + const [exportHintText, accountDescription] = useMemo(() => { + let hintText: string | undefined; + let description: string | undefined; + switch (reimbursableExpensesExportDestination) { + case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.CHECK: + hintText = isLocationEnabled ? undefined : translate('workspace.qbo.exportCheckDescription'); + description = translate('workspace.qbo.bankAccount'); + break; + case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY: + hintText = isTaxesEnabled ? undefined : translate('workspace.qbo.exportJournalEntryDescription'); + description = translate('workspace.qbo.account'); + break; + case CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.VENDOR_BILL: + hintText = isLocationEnabled ? undefined : translate('workspace.qbo.exportVendorBillDescription'); + description = translate('workspace.qbo.accountsPayable'); + break; + default: + } + + return [hintText, description]; + }, [translate, reimbursableExpensesExportDestination, isLocationEnabled, isTaxesEnabled]); return ( Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_EXPORT_OUT_OF_POCKET_EXPENSES_SELECT.getRoute(policyID))} brickRoadIndicator={hasErrors ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined} shouldShowRightIcon - hintText={ - reimbursableExpensesExportDestination === CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.VENDOR_BILL && !isLocationEnabled - ? translate('workspace.qbo.exportVendorBillDescription') - : undefined - } + hintText={exportHintText} /> {isLocationEnabled && {translate('workspace.qbo.outOfPocketLocationEnabledDescription')}} @@ -58,7 +75,7 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT.getRoute(policyID))} brickRoadIndicator={errorFields?.exportAccount ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined} shouldShowRightIcon From f3686bffe3f640a8fbf7b6d4be2698d48941eccb Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Fri, 24 May 2024 06:50:25 +0100 Subject: [PATCH 2/3] Update QuickbooksOutOfPocketExpenseAccountSelectPage.tsx --- .../qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx index 29b378c6bfc4..0d1c3c7b9ca9 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx @@ -44,6 +44,7 @@ function QuickbooksOutOfPocketExpenseAccountSelectPage({policy}: WithPolicyConne descriptionText = translate('workspace.qbo.accountsPayableDescription'); break; default: + break; } return [titleText, descriptionText]; From 736781544409ce3a8f575ec333bd10c6d934f407 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Fri, 24 May 2024 06:50:47 +0100 Subject: [PATCH 3/3] Update QuickbooksOutOfPocketExpenseConfigurationPage.tsx --- .../qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx index 6aca5f4af8a6..aa521ddc7465 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -41,6 +41,7 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne description = translate('workspace.qbo.accountsPayable'); break; default: + break; } return [hintText, description];