Skip to content

Commit 86ed5e6

Browse files
committed
fix: disable all fields for forwarded submitter in submitted expense reports
1 parent 76d47e6 commit 86ed5e6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/libs/ReportUtils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4467,7 +4467,7 @@ function isHoldCreator(transaction: OnyxEntry<Transaction>, reportID: string | u
44674467
* For title fields, its considered disabled if `deletable` prop is `true` (https://github.com/Expensify/App/issues/35043#issuecomment-1911275433)
44684468
* For non title fields, its considered disabled if:
44694469
* 1. The user is not admin of the report
4470-
* 2. Report is settled or it is closed
4470+
* 2. Report is settled, closed, approved, or submitted and already forwarded for review
44714471
*/
44724472
function isReportFieldDisabled(report: OnyxEntry<Report>, reportField: OnyxEntry<PolicyReportField>, policy: OnyxEntry<Policy>): boolean {
44734473
if (isInvoiceReport(report)) {
@@ -4478,9 +4478,8 @@ function isReportFieldDisabled(report: OnyxEntry<Report>, reportField: OnyxEntry
44784478
const isTitleField = isReportFieldOfTypeTitle(reportField);
44794479
const isAdmin = isPolicyAdmin(policy);
44804480
const isApproved = isReportApproved({report});
4481-
const shouldDisableTitleFieldForSubmitterInForwardedApproval =
4482-
isTitleField && isExpenseReport(report) && isReportOwner(report) && isProcessingReport(report) && !isAwaitingFirstLevelApproval(report);
4483-
if (!isAdmin && (isReportSettled || isReportClosed || isApproved || shouldDisableTitleFieldForSubmitterInForwardedApproval)) {
4481+
const isForwardedForSubmitter = isReportOwner(report) && isExpenseReport(report) && isProcessingReport(report) && !isAwaitingFirstLevelApproval(report);
4482+
if (!isAdmin && (isReportSettled || isReportClosed || isApproved || isForwardedForSubmitter)) {
44844483
return true;
44854484
}
44864485

0 commit comments

Comments
 (0)