Allow admins to apply rule changes to existing unsubmitted expenses - #80851
Conversation
…ed expenses Add a new "Apply to existing unsubmitted expenses" toggle to the merchant rule form footer. When enabled, this passes shouldUpdateMatchingTransactions as true to SetPolicyCodingRule, triggering backend logic to update matching draft transactions with the new rule values. Changes: - Add Switch component to MerchantRulePageBase footer - Add shouldUpdateMatchingTransactions state - Pass toggle value to setPolicyCodingRule on submit - Add translations for all supported languages
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index 5eedf252..d1b260c8 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -6409,7 +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 bestehende nicht eingereichte Ausgaben anwenden',
+ applyToExistingUnsubmittedExpenses: 'Auf bereits vorhandene, noch nicht eingereichte Ausgaben anwenden',
},
},
planTypePage: {
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index c3fc3d7d..79df7374 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -6420,7 +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 existantes non soumises',
+ applyToExistingUnsubmittedExpenses: 'Appliquer aux dépenses non soumises existantes',
},
},
planTypePage: {
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 947e22df..ba5cce63 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -6346,7 +6346,7 @@ ${reportName}
matchTypeContains: '含む',
matchTypeExact: '完全一致',
expensesExactlyMatching: '以下と完全一致する経費について:',
- applyToExistingUnsubmittedExpenses: '既存の未提出経費に適用する',
+ applyToExistingUnsubmittedExpenses: '既存の未提出経費に適用',
},
},
planTypePage: {
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 556ee4bc..84c8b979 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -6379,7 +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 uitgaven',
+ applyToExistingUnsubmittedExpenses: 'Toepassen op bestaande niet-ingediende onkosten',
},
},
planTypePage: {
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index eb7d9c24..2f5e9e11 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -6371,7 +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 niezgłoszonych wydatków',
+ applyToExistingUnsubmittedExpenses: 'Zastosuj do istniejących niewysłanych wydatków',
},
},
planTypePage: {
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 97e9501c..a65b47d1 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -6371,7 +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 a despesas existentes não enviadas',
+ applyToExistingUnsubmittedExpenses: 'Aplicar às despesas não enviadas existentes',
},
},
planTypePage: {
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 4fccf70c..86a0fff7 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -6236,7 +6236,7 @@ ${reportName}
matchTypeContains: '包含',
matchTypeExact: '完全匹配',
expensesExactlyMatching: '对于完全匹配以下条件的报销:',
- applyToExistingUnsubmittedExpenses: '应用于现有未提交的费用',
+ applyToExistingUnsubmittedExpenses: '应用到现有的未提交报销费用',
},
},
planTypePage: {
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
|
@DylanDylann @JS00001 One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@situchan note the BE is still not ready for this feature |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safariweb.mov |
|
@situchan I confirmed all of the above with @JmillsExpensify and what we currently have is expected, i.e.
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.3.11-16 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.3.12-1 🚀
|


Explanation of Change
Add a new "Apply to existing unsubmitted expenses" toggle to the merchant rule form footer.
Fixed Issues
$ #80525
Tests
Pre-condition: rules are enabled in the workspace
Workspace > Rules > MerchantAdd merchant ruleApply to existing unsubmitted expensestoggleSetPolicyCodingRuleAPI command withshouldUpdateMatchingTransactionsastrueOffline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Screen.Recording.2026-01-28.at.8.56.44.PM.mov
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari