diff --git a/src/CONST.ts b/src/CONST.ts index 95da3eee884a..afe9bdd1114e 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1270,10 +1270,10 @@ const CONST = { IMPORT_TAX_RATES: 'importTaxRates', }, - QUICKBOOKS_EXPORT_ENTITY: { - VENDOR_BILL: 'vendorBill', + QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE: { + VENDOR_BILL: 'bill', CHECK: 'check', - JOURNAL_ENTRY: 'journalEntry', + JOURNAL_ENTRY: 'journal_entry', }, ACCOUNT_ID: { @@ -4662,10 +4662,10 @@ const CONST = { REPORT_SUBMITTED: 'REPORT_SUBMITTED', }, - QUICKBOOKS_EXPORT_COMPANY_CARD: { - CREDIT_CARD: 'creditCard', - DEBIT_CARD: 'debitCard', - VENDOR_BILL: 'vendorBill', + QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE: { + CREDIT_CARD: 'credit_card', + DEBIT_CARD: 'debit_card', + VENDOR_BILL: 'bill', }, SESSION_STORAGE_KEYS: { diff --git a/src/languages/en.ts b/src/languages/en.ts index 4365ce6a6a88..48df154a3a5c 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1932,35 +1932,18 @@ export default { archive: 'Accounts receivable archive', // This is an account name that will come directly from QBO, so I don't know why we need a translation for it. It should take whatever the name of the account is in QBO. Leaving this note for CS. exportInvoicesDescription: 'Invoices will be exported to this account in QuickBooks Online.', exportCompanyCardsDescription: 'Set how company card purchases export to QuickBooks Online.', - creditCard: 'Credit card', - debitCard: 'Debit card', - vendorBill: 'Vendor bill', vendor: 'Vendor', defaultVendor: 'Default vendor', defaultVendorDescription: 'Set a default vendor that will apply to all credit card transactions upon export.', - debitCardDescription: - "We'll automatically match the merchant name on the debit card transaction to any corresponding vendors in QuickBooks. If no vendors exist, we'll create a 'Debit Card Misc.' vendor for association.", - creditCardDescription: - "We'll automatically match the merchant name on the credit card transaction to any corresponding vendors in QuickBooks. If no vendors exist, we'll create a 'Credit Card Misc.' vendor for association.", - vendorBillDescription: - "We'll create a single itemized vendor bill for each Expensify report, carrying the date of the last expense on the report. If this period 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).", - debitCardAccountDescription: 'Debit card transactions will export to the bank account below.”', - creditCardAccountDescription: 'Credit card transactions will export to the bank account below.', - vendorBillAccountDescription: 'Select the vendor applied to all credit card transactions.', 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.', 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).", - check: 'Check', accountsPayable: 'Accounts payable', account: 'Account', accountsPayableDescription: 'This is your chosen A/P account, against which vendor bills for each report are created.', - journalEntry: 'Journal entry', optionBelow: 'Choose an option below:', - vendorBillError: 'Vendor Bills are not available when locations are enabled. Please select a different export option.', - checkError: 'Check is not available when locations are enabled. Please select a different export option.', - journalEntryError: 'Journal entry is not available when taxes enabled. please select a different export option.', 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.', outOfPocketTaxEnabledDescription: @@ -1987,6 +1970,29 @@ export default { invoiceAccountSelectDescription: 'If you are exporting invoices from Expensify to Quickbooks Online, this is the account the invoice will appear against once marked as paid.', }, + accounts: { + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Debit card', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Credit card', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'Vendor bill', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Journal entry', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK]: 'Check', + + [`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD}Description`]: + "We'll automatically match the merchant name on the debit card transaction to any corresponding vendors in QuickBooks. If no vendors exist, we'll create a 'Debit Card Misc.' vendor for association.", + [`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD}Description`]: + "We'll automatically match the merchant name on the credit card transaction to any corresponding vendors in QuickBooks. If no vendors exist, we'll create a 'Credit Card Misc.' vendor for association.", + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}Description`]: + "We'll create a single itemized vendor bill for each Expensify report, carrying the date of the last expense on the report. If this period 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).", + + [`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD}AccountDescription`]: 'Debit card transactions will export to the bank account below.”', + [`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD}AccountDescription`]: 'Credit card transactions will export to the bank account below.', + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}AccountDescription`]: 'Select the vendor applied to all credit card transactions.', + + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}Error`]: + 'Vendor Bills are not available when locations are enabled. Please select a different export option.', + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK}Error`]: 'Check is not available when locations are enabled. Please select a different export option.', + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY}Error`]: 'Journal entry is not available when taxes enabled. please select a different export option.', + }, }, xero: { organization: 'Xero organization', diff --git a/src/languages/es.ts b/src/languages/es.ts index 3301734636ef..544a1d562ced 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1956,35 +1956,18 @@ export default { archive: 'Archivo de cuentas por cobrar', // This is an account name that will come directly from QBO, so I don't know why we need a translation for it. It should take whatever the name of the account is in QBO. Leaving this note for CS. 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.', - debitCard: 'Tarjeta de débito', - check: 'Cheque', - optionBelow: 'Elija una opción a continuación:', - creditCard: 'Tarjeta de crédito', - vendorBill: 'Factura del proveedor', account: 'Cuenta', 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.', - debitCardAccountDescription: 'Las transacciones con tarjeta de débito se exportarán a la cuenta bancaria que aparece a continuación.”', - creditCardAccountDescription: 'Las transacciones con tarjeta de crédito se exportarán a la cuenta bancaria que aparece a continuación.', - vendorBillAccountDescription: 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.', - debitCardDescription: - "Automáticamente relacionaremos el nombre del comerciante de la transacción con tarjeta de débito con cualquier proveedor correspondiente en QuickBooks. Si no existen proveedores, crearemos un proveedor asociado 'Debit Card Misc.'.", - creditCardDescription: - "Automáticamente relacionaremos el nombre del comerciante de la transacción con tarjeta de crédito con cualquier proveedor correspondiente en QuickBooks. Si no existen proveedores, crearemos un proveedor asociado 'Credit Card Misc.'.", - vendorBillDescription: - 'Crearemos una única factura detallada con los proveedores por cada informe de Expensify, con fecha del último gasto en el informe. Si este período está cerrado, la publicaremos con fecha del día 1 del próximo período abierto. Puede añadir la factura del proveedor a la cuenta A/P de su elección (a continuación).', 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.', + 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.', exportPreferredExporterNote: '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 su cuenta.', - journalEntry: 'Asiento contable', - vendorBillError: 'Las facturas de proveedores no están disponibles cuando las ubicaciones están habilitadas. Seleccione una opción de exportación diferente.', - checkError: 'La verificación no está disponible cuando las ubicaciones están habilitadas. Seleccione una opción de exportación diferente.', - journalEntryError: 'El asiento de diario no está disponible cuando los impuestos están habilitados. seleccione una opción de exportación diferente.', exportOutOfPocketExpensesDescription: 'Establezca cómo se exportan los gastos de bolsillo a QuickBooks Online.', 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 su elección (a continuación).', @@ -2014,6 +1997,34 @@ export default { invoiceAccountSelectDescription: 'Si está exportando facturas de Expensify a Quickbooks Online, ésta es la cuenta en la que aparecerá la factura una vez marcada como pagada.', }, + accounts: { + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Tarjeta de débito', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Tarjeta de crédito', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'Factura del proveedor', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Asiento contable', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK]: 'Cheque', + + [`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD}Description`]: + "Automáticamente relacionaremos el nombre del comerciante de la transacción con tarjeta de débito con cualquier proveedor correspondiente en QuickBooks. Si no existen proveedores, crearemos un proveedor asociado 'Debit Card Misc.'.", + [`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD}Description`]: + "Automáticamente relacionaremos el nombre del comerciante de la transacción con tarjeta de crédito con cualquier proveedor correspondiente en QuickBooks. Si no existen proveedores, crearemos un proveedor asociado 'Credit Card Misc.'.", + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}Description`]: + 'Crearemos una única factura detallada con los proveedores por cada informe de Expensify, con fecha del último gasto en el informe. Si este período está cerrado, la publicaremos con fecha del día 1 del próximo período abierto. Puede añadir la factura del proveedor a la cuenta A/P de su elección (a continuación).', + + [`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD}AccountDescription`]: + 'Las transacciones con tarjeta de débito se exportarán a la cuenta bancaria que aparece a continuación.”', + [`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD}AccountDescription`]: + 'Las transacciones con tarjeta de crédito se exportarán a la cuenta bancaria que aparece a continuación.', + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}AccountDescription`]: + 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.', + + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}Error`]: + 'Las facturas de proveedores no están disponibles cuando las ubicaciones están habilitadas. Seleccione una opción de exportación diferente.', + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK}Error`]: + 'La verificación no está disponible cuando las ubicaciones están habilitadas. Seleccione una opción de exportación diferente.', + [`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY}Error`]: + 'El asiento de diario no está disponible cuando los impuestos están habilitados. seleccione una opción de exportación diferente.', + }, }, xero: { organization: 'Organización Xero', diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx index 498236d0912d..abc0b0bd2ba5 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx @@ -21,7 +21,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections const styles = useThemeStyles(); const policyID = policy?.id ?? ''; const {exportCompanyCardAccount, exportAccountPayable, autoCreateVendor, errorFields, pendingFields, exportCompanyCard} = policy?.connections?.quickbooksOnline?.config ?? {}; - const isVendorSelected = exportCompanyCard === CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.VENDOR_BILL; + const isVendorSelected = exportCompanyCard === CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL; return ( {translate('workspace.qbo.exportCompanyCardsDescription')} Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_SELECT.getRoute(policyID))} @@ -46,7 +46,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections /> {!!exportCompanyCard && ( - {translate(`workspace.qbo.${exportCompanyCard}Description`)} + {translate(`workspace.qbo.accounts.${exportCompanyCard}Description`)} )} {isVendorSelected && ( <> diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx index e67922e6a773..9a18a188667b 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx @@ -19,10 +19,10 @@ import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; type CardListItem = ListItem & { - value: ValueOf; + value: ValueOf; }; type CardsSection = SectionListData>; -type Card = {name: string; id: ValueOf}; +type Card = {name: string; id: ValueOf}; function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); @@ -34,16 +34,16 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC const defaultCards = useMemo( () => [ { - name: translate(`workspace.qbo.creditCard`), - id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.CREDIT_CARD, + name: translate(`workspace.qbo.accounts.credit_card`), + id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD, }, { - name: translate(`workspace.qbo.debitCard`), - id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.DEBIT_CARD, + name: translate(`workspace.qbo.accounts.debit_card`), + id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD, }, { - name: translate(`workspace.qbo.vendorBill`), - id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.VENDOR_BILL, + name: translate(`workspace.qbo.accounts.bill`), + id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL, }, ], [translate], diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx index 52865f9ae55c..e6f408f0b54a 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx @@ -31,13 +31,13 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne const data: CardListItem[] = useMemo(() => { let accounts: Account[]; switch (exportCompanyCard) { - case CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.CREDIT_CARD: + case CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD: accounts = creditCards ?? []; break; - case CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.DEBIT_CARD: + case CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD: accounts = bankAccounts ?? []; break; - case CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL: accounts = vendors ?? []; break; default: @@ -70,10 +70,10 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne > {translate(`workspace.qbo.${exportCompanyCard}AccountDescription`)} : null} + headerContent={exportCompanyCard ? {translate(`workspace.qbo.accounts.${exportCompanyCard}AccountDescription`)} : null} sections={[{data}]} ListItem={RadioListItem} onSelectRow={selectExportAccount} diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx index a7e3916441f3..3d58b5807b16 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx @@ -47,7 +47,7 @@ function QuickbooksExportConfigurationPage({policy}: WithPolicyConnectionsProps) description: translate('workspace.qbo.exportExpenses'), onPress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_EXPORT_OUT_OF_POCKET_EXPENSES.getRoute(policyID)), brickRoadIndicator: Boolean(errorFields?.exportEntity) || Boolean(errorFields?.exportAccount) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, - title: exportEntity ? translate(`workspace.qbo.${exportEntity}`) : undefined, + title: exportEntity ? translate(`workspace.qbo.accounts.${exportEntity}`) : undefined, // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing pendingAction: pendingFields?.exportEntity || pendingFields?.exportAccount, }, @@ -63,13 +63,13 @@ function QuickbooksExportConfigurationPage({policy}: WithPolicyConnectionsProps) description: translate('workspace.qbo.exportCompany'), onPress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT.getRoute(policyID)), brickRoadIndicator: errorFields?.exportCompanyCard ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, - title: exportCompanyCard ? translate(`workspace.qbo.${exportCompanyCard}`) : undefined, + title: exportCompanyCard ? translate(`workspace.qbo.accounts.${exportCompanyCard}`) : undefined, pendingAction: pendingFields?.exportCompanyCard, error: errorFields?.exportCompanyCard ? translate('common.genericErrorMessage') : undefined, }, { description: translate('workspace.qbo.exportExpensifyCard'), - title: translate('workspace.qbo.creditCard'), + title: translate('workspace.qbo.accounts.credit_card'), shouldShowRightIcon: false, interactive: false, }, diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx index 729fd6ade173..de897460fbf6 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx @@ -30,13 +30,13 @@ function QuickbooksOutOfPocketExpenseAccountSelectPage({policy}: WithPolicyConne const data: CardListItem[] = useMemo(() => { let accounts: Account[]; switch (exportEntity) { - case CONST.QUICKBOOKS_EXPORT_ENTITY.CHECK: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK: accounts = bankAccounts ?? []; break; - case CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL: accounts = accountsPayable ?? []; break; - case CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY: accounts = journalEntryAccounts ?? []; break; default: diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx index 5ed2cf9d8978..c5754f95d423 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -21,8 +21,8 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne const {syncLocations, exportAccount, exportEntity, errorFields, syncTax, pendingFields} = policy?.connections?.quickbooksOnline?.config ?? {}; const isLocationEnabled = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); const isTaxesEnabled = Boolean(syncTax); - const shouldShowTaxError = isTaxesEnabled && exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY; - const shouldShowLocationError = isLocationEnabled && exportEntity !== CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY; + const shouldShowTaxError = isTaxesEnabled && exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY; + const shouldShowLocationError = isLocationEnabled && exportEntity !== CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY; const hasErrors = Boolean(errorFields?.exportEntity) || shouldShowTaxError || shouldShowLocationError; return ( @@ -40,15 +40,15 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne {!isLocationEnabled && {translate('workspace.qbo.exportOutOfPocketExpensesDescription')}} 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 /> - {exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL && !isLocationEnabled && ( + {exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL && !isLocationEnabled && ( {translate('workspace.qbo.exportVendorBillDescription')} )} {isLocationEnabled && {translate('workspace.qbo.outOfPocketLocationEnabledDescription')}} diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx index 3467943d3b07..cb4bcb33edb8 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx @@ -19,7 +19,7 @@ import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; type CardListItem = ListItem & { - value: ValueOf; + value: ValueOf; isShown: boolean; }; type CardsSection = SectionListData>; @@ -30,8 +30,8 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec const {exportEntity, syncTax, syncLocations} = policy?.connections?.quickbooksOnline?.config ?? {}; const isLocationsEnabled = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); const isTaxesEnabled = Boolean(syncTax); - const isTaxError = isTaxesEnabled && exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY; - const isLocationError = isLocationsEnabled && exportEntity !== CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY; + const isTaxError = isTaxesEnabled && exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY; + const isLocationError = isLocationsEnabled && exportEntity !== CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY; const policyID = policy?.id ?? ''; useEffect(() => { @@ -44,24 +44,24 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec const data: CardListItem[] = useMemo( () => [ { - value: CONST.QUICKBOOKS_EXPORT_ENTITY.CHECK, - text: translate(`workspace.qbo.check`), - keyForList: CONST.QUICKBOOKS_EXPORT_ENTITY.CHECK, - isSelected: exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.CHECK, + value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK, + text: translate(`workspace.qbo.accounts.check`), + keyForList: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK, + isSelected: exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK, isShown: !isLocationsEnabled, }, { - value: CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY, - text: translate(`workspace.qbo.journalEntry`), - keyForList: CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY, - isSelected: exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY, + value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY, + text: translate(`workspace.qbo.accounts.journal_entry`), + keyForList: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY, + isSelected: exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY, isShown: !isTaxesEnabled || isLocationsEnabled, }, { - value: CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL, - text: translate(`workspace.qbo.vendorBill`), - keyForList: CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL, - isSelected: exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL, + value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL, + text: translate(`workspace.qbo.accounts.bill`), + keyForList: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL, + isSelected: exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL, isShown: !isLocationsEnabled, }, ], diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 8073ac17464d..d64de6196985 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -190,8 +190,8 @@ type QBOConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<{ exportAccount: string; exportAccountPayable: string; accountPayable: string; - exportEntity?: ValueOf; - exportCompanyCard: ValueOf; + exportEntity?: ValueOf; + exportCompanyCard: ValueOf; errorFields?: OnyxCommon.ErrorFields; }>;