diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 0b5d03e9e365..eb728586f8f2 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2990,13 +2990,6 @@ function isReportFieldDisabled(report: OnyxEntry, reportField: OnyxEntry return isTitleField ? !reportField?.deletable : !isAdmin && (isReportSettled || isReportClosed); } -/** - * Given a set of report fields, return the field of type formula - */ -function getFormulaTypeReportField(reportFields: Record) { - return Object.values(reportFields).find((field) => field?.type === 'formula'); -} - /** * Given a set of report fields, return the field that refers to title */ @@ -3074,7 +3067,7 @@ function getAvailableReportFields(report: Report, policyReportFields: PolicyRepo function getMoneyRequestReportName(report: OnyxEntry, policy?: OnyxEntry, invoiceReceiverPolicy?: OnyxEntry): string { const isReportSettled = isSettled(report?.reportID ?? '-1'); const reportFields = isReportSettled ? report?.fieldList : getReportFieldsByPolicyID(report?.policyID ?? '-1'); - const titleReportField = getFormulaTypeReportField(reportFields ?? {}); + const titleReportField = Object.values(reportFields ?? {}).find((reportField) => reportField?.fieldID === CONST.REPORT_FIELD_TITLE_FIELD_ID); if (titleReportField && report?.reportName && isPaidGroupPolicyExpenseReport(report)) { return report.reportName;