Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix account type name constants #41155

Merged
merged 44 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d6739e0
fix: const strings
Apr 27, 2024
46c3531
Revert "fix: const strings"
Apr 27, 2024
7f47efe
fix: string values for the out of pocket expense account options
Apr 27, 2024
98e6461
refactor: const object name
Apr 27, 2024
9427bdb
fix: string values for the company card export account options
Apr 27, 2024
495ecad
refactor: rename const object
Apr 27, 2024
35ebb51
refactor: rename const object
Apr 27, 2024
b8cdac6
fix: map the account type string value to translation key
Apr 27, 2024
0ab5b8b
Merge branch 'main' into hayata-fix-account-type-name-constants
Apr 29, 2024
897e4d8
fix: translation key
Apr 29, 2024
a6cd09d
fix: translation key
Apr 29, 2024
3060112
refactor: rename the translation keys for the type of accounts used t…
Apr 29, 2024
f936dab
fix: remove the translation key mapping
Apr 29, 2024
4d5b99b
fix: use underscore formatted account type name
Apr 29, 2024
2338c9a
fix: change translation key to match the backend account type name & …
Apr 29, 2024
3909feb
fix: the const name
Apr 29, 2024
87693a9
fix: spelling
Apr 29, 2024
05e1019
fix: const name
Apr 29, 2024
47f72aa
fix: translation key that starts with underscore
Apr 29, 2024
68ae452
fix: translation keys
Apr 29, 2024
838a613
fix: remove translation key mapping
Apr 29, 2024
785b8e0
fix: use values from const declarations
Apr 30, 2024
bf9c8ee
fix: use const values for bill
Apr 30, 2024
93b78d2
refactor: organize translation
Apr 30, 2024
99f1fd4
refactor: organize translation keys
Apr 30, 2024
84eb6ee
fix: translation path
Apr 30, 2024
8766e92
fix: translation path
Apr 30, 2024
0ba26a8
fix: translation key path
Apr 30, 2024
c7382bd
fix: translation path
Apr 30, 2024
088ac3d
fix: translation path error
Apr 30, 2024
1955c29
fix: translation key
Apr 30, 2024
e497980
chore: put the translation to the original place
Apr 30, 2024
86b60f7
Merge branch 'main' into hayata-fix-account-type-name-constants
Apr 30, 2024
e328e0f
fix: wrong translation key
Apr 30, 2024
91b078e
Merge branch 'main' into hayata-fix-account-type-name-constants
May 1, 2024
6abfbd2
fix: translation
May 1, 2024
d0029f6
chore: translation key
May 1, 2024
244be92
bring account related translation key under the same property
May 1, 2024
e1d7df2
fix: remove old translation key
May 1, 2024
b90834a
fix: remove old translation key
May 1, 2024
ca5420d
refactor: rename the translation key
May 1, 2024
fc6d2a0
fix: rename outdated translation key
May 1, 2024
4a13595
Merge branch 'main' into hayata-fix-account-type-name-constants
May 1, 2024
8dba03d
Merge branch 'main' into hayata-fix-account-type-name-constants
May 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1270,10 +1270,10 @@ const CONST = {
IMPORT_TAX_RATES: 'importTaxRates',
},

QUICKBOOKS_EXPORT_ENTITY: {
VENDOR_BILL: 'vendorBill',
QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE: {
VENDOR_BILL: 'bill',
CHECK: 'check',
JOURNAL_ENTRY: 'journalEntry',
JOURNAL_ENTRY: 'journal_entry',
},

ACCOUNT_ID: {
Expand Down Expand Up @@ -4662,10 +4662,10 @@ const CONST = {
REPORT_SUBMITTED: 'REPORT_SUBMITTED',
},

QUICKBOOKS_EXPORT_COMPANY_CARD: {
CREDIT_CARD: 'creditCard',
DEBIT_CARD: 'debitCard',
VENDOR_BILL: 'vendorBill',
QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE: {
CREDIT_CARD: 'credit_card',
DEBIT_CARD: 'debit_card',
VENDOR_BILL: 'bill',
},

SESSION_STORAGE_KEYS: {
Expand Down
40 changes: 23 additions & 17 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1932,35 +1932,18 @@ export default {
archive: 'Accounts receivable archive', // This is an account name that will come directly from QBO, so I don't know why we need a translation for it. It should take whatever the name of the account is in QBO. Leaving this note for CS.
exportInvoicesDescription: 'Invoices will be exported to this account in QuickBooks Online.',
exportCompanyCardsDescription: 'Set how company card purchases export to QuickBooks Online.',
creditCard: 'Credit card',
debitCard: 'Debit card',
vendorBill: 'Vendor bill',
vendor: 'Vendor',
defaultVendor: 'Default vendor',
defaultVendorDescription: 'Set a default vendor that will apply to all credit card transactions upon export.',
debitCardDescription:
"We'll automatically match the merchant name on the debit card transaction to any corresponding vendors in QuickBooks. If no vendors exist, we'll create a 'Debit Card Misc.' vendor for association.",
creditCardDescription:
"We'll automatically match the merchant name on the credit card transaction to any corresponding vendors in QuickBooks. If no vendors exist, we'll create a 'Credit Card Misc.' vendor for association.",
vendorBillDescription:
"We'll create a single itemized vendor bill for each Expensify report, carrying the date of the last expense on the report. If this period is closed, we'll post to the 1st of the next open period. You can add the vendor bill to your A/P account of choice (below).",
debitCardAccountDescription: 'Debit card transactions will export to the bank account below.”',
creditCardAccountDescription: 'Credit card transactions will export to the bank account below.',
vendorBillAccountDescription: 'Select the vendor applied to all credit card transactions.',
exportPreferredExporterNote: 'This can be any workspace admin, but must be a Domain Admin if you set different export accounts for individual company cards in Domain Settings.',
exportPreferredExporterSubNote: 'Once set, the preferred exporter will see reports for export in their account.',
exportOutOfPocketExpensesDescription: 'Set how out-of-pocket expenses export to QuickBooks Online.',
exportVendorBillDescription:
"We'll create a single itemized vendor bill for each Expensify report. If the period of the bill is closed, we'll post to the 1st of the next open period. You can add the vendor bill to your A/P account of choice (below).",
check: 'Check',
accountsPayable: 'Accounts payable',
account: 'Account',
accountsPayableDescription: 'This is your chosen A/P account, against which vendor bills for each report are created.',
journalEntry: 'Journal entry',
optionBelow: 'Choose an option below:',
vendorBillError: 'Vendor Bills are not available when locations are enabled. Please select a different export option.',
checkError: 'Check is not available when locations are enabled. Please select a different export option.',
journalEntryError: 'Journal entry is not available when taxes enabled. please select a different export option.',
companyCardsLocationEnabledDescription:
'Note: QuickBooks Online does not support a field for Locations as Tags on Vendor Bills exports. As you import Locations from, this this export option is unavailable.',
outOfPocketTaxEnabledDescription:
Expand All @@ -1987,6 +1970,29 @@ export default {
invoiceAccountSelectDescription:
'If you are exporting invoices from Expensify to Quickbooks Online, this is the account the invoice will appear against once marked as paid.',
},
accounts: {
[CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Debit card',
[CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Credit card',
[CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'Vendor bill',
[CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Journal entry',
[CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK]: 'Check',

[`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD}Description`]:
"We'll automatically match the merchant name on the debit card transaction to any corresponding vendors in QuickBooks. If no vendors exist, we'll create a 'Debit Card Misc.' vendor for association.",
[`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD}Description`]:
"We'll automatically match the merchant name on the credit card transaction to any corresponding vendors in QuickBooks. If no vendors exist, we'll create a 'Credit Card Misc.' vendor for association.",
[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}Description`]:
"We'll create a single itemized vendor bill for each Expensify report, carrying the date of the last expense on the report. If this period is closed, we'll post to the 1st of the next open period. You can add the vendor bill to your A/P account of choice (below).",

[`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD}AccountDescription`]: 'Debit card transactions will export to the bank account below.”',
[`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD}AccountDescription`]: 'Credit card transactions will export to the bank account below.',
[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}AccountDescription`]: 'Select the vendor applied to all credit card transactions.',

[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}Error`]:
'Vendor Bills are not available when locations are enabled. Please select a different export option.',
[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK}Error`]: 'Check is not available when locations are enabled. Please select a different export option.',
[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY}Error`]: 'Journal entry is not available when taxes enabled. please select a different export option.',
},
},
xero: {
organization: 'Xero organization',
Expand Down
47 changes: 29 additions & 18 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1956,35 +1956,18 @@ export default {
archive: 'Archivo de cuentas por cobrar', // This is an account name that will come directly from QBO, so I don't know why we need a translation for it. It should take whatever the name of the account is in QBO. Leaving this note for CS.
exportInvoicesDescription: 'Las facturas se exportarán a esta cuenta en QuickBooks Online.',
exportCompanyCardsDescription: 'Establece cómo se exportan las compras con tarjeta de empresa a QuickBooks Online.',
debitCard: 'Tarjeta de débito',
check: 'Cheque',
optionBelow: 'Elija una opción a continuación:',
creditCard: 'Tarjeta de crédito',
vendorBill: 'Factura del proveedor',
account: 'Cuenta',
vendor: 'Proveedor',
defaultVendor: 'Proveedor predeterminado',
defaultVendorDescription: 'Establece un proveedor predeterminado que se aplicará a todas las transacciones con tarjeta de crédito al momento de exportarlas.',
debitCardAccountDescription: 'Las transacciones con tarjeta de débito se exportarán a la cuenta bancaria que aparece a continuación.”',
creditCardAccountDescription: 'Las transacciones con tarjeta de crédito se exportarán a la cuenta bancaria que aparece a continuación.',
vendorBillAccountDescription: 'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.',
debitCardDescription:
"Automáticamente relacionaremos el nombre del comerciante de la transacción con tarjeta de débito con cualquier proveedor correspondiente en QuickBooks. Si no existen proveedores, crearemos un proveedor asociado 'Debit Card Misc.'.",
creditCardDescription:
"Automáticamente relacionaremos el nombre del comerciante de la transacción con tarjeta de crédito con cualquier proveedor correspondiente en QuickBooks. Si no existen proveedores, crearemos un proveedor asociado 'Credit Card Misc.'.",
vendorBillDescription:
'Crearemos una única factura detallada con los proveedores por cada informe de Expensify, con fecha del último gasto en el informe. Si este período está cerrado, la publicaremos con fecha del día 1 del próximo período abierto. Puede añadir la factura del proveedor a la cuenta A/P de su elección (a continuación).',
accountsPayable: 'Cuentas por pagar',
accountsPayableDescription: 'Esta es la cuenta de cuentas por pagar elegida, contra la cual se crean las facturas de proveedores para cada informe.',
optionBelow: 'Elija una opción a continuación:',
companyCardsLocationEnabledDescription:
'Nota: QuickBooks Online no admite un campo para Ubicaciones como etiquetas en las exportaciones de facturas de proveedores. A medida que importa ubicaciones, esta opción de exportación no está disponible.',
exportPreferredExporterNote:
'Puede ser cualquier administrador del espacio de trabajo, pero debe ser un administrador de dominio si configura diferentes cuentas de exportación para tarjetas de empresa individuales en la configuración del dominio.',
exportPreferredExporterSubNote: 'Una vez configurado, el exportador preferido verá los informes para exportar en su cuenta.',
journalEntry: 'Asiento contable',
vendorBillError: 'Las facturas de proveedores no están disponibles cuando las ubicaciones están habilitadas. Seleccione una opción de exportación diferente.',
checkError: 'La verificación no está disponible cuando las ubicaciones están habilitadas. Seleccione una opción de exportación diferente.',
journalEntryError: 'El asiento de diario no está disponible cuando los impuestos están habilitados. seleccione una opción de exportación diferente.',
exportOutOfPocketExpensesDescription: 'Establezca cómo se exportan los gastos de bolsillo a QuickBooks Online.',
exportVendorBillDescription:
'Crearemos una única factura de proveedor detallada para cada informe de Expensify. Si el período de la factura está cerrado, lo publicaremos en el día 1 del siguiente período abierto. Puede agregar la factura del proveedor a la cuenta A/P de su elección (a continuación).',
Expand Down Expand Up @@ -2014,6 +1997,34 @@ export default {
invoiceAccountSelectDescription:
'Si está exportando facturas de Expensify a Quickbooks Online, ésta es la cuenta en la que aparecerá la factura una vez marcada como pagada.',
},
accounts: {
[CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'Tarjeta de débito',
[CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'Tarjeta de crédito',
[CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL]: 'Factura del proveedor',
[CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY]: 'Asiento contable',
[CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK]: 'Cheque',

[`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD}Description`]:
"Automáticamente relacionaremos el nombre del comerciante de la transacción con tarjeta de débito con cualquier proveedor correspondiente en QuickBooks. Si no existen proveedores, crearemos un proveedor asociado 'Debit Card Misc.'.",
[`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD}Description`]:
"Automáticamente relacionaremos el nombre del comerciante de la transacción con tarjeta de crédito con cualquier proveedor correspondiente en QuickBooks. Si no existen proveedores, crearemos un proveedor asociado 'Credit Card Misc.'.",
[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}Description`]:
'Crearemos una única factura detallada con los proveedores por cada informe de Expensify, con fecha del último gasto en el informe. Si este período está cerrado, la publicaremos con fecha del día 1 del próximo período abierto. Puede añadir la factura del proveedor a la cuenta A/P de su elección (a continuación).',

[`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD}AccountDescription`]:
'Las transacciones con tarjeta de débito se exportarán a la cuenta bancaria que aparece a continuación.”',
[`${CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD}AccountDescription`]:
'Las transacciones con tarjeta de crédito se exportarán a la cuenta bancaria que aparece a continuación.',
[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}AccountDescription`]:
'Selecciona el proveedor que se aplicará a todas las transacciones con tarjeta de crédito.',

[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.VENDOR_BILL}Error`]:
'Las facturas de proveedores no están disponibles cuando las ubicaciones están habilitadas. Seleccione una opción de exportación diferente.',
[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.CHECK}Error`]:
'La verificación no está disponible cuando las ubicaciones están habilitadas. Seleccione una opción de exportación diferente.',
[`${CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE.JOURNAL_ENTRY}Error`]:
'El asiento de diario no está disponible cuando los impuestos están habilitados. seleccione una opción de exportación diferente.',
},
},
xero: {
organization: 'Organización Xero',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections
const styles = useThemeStyles();
const policyID = policy?.id ?? '';
const {exportCompanyCardAccount, exportAccountPayable, autoCreateVendor, errorFields, pendingFields, exportCompanyCard} = policy?.connections?.quickbooksOnline?.config ?? {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB: I don't think exportCompanyCardAccount, exportAccountPayable or exportCompanyCard really exists in the backend

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these were also added by Nikolay in another PR 😨

const isVendorSelected = exportCompanyCard === CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.VENDOR_BILL;
const isVendorSelected = exportCompanyCard === CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL;
return (
<AccessOrNotFoundWrapper
policyID={policyID}
Expand All @@ -37,7 +37,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections
<Text style={[styles.ph5, styles.pb5]}>{translate('workspace.qbo.exportCompanyCardsDescription')}</Text>
<OfflineWithFeedback pendingAction={pendingFields?.exportCompanyCard}>
<MenuItemWithTopDescription
title={exportCompanyCard ? translate(`workspace.qbo.${exportCompanyCard}`) : undefined}
title={exportCompanyCard ? translate(`workspace.qbo.accounts.${exportCompanyCard}`) : undefined}
description={translate('workspace.qbo.exportCompany')}
error={errorFields?.exportCompanyCard ? translate('common.genericErrorMessage') : undefined}
onPress={() => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_SELECT.getRoute(policyID))}
Expand All @@ -46,7 +46,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections
/>
</OfflineWithFeedback>
{!!exportCompanyCard && (
<Text style={[styles.ph5, styles.mutedNormalTextLabel, styles.pt1, styles.pb2]}>{translate(`workspace.qbo.${exportCompanyCard}Description`)}</Text>
<Text style={[styles.ph5, styles.mutedNormalTextLabel, styles.pt1, styles.pb2]}>{translate(`workspace.qbo.accounts.${exportCompanyCard}Description`)}</Text>
)}
{isVendorSelected && (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';

type CardListItem = ListItem & {
value: ValueOf<typeof CONST.QUICKBOOKS_EXPORT_COMPANY_CARD>;
value: ValueOf<typeof CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE>;
};
type CardsSection = SectionListData<CardListItem, Section<CardListItem>>;
type Card = {name: string; id: ValueOf<typeof CONST.QUICKBOOKS_EXPORT_COMPANY_CARD>};
type Card = {name: string; id: ValueOf<typeof CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE>};

function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyConnectionsProps) {
const {translate} = useLocalize();
Expand All @@ -34,16 +34,16 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC
const defaultCards = useMemo<Card[]>(
() => [
{
name: translate(`workspace.qbo.creditCard`),
id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.CREDIT_CARD,
name: translate(`workspace.qbo.accounts.credit_card`),
id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD,
},
{
name: translate(`workspace.qbo.debitCard`),
id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.DEBIT_CARD,
name: translate(`workspace.qbo.accounts.debit_card`),
id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD,
},
{
name: translate(`workspace.qbo.vendorBill`),
id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD.VENDOR_BILL,
name: translate(`workspace.qbo.accounts.bill`),
id: CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL,
},
],
[translate],
Expand Down
Loading
Loading