Skip to content

Commit

Permalink
Merge pull request #34401 from Expensify/vit-offlineSubmit
Browse files Browse the repository at this point in the history
Enable offline draft report creation and submission
  • Loading branch information
luacmartins authored Jan 19, 2024
2 parents 56fb814 + b826dae commit 68e997d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ type OptimisticExpenseReport = Pick<
| 'policyID'
| 'type'
| 'ownerAccountID'
| 'managerID'
| 'currency'
| 'reportName'
| 'stateNum'
Expand Down Expand Up @@ -2704,7 +2705,7 @@ function buildOptimisticExpenseReport(chatReportID: string, policyID: string, pa
const stateNum = isFree ? CONST.REPORT.STATE_NUM.SUBMITTED : CONST.REPORT.STATE_NUM.OPEN;
const statusNum = isFree ? CONST.REPORT.STATUS_NUM.SUBMITTED : CONST.REPORT.STATUS_NUM.OPEN;

return {
const expenseReport: OptimisticExpenseReport = {
reportID: generateReportID(),
chatReportID,
policyID,
Expand All @@ -2721,6 +2722,13 @@ function buildOptimisticExpenseReport(chatReportID: string, policyID: string, pa
parentReportID: chatReportID,
lastVisibleActionCreated: DateUtils.getDBTime(),
};

// The account defined in the policy submitsTo field is the approver/ manager for this report
if (policy?.submitsTo) {
expenseReport.managerID = policy.submitsTo;
}

return expenseReport;
}

/**
Expand Down

0 comments on commit 68e997d

Please sign in to comment.