Repository navigation
feat: Allow admins to merge approved reports - #102712
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@garrettmknight Could you please trigger this? #102712 (comment) |
This comment has been minimized.
This comment has been minimized.
|
@dmkt9 I updated the OP of #100399 to add a report field check (see Scope #5). Right now Please add this check to the PR. If any report field value differs across the selected reports, block the merge and show this error:
Use this one error for every case. Skip formula fields in the comparison, since nobody can edit them. |
|
This is on hold for BE implementation, right? |
🦜 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 0605eb12..acafb1c9 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -10157,8 +10157,8 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
title: 'Berichte zusammenführen',
description: 'Wählen Sie den Bericht aus, der beibehalten werden soll. Alle Ausgaben werden in ihn verschoben und die anderen Berichte werden gelöscht.',
exportedWarning:
- 'Mindestens einer der ausgewählten Berichte wurde bereits in eine Buchhaltungsintegration exportiert. Wenn die Berichte zusammengeführt und erneut exportiert werden, können doppelte Daten entstehen.',
- reportFieldsMismatch: 'Diese Berichte haben unterschiedliche Berichtsfeldwerte. Um sie zusammenzuführen, gleiche zuerst die Berichtsfelder in allen Berichten an.',
+ 'Ein oder mehrere ausgewählte Berichte wurden bereits an eine Buchhaltungsintegration exportiert. Das Zusammenführen kann zu doppelten Daten führen, wenn sie erneut exportiert werden.',
+ reportFieldsMismatch: 'Diese Berichte haben unterschiedliche Berichtsfeldwerte. Um sie zusammenzuführen, passen Sie zuerst die Berichtsfelder in jedem Bericht aneinander an.',
},
periodSoFar: ({period}: {period: string}) => `${period} bisher`,
weekOf: ({date}: {date: string}) => `Woche vom ${date}`,
diff --git a/src/languages/el.ts b/src/languages/el.ts
index ee0a01f9..f76ea9ed 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -10348,8 +10348,8 @@ ${reportName}`,
title: 'Συγχώνευση αναφορών',
description: 'Επιλέξτε την αναφορά που θέλετε να κρατήσετε. Όλες οι δαπάνες θα μετακινηθούν σε αυτήν και οι άλλες αναφορές θα διαγραφούν.',
exportedWarning:
- 'Μία ή περισσότερες επιλεγμένες αναφορές έχουν ήδη εξαχθεί σε μια λογιστική ενσωμάτωση. Η συγχώνευσή τους μπορεί να προκαλέσει διπλότυπα δεδομένα αν εξαχθούν ξανά.',
- reportFieldsMismatch: 'Αυτές οι αναφορές έχουν διαφορετικές τιμές στα πεδία αναφοράς. Για να τις συγχωνεύσετε, αντιστοιχίστε πρώτα τις τιμές των πεδίων σε κάθε αναφορά.',
+ 'Μία ή περισσότερες από τις επιλεγμένες αναφορές έχουν ήδη εξαχθεί σε μια λογιστική διασύνδεση. Η συγχώνευσή τους μπορεί να προκαλέσει διπλά δεδομένα αν εξαχθούν ξανά.',
+ reportFieldsMismatch: 'Αυτές οι αναφορές έχουν διαφορετικές τιμές στα πεδία αναφοράς. Για να τις συγχωνεύσετε, κάντε πρώτα τα πεδία αναφοράς να ταιριάζουν σε κάθε αναφορά.',
},
goTo: ({destination}: {destination: string}) => `Μετάβαση στο ${destination}`,
mySavedSearch: 'Οι δαπάνες μου',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 784afd27..f53d9cc3 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -9975,7 +9975,7 @@ ${reportName}`,
title: 'Combinar informes',
description: 'Selecciona el informe que quieres conservar. Todos los gastos se moverán a él y los demás informes se eliminarán.',
exportedWarning: 'Uno o más informes seleccionados ya se han exportado a una integración contable. Combinarlos puede causar datos duplicados si se vuelven a exportar.',
- reportFieldsMismatch: 'Estos informes tienen valores de campos de informe diferentes. Para combinarlos, primero haz que los campos coincidan en cada informe.',
+ reportFieldsMismatch: 'Estos informes tienen diferentes valores en los campos del informe. Para combinarlos, haz que los campos del informe coincidan en cada informe primero.',
},
periodSoFar: ({period}: {period: string}) => `${period} hasta ahora`,
weekOf: ({date}: {date: string}) => `Semana del ${date}`,
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index e98244da..88a0dd99 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -10181,8 +10181,9 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
title: 'Fusionner des notes de frais',
description: 'Sélectionnez la note de frais à conserver. Toutes les dépenses y seront déplacées et les autres notes de frais seront supprimées.',
exportedWarning:
- 'Une ou plusieurs notes de frais sélectionnées ont déjà été exportées vers une intégration comptable. Les fusionner peut créer des données en double si elles sont exportées à nouveau.',
- reportFieldsMismatch: 'Ces notes de frais ont des valeurs de champs différentes. Pour les fusionner, commencez par faire correspondre les champs de chaque note de frais.',
+ 'Une ou plusieurs notes de frais sélectionnées ont déjà été exportées vers une intégration comptable. Les fusionner peut entraîner des doublons si elles sont exportées de nouveau.',
+ reportFieldsMismatch:
+ 'Ces notes de frais ont des valeurs de champ de note de frais différentes. Pour les fusionner, faites d’abord correspondre les champs de note de frais sur chaque note de frais.',
},
periodSoFar: ({period}: {period: string}) => `${period} jusqu’à présent`,
weekOf: ({date}: {date: string}) => `Semaine du ${date}`,
diff --git a/src/languages/it.ts b/src/languages/it.ts
index a07391f2..a14f2188 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -10109,8 +10109,8 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
mergeReports: {
title: 'Unisci report',
description: 'Seleziona il report da mantenere. Tutte le spese verranno spostate al suo interno e gli altri report verranno eliminati.',
- exportedWarning: 'Uno o più report selezionati sono già stati esportati in un’integrazione contabile. Unirli potrebbe causare dati duplicati se vengono esportati di nuovo.',
- reportFieldsMismatch: 'Questi report hanno valori dei campi diversi. Per unirli, fai prima in modo che i campi corrispondano in ogni report.',
+ exportedWarning: 'Uno o più report selezionati sono già stati esportati in un’integrazione contabile. Fonderli potrebbe causare dati duplicati se vengono esportati di nuovo.',
+ reportFieldsMismatch: 'Questi report hanno valori diversi nei campi del report. Per unirli, prima fai in modo che i campi del report coincidano in ogni report.',
},
periodSoFar: ({period}: {period: string}) => `${period} finora`,
weekOf: ({date}: {date: string}) => `Settimana del ${date}`,
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 153d4f1d..e890f427 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -9959,8 +9959,8 @@ ${reportName}`,
mergeReports: {
title: 'レポートをマージする',
description: '保持するレポートを選択してください。すべての経費はそのレポートに移動され、他のレポートは削除されます。',
- exportedWarning: '選択したレポートのうち1つ以上は、すでに会計連携にエクスポートされています。マージ後に再度エクスポートすると、データが重複する可能性があります。',
- reportFieldsMismatch: 'これらのレポートではレポートフィールドの値が異なります。マージするには、まず各レポートのレポートフィールドを一致させてください。',
+ exportedWarning: '選択したレポートのうち1件以上は、すでに会計連携へエクスポートされています。これらをマージすると、再度エクスポートした際にデータが重複する可能性があります。',
+ reportFieldsMismatch: 'これらのレポートには異なるレポートフィールドの値があります。レポートをマージするには、まず各レポートのレポートフィールドを同じ値にそろえてください。',
},
periodSoFar: ({period}: {period: string}) => `これまでの${period}`,
weekOf: ({date}: {date: string}) => `${date} の週`,
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 7fb21d4a..fe0b884a 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -10077,8 +10077,9 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
title: 'Rapporten samenvoegen',
description: 'Selecteer het rapport dat je wilt behouden. Alle uitgaven worden daarheen verplaatst en de andere rapporten worden verwijderd.',
exportedWarning:
- 'Een of meer geselecteerde rapporten zijn al geëxporteerd naar een boekhoudintegratie. Als je ze samenvoegt en opnieuw exporteert, kunnen dubbele gegevens ontstaan.',
- reportFieldsMismatch: 'Deze rapporten hebben verschillende rapportveldwaarden. Maak eerst de rapportvelden in elk rapport gelijk om ze samen te voegen.',
+ 'Een of meer geselecteerde rapporten zijn al geëxporteerd naar een boekhoudintegratie. Deze samenvoegen kan dubbele gegevens veroorzaken als ze opnieuw worden geëxporteerd.',
+ reportFieldsMismatch:
+ 'Deze rapporten hebben verschillende waarden voor rapportvelden. Om ze te combineren, zorg je er eerst voor dat de rapportvelden in elk rapport overeenkomen.',
},
periodSoFar: ({period}: {period: string}) => `${period} tot nu toe`,
weekOf: ({date}: {date: string}) => `Week van ${date}`,
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 04a57835..66713bc8 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -10092,8 +10092,8 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
title: 'Połącz raporty',
description: 'Wybierz raport, który chcesz zachować. Wszystkie wydatki zostaną do niego przeniesione, a pozostałe raporty zostaną usunięte.',
exportedWarning:
- 'Co najmniej jeden z wybranych raportów został już wyeksportowany do integracji księgowej. Scalenie raportów może spowodować duplikację danych, jeśli zostaną ponownie wyeksportowane.',
- reportFieldsMismatch: 'Te raporty mają różne wartości pól raportu. Aby je scalić, najpierw ustaw takie same wartości pól w każdym raporcie.',
+ 'Co najmniej jeden z wybranych raportów został już wyeksportowany do integracji księgowej. Połączenie ich może spowodować zduplikowanie danych, jeśli zostaną wyeksportowane ponownie.',
+ reportFieldsMismatch: 'Te raporty mają różne wartości pól raportu. Żeby je scalić, najpierw ustaw identyczne pola raportu w każdym raporcie.',
},
periodSoFar: ({period}: {period: string}) => `${period} do tej pory`,
weekOf: ({date}: {date: string}) => `Tydzień od ${date}`,
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index f3181fa8..6aea65e1 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -10074,8 +10074,9 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
mergeReports: {
title: 'Mesclar relatórios',
description: 'Selecione o relatório que você quer manter. Todas as despesas serão movidas para ele e os outros relatórios serão excluídos.',
- exportedWarning: 'Um ou mais relatórios selecionados já foram exportados para uma integração contábil. Mesclá-los pode causar dados duplicados se forem exportados novamente.',
- reportFieldsMismatch: 'Estes relatórios têm valores de campos de relatório diferentes. Para mesclá-los, primeiro faça os campos corresponderem em cada relatório.',
+ exportedWarning: 'Um ou mais relatórios selecionados já foram exportados para uma integração contábil. Unificá-los pode causar dados duplicados se forem exportados novamente.',
+ reportFieldsMismatch:
+ 'Esses relatórios têm valores diferentes nos campos do relatório. Para mesclá-los, faça com que os campos do relatório correspondam em cada relatório primeiro.',
},
periodSoFar: ({period}: {period: string}) => `${period} até agora`,
weekOf: ({date}: {date: string}) => `Semana de ${date}`,
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 0a492b99..6031465b 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -9695,8 +9695,8 @@ ${reportName}`,
mergeReports: {
title: '合并报表',
description: '选择要保留的报表。所有费用都将移入该报表,其他报表将被删除。',
- exportedWarning: '一个或多个选定报表已导出到会计集成。如果再次导出,合并这些报表可能会导致重复数据。',
- reportFieldsMismatch: '这些报表的报表字段值不同。要合并它们,请先使每个报表中的报表字段保持一致。',
+ exportedWarning: '一个或多个选中的报表已导出到会计集成中。如果再次导出,合并它们可能会导致数据重复。',
+ reportFieldsMismatch: '这些报表包含不同的报表字段值。要合并它们,请先让每个报表中的报表字段保持一致。',
},
periodSoFar: ({period}: {period: string}) => `目前 ${period}`,
weekOf: ({date}: {date: string}) => `${date} 当周`,
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
|
@situchan This PR is ready for review. The ts failure is unrelated to our changes |
|
@situchan Thanks! I've updated this PR. Could you take another look when you get a chance? |
ReviewAll earlier review feedback is addressed, and I found no blocking bugs at 1. Please confirm: the report field check passes when field values haven't loaded
The merge page takes Possible failure: you select two reports you haven't opened in this session. One is saved with "A" and the other with "B". If neither has Ask: confirm that Search results include 2. Open question: backend support for Approved merges
3. Optional: the optimistic next step can show the wrong text on Approved destinations
Example: you merge reimbursable expenses into an Approved report that has only card expenses. The next step shows "No further action" instead of "Waiting to pay" until the server responds. Only Approved destinations hit this path. To fix it, copy the updated reimbursable totals into Earlier feedback that is now addressed
|
Regression checkI found one regression at Text fields that differ only by spaces block the merge, and the user can't fix it
Example: Report A has the field set to "Project X " with a trailing space, and report B has "Project X".
Fix: Trim text values before comparing them in Other cases I checked that are not regressions
|
|
Please check #102712 (comment) |
|
@dmkt9 thoughts on #102712 (comment)? |
|
Thanks. Resolved |
|
dang another merge conflict :/ |
Thanks. Resolved |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.5.28-4 🚀
|
|
No help site update needed. The Merge reports bulk action is only shown when the |
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.5.30-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.5.30-0 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Allows workspace admins to merge expense reports that are already in the
Approvedstate while preserving the existing merge constraints (same submitter, workspace, state, manager, and write access). Paid/reimbursed and Closed reports remain ineligible.The merge RHP also shows an informational heads-up when any selected report is already exported or has an export pending. Export state is resolved from both live Onyx data and the current Search snapshot so the warning still works when report actions have not been hydrated yet. The warning does not disable Confirm.
Fixed Issues
$ #100399
PROPOSAL:
Tests
managerID, and move both reports toApproved.Approvedand payable, while the source report is removed after the merge completes.Offline tests
Same as the Tests
QA Steps
Same as the Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
chrome.mp4
chrome-report-field.mp4