Skip to content

Commit

Permalink
Merge pull request #37617 from paultsimura/fix/36267-report-name-formula
Browse files Browse the repository at this point in the history
Fix optimistic report amount in title
  • Loading branch information
thienlnam authored Mar 5, 2024
2 parents f4f5de1 + 04c5c45 commit 3df2616
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2951,11 +2951,10 @@ function getHumanReadableStatus(statusNum: number): string {
function populateOptimisticReportFormula(formula: string, report: OptimisticExpenseReport, policy: Policy | EmptyObject): string {
const createdDate = report.lastVisibleActionCreated ? new Date(report.lastVisibleActionCreated) : undefined;
const result = formula
.replaceAll('{report:id}', report.reportID)
// We don't translate because the server response is always in English
.replaceAll('{report:type}', 'Expense Report')
.replaceAll('{report:startdate}', createdDate ? format(createdDate, CONST.DATE.FNS_FORMAT_STRING) : '')
.replaceAll('{report:total}', report.total?.toString() ?? '')
.replaceAll('{report:total}', report.total !== undefined ? CurrencyUtils.convertToDisplayString(Math.abs(report.total), report.currency).toString() : '')
.replaceAll('{report:currency}', report.currency ?? '')
.replaceAll('{report:policyname}', policy.name ?? '')
.replaceAll('{report:created}', createdDate ? format(createdDate, CONST.DATE.FNS_DATE_TIME_FORMAT_STRING) : '')
Expand Down

0 comments on commit 3df2616

Please sign in to comment.