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
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6409,6 +6409,7 @@ Fordere Spesendetails wie Belege und Beschreibungen an, lege Limits und Standard
matchTypeContains: 'Enthält',
matchTypeExact: 'Exakte Übereinstimmung',
expensesExactlyMatching: 'Für Ausgaben mit genau folgender Übereinstimmung:',
applyToExistingUnsubmittedExpenses: 'Auf bereits vorhandene, noch nicht eingereichte Ausgaben anwenden',
},
},
planTypePage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6265,6 +6265,7 @@ const translations = {
matchType: 'Match type',
matchTypeContains: 'Contains',
matchTypeExact: 'Exactly matches',
applyToExistingUnsubmittedExpenses: 'Apply to existing unsubmitted expenses',
},
categoryRules: {
title: 'Category rules',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6044,6 +6044,7 @@ ${amount} para ${merchant} - ${date}`,
matchType: 'Tipo de coincidencia',
matchTypeContains: 'Contiene',
matchTypeExact: 'Coincide exactamente',
applyToExistingUnsubmittedExpenses: 'Aplicar a gastos existentes no enviados',
},
categoryRules: {
title: 'Reglas de categoría',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6420,6 +6420,7 @@ Exigez des informations de dépense comme les reçus et les descriptions, défin
matchTypeContains: 'Contient',
matchTypeExact: 'Correspond exactement',
expensesExactlyMatching: 'Pour les dépenses correspondant exactement :',
applyToExistingUnsubmittedExpenses: 'Appliquer aux dépenses non soumises existantes',
},
},
planTypePage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6391,6 +6391,7 @@ Richiedi dettagli di spesa come ricevute e descrizioni, imposta limiti e valori
matchTypeContains: 'Contiene',
matchTypeExact: 'Corrisponde esattamente',
expensesExactlyMatching: 'Per le spese che corrispondono esattamente:',
applyToExistingUnsubmittedExpenses: 'Applica alle spese esistenti non inviate',
},
},
planTypePage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6346,6 +6346,7 @@ ${reportName}
matchTypeContains: '含む',
matchTypeExact: '完全一致',
expensesExactlyMatching: '以下と完全一致する経費について:',
applyToExistingUnsubmittedExpenses: '既存の未提出経費に適用',
},
},
planTypePage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6379,6 +6379,7 @@ Vraag verplichte uitgavedetails zoals bonnetjes en beschrijvingen, stel limieten
matchTypeContains: 'Bevat',
matchTypeExact: 'Komt exact overeen',
expensesExactlyMatching: 'Voor uitgaven die exact overeenkomen met:',
applyToExistingUnsubmittedExpenses: 'Toepassen op bestaande niet-ingediende onkosten',
},
},
planTypePage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6371,6 +6371,7 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
matchTypeContains: 'Zawiera',
matchTypeExact: 'Dokładne dopasowanie',
expensesExactlyMatching: 'Dla wydatków dokładnie pasujących:',
applyToExistingUnsubmittedExpenses: 'Zastosuj do istniejących niewysłanych wydatków',
},
},
planTypePage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6371,6 +6371,7 @@ Exija detalhes de despesas como recibos e descrições, defina limites e padrõe
matchTypeContains: 'Contém',
matchTypeExact: 'Corresponde exatamente',
expensesExactlyMatching: 'Para despesas que correspondem exatamente:',
applyToExistingUnsubmittedExpenses: 'Aplicar às despesas não enviadas existentes',
},
},
planTypePage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6236,6 +6236,7 @@ ${reportName}
matchTypeContains: '包含',
matchTypeExact: '完全匹配',
expensesExactlyMatching: '对于完全匹配以下条件的报销:',
applyToExistingUnsubmittedExpenses: '应用到现有的未提交报销费用',
},
},
planTypePage: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {LocalizedTranslate} from '@components/LocaleContextProvider';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import Switch from '@components/Switch';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
Expand Down Expand Up @@ -87,6 +88,7 @@ function MerchantRulePageBase({policyID, ruleID, titleKey, testID}: MerchantRule
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`, {canBeMissing: true});
const [shouldShowError, setShouldShowError] = useState(false);
const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false);
Comment thread
luacmartins marked this conversation as resolved.
const [shouldUpdateMatchingTransactions, setShouldUpdateMatchingTransactions] = useState(false);
Comment thread
luacmartins marked this conversation as resolved.

// Get the existing rule from the policy (for edit mode)
const existingRule = ruleID ? policy?.rules?.codingRules?.[ruleID] : undefined;
Expand Down Expand Up @@ -160,7 +162,7 @@ function MerchantRulePageBase({policyID, ruleID, titleKey, testID}: MerchantRule
return;
}

setPolicyCodingRule(policyID, form, policy, ruleID, false);
setPolicyCodingRule(policyID, form, policy, ruleID, shouldUpdateMatchingTransactions);
Navigation.goBack();
};

Expand Down Expand Up @@ -283,14 +285,24 @@ function MerchantRulePageBase({policyID, ruleID, titleKey, testID}: MerchantRule
enabledWhenOffline
shouldRenderFooterAboveSubmit
footerContent={
isEditing ? (
<Button
text={translate('workspace.rules.merchantRules.deleteRule')}
onPress={() => setIsDeleteModalVisible(true)}
style={[styles.mb4]}
large
/>
) : null
<>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.justifyContentBetween, styles.mb4]}>
<Text style={[styles.textNormal]}>{translate('workspace.rules.merchantRules.applyToExistingUnsubmittedExpenses')}</Text>
<Switch
accessibilityLabel={translate('workspace.rules.merchantRules.applyToExistingUnsubmittedExpenses')}
isOn={shouldUpdateMatchingTransactions}
onToggle={setShouldUpdateMatchingTransactions}
/>
</View>
{isEditing && (
<Button
text={translate('workspace.rules.merchantRules.deleteRule')}
onPress={() => setIsDeleteModalVisible(true)}
style={[styles.mb4]}
large
/>
)}
</>
}
/>
{isEditing && (
Expand Down
Loading