Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3083,7 +3083,7 @@ const ROUTES = {
},
POLICY_ACCOUNTING_SAGE_INTACCT_MAPPINGS_TYPE: {
route: 'workspaces/:policyID/accounting/sage-intacct/import/mapping-type/:mapping',
getRoute: (policyID: string, mapping: string) => `workspaces/${policyID}/accounting/sage-intacct/import/mapping-type/${mapping}` as const,
getRoute: (policyID: string | undefined, mapping: string) => `workspaces/${policyID}/accounting/sage-intacct/import/mapping-type/${mapping}` as const,
},
POLICY_ACCOUNTING_SAGE_INTACCT_IMPORT_TAX: {
route: 'workspaces/:policyID/accounting/sage-intacct/import/tax',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4411,8 +4412,7 @@ ${amount} für ${merchant} - ${date}`,
employeeDefaultDescription: 'Die Standardabteilung des Mitarbeiters wird auf seine Ausgaben in Sage Intacct angewendet, falls eine vorhanden ist.',
displayedAsTagDescription: 'Die Abteilung wird für jede einzelne Ausgabe in einem Bericht eines Mitarbeiters auswählbar sein.',
displayedAsReportFieldDescription: 'Die Abteilungsauswahl gilt für alle Ausgaben im Bericht eines Mitarbeiters.',
toggleImportTitleFirstPart: 'Wählen Sie, wie Sage Intacct behandelt werden soll',
toggleImportTitleSecondPart: 'in Expensify.',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `Wählen Sie, wie Sage Intacct behandelt werden soll <strong>${mappingTitle}</strong> in Expensify.`,
expenseTypes: 'Ausgabenarten',
expenseTypesDescription: 'Ihre Sage Intacct-Ausgabenarten werden in Expensify als Kategorien importiert.',
accountTypesDescription: 'Ihr Sage Intacct-Kontenplan wird in Expensify als Kategorien importiert.',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4383,8 +4384,7 @@ const translations = {
employeeDefaultDescription: "The employee's default department will be applied to their expenses in Sage Intacct if one exists.",
displayedAsTagDescription: "Department will be selectable for each individual expense on an employee's report.",
displayedAsReportFieldDescription: "Department selection will apply to all expenses on an employee's report.",
toggleImportTitleFirstPart: 'Choose how to handle Sage Intacct ',
toggleImportTitleSecondPart: ' in Expensify.',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `Choose how to handle Sage Intacct <strong>${mappingTitle}</strong> in Expensify.`,
expenseTypes: 'Expense types',
expenseTypesDescription: 'Your Sage Intacct expense types will import into Expensify as categories.',
accountTypesDescription: 'Your Sage Intacct chart of accounts will import into Expensify as categories.',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4395,8 +4396,7 @@ ${amount} para ${merchant} - ${date}`,
employeeDefaultDescription: 'El departamento por defecto del empleado se aplicará a sus gastos en Sage Intacct si existe.',
displayedAsTagDescription: 'Se podrá seleccionar el departamento para cada gasto individual en el informe de un empleado.',
displayedAsReportFieldDescription: 'La selección de departamento se aplicará a todos los gastos que figuren en el informe de un empleado.',
toggleImportTitleFirstPart: 'Elija cómo gestionar Sage Intacct ',
toggleImportTitleSecondPart: ' en Expensify.',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `Elija cómo gestionar Sage Intacct <strong>${mappingTitle}</strong> en Expensify.`,
expenseTypes: 'Tipos de gastos',
expenseTypesDescription: 'Los tipos de gastos de Sage Intacct se importan a Expensify como categorías.',
accountTypesDescription: 'Su plan de cuentas de Sage Intacct se importará a Expensify como categorías.',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4415,8 +4416,7 @@ ${amount} pour ${merchant} - ${date}`,
employeeDefaultDescription: "Le département par défaut de l'employé sera appliqué à ses dépenses dans Sage Intacct si un existe.",
displayedAsTagDescription: "Le département sera sélectionnable pour chaque dépense individuelle sur le rapport d'un employé.",
displayedAsReportFieldDescription: "La sélection du département s'appliquera à toutes les dépenses sur le rapport d'un employé.",
toggleImportTitleFirstPart: 'Choisissez comment gérer Sage Intacct',
toggleImportTitleSecondPart: 'dans Expensify.',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `Choisissez comment gérer Sage Intacct <strong>${mappingTitle}</strong> dans Expensify.`,
expenseTypes: 'Types de dépenses',
expenseTypesDescription: 'Vos types de dépenses Sage Intacct seront importés dans Expensify en tant que catégories.',
accountTypesDescription: 'Votre plan comptable Sage Intacct sera importé dans Expensify en tant que catégories.',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4423,8 +4424,7 @@ ${amount} per ${merchant} - ${date}`,
employeeDefaultDescription: 'Il dipartimento predefinito del dipendente verrà applicato alle sue spese in Sage Intacct, se esiste.',
displayedAsTagDescription: 'Il dipartimento sarà selezionabile per ogni singola spesa nel rapporto di un dipendente.',
displayedAsReportFieldDescription: 'La selezione del dipartimento verrà applicata a tutte le spese nel rapporto di un dipendente.',
toggleImportTitleFirstPart: 'Scegli come gestire Sage Intacct',
toggleImportTitleSecondPart: 'in Expensify.',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `Scegli come gestire Sage Intacct <strong>${mappingTitle}</strong> in Expensify.`,
expenseTypes: 'Tipi di spesa',
expenseTypesDescription: 'I tuoi tipi di spesa Sage Intacct verranno importati in Expensify come categorie.',
accountTypesDescription: 'Il tuo piano dei conti di Sage Intacct verrà importato in Expensify come categorie.',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4386,8 +4387,7 @@ ${date} - ${merchant}に${amount}`,
employeeDefaultDescription: '従業員のデフォルト部門は、Sage Intacct に存在する場合、その経費に適用されます。',
displayedAsTagDescription: '部門は、従業員のレポートの各経費ごとに選択可能になります。',
displayedAsReportFieldDescription: '部門の選択は、従業員のレポート上のすべての経費に適用されます。',
toggleImportTitleFirstPart: 'Sage Intacctの処理方法を選択',
toggleImportTitleSecondPart: 'in Expensify.',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `Sage Intacct <strong>${mappingTitle}</strong>をExpensifyでどのように処理するかを選択します。`,
expenseTypes: '経費タイプ',
expenseTypesDescription: 'あなたのSage Intacctの経費タイプは、Expensifyにカテゴリーとしてインポートされます。',
accountTypesDescription: 'あなたのSage Intacct勘定科目表は、Expensifyにカテゴリとしてインポートされます。',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4421,8 +4422,7 @@ ${amount} voor ${merchant} - ${date}`,
employeeDefaultDescription: 'De standaardafdeling van de werknemer wordt toegepast op hun uitgaven in Sage Intacct indien deze bestaat.',
displayedAsTagDescription: 'Afdeling zal selecteerbaar zijn voor elke individuele uitgave op het rapport van een werknemer.',
displayedAsReportFieldDescription: 'Afdelingsselectie zal van toepassing zijn op alle uitgaven in het rapport van een werknemer.',
toggleImportTitleFirstPart: 'Kies hoe Sage Intacct te beheren',
toggleImportTitleSecondPart: 'in Expensify.',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `Kies hoe Sage Intacct <strong>${mappingTitle}</strong> in Expensify te beheren.`,
expenseTypes: 'Uitgavensoorten',
expenseTypesDescription: 'Uw Sage Intacct-uitgavensoorten worden in Expensify geïmporteerd als categorieën.',
accountTypesDescription: 'Uw Sage Intacct-rekeningschema wordt in Expensify geïmporteerd als categorieën.',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -943,12 +943,17 @@ type MergeAccountIntoParams = {
login: string;
};

type ToggleImportTitleParams = {
mappingTitle: string;
};

type FocusModeUpdateParams = {
priorityModePageUrl: string;
};

export type {
SettlementAccountReconciliationParams,
ToggleImportTitleParams,
ContactMethodsRouteParams,
ContactMethodParams,
SplitExpenseEditTitleParams,
Expand Down
5 changes: 3 additions & 2 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4409,8 +4410,8 @@ ${amount} dla ${merchant} - ${date}`,
employeeDefaultDescription: 'Domyślny dział pracownika zostanie zastosowany do jego wydatków w Sage Intacct, jeśli taki istnieje.',
displayedAsTagDescription: 'Dział będzie można wybrać dla każdego indywidualnego wydatku w raporcie pracownika.',
displayedAsReportFieldDescription: 'Wybór działu będzie dotyczył wszystkich wydatków w raporcie pracownika.',
toggleImportTitleFirstPart: 'Wybierz, jak obsługiwać Sage Intacct',
toggleImportTitleSecondPart: 'w Expensify.',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `Wybierz, jak obsługiwać Sage Intacct <strong>${mappingTitle}</strong> w Expensify.`,

expenseTypes: 'Typy wydatków',
expenseTypesDescription: 'Twoje typy wydatków Sage Intacct zostaną zaimportowane do Expensify jako kategorie.',
accountTypesDescription: 'Twój plan kont Sage Intacct zostanie zaimportowany do Expensify jako kategorie.',
Expand Down
5 changes: 3 additions & 2 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4409,8 +4410,8 @@ ${amount} para ${merchant} - ${date}`,
employeeDefaultDescription: 'O departamento padrão do funcionário será aplicado às suas despesas no Sage Intacct, se existir.',
displayedAsTagDescription: 'O departamento será selecionável para cada despesa individual no relatório de um funcionário.',
displayedAsReportFieldDescription: 'A seleção de departamento será aplicada a todas as despesas no relatório de um funcionário.',
toggleImportTitleFirstPart: 'Escolha como lidar com o Sage Intacct',
toggleImportTitleSecondPart: 'in Expensify.',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `Escolha como lidar com o Sage Intacct <strong>${mappingTitle}</strong> in Expensify.`,

expenseTypes: 'Tipos de despesas',
expenseTypesDescription: 'Seus tipos de despesas do Sage Intacct serão importados para o Expensify como categorias.',
accountTypesDescription: 'Seu plano de contas do Sage Intacct será importado para o Expensify como categorias.',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import type {
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToggleImportTitleParams,
TotalAmountGreaterOrLessThanOriginalParams,
ToValidateLoginParams,
TransferParams,
Expand Down Expand Up @@ -4333,8 +4334,7 @@ ${merchant}的${amount} - ${date}`,
employeeDefaultDescription: '如果存在,员工的默认部门将应用于他们在 Sage Intacct 中的费用。',
displayedAsTagDescription: '部门将可在员工报告的每一笔费用中选择。',
displayedAsReportFieldDescription: '部门选择将适用于员工报告中的所有费用。',
toggleImportTitleFirstPart: '选择如何处理 Sage Intacct',
toggleImportTitleSecondPart: '在Expensify中。',
toggleImportTitle: ({mappingTitle}: ToggleImportTitleParams) => `选择如何处理 Sage Intacct <strong>${mappingTitle}</strong> 在Expensify中。`,
expenseTypes: '费用类型',
expenseTypesDescription: '您的 Sage Intacct 费用类型将作为类别导入到 Expensify。',
accountTypesDescription: '您的 Sage Intacct 科目表将作为类别导入到 Expensify 中。',
Expand Down
5 changes: 4 additions & 1 deletion src/libs/actions/connections/SageIntacct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ function getCommandForMapping(mappingName: ValueOf<typeof CONST.SAGE_INTACCT_CON
}
}

function updateSageIntacctMappingValue(policyID: string, mappingName: SageIntacctMappingName, mappingValue: SageIntacctMappingValue, oldMappingValue?: SageIntacctMappingValue) {
function updateSageIntacctMappingValue(policyID: string | undefined, mappingName: SageIntacctMappingName, mappingValue: SageIntacctMappingValue, oldMappingValue?: SageIntacctMappingValue) {
if (!policyID) {
return;
}
const command = getCommandForMapping(mappingName);
if (!command) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import Accordion from '@components/Accordion';
import ConnectionLayout from '@components/ConnectionLayout';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import RenderHTML from '@components/RenderHTML';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import usePolicy from '@hooks/usePolicy';
import useThemeStyles from '@hooks/useThemeStyles';
import {clearSageIntacctErrorField, updateSageIntacctMappingValue} from '@libs/actions/connections/SageIntacct';
import * as ErrorUtils from '@libs/ErrorUtils';
import {getLatestErrorField} from '@libs/ErrorUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
Expand Down Expand Up @@ -52,7 +53,7 @@ function SageIntacctToggleMappingsPage({route}: SageIntacctToggleMappingsPagePro

const policy = usePolicy(route.params.policyID);
const mappingName: SageIntacctMappingName = route.params.mapping;
const policyID: string = policy?.id ?? '-1';
const policyID = policy?.id;
const config = policy?.connections?.intacct?.config;
const isImportMappingEnable = config?.mappings?.[mappingName] !== CONST.SAGE_INTACCT_MAPPING_VALUE.NONE;
const isAccordionExpanded = useSharedValue(isImportMappingEnable);
Expand Down Expand Up @@ -83,9 +84,11 @@ function SageIntacctToggleMappingsPage({route}: SageIntacctToggleMappingsPagePro
onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_IMPORT.getRoute(policyID))}
>
<Text style={[styles.flexRow, styles.alignItemsCenter, styles.w100, styles.mb5, styles.ph5]}>
<Text style={[styles.textNormal]}>{translate('workspace.intacct.toggleImportTitleFirstPart')}</Text>
<Text style={[styles.textStrong]}>{translate('workspace.intacct.mappingTitle', {mappingName})}</Text>
<Text style={[styles.textNormal]}>{translate('workspace.intacct.toggleImportTitleSecondPart')}</Text>
<RenderHTML
html={translate('workspace.intacct.toggleImportTitle', {
mappingTitle: translate('workspace.intacct.mappingTitle', {mappingName}),
})}
/>
</Text>
<ToggleSettingOptionRow
title={translate('workspace.accounting.import')}
Expand All @@ -100,7 +103,7 @@ function SageIntacctToggleMappingsPage({route}: SageIntacctToggleMappingsPagePro
shouldAnimateAccordionSection.set(true);
}}
pendingAction={settingsPendingAction([mappingName], config?.pendingFields)}
errors={ErrorUtils.getLatestErrorField(config ?? {}, mappingName)}
errors={getLatestErrorField(config ?? {}, mappingName)}
onCloseError={() => clearSageIntacctErrorField(policyID, mappingName)}
/>
<Accordion
Expand Down