Skip to content

Commit 91f5892

Browse files
authored
Merge pull request Expensify#66899 from parasharrajat/parasharrajat/change-approver
[Change Approver] Add support to bypass approver on an expense report
2 parents 8e961ef + e5757a2 commit 91f5892

34 files changed

Lines changed: 601 additions & 4 deletions

src/CONST/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ const CONST = {
10831083
HOLD: 'hold',
10841084
DOWNLOAD_PDF: 'downloadPDF',
10851085
CHANGE_WORKSPACE: 'changeWorkspace',
1086+
CHANGE_APPROVER: 'changeApprover',
10861087
VIEW_DETAILS: 'viewDetails',
10871088
DELETE: 'delete',
10881089
RETRACT: 'retract',
@@ -6712,6 +6713,14 @@ const CONST = {
67126713
description: `workspace.upgrade.approvals.description` as const,
67136714
icon: 'AdvancedApprovalsSquare',
67146715
},
6716+
multiApprovalLevels: {
6717+
id: 'multiApprovalLevels' as const,
6718+
alias: 'multi-approval-levels' as const,
6719+
name: 'Multiple approval levels' as const,
6720+
title: `workspace.upgrade.multiApprovalLevels.title` as const,
6721+
description: `workspace.upgrade.multiApprovalLevels.description` as const,
6722+
icon: 'AdvancedApprovalsSquare',
6723+
},
67156724
glCodes: {
67166725
id: 'glCodes' as const,
67176726
alias: 'gl-codes',

src/ROUTES.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,10 @@ const ROUTES = {
509509
route: 'r/:reportID/settings/visibility',
510510
getRoute: (reportID: string, backTo?: string) => getUrlWithBackToParam(`r/${reportID}/settings/visibility` as const, backTo),
511511
},
512+
REPORT_CHANGE_APPROVER: {
513+
route: 'r/:reportID/change-approver',
514+
getRoute: (reportID: string, backTo?: string) => getUrlWithBackToParam(`r/${reportID}/change-approver` as const, backTo),
515+
},
512516
SPLIT_BILL_DETAILS: {
513517
route: 'r/:reportID/split/:reportActionID',
514518
getRoute: (reportID: string | undefined, reportActionID: string, backTo?: string) => {

src/SCREENS.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ const SCREENS = {
228228
DEBUG: 'Debug',
229229
ADD_UNREPORTED_EXPENSE: 'AddUnreportedExpense',
230230
SCHEDULE_CALL: 'ScheduleCall',
231+
REPORT_CHANGE_APPROVER: 'Report_Change_Approver',
231232
MERGE_TRANSACTION: 'MergeTransaction',
232233
},
233234
PUBLIC_CONSOLE_DEBUG: 'Console_Debug',
@@ -767,7 +768,9 @@ const SCREENS = {
767768
BOOK: 'ScheduleCall_Book',
768769
CONFIRMATION: 'ScheduleCall_Confirmation',
769770
},
770-
771+
REPORT_CHANGE_APPROVER: {
772+
ROOT: 'Report_Change_Approver_Root',
773+
},
771774
TEST_TOOLS_MODAL: {
772775
ROOT: 'TestToolsModal_Root',
773776
},

src/components/MoneyReportHeader.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {deleteAppReport, downloadReportPDF, exportReportToCSV, exportReportToPDF
2323
import {queueExportSearchWithTemplate} from '@libs/actions/Search';
2424
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
2525
import getPlatform from '@libs/getPlatform';
26+
import Log from '@libs/Log';
2627
import {getThreadReportIDsForTransactions, getTotalAmountForIOUReportPreviewButton} from '@libs/MoneyRequestReportUtils';
2728
import Navigation, {navigationRef} from '@libs/Navigation/Navigation';
2829
import type {PlatformStackRouteProp} from '@libs/Navigation/PlatformStackNavigation/types';
@@ -969,6 +970,18 @@ function MoneyReportHeader({
969970
Navigation.navigate(ROUTES.REPORT_WITH_ID_CHANGE_WORKSPACE.getRoute(moneyRequestReport.reportID, Navigation.getActiveRoute()));
970971
},
971972
},
973+
[CONST.REPORT.SECONDARY_ACTIONS.CHANGE_APPROVER]: {
974+
text: translate('iou.changeApprover.title'),
975+
icon: Expensicons.Workflows,
976+
value: CONST.REPORT.SECONDARY_ACTIONS.CHANGE_APPROVER,
977+
onSelected: () => {
978+
if (!moneyRequestReport) {
979+
Log.warn('Change approver secondary action triggered without moneyRequestReport data.');
980+
return;
981+
}
982+
Navigation.navigate(ROUTES.REPORT_CHANGE_APPROVER.getRoute(moneyRequestReport.reportID, Navigation.getActiveRoute()));
983+
},
984+
},
972985
[CONST.REPORT.SECONDARY_ACTIONS.DELETE]: {
973986
text: translate('common.delete'),
974987
icon: Expensicons.Trashcan,

src/languages/de.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import type {
5858
CardInfoParams,
5959
CardNextPaymentParams,
6060
CategoryNameParams,
61+
ChangedApproverMessageParams,
6162
ChangeFieldParams,
6263
ChangeOwnerDuplicateSubscriptionParams,
6364
ChangeOwnerHasFailedSettlementsParams,
@@ -292,6 +293,7 @@ import type {
292293
WeSentYouMagicSignInLinkParams,
293294
WorkEmailMergingBlockedParams,
294295
WorkEmailResendCodeParams,
296+
WorkflowSettingsParam,
295297
WorkspaceLockedPlanTypeParams,
296298
WorkspaceMemberList,
297299
WorkspaceMembersCountParams,
@@ -1385,6 +1387,22 @@ const translations = {
13851387
rates: 'Preise',
13861388
submitsTo: ({name}: SubmitsToParams) => `Übermittelt an ${name}`,
13871389
moveExpenses: () => ({one: 'Ausgabe verschieben', other: 'Ausgaben verschieben'}),
1390+
changeApprover: {
1391+
title: 'Genehmiger ändern',
1392+
subtitle: 'Wählen Sie eine Option, um den Genehmiger für diesen Bericht zu ändern.',
1393+
description: ({workflowSettingLink}: WorkflowSettingsParam) =>
1394+
`Sie können den Genehmiger auch dauerhaft für alle Berichte in Ihren <a href="${workflowSettingLink}">Workflow-Einstellungen</a> ändern.`,
1395+
changedApproverMessage: ({managerID}: ChangedApproverMessageParams) => `änderte den Genehmiger zu <mention-user accountID="${managerID}"/>`,
1396+
actions: {
1397+
addApprover: 'Genehmiger hinzufügen',
1398+
addApproverSubtitle: 'Fügen Sie dem bestehenden Workflow einen zusätzlichen Genehmiger hinzu.',
1399+
bypassApprovers: 'Genehmiger umgehen',
1400+
bypassApproversSubtitle: 'Weisen Sie sich selbst als endgültigen Genehmiger zu und überspringen Sie alle verbleibenden Genehmiger.',
1401+
},
1402+
addApprover: {
1403+
subtitle: 'Wählen Sie einen zusätzlichen Genehmiger für diesen Bericht, bevor wir ihn durch den Rest des Genehmigungs-Workflows leiten.',
1404+
},
1405+
},
13881406
},
13891407
transactionMerge: {
13901408
listPage: {
@@ -5485,6 +5503,12 @@ const translations = {
54855503
'Mehrstufige Tags helfen Ihnen, Ausgaben präziser zu verfolgen. Weisen Sie jedem Posten mehrere Tags zu – wie Abteilung, Kunde oder Kostenstelle – um den vollständigen Kontext jeder Ausgabe zu erfassen. Dies ermöglicht detailliertere Berichte, Genehmigungs-Workflows und Buchhaltungsexporte.',
54865504
onlyAvailableOnPlan: 'Mehrstufige Tags sind nur im Control-Plan verfügbar, beginnend bei',
54875505
},
5506+
[CONST.UPGRADE_FEATURE_INTRO_MAPPING.multiApprovalLevels.id]: {
5507+
title: 'Mehrere Genehmigungsstufen',
5508+
description:
5509+
'Mehrere Genehmigungsstufen ist ein Workflow-Tool für Unternehmen, die mehr als eine Person benötigen, um einen Bericht zu genehmigen, bevor er erstattet werden kann.',
5510+
onlyAvailableOnPlan: 'Mehrere Genehmigungsstufen sind nur im Control-Plan verfügbar, beginnend bei ',
5511+
},
54885512
pricing: {
54895513
perActiveMember: 'pro aktivem Mitglied pro Monat.',
54905514
perMember: 'pro Mitglied pro Monat.',

src/languages/en.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import type {
4747
CardInfoParams,
4848
CardNextPaymentParams,
4949
CategoryNameParams,
50+
ChangedApproverMessageParams,
5051
ChangeFieldParams,
5152
ChangeOwnerDuplicateSubscriptionParams,
5253
ChangeOwnerHasFailedSettlementsParams,
@@ -281,6 +282,7 @@ import type {
281282
WeSentYouMagicSignInLinkParams,
282283
WorkEmailMergingBlockedParams,
283284
WorkEmailResendCodeParams,
285+
WorkflowSettingsParam,
284286
WorkspaceLockedPlanTypeParams,
285287
WorkspaceMemberList,
286288
WorkspaceMembersCountParams,
@@ -1369,6 +1371,22 @@ const translations = {
13691371
rates: 'Rates',
13701372
submitsTo: ({name}: SubmitsToParams) => `Submits to ${name}`,
13711373
moveExpenses: () => ({one: 'Move expense', other: 'Move expenses'}),
1374+
changeApprover: {
1375+
title: 'Change approver',
1376+
subtitle: 'Choose an option to change the approver for this report.',
1377+
description: ({workflowSettingLink}: WorkflowSettingsParam) =>
1378+
`You can also change the approver permanently for all reports in your <a href="${workflowSettingLink}">workflow settings</a>.`,
1379+
changedApproverMessage: ({managerID}: ChangedApproverMessageParams) => `changed the approver to <mention-user accountID="${managerID}"/>`,
1380+
actions: {
1381+
addApprover: 'Add approver',
1382+
addApproverSubtitle: 'Add an additional approver to the existing workflow.',
1383+
bypassApprovers: 'Bypass approvers',
1384+
bypassApproversSubtitle: 'Assign yourself as final approver and skip any remaining approvers.',
1385+
},
1386+
addApprover: {
1387+
subtitle: 'Choose an additional approver for this report before we route through the rest of the approval workflow.',
1388+
},
1389+
},
13721390
},
13731391
transactionMerge: {
13741392
listPage: {
@@ -5463,6 +5481,11 @@ const translations = {
54635481
'Multi-Level Tags help you track expenses with greater precision. Assign multiple tags to each line item—such as department, client, or cost center—to capture the full context of every expense. This enables more detailed reporting, approval workflows, and accounting exports.',
54645482
onlyAvailableOnPlan: 'Multi-level tags are only available on the Control plan, starting at ',
54655483
},
5484+
[CONST.UPGRADE_FEATURE_INTRO_MAPPING.multiApprovalLevels.id]: {
5485+
title: 'Multiple approval levels',
5486+
description: 'Multiple approval levels is a workflow tool for companies that require more than one person to approve a report before it can be reimbursed.',
5487+
onlyAvailableOnPlan: 'Multiple approval levels are only available on the Control plan, starting at ',
5488+
},
54665489
pricing: {
54675490
perActiveMember: 'per active member per month.',
54685491
perMember: 'per member per month.',

src/languages/es.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import type {
4545
CardInfoParams,
4646
CardNextPaymentParams,
4747
CategoryNameParams,
48+
ChangedApproverMessageParams,
4849
ChangeFieldParams,
4950
ChangeOwnerDuplicateSubscriptionParams,
5051
ChangeOwnerHasFailedSettlementsParams,
@@ -280,6 +281,7 @@ import type {
280281
WeSentYouMagicSignInLinkParams,
281282
WorkEmailMergingBlockedParams,
282283
WorkEmailResendCodeParams,
284+
WorkflowSettingsParam,
283285
WorkspaceLockedPlanTypeParams,
284286
WorkspaceMemberList,
285287
WorkspaceMembersCountParams,
@@ -1366,6 +1368,22 @@ const translations = {
13661368
rates: 'Tasas',
13671369
submitsTo: ({name}: SubmitsToParams) => `Se envía a ${name}`,
13681370
moveExpenses: () => ({one: 'Mover gasto', other: 'Mover gastos'}),
1371+
changeApprover: {
1372+
title: 'Cambiar aprobador',
1373+
subtitle: 'Elige una opción para cambiar el aprobador de este informe.',
1374+
description: ({workflowSettingLink}: WorkflowSettingsParam) =>
1375+
`También puedes cambiar el aprobador de forma permanente para todos los informes en tu <a href="${workflowSettingLink}">configuración de flujo de trabajo</a>.`,
1376+
changedApproverMessage: ({managerID}: ChangedApproverMessageParams) => `cambió el aprobador a <mention-user accountID="${managerID}"/>`,
1377+
actions: {
1378+
addApprover: 'Añadir aprobador',
1379+
addApproverSubtitle: 'Añade un aprobador adicional al flujo de trabajo existente.',
1380+
bypassApprovers: 'Omitir aprobadores',
1381+
bypassApproversSubtitle: 'Asígnate como aprobador final y omite a los aprobadores restantes.',
1382+
},
1383+
addApprover: {
1384+
subtitle: 'Elige un aprobador adicional para este informe antes de que lo enviemos por el resto del flujo de aprobación.',
1385+
},
1386+
},
13691387
},
13701388
transactionMerge: {
13711389
listPage: {
@@ -5496,6 +5514,12 @@ const translations = {
54965514
'Las etiquetas multinivel te ayudan a llevar un control más preciso de los gastos. Asigna múltiples etiquetas a cada partida, como departamento, cliente o centro de costos, para capturar el contexto completo de cada gasto. Esto permite informes más detallados, flujos de aprobación y exportaciones contables.',
54975515
onlyAvailableOnPlan: 'Las etiquetas multinivel solo están disponibles en el plan Control, a partir de ',
54985516
},
5517+
[CONST.UPGRADE_FEATURE_INTRO_MAPPING.multiApprovalLevels.id]: {
5518+
title: 'Múltiples niveles de aprobación',
5519+
description:
5520+
'Los múltiples niveles de aprobación son una herramienta de flujo de trabajo para empresas que requieren que más de una persona apruebe un informe antes de que pueda ser reembolsado.',
5521+
onlyAvailableOnPlan: 'Los múltiples niveles de aprobación solo están disponibles en el plan Controlar, a partir de ',
5522+
},
54995523
note: {
55005524
upgradeWorkspace: 'Mejore su espacio de trabajo para acceder a esta función, o',
55015525
learnMore: 'más información',

src/languages/fr.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import type {
5858
CardInfoParams,
5959
CardNextPaymentParams,
6060
CategoryNameParams,
61+
ChangedApproverMessageParams,
6162
ChangeFieldParams,
6263
ChangeOwnerDuplicateSubscriptionParams,
6364
ChangeOwnerHasFailedSettlementsParams,
@@ -292,6 +293,7 @@ import type {
292293
WeSentYouMagicSignInLinkParams,
293294
WorkEmailMergingBlockedParams,
294295
WorkEmailResendCodeParams,
296+
WorkflowSettingsParam,
295297
WorkspaceLockedPlanTypeParams,
296298
WorkspaceMemberList,
297299
WorkspaceMembersCountParams,
@@ -1388,6 +1390,22 @@ const translations = {
13881390
rates: 'Tarifs',
13891391
submitsTo: ({name}: SubmitsToParams) => `Soumet à ${name}`,
13901392
moveExpenses: () => ({one: 'Déplacer la dépense', other: 'Déplacer les dépenses'}),
1393+
changeApprover: {
1394+
title: "Modifier l'approbateur",
1395+
subtitle: "Choisissez une option pour modifier l'approbateur de ce rapport.",
1396+
description: ({workflowSettingLink}: WorkflowSettingsParam) =>
1397+
`Vous pouvez également modifier l'approbateur de manière permanente pour tous les rapports dans vos <a href="${workflowSettingLink}">paramètres de flux de travail</a>.`,
1398+
changedApproverMessage: ({managerID}: ChangedApproverMessageParams) => `a changé l'approbateur en <mention-user accountID="${managerID}"/>`,
1399+
actions: {
1400+
addApprover: 'Ajouter un approbateur',
1401+
addApproverSubtitle: 'Ajouter un approbateur supplémentaire au flux de travail existant.',
1402+
bypassApprovers: 'Contourner les approbateurs',
1403+
bypassApproversSubtitle: 'Vous désigner comme approbateur final et ignorer les autres approbateurs.',
1404+
},
1405+
addApprover: {
1406+
subtitle: "Choisissez un approbateur supplémentaire pour ce rapport avant de le faire passer par le reste du flux de travail d'approbation.",
1407+
},
1408+
},
13911409
},
13921410
transactionMerge: {
13931411
listPage: {
@@ -5499,6 +5517,12 @@ const translations = {
54995517
"Les balises multi-niveaux vous aident à suivre les dépenses avec plus de précision. Assignez plusieurs balises à chaque poste—comme le département, le client ou le centre de coût—pour capturer le contexte complet de chaque dépense. Cela permet des rapports plus détaillés, des flux de travail d'approbation et des exportations comptables.",
55005518
onlyAvailableOnPlan: 'Les balises multi-niveaux sont uniquement disponibles sur le plan Control, à partir de',
55015519
},
5520+
[CONST.UPGRADE_FEATURE_INTRO_MAPPING.multiApprovalLevels.id]: {
5521+
title: "Niveaux d'approbation multiples",
5522+
description:
5523+
"Les niveaux d'approbation multiples sont un outil de flux de travail pour les entreprises qui exigent que plus d'une personne approuve un rapport avant qu'il ne puisse être remboursé.",
5524+
onlyAvailableOnPlan: "Les niveaux d'approbation multiples sont uniquement disponibles sur le plan Control, à partir de ",
5525+
},
55025526
pricing: {
55035527
perActiveMember: 'par membre actif par mois.',
55045528
perMember: 'par membre par mois.',

src/languages/it.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import type {
5858
CardInfoParams,
5959
CardNextPaymentParams,
6060
CategoryNameParams,
61+
ChangedApproverMessageParams,
6162
ChangeFieldParams,
6263
ChangeOwnerDuplicateSubscriptionParams,
6364
ChangeOwnerHasFailedSettlementsParams,
@@ -292,6 +293,7 @@ import type {
292293
WeSentYouMagicSignInLinkParams,
293294
WorkEmailMergingBlockedParams,
294295
WorkEmailResendCodeParams,
296+
WorkflowSettingsParam,
295297
WorkspaceLockedPlanTypeParams,
296298
WorkspaceMemberList,
297299
WorkspaceMembersCountParams,
@@ -1381,6 +1383,22 @@ const translations = {
13811383
rates: 'Tariffe',
13821384
submitsTo: ({name}: SubmitsToParams) => `Invia a ${name}`,
13831385
moveExpenses: () => ({one: 'Sposta spesa', other: 'Sposta spese'}),
1386+
changeApprover: {
1387+
title: 'Cambia approvatore',
1388+
subtitle: "Scegli un'opzione per cambiare l'approvatore di questo report.",
1389+
description: ({workflowSettingLink}: WorkflowSettingsParam) =>
1390+
`Puoi anche cambiare l'approvatore in modo permanente per tutti i report nelle tue <a href="${workflowSettingLink}">impostazioni del flusso di lavoro</a>.`,
1391+
changedApproverMessage: ({managerID}: ChangedApproverMessageParams) => `ha cambiato l'approvatore in <mention-user accountID="${managerID}"/>`,
1392+
actions: {
1393+
addApprover: 'Aggiungi approvatore',
1394+
addApproverSubtitle: 'Aggiungi un approvatore aggiuntivo al flusso di lavoro esistente.',
1395+
bypassApprovers: 'Ignora approvatori',
1396+
bypassApproversSubtitle: 'Assegna te stesso come approvatore finale e salta gli approvatori rimanenti.',
1397+
},
1398+
addApprover: {
1399+
subtitle: 'Scegli un approvatore aggiuntivo per questo report prima di instradarlo attraverso il resto del flusso di lavoro di approvazione.',
1400+
},
1401+
},
13841402
},
13851403
transactionMerge: {
13861404
listPage: {
@@ -5498,6 +5516,12 @@ const translations = {
54985516
'I tag multilivello ti aiutano a monitorare le spese con maggiore precisione. Assegna più tag a ciascuna voce, come reparto, cliente o centro di costo, per catturare il contesto completo di ogni spesa. Questo consente report più dettagliati, flussi di lavoro di approvazione ed esportazioni contabili.',
54995517
onlyAvailableOnPlan: 'I tag multilivello sono disponibili solo nel piano Control, a partire da',
55005518
},
5519+
[CONST.UPGRADE_FEATURE_INTRO_MAPPING.multiApprovalLevels.id]: {
5520+
title: 'Livelli di approvazione multipli',
5521+
description:
5522+
'I livelli di approvazione multipli sono uno strumento di flusso di lavoro per le aziende che richiedono a più di una persona di approvare un report prima che possa essere rimborsato.',
5523+
onlyAvailableOnPlan: 'I livelli di approvazione multipli sono disponibili solo nel piano Control, a partire da ',
5524+
},
55015525
pricing: {
55025526
perActiveMember: 'per membro attivo al mese.',
55035527
perMember: 'per membro al mese.',

0 commit comments

Comments
 (0)