Skip to content

Commit

Permalink
Merge pull request #34746 from Expensify/vit-usePolicySubmitsToAsMana…
Browse files Browse the repository at this point in the history
…gerAccountID

Use policy submitsTo as managerAccountID when submitting report
  • Loading branch information
mountiny committed Jan 22, 2024
2 parents 0c5db5f + 74a61a2 commit 804aac5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -3259,6 +3259,7 @@ function submitReport(expenseReport) {

const optimisticSubmittedReportAction = ReportUtils.buildOptimisticSubmittedReportAction(expenseReport.total, expenseReport.currency, expenseReport.reportID);
const parentReport = ReportUtils.getReport(expenseReport.parentReportID);
const policy = ReportUtils.getPolicy(expenseReport.policyID);
const isCurrentUserManager = currentUserPersonalDetails.accountID === expenseReport.managerID;

const optimisticData = [
Expand Down Expand Up @@ -3361,7 +3362,7 @@ function submitReport(expenseReport) {
'SubmitReport',
{
reportID: expenseReport.reportID,
managerAccountID: expenseReport.managerID,
managerAccountID: policy.submitsTo || expenseReport.managerID,
reportActionID: optimisticSubmittedReportAction.reportActionID,
},
{optimisticData, successData, failureData},
Expand Down

0 comments on commit 804aac5

Please sign in to comment.