Skip to content

Commit e4b9324

Browse files
authored
Merge pull request #42574 from nkdengineer/fix/42202
fix: hold Expense option is displayed on expenses on a closed report
2 parents cb692c5 + bcec37c commit e4b9324

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

src/components/MoneyRequestHeader.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
9393
const isScanning = TransactionUtils.hasReceipt(transaction) && TransactionUtils.isReceiptBeingScanned(transaction);
9494

9595
const isDeletedParentAction = ReportActionsUtils.isDeletedAction(parentReportAction);
96-
const canHoldOrUnholdRequest = !isSettled && !isApproved && !isDeletedParentAction;
96+
const canHoldOrUnholdRequest = !isSettled && !isApproved && !isDeletedParentAction && !ReportUtils.isArchivedRoom(parentReport);
9797

9898
// If the report supports adding transactions to it, then it also supports deleting transactions from it.
9999
const canDeleteRequest = isActionOwner && (ReportUtils.canAddOrDeleteTransactions(moneyRequestReport) || ReportUtils.isTrackExpenseReport(report)) && !isDeletedParentAction;

src/languages/en.ts

+2
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ export default {
734734
other: 'Unexpected error, please try again later.',
735735
genericCreateFailureMessage: 'Unexpected error submitting this expense. Please try again later.',
736736
genericCreateInvoiceFailureMessage: 'Unexpected error sending invoice, please try again later.',
737+
genericHoldExpenseFailureMessage: 'Unexpected error while holding the expense. Please try again later.',
738+
genericUnholdExpenseFailureMessage: 'Unexpected error while taking the expense off hold. Please try again later.',
737739
receiptDeleteFailureError: 'Unexpected error deleting this receipt. Please try again later.',
738740
// eslint-disable-next-line rulesdir/use-periods-for-error-messages
739741
receiptFailureMessage: "The receipt didn't upload. ",

src/languages/es.ts

+2
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ export default {
727727
invalidSplit: 'La suma de las partes debe ser igual al importe total.',
728728
invalidSplitParticipants: 'Introduce un importe superior a cero para al menos dos participantes.',
729729
other: 'Error inesperado, por favor inténtalo más tarde.',
730+
genericHoldExpenseFailureMessage: 'Error inesperado al bloquear el gasto, por favor inténtalo de nuevo más tarde.',
731+
genericUnholdExpenseFailureMessage: 'Error inesperado al desbloquear el gasto, por favor inténtalo de nuevo más tarde.',
730732
genericCreateFailureMessage: 'Error inesperado al enviar este gasto. Por favor, inténtalo más tarde.',
731733
genericCreateInvoiceFailureMessage: 'Error inesperado al enviar la factura, inténtalo de nuevo más tarde.',
732734
receiptDeleteFailureError: 'Error inesperado al borrar este recibo. Vuelve a intentarlo más tarde.',

src/libs/actions/IOU.ts

+2
Original file line numberDiff line numberDiff line change
@@ -6769,6 +6769,7 @@ function putOnHold(transactionID: string, comment: string, reportID: string) {
67696769
comment: {
67706770
hold: null,
67716771
},
6772+
errors: ErrorUtils.getMicroSecondOnyxError('iou.genericHoldExpenseFailureMessage'),
67726773
},
67736774
},
67746775
];
@@ -6830,6 +6831,7 @@ function unholdRequest(transactionID: string, reportID: string) {
68306831
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
68316832
value: {
68326833
pendingAction: null,
6834+
errors: ErrorUtils.getMicroSecondOnyxError('iou.genericUnholdExpenseFailureMessage'),
68336835
},
68346836
},
68356837
];

0 commit comments

Comments
 (0)