From d6739e03dc9a2e6cf66b8e69665870539f571f51 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sat, 27 Apr 2024 16:06:05 -0400 Subject: [PATCH 01/39] fix: const strings --- src/CONST.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 8e356be6df29..1fc63b97c234 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1262,9 +1262,11 @@ const CONST = { }, QUICKBOOKS_EXPORT_ENTITY: { - VENDOR_BILL: 'vendorBill', + VENDOR_BILL: 'bill', CHECK: 'check', - JOURNAL_ENTRY: 'journalEntry', + JOURNAL_ENTRY: 'journal_entry', + CREDIT_CARD: 'credit_card', + DEBIT_CARD: 'debit_card', }, ACCOUNT_ID: { @@ -4675,12 +4677,6 @@ const CONST = { SUBMITTED_DATA: 'submittedData', }, - QUICKBOOKS_EXPORT_COMPANY_CARD: { - CREDIT_CARD: 'creditCard', - DEBIT_CARD: 'debitCard', - VENDOR_BILL: 'vendorBill', - }, - SESSION_STORAGE_KEYS: { INITIAL_URL: 'INITIAL_URL', }, From 46c35314d061d257c95220932a7ba8f301a73605 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sat, 27 Apr 2024 16:08:49 -0400 Subject: [PATCH 02/39] Revert "fix: const strings" This reverts commit d6739e03dc9a2e6cf66b8e69665870539f571f51. --- src/CONST.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 1fc63b97c234..8e356be6df29 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1262,11 +1262,9 @@ const CONST = { }, QUICKBOOKS_EXPORT_ENTITY: { - VENDOR_BILL: 'bill', + VENDOR_BILL: 'vendorBill', CHECK: 'check', - JOURNAL_ENTRY: 'journal_entry', - CREDIT_CARD: 'credit_card', - DEBIT_CARD: 'debit_card', + JOURNAL_ENTRY: 'journalEntry', }, ACCOUNT_ID: { @@ -4677,6 +4675,12 @@ const CONST = { SUBMITTED_DATA: 'submittedData', }, + QUICKBOOKS_EXPORT_COMPANY_CARD: { + CREDIT_CARD: 'creditCard', + DEBIT_CARD: 'debitCard', + VENDOR_BILL: 'vendorBill', + }, + SESSION_STORAGE_KEYS: { INITIAL_URL: 'INITIAL_URL', }, From 7f47efe457d4c94534ed18ce4809c63e5ec2587f Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sat, 27 Apr 2024 16:10:16 -0400 Subject: [PATCH 03/39] fix: string values for the out of pocket expense account options --- src/CONST.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 8e356be6df29..bc8e8edeed8a 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1262,9 +1262,9 @@ const CONST = { }, QUICKBOOKS_EXPORT_ENTITY: { - VENDOR_BILL: 'vendorBill', + VENDOR_BILL: 'vendor_bill', CHECK: 'check', - JOURNAL_ENTRY: 'journalEntry', + JOURNAL_ENTRY: 'jouranl_entry', }, ACCOUNT_ID: { From 98e64615d6570b1f4d018ae5e5d26b529867ab2d Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sat, 27 Apr 2024 16:11:20 -0400 Subject: [PATCH 04/39] refactor: const object name --- src/CONST.ts | 2 +- ...oksCompanyCardExpenseAccountSelectPage.tsx | 2 +- ...oksOutOfPocketExpenseAccountSelectPage.tsx | 6 ++--- ...oksOutOfPocketExpenseConfigurationPage.tsx | 6 ++--- ...ooksOutOfPocketExpenseEntitySelectPage.tsx | 24 +++++++++---------- src/types/onyx/Policy.ts | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index bc8e8edeed8a..53e22607f519 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1261,7 +1261,7 @@ const CONST = { COLLECTION_ACCOUNT_ID: 'collectionAccountID', }, - QUICKBOOKS_EXPORT_ENTITY: { + QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT: { VENDOR_BILL: 'vendor_bill', CHECK: 'check', JOURNAL_ENTRY: 'jouranl_entry', diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx index 626ba45dea2c..149245f3d2cd 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx @@ -38,7 +38,7 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne case CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.DEBIT_CARD: accounts = bankAccounts ?? []; break; - case CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL: accounts = vendors ?? []; break; default: diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx index a94c209a1bc0..ea57392a4f7b 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx @@ -31,13 +31,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.CHECK: accounts = bankAccounts ?? []; break; - case CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL: accounts = accountsPayable ?? []; break; - case CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.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 e2748e4055d6..bb5dc054abf9 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -22,8 +22,8 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne const {syncLocations, exportAccount, exportEntity, errorFields, syncTaxes, pendingFields} = policy?.connections?.quickbooksOnline?.config ?? {}; const isLocationEnabled = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); const isTaxesEnabled = Boolean(syncTaxes && syncTaxes !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); - 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.JOURNAL_ENTRY; + const shouldShowLocationError = isLocationEnabled && exportEntity !== CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.JOURNAL_ENTRY; const hasErrors = Boolean(errorFields?.exportEntity) || shouldShowTaxError || shouldShowLocationError; return ( @@ -49,7 +49,7 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne shouldShowRightIcon /> - {exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL && !isLocationEnabled && ( + {exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.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 5f2fe30aa5da..4b2a7ff04d56 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx @@ -20,7 +20,7 @@ import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; type CardListItem = ListItem & { - value: ValueOf; + value: ValueOf; isShown: boolean; }; type CardsSection = SectionListData>; @@ -31,8 +31,8 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec const {exportEntity, syncTaxes, syncLocations} = policy?.connections?.quickbooksOnline?.config ?? {}; const isLocationsEnabled = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); const isTaxesEnabled = Boolean(syncTaxes && syncTaxes !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); - 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.JOURNAL_ENTRY; + const isLocationError = isLocationsEnabled && exportEntity !== CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.JOURNAL_ENTRY; const policyID = policy?.id ?? ''; useEffect(() => { @@ -45,24 +45,24 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec const data: CardListItem[] = useMemo( () => [ { - value: CONST.QUICKBOOKS_EXPORT_ENTITY.CHECK, + value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.CHECK, text: translate(`workspace.qbo.check`), - keyForList: CONST.QUICKBOOKS_EXPORT_ENTITY.CHECK, - isSelected: exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.CHECK, + keyForList: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.CHECK, + isSelected: exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.CHECK, isShown: !isLocationsEnabled, }, { - value: CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY, + value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.JOURNAL_ENTRY, text: translate(`workspace.qbo.journalEntry`), - keyForList: CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY, - isSelected: exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.JOURNAL_ENTRY, + keyForList: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.JOURNAL_ENTRY, + isSelected: exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.JOURNAL_ENTRY, isShown: !isTaxesEnabled || isLocationsEnabled, }, { - value: CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL, + value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL, text: translate(`workspace.qbo.vendorBill`), - keyForList: CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL, - isSelected: exportEntity === CONST.QUICKBOOKS_EXPORT_ENTITY.VENDOR_BILL, + keyForList: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL, + isSelected: exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL, isShown: !isLocationsEnabled, }, ], diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index ef4960818946..c54e13ad0e4f 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -182,7 +182,7 @@ type QBOConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<{ exportAccount: string; exportAccountPayable: string; accountPayable: string; - exportEntity?: ValueOf; + exportEntity?: ValueOf; exportCompanyCard: ValueOf; errorFields?: OnyxCommon.ErrorFields; }>; From 9427bdb932453fafa4430a7e789285c70e03dd19 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sat, 27 Apr 2024 16:12:23 -0400 Subject: [PATCH 05/39] fix: string values for the company card export account options --- src/CONST.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 53e22607f519..691b670b5ac5 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -4676,9 +4676,9 @@ const CONST = { }, QUICKBOOKS_EXPORT_COMPANY_CARD: { - CREDIT_CARD: 'creditCard', - DEBIT_CARD: 'debitCard', - VENDOR_BILL: 'vendorBill', + CREDIT_CARD: 'credit_card', + DEBIT_CARD: 'debit_card', + VENDOR_BILL: 'vendor_bill', }, SESSION_STORAGE_KEYS: { From 495ecad8a897d741ed6a77001b276fe02cff412d Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sat, 27 Apr 2024 16:12:52 -0400 Subject: [PATCH 06/39] refactor: rename const object --- src/CONST.ts | 2 +- .../export/QuickbooksCompanyCardExpenseAccountPage.tsx | 2 +- ...ickbooksCompanyCardExpenseAccountSelectCardPage.tsx | 10 +++++----- .../QuickbooksCompanyCardExpenseAccountSelectPage.tsx | 6 +++--- src/types/onyx/Policy.ts | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 691b670b5ac5..f7592d75d9e1 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -4675,7 +4675,7 @@ const CONST = { SUBMITTED_DATA: 'submittedData', }, - QUICKBOOKS_EXPORT_COMPANY_CARD: { + QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE: { CREDIT_CARD: 'credit_card', DEBIT_CARD: 'debit_card', VENDOR_BILL: 'vendor_bill', diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx index ee1497ed3e60..6638d47a04a9 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx @@ -22,7 +22,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 ( ; + value: ValueOf; }; type CardsSection = SectionListData>; -type Card = {name: string; id: ValueOf}; +type Card = {name: string; id: ValueOf}; function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); @@ -36,15 +36,15 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC () => [ { name: translate(`workspace.qbo.creditCard`), - id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.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, + id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD, }, { name: translate(`workspace.qbo.vendorBill`), - id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.VENDOR_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 149245f3d2cd..c80ff6f7b860 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx @@ -32,10 +32,10 @@ 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_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL: @@ -71,7 +71,7 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne > {translate(`workspace.qbo.${exportCompanyCard}AccountDescription`)} : null} diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index c54e13ad0e4f..6f8b0d40a19c 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -183,7 +183,7 @@ type QBOConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<{ exportAccountPayable: string; accountPayable: string; exportEntity?: ValueOf; - exportCompanyCard: ValueOf; + exportCompanyCard: ValueOf; errorFields?: OnyxCommon.ErrorFields; }>; type Connection = { From 35ebb516b2c5f57550588bd96637bf8aa0b72b25 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sat, 27 Apr 2024 16:13:26 -0400 Subject: [PATCH 07/39] refactor: rename const object --- src/CONST.ts | 2 +- ...oksCompanyCardExpenseAccountSelectPage.tsx | 2 +- ...oksOutOfPocketExpenseAccountSelectPage.tsx | 6 ++--- ...oksOutOfPocketExpenseConfigurationPage.tsx | 6 ++--- ...ooksOutOfPocketExpenseEntitySelectPage.tsx | 24 +++++++++---------- src/types/onyx/Policy.ts | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index f7592d75d9e1..4dd75ad7f98f 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1261,7 +1261,7 @@ const CONST = { COLLECTION_ACCOUNT_ID: 'collectionAccountID', }, - QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT: { + QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE: { VENDOR_BILL: 'vendor_bill', CHECK: 'check', JOURNAL_ENTRY: 'jouranl_entry', diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx index c80ff6f7b860..d5b6577dab6c 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx @@ -38,7 +38,7 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne case CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD: accounts = bankAccounts ?? []; break; - case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL: accounts = vendors ?? []; break; default: diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx index ea57392a4f7b..77399cb30983 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx @@ -31,13 +31,13 @@ function QuickbooksOutOfPocketExpenseAccountSelectPage({policy}: WithPolicyConne const data: CardListItem[] = useMemo(() => { let accounts: Account[]; switch (exportEntity) { - case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.CHECK: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK: accounts = bankAccounts ?? []; break; - case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL: + case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL: accounts = accountsPayable ?? []; break; - case CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.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 bb5dc054abf9..04f1842bb584 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -22,8 +22,8 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne const {syncLocations, exportAccount, exportEntity, errorFields, syncTaxes, pendingFields} = policy?.connections?.quickbooksOnline?.config ?? {}; const isLocationEnabled = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); const isTaxesEnabled = Boolean(syncTaxes && syncTaxes !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); - const shouldShowTaxError = isTaxesEnabled && exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.JOURNAL_ENTRY; - const shouldShowLocationError = isLocationEnabled && exportEntity !== CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.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 ( @@ -49,7 +49,7 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne shouldShowRightIcon /> - {exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.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 4b2a7ff04d56..db43fb807451 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx @@ -20,7 +20,7 @@ import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; type CardListItem = ListItem & { - value: ValueOf; + value: ValueOf; isShown: boolean; }; type CardsSection = SectionListData>; @@ -31,8 +31,8 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec const {exportEntity, syncTaxes, syncLocations} = policy?.connections?.quickbooksOnline?.config ?? {}; const isLocationsEnabled = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); const isTaxesEnabled = Boolean(syncTaxes && syncTaxes !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); - const isTaxError = isTaxesEnabled && exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.JOURNAL_ENTRY; - const isLocationError = isLocationsEnabled && exportEntity !== CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.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(() => { @@ -45,24 +45,24 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec const data: CardListItem[] = useMemo( () => [ { - value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.CHECK, + value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK, text: translate(`workspace.qbo.check`), - keyForList: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.CHECK, - isSelected: exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.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_OUT_OF_POCKET_EXPENSE_ACCOUNT.JOURNAL_ENTRY, + value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY, text: translate(`workspace.qbo.journalEntry`), - keyForList: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.JOURNAL_ENTRY, - isSelected: exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.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_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL, + value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL, text: translate(`workspace.qbo.vendorBill`), - keyForList: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_BILL, - isSelected: exportEntity === CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT.VENDOR_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 6f8b0d40a19c..7c4190122faf 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -182,7 +182,7 @@ type QBOConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<{ exportAccount: string; exportAccountPayable: string; accountPayable: string; - exportEntity?: ValueOf; + exportEntity?: ValueOf; exportCompanyCard: ValueOf; errorFields?: OnyxCommon.ErrorFields; }>; From b8cdac676a60ee0dfcef508c4caed5dd6657f323 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sat, 27 Apr 2024 16:38:50 -0400 Subject: [PATCH 08/39] fix: map the account type string value to translation key --- .../QuickbooksCompanyCardExpenseAccountPage.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx index 6638d47a04a9..fbdb837ea388 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx @@ -17,6 +17,12 @@ import ToggleSettingOptionRow from '@pages/workspace/workflows/ToggleSettingsOpt import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; +const AccountTypeTranslationKeyMapping = { + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL]: 'vendorBill', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'creditCard', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'debitCard', +} as const; + function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); @@ -38,7 +44,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections {translate('workspace.qbo.exportCompanyCardsDescription')} Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_SELECT.getRoute(policyID))} @@ -47,7 +53,9 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections /> {!!exportCompanyCard && ( - {translate(`workspace.qbo.${exportCompanyCard}Description`)} + + {translate(`workspace.qbo.${AccountTypeTranslationKeyMapping[exportCompanyCard]}Description`)} + )} {isVendorSelected && ( <> From 897e4d86d5716e313e3c189a17a81bb962e09cc7 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 15:48:10 -0700 Subject: [PATCH 09/39] fix: translation key --- .../QuickbooksOutOfPocketExpenseConfigurationPage.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx index 3374399e5c9e..54420bafb892 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -14,6 +14,12 @@ import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; +const AccountTypeTranslationKeyMapping = { + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'vendorBill', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK]: 'check', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'journalEntry', +} as const; + function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); @@ -40,9 +46,9 @@ 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 From a6cd09d27411c8feefb0cf71e3ba9998d3920efe Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 15:53:13 -0700 Subject: [PATCH 10/39] fix: translation key --- .../QuickbooksCompanyCardExpenseAccountSelectPage.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx index 8cee387ce754..de6edd0f3274 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx @@ -19,6 +19,11 @@ import type {Account} from '@src/types/onyx/Policy'; type CardListItem = ListItem & { value: string; }; +const AccountTypeTranslationKeyMapping = { + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL]: 'vendorBill', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'creditCard', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'debitCard', +} as const; function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); @@ -73,7 +78,11 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne title={exportCompanyCard === CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL ? translate('workspace.qbo.vendor') : translate('workspace.qbo.account')} /> {translate(`workspace.qbo.${exportCompanyCard}AccountDescription`)} : null} + headerContent={ + exportCompanyCard ? ( + {translate(`workspace.qbo.${AccountTypeTranslationKeyMapping[exportCompanyCard]}AccountDescription`)} + ) : null + } sections={[{data}]} ListItem={RadioListItem} onSelectRow={selectExportAccount} From 30601126f92552e9b9fdec408d76b230ea3dc6dc Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:00:55 -0700 Subject: [PATCH 11/39] refactor: rename the translation keys for the type of accounts used to export expenses on company card --- src/languages/en.ts | 10 +++++++--- src/languages/es.ts | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 9062fb526ed1..94b50f44605d 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1920,9 +1920,13 @@ 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', + // The account type name uses underscores in the backend. + // eslint-disable-next-line @typescript-eslint/naming-convention + credit_card: 'Credit card', + // eslint-disable-next-line @typescript-eslint/naming-convention + debit_card: 'Debit card', + // eslint-disable-next-line @typescript-eslint/naming-convention + vendor_bill: 'Vendor bill', vendor: 'Vendor', defaultVendor: 'Default vendor', defaultVendorDescription: 'Set a default vendor that will apply to all credit card transactions upon export.', diff --git a/src/languages/es.ts b/src/languages/es.ts index a14c71e23c0c..08b903b3ea2a 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1944,11 +1944,11 @@ 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', + debit_card: 'Tarjeta de débito', check: 'Cheque', optionBelow: 'Elija una opción a continuación:', - creditCard: 'Tarjeta de crédito', - vendorBill: 'Factura del proveedor', + credit_card: 'Tarjeta de crédito', + vendor_bill: 'Factura del proveedor', account: 'Cuenta', vendor: 'Proveedor', defaultVendor: 'Proveedor predeterminado', From f936dabf2991d372c42da94166577f8330092b7c Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:01:42 -0700 Subject: [PATCH 12/39] fix: remove the translation key mapping --- .../QuickbooksCompanyCardExpenseAccountSelectPage.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx index de6edd0f3274..8cee387ce754 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx @@ -19,11 +19,6 @@ import type {Account} from '@src/types/onyx/Policy'; type CardListItem = ListItem & { value: string; }; -const AccountTypeTranslationKeyMapping = { - [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL]: 'vendorBill', - [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'creditCard', - [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'debitCard', -} as const; function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); @@ -78,11 +73,7 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne title={exportCompanyCard === CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL ? translate('workspace.qbo.vendor') : translate('workspace.qbo.account')} /> {translate(`workspace.qbo.${AccountTypeTranslationKeyMapping[exportCompanyCard]}AccountDescription`)} - ) : null - } + headerContent={exportCompanyCard ? {translate(`workspace.qbo.${exportCompanyCard}AccountDescription`)} : null} sections={[{data}]} ListItem={RadioListItem} onSelectRow={selectExportAccount} From 4d5b99b9e7aa646a319d9b3d39959357c489d938 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:08:02 -0700 Subject: [PATCH 13/39] fix: use underscore formatted account type name --- src/languages/en.ts | 12 +++++++++--- src/languages/es.ts | 6 +++--- .../QuickbooksCompanyCardExpenseAccountPage.tsx | 12 ++---------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 94b50f44605d..1be38b892bfb 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1930,11 +1930,17 @@ export default { vendor: 'Vendor', defaultVendor: 'Default vendor', defaultVendorDescription: 'Set a default vendor that will apply to all credit card transactions upon export.', - debitCardDescription: + // The account type name uses underscores in the backend. + // eslint-disable-next-line @typescript-eslint/naming-convention + debit_cardDescription: "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: + // The account type name uses underscores in the backend. + // eslint-disable-next-line @typescript-eslint/naming-convention + credit_cardDescription: "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: + // The account type name uses underscores in the backend. + // eslint-disable-next-line @typescript-eslint/naming-convention + vendor_billDescription: "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.', diff --git a/src/languages/es.ts b/src/languages/es.ts index 08b903b3ea2a..0becc1cbcb63 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1956,11 +1956,11 @@ export default { 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: + debit_cardDescription: "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: + credit_cardDescription: "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: + vendor_billDescription: '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.', diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx index 8f5461718c31..ba44cb93a10c 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx @@ -16,12 +16,6 @@ import ToggleSettingOptionRow from '@pages/workspace/workflows/ToggleSettingsOpt import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -const AccountTypeTranslationKeyMapping = { - [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL]: 'vendorBill', - [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'creditCard', - [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'debitCard', -} as const; - function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); @@ -43,7 +37,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections {translate('workspace.qbo.exportCompanyCardsDescription')} Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_SELECT.getRoute(policyID))} @@ -52,9 +46,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections /> {!!exportCompanyCard && ( - - {translate(`workspace.qbo.${AccountTypeTranslationKeyMapping[exportCompanyCard]}Description`)} - + {translate(`workspace.qbo.${exportCompanyCard}Description`)} )} {isVendorSelected && ( <> From 2338c9a0e4f1f11889cbd97e33da8b729bbd92eb Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:12:28 -0700 Subject: [PATCH 14/39] fix: change translation key to match the backend account type name & suppress ts errors --- src/languages/en.ts | 9 ++++++--- src/languages/es.ts | 17 ++++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 1be38b892bfb..c27160a920da 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1942,9 +1942,12 @@ export default { // eslint-disable-next-line @typescript-eslint/naming-convention vendor_billDescription: "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.', + // eslint-disable-next-line @typescript-eslint/naming-convention + debit_cardAccountDescription: 'Debit card transactions will export to the bank account below.”', + // eslint-disable-next-line @typescript-eslint/naming-convention + credit_cardAccountDescription: 'Credit card transactions will export to the bank account below.', + // eslint-disable-next-line @typescript-eslint/naming-convention + vendor_billAccountDescription: '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.', diff --git a/src/languages/es.ts b/src/languages/es.ts index 0becc1cbcb63..2baf60f0dc2b 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1944,22 +1944,33 @@ 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.', + // The account type name uses underscores in the backend. + // eslint-disable-next-line @typescript-eslint/naming-convention debit_card: 'Tarjeta de débito', check: 'Cheque', optionBelow: 'Elija una opción a continuación:', + // eslint-disable-next-line @typescript-eslint/naming-convention credit_card: 'Tarjeta de crédito', + // eslint-disable-next-line @typescript-eslint/naming-convention vendor_bill: '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.', + // The account type name uses underscores in the backend. + // eslint-disable-next-line @typescript-eslint/naming-convention + debit_cardAccountDescription: 'Las transacciones con tarjeta de débito se exportarán a la cuenta bancaria que aparece a continuación.”', + // eslint-disable-next-line @typescript-eslint/naming-convention + credit_cardAccountDescription: 'Las transacciones con tarjeta de crédito se exportarán a la cuenta bancaria que aparece a continuación.', + // eslint-disable-next-line @typescript-eslint/naming-convention + vendor_billAccountDescription: 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.', + // eslint-disable-next-line @typescript-eslint/naming-convention debit_cardDescription: "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.'.", + // eslint-disable-next-line @typescript-eslint/naming-convention credit_cardDescription: "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.'.", + // eslint-disable-next-line @typescript-eslint/naming-convention vendor_billDescription: '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', From 3909feb81fde5f74759dddbd980ec41a01978357 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:38:44 -0700 Subject: [PATCH 15/39] fix: the const name --- src/CONST.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 90ee03e658e5..29b05a81bdc5 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1268,7 +1268,7 @@ const CONST = { }, QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE: { - VENDOR_BILL: 'vendor_bill', + VENDOR_BILL: 'bill', CHECK: 'check', JOURNAL_ENTRY: 'jouranl_entry', }, From 87693a91df3510823a4a8aca462357f75796864c Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:39:05 -0700 Subject: [PATCH 16/39] fix: spelling --- src/CONST.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 29b05a81bdc5..d2e14af692ef 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1270,7 +1270,7 @@ const CONST = { QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE: { VENDOR_BILL: 'bill', CHECK: 'check', - JOURNAL_ENTRY: 'jouranl_entry', + JOURNAL_ENTRY: 'journal_entry', }, ACCOUNT_ID: { From 05e1019a708f74d3aa1d258309204039f570a2be Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:40:12 -0700 Subject: [PATCH 17/39] fix: const name --- src/CONST.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index d2e14af692ef..a1a9f513b63f 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -4706,7 +4706,7 @@ const CONST = { QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE: { CREDIT_CARD: 'credit_card', DEBIT_CARD: 'debit_card', - VENDOR_BILL: 'vendor_bill', + VENDOR_BILL: 'bill', }, SESSION_STORAGE_KEYS: { From 47f72aac51e1d68edaa44e564172cec0652aa3b6 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:42:38 -0700 Subject: [PATCH 18/39] fix: translation key that starts with underscore --- src/languages/en.ts | 13 +++++-------- src/languages/es.ts | 12 +++++------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index c27160a920da..788316c7a11f 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1925,8 +1925,7 @@ export default { credit_card: 'Credit card', // eslint-disable-next-line @typescript-eslint/naming-convention debit_card: 'Debit card', - // eslint-disable-next-line @typescript-eslint/naming-convention - vendor_bill: 'Vendor bill', + bill: 'Vendor bill', vendor: 'Vendor', defaultVendor: 'Default vendor', defaultVendorDescription: 'Set a default vendor that will apply to all credit card transactions upon export.', @@ -1938,16 +1937,13 @@ export default { // eslint-disable-next-line @typescript-eslint/naming-convention credit_cardDescription: "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.", - // The account type name uses underscores in the backend. - // eslint-disable-next-line @typescript-eslint/naming-convention - vendor_billDescription: + billDescription: "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).", // eslint-disable-next-line @typescript-eslint/naming-convention debit_cardAccountDescription: 'Debit card transactions will export to the bank account below.”', // eslint-disable-next-line @typescript-eslint/naming-convention credit_cardAccountDescription: 'Credit card transactions will export to the bank account below.', - // eslint-disable-next-line @typescript-eslint/naming-convention - vendor_billAccountDescription: 'Select the vendor applied to all credit card transactions.', + billAccountDescription: '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.', @@ -1957,7 +1953,8 @@ export default { 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', + // eslint-disable-next-line @typescript-eslint/naming-convention + journal_entry: '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.', diff --git a/src/languages/es.ts b/src/languages/es.ts index 2baf60f0dc2b..adca084646af 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1951,8 +1951,7 @@ export default { optionBelow: 'Elija una opción a continuación:', // eslint-disable-next-line @typescript-eslint/naming-convention credit_card: 'Tarjeta de crédito', - // eslint-disable-next-line @typescript-eslint/naming-convention - vendor_bill: 'Factura del proveedor', + bill: 'Factura del proveedor', account: 'Cuenta', vendor: 'Proveedor', defaultVendor: 'Proveedor predeterminado', @@ -1962,16 +1961,14 @@ export default { debit_cardAccountDescription: 'Las transacciones con tarjeta de débito se exportarán a la cuenta bancaria que aparece a continuación.”', // eslint-disable-next-line @typescript-eslint/naming-convention credit_cardAccountDescription: 'Las transacciones con tarjeta de crédito se exportarán a la cuenta bancaria que aparece a continuación.', - // eslint-disable-next-line @typescript-eslint/naming-convention - vendor_billAccountDescription: 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.', + billAccountDescription: 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.', // eslint-disable-next-line @typescript-eslint/naming-convention debit_cardDescription: "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.'.", // eslint-disable-next-line @typescript-eslint/naming-convention credit_cardDescription: "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.'.", - // eslint-disable-next-line @typescript-eslint/naming-convention - vendor_billDescription: + billDescription: '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.', @@ -1980,7 +1977,8 @@ export default { 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', + // eslint-disable-next-line @typescript-eslint/naming-convention + journal_entry: '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.', From 68ae45259d306151fb7e94f2a396cbde5f78efae Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:44:21 -0700 Subject: [PATCH 19/39] fix: translation keys --- src/languages/en.ts | 5 +++-- src/languages/es.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 788316c7a11f..10102ca2c574 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1956,9 +1956,10 @@ export default { // eslint-disable-next-line @typescript-eslint/naming-convention journal_entry: 'Journal entry', optionBelow: 'Choose an option below:', - vendorBillError: 'Vendor Bills are not available when locations are enabled. Please select a different export option.', + billError: '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.', + // eslint-disable-next-line @typescript-eslint/naming-convention + journal_entryError: '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: diff --git a/src/languages/es.ts b/src/languages/es.ts index adca084646af..257a9e07bcb0 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1979,9 +1979,10 @@ export default { exportPreferredExporterSubNote: 'Una vez configurado, el exportador preferido verá los informes para exportar en su cuenta.', // eslint-disable-next-line @typescript-eslint/naming-convention journal_entry: '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.', + billError: '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.', + // eslint-disable-next-line @typescript-eslint/naming-convention + journal_entryError: '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).', From 838a6138d0ebaac2158ea5bbe4225a92e40cec12 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 16:45:19 -0700 Subject: [PATCH 20/39] fix: remove translation key mapping --- .../QuickbooksOutOfPocketExpenseConfigurationPage.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx index 54420bafb892..3374399e5c9e 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -14,12 +14,6 @@ import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -const AccountTypeTranslationKeyMapping = { - [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'vendorBill', - [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK]: 'check', - [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'journalEntry', -} as const; - function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); @@ -46,9 +40,9 @@ 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 From 785b8e03d2f2fceaabd2a651f56c13e6d0c7fca0 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 17:10:06 -0700 Subject: [PATCH 21/39] fix: use values from const declarations --- src/languages/en.ts | 27 ++++++++------------------- src/languages/es.ts | 29 +++++++++++------------------ 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 10102ca2c574..401d84910377 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1920,29 +1920,20 @@ 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.', - // The account type name uses underscores in the backend. - // eslint-disable-next-line @typescript-eslint/naming-convention - credit_card: 'Credit card', - // eslint-disable-next-line @typescript-eslint/naming-convention - debit_card: 'Debit card', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Credit card', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Debit card', bill: 'Vendor bill', vendor: 'Vendor', defaultVendor: 'Default vendor', defaultVendorDescription: 'Set a default vendor that will apply to all credit card transactions upon export.', - // The account type name uses underscores in the backend. - // eslint-disable-next-line @typescript-eslint/naming-convention - debit_cardDescription: + [`${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.", - // The account type name uses underscores in the backend. - // eslint-disable-next-line @typescript-eslint/naming-convention - credit_cardDescription: + [`${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.", billDescription: "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).", - // eslint-disable-next-line @typescript-eslint/naming-convention - debit_cardAccountDescription: 'Debit card transactions will export to the bank account below.”', - // eslint-disable-next-line @typescript-eslint/naming-convention - credit_cardAccountDescription: 'Credit card transactions will export to the bank account 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.', billAccountDescription: '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.', @@ -1953,13 +1944,11 @@ export default { accountsPayable: 'Accounts payable', account: 'Account', accountsPayableDescription: 'This is your chosen A/P account, against which vendor bills for each report are created.', - // eslint-disable-next-line @typescript-eslint/naming-convention - journal_entry: 'Journal entry', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Journal entry', optionBelow: 'Choose an option below:', billError: '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.', - // eslint-disable-next-line @typescript-eslint/naming-convention - journal_entryError: 'Journal entry is not available when taxes 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.', 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: diff --git a/src/languages/es.ts b/src/languages/es.ts index 257a9e07bcb0..8df552a27772 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1944,29 +1944,23 @@ 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.', - // The account type name uses underscores in the backend. - // eslint-disable-next-line @typescript-eslint/naming-convention - debit_card: 'Tarjeta de débito', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Tarjeta de débito', check: 'Cheque', optionBelow: 'Elija una opción a continuación:', - // eslint-disable-next-line @typescript-eslint/naming-convention - credit_card: 'Tarjeta de crédito', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Tarjeta de crédito', bill: '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.', - // The account type name uses underscores in the backend. - // eslint-disable-next-line @typescript-eslint/naming-convention - debit_cardAccountDescription: 'Las transacciones con tarjeta de débito se exportarán a la cuenta bancaria que aparece a continuación.”', - // eslint-disable-next-line @typescript-eslint/naming-convention - credit_cardAccountDescription: 'Las transacciones con tarjeta de crédito se exportarán a la cuenta bancaria que aparece 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.', billAccountDescription: 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.', - // eslint-disable-next-line @typescript-eslint/naming-convention - debit_cardDescription: + [`${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.'.", - // eslint-disable-next-line @typescript-eslint/naming-convention - credit_cardDescription: + [`${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.'.", billDescription: '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).', @@ -1977,12 +1971,11 @@ export default { 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.', - // eslint-disable-next-line @typescript-eslint/naming-convention - journal_entry: 'Asiento contable', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Asiento contable', billError: '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.', - // eslint-disable-next-line @typescript-eslint/naming-convention - journal_entryError: 'El asiento de diario no está disponible cuando los impuestos están habilitados. 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.', 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).', From bf9c8ee2cd165c07f24a61d0dbeac46542854d5f Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 17:14:06 -0700 Subject: [PATCH 22/39] fix: use const values for bill --- src/languages/en.ts | 5 +++-- src/languages/es.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 401d84910377..c85ba7c9b886 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1922,7 +1922,7 @@ export default { exportCompanyCardsDescription: 'Set how company card purchases export to QuickBooks Online.', [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Credit card', [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Debit card', - bill: 'Vendor bill', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'Vendor bill', vendor: 'Vendor', defaultVendor: 'Default vendor', defaultVendorDescription: 'Set a default vendor that will apply to all credit card transactions upon export.', @@ -1946,7 +1946,8 @@ export default { accountsPayableDescription: 'This is your chosen A/P account, against which vendor bills for each report are created.', [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Journal entry', optionBelow: 'Choose an option below:', - billError: 'Vendor Bills are not available when locations are enabled. Please select a different export option.', + [`${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.', checkError: '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.', companyCardsLocationEnabledDescription: diff --git a/src/languages/es.ts b/src/languages/es.ts index 8df552a27772..6181d1cc47bd 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1948,7 +1948,7 @@ export default { check: 'Cheque', optionBelow: 'Elija una opción a continuación:', [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Tarjeta de crédito', - bill: 'Factura del proveedor', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'Factura del proveedor', account: 'Cuenta', vendor: 'Proveedor', defaultVendor: 'Proveedor predeterminado', @@ -1972,7 +1972,8 @@ 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 su cuenta.', [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Asiento contable', - billError: '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.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.', checkError: '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.', From 93b78d26aa06dd494b886477919b5f5aa2de241d Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 17:27:14 -0700 Subject: [PATCH 23/39] refactor: organize translation --- src/languages/en.ts | 44 ++++++++++++++++++++++------------------- src/languages/es.ts | 48 ++++++++++++++++++++++++--------------------- 2 files changed, 50 insertions(+), 42 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index c85ba7c9b886..3dbdabf6da72 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1920,21 +1920,9 @@ 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.', - [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Credit card', - [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Debit card', - [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'Vendor bill', vendor: 'Vendor', defaultVendor: 'Default vendor', defaultVendorDescription: 'Set a default vendor that will apply to all credit card transactions upon export.', - [`${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.", - billDescription: - "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.', - billAccountDescription: '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.', @@ -1944,20 +1932,14 @@ export default { accountsPayable: 'Accounts payable', account: 'Account', accountsPayableDescription: 'This is your chosen A/P account, against which vendor bills for each report are created.', - [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Journal entry', - optionBelow: 'Choose an option below:', - [`${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.', - checkError: '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.', - 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: "Note: QuickBooks Online doesn't support a field for tax on Journal Entry exports. Because you have tax tracking enabled on your workspace, this export option is unavailable.", outOfPocketTaxEnabledError: 'Journal entry is not available when taxes enabled. please select a different export option.', outOfPocketLocationEnabledError: 'Vendor Bills are not available when locations are enabled. Please select a different export option.', outOfPocketLocationEnabledDescription: 'Note: QuickBooks Online does not support a field for Locations as Tags on Vendor Bills exports. As you import Locations as Tags, this export option is unavailable.', + 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.', advancedConfig: { advanced: 'Advanced', autoSync: 'Auto-sync', @@ -1976,6 +1958,28 @@ 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.', }, + exportCompanyCardAccountType: { + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Debit card', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Credit card', + [`${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_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.', + billAccountDescription: 'Select the vendor applied to all credit card transactions.', + }, + outOfPocketExpenseAccountType: { + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'Vendor bill', + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Journal entry', + optionBelow: 'Choose an option below:', + billDescription: + "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_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}Error`]: + '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.', + [`${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.', + }, }, type: { free: 'Free', diff --git a/src/languages/es.ts b/src/languages/es.ts index 6181d1cc47bd..b740608f9cfb 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1944,26 +1944,10 @@ 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.', - [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Tarjeta de débito', - check: 'Cheque', - optionBelow: 'Elija una opción a continuación:', - [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', 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.', - [`${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.', - billAccountDescription: 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.', - [`${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.'.", - billDescription: - '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.', companyCardsLocationEnabledDescription: @@ -1971,12 +1955,6 @@ export default { 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.', - [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Asiento contable', - [`${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.', - checkError: '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.', 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).', @@ -2006,6 +1984,32 @@ 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.', }, + exportCompanyCardsAccountType: { + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Tarjeta de débito', + check: 'Cheque', + optionBelow: 'Elija una opción a continuación:', + [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Tarjeta de crédito', + [`${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_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.', + billAccountDescription: 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.', + }, + outOfPocketExpenseAccountType: { + [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', + billDescription: + '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_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.', + checkError: '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.', + }, }, type: { free: 'Gratis', From 99f1fd403d318eb700ffd5ba931e25c862989340 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 17:40:47 -0700 Subject: [PATCH 24/39] refactor: organize translation keys --- src/languages/en.ts | 10 +++++----- src/languages/es.ts | 14 ++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 3dbdabf6da72..73c3e62365e9 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1928,10 +1928,10 @@ export default { 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.', + optionBelow: 'Choose an option below:', outOfPocketTaxEnabledDescription: "Note: QuickBooks Online doesn't support a field for tax on Journal Entry exports. Because you have tax tracking enabled on your workspace, this export option is unavailable.", outOfPocketTaxEnabledError: 'Journal entry is not available when taxes enabled. please select a different export option.', @@ -1967,17 +1967,17 @@ export default { "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_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.', - billAccountDescription: 'Select the vendor applied to all credit card transactions.', }, outOfPocketExpenseAccountType: { [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'Vendor bill', [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Journal entry', - optionBelow: 'Choose an option below:', - billDescription: + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK]: 'Check', + [`${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_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.', - checkError: 'Check is 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.', }, }, diff --git a/src/languages/es.ts b/src/languages/es.ts index b740608f9cfb..8badca11553a 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1950,6 +1950,7 @@ export default { 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.', + 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: @@ -1984,10 +1985,8 @@ 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.', }, - exportCompanyCardsAccountType: { + exportCompanyCardAccountType: { [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Tarjeta de débito', - check: 'Cheque', - optionBelow: 'Elija una opción a continuación:', [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Tarjeta de crédito', [`${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.'.", @@ -1997,16 +1996,19 @@ export default { '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.', - billAccountDescription: 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.', }, outOfPocketExpenseAccountType: { [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', - billDescription: + [CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK]: 'Cheque', + [`${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_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.', - checkError: '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.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.', }, From 84eb6ee2fbe49c9b7103a3f15c5d8728cd9c64e3 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 17:42:38 -0700 Subject: [PATCH 25/39] fix: translation path --- .../QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx index 772131554f4e..969e20f3fe72 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx @@ -34,15 +34,15 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC const defaultCards = useMemo( () => [ { - name: translate(`workspace.qbo.creditCard`), + name: translate(`workspace.qbo.exportCompanyCardAccountType.creditCard`), id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD, }, { - name: translate(`workspace.qbo.debitCard`), + name: translate(`workspace.qbo.exportCompanyCardAccountType.debitCard`), id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD, }, { - name: translate(`workspace.qbo.vendorBill`), + name: translate(`workspace.qbo.exportCompanyCardAccountType.vendorBill`), id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL, }, ], From 8766e922cbf508f14931c870a32c144e3edc0acf Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 17:46:43 -0700 Subject: [PATCH 26/39] fix: translation path --- .../qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx index ba44cb93a10c..4291aa631dfc 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx @@ -37,7 +37,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections {translate('workspace.qbo.exportCompanyCardsDescription')} Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_SELECT.getRoute(policyID))} @@ -46,7 +46,9 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections /> {!!exportCompanyCard && ( - {translate(`workspace.qbo.${exportCompanyCard}Description`)} + + {translate(`workspace.qbo.exportCompanyCardAccountType.${exportCompanyCard}Description`)} + )} {isVendorSelected && ( <> From 0ba26a8d155ec11e0a867dabd454cb8b4f47c2da Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 18:04:13 -0700 Subject: [PATCH 27/39] fix: translation key path --- .../QuickbooksCompanyCardExpenseAccountSelectPage.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx index 8cee387ce754..45c5907fcd1b 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx @@ -73,7 +73,11 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne title={exportCompanyCard === CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL ? translate('workspace.qbo.vendor') : translate('workspace.qbo.account')} /> {translate(`workspace.qbo.${exportCompanyCard}AccountDescription`)} : null} + headerContent={ + exportCompanyCard ? ( + {translate(`workspace.qbo.exportCompanyCardAccountType.${exportCompanyCard}AccountDescription`)} + ) : null + } sections={[{data}]} ListItem={RadioListItem} onSelectRow={selectExportAccount} From c7382bdeae2ae66f6121822a329e8485a2ce15a7 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 18:05:52 -0700 Subject: [PATCH 28/39] fix: translation path --- .../qbo/export/QuickbooksExportConfigurationPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx index 4d550d11547f..1e9f6ccb45ee 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.outOfPocketExpenseAccountType.${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.exportCompanyCardAccountType.${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.exportCompanyCardAccountType.creditCard'), shouldShowRightIcon: false, interactive: false, }, From 088ac3d5824ce7cb5f59bb95733e2ea99a87fb9f Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 18:06:45 -0700 Subject: [PATCH 29/39] fix: translation path error --- .../export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx index 3374399e5c9e..470cc7d385f1 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -40,9 +40,9 @@ 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 From 1955c29cb45073540447ea63320715934704ff09 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 18:07:38 -0700 Subject: [PATCH 30/39] fix: translation key --- .../export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx index 0666e22eb911..c44f99c6e3ab 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx @@ -45,21 +45,21 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec () => [ { value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK, - text: translate(`workspace.qbo.check`), + text: translate(`workspace.qbo.outOfPocketExpenseAccountType.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_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY, - text: translate(`workspace.qbo.journalEntry`), + text: translate(`workspace.qbo.outOfPocketExpenseAccountType.journalEntry`), 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_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL, - text: translate(`workspace.qbo.vendorBill`), + text: translate(`workspace.qbo.outOfPocketExpenseAccountType.vendorBill`), 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, From e497980476d3728bfdfe332606cb849278c3fc29 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 18:09:10 -0700 Subject: [PATCH 31/39] chore: put the translation to the original place --- src/languages/en.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 73c3e62365e9..a683331043cd 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1932,14 +1932,14 @@ export default { account: 'Account', accountsPayableDescription: 'This is your chosen A/P account, against which vendor bills for each report are created.', 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.', outOfPocketTaxEnabledDescription: "Note: QuickBooks Online doesn't support a field for tax on Journal Entry exports. Because you have tax tracking enabled on your workspace, this export option is unavailable.", outOfPocketTaxEnabledError: 'Journal entry is not available when taxes enabled. please select a different export option.', outOfPocketLocationEnabledError: 'Vendor Bills are not available when locations are enabled. Please select a different export option.', outOfPocketLocationEnabledDescription: 'Note: QuickBooks Online does not support a field for Locations as Tags on Vendor Bills exports. As you import Locations as Tags, this export option is unavailable.', - 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.', advancedConfig: { advanced: 'Advanced', autoSync: 'Auto-sync', From e328e0f7a47211383e96cdce63bafcfb3e7e12cd Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 29 Apr 2024 23:08:43 -0700 Subject: [PATCH 32/39] fix: wrong translation key --- .../accounting/qbo/export/QuickbooksExportConfigurationPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx index 72052a66a5f3..352a83e58f42 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx @@ -69,7 +69,7 @@ function QuickbooksExportConfigurationPage({policy}: WithPolicyConnectionsProps) }, { description: translate('workspace.qbo.exportExpensifyCard'), - title: translate('workspace.qbo.exportCompanyCardAccountType.creditCard'), + title: translate('workspace.qbo.exportCompanyCardAccountType.credit_card'), shouldShowRightIcon: false, interactive: false, }, From 6abfbd24306919b65e8bf0ea16b39e0f8c237244 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 1 May 2024 10:06:20 -0700 Subject: [PATCH 33/39] fix: translation --- .../export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx index c44f99c6e3ab..21f4b140ee1a 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx @@ -52,14 +52,14 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec }, { value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY, - text: translate(`workspace.qbo.outOfPocketExpenseAccountType.journalEntry`), + text: translate(`workspace.qbo.outOfPocketExpenseAccountType.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_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL, - text: translate(`workspace.qbo.outOfPocketExpenseAccountType.vendorBill`), + text: translate(`workspace.qbo.outOfPocketExpenseAccountType.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, From d0029f643bc86a0eda4f302b18ef32bc3d253f79 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 1 May 2024 10:08:38 -0700 Subject: [PATCH 34/39] chore: translation key --- .../QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx index 969e20f3fe72..5770745890a6 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx @@ -34,15 +34,15 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC const defaultCards = useMemo( () => [ { - name: translate(`workspace.qbo.exportCompanyCardAccountType.creditCard`), + name: translate(`workspace.qbo.exportCompanyCardAccountType.credit_card`), id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD, }, { - name: translate(`workspace.qbo.exportCompanyCardAccountType.debitCard`), + name: translate(`workspace.qbo.exportCompanyCardAccountType.debit_card`), id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD, }, { - name: translate(`workspace.qbo.exportCompanyCardAccountType.vendorBill`), + name: translate(`workspace.qbo.exportCompanyCardAccountType.bill`), id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL, }, ], From 244be92e09888bd125af92972027b7ad90bdf223 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 1 May 2024 10:51:34 -0700 Subject: [PATCH 35/39] bring account related translation key under the same property --- src/languages/en.ts | 16 +++++++++------- src/languages/es.ts | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 88b544247481..4b9c55342fb5 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1973,25 +1973,27 @@ export default { exportCompanyCardAccountType: { [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_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.', - }, - outOfPocketExpenseAccountType: { - [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_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.', }, + outOfPocketExpenseAccountType: {}, }, xero: { organization: 'Xero organization', diff --git a/src/languages/es.ts b/src/languages/es.ts index d9b968fb2d79..414f2335a55e 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2000,23 +2000,24 @@ export default { exportCompanyCardAccountType: { [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.', - }, - outOfPocketExpenseAccountType: { - [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_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_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`]: @@ -2024,6 +2025,7 @@ export default { [`${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.', }, + outOfPocketExpenseAccountType: {}, }, xero: { organization: 'Organización Xero', From e1d7df21a7fd3e1b8f27b925217878db02220732 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 1 May 2024 10:52:46 -0700 Subject: [PATCH 36/39] fix: remove old translation key --- .../qbo/export/QuickbooksExportConfigurationPage.tsx | 2 +- .../QuickbooksOutOfPocketExpenseConfigurationPage.tsx | 4 ++-- .../export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksExportConfigurationPage.tsx index 352a83e58f42..833bdcad67a0 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.outOfPocketExpenseAccountType.${exportEntity}`) : undefined, + title: exportEntity ? translate(`workspace.qbo.exportCompanyCardAccountType.${exportEntity}`) : undefined, // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing pendingAction: pendingFields?.exportEntity || pendingFields?.exportAccount, }, diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx index 470cc7d385f1..a1e6bb3fc243 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -40,9 +40,9 @@ 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 diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx index 21f4b140ee1a..14630062b814 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx @@ -45,21 +45,21 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec () => [ { value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK, - text: translate(`workspace.qbo.outOfPocketExpenseAccountType.check`), + text: translate(`workspace.qbo.exportCompanyCardAccountType.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_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY, - text: translate(`workspace.qbo.outOfPocketExpenseAccountType.journal_entry`), + text: translate(`workspace.qbo.exportCompanyCardAccountType.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_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL, - text: translate(`workspace.qbo.outOfPocketExpenseAccountType.bill`), + text: translate(`workspace.qbo.exportCompanyCardAccountType.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, From b90834a0d93e4f6ddb86214c092b3a597703044b Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 1 May 2024 10:59:58 -0700 Subject: [PATCH 37/39] fix: remove old translation key --- src/languages/en.ts | 1 - src/languages/es.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 4b9c55342fb5..6a421a86b48a 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1993,7 +1993,6 @@ export default { [`${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.', }, - outOfPocketExpenseAccountType: {}, }, xero: { organization: 'Xero organization', diff --git a/src/languages/es.ts b/src/languages/es.ts index 414f2335a55e..8fa5afa14e76 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2025,7 +2025,6 @@ export default { [`${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.', }, - outOfPocketExpenseAccountType: {}, }, xero: { organization: 'Organización Xero', From ca5420d55b812eb53fb9bd31da3912b506399db1 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 1 May 2024 11:02:08 -0700 Subject: [PATCH 38/39] refactor: rename the translation key --- src/languages/en.ts | 2 +- src/languages/es.ts | 2 +- .../qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx | 6 ++---- .../QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx | 6 +++--- .../QuickbooksCompanyCardExpenseAccountSelectPage.tsx | 6 +----- .../qbo/export/QuickbooksExportConfigurationPage.tsx | 6 +++--- .../QuickbooksOutOfPocketExpenseConfigurationPage.tsx | 4 ++-- 7 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 6a421a86b48a..48df154a3a5c 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1970,7 +1970,7 @@ 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.', }, - exportCompanyCardAccountType: { + 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', diff --git a/src/languages/es.ts b/src/languages/es.ts index 8fa5afa14e76..544a1d562ced 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1997,7 +1997,7 @@ 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.', }, - exportCompanyCardAccountType: { + 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', diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx index 4291aa631dfc..abc0b0bd2ba5 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx @@ -37,7 +37,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections {translate('workspace.qbo.exportCompanyCardsDescription')} Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_SELECT.getRoute(policyID))} @@ -46,9 +46,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections /> {!!exportCompanyCard && ( - - {translate(`workspace.qbo.exportCompanyCardAccountType.${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 5770745890a6..9a18a188667b 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx @@ -34,15 +34,15 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC const defaultCards = useMemo( () => [ { - name: translate(`workspace.qbo.exportCompanyCardAccountType.credit_card`), + name: translate(`workspace.qbo.accounts.credit_card`), id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD, }, { - name: translate(`workspace.qbo.exportCompanyCardAccountType.debit_card`), + name: translate(`workspace.qbo.accounts.debit_card`), id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD, }, { - name: translate(`workspace.qbo.exportCompanyCardAccountType.bill`), + name: translate(`workspace.qbo.accounts.bill`), id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL, }, ], diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx index 45c5907fcd1b..e6f408f0b54a 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx @@ -73,11 +73,7 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne title={exportCompanyCard === CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL ? translate('workspace.qbo.vendor') : translate('workspace.qbo.account')} /> {translate(`workspace.qbo.exportCompanyCardAccountType.${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 833bdcad67a0..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.exportCompanyCardAccountType.${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.exportCompanyCardAccountType.${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.exportCompanyCardAccountType.credit_card'), + title: translate('workspace.qbo.accounts.credit_card'), shouldShowRightIcon: false, interactive: false, }, diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx index a1e6bb3fc243..a23c224fd0ac 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -40,9 +40,9 @@ 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 From fc6d2a0e7b169c8e58bd33289d31348edd737da5 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 1 May 2024 11:02:29 -0700 Subject: [PATCH 39/39] fix: rename outdated translation key --- .../export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx index 14630062b814..3034f8db5b4d 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx @@ -45,21 +45,21 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec () => [ { value: CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK, - text: translate(`workspace.qbo.exportCompanyCardAccountType.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_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY, - text: translate(`workspace.qbo.exportCompanyCardAccountType.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_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL, - text: translate(`workspace.qbo.exportCompanyCardAccountType.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,