Skip to content

Commit b18a68a

Browse files
committed
fix: scan expense add to 2nd report
1 parent a4898c6 commit b18a68a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/libs/ReportUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11146,6 +11146,7 @@ function shouldCreateNewMoneyRequestReport(
1114611146
isScanRequest: boolean,
1114711147
betas: OnyxEntry<Beta[]>,
1114811148
action?: IOUAction,
11149+
isFromExistingReport?: boolean,
1114911150
): boolean {
1115011151
if (existingIOUReport && !!existingIOUReport.errorFields?.createChat) {
1115111152
return true;
@@ -11156,7 +11157,7 @@ function shouldCreateNewMoneyRequestReport(
1115611157
!existingIOUReport ||
1115711158
hasIOUWaitingOnCurrentUserBankAccount(chatReport) ||
1115811159
!canAddTransaction(existingIOUReport) ||
11159-
(action !== CONST.IOU.ACTION.SUBMIT && isScanRequest && isASAPSubmitBetaEnabled)
11160+
(!isFromExistingReport && action !== CONST.IOU.ACTION.SUBMIT && isScanRequest && isASAPSubmitBetaEnabled)
1116011161
);
1116111162
}
1116211163

src/libs/actions/IOU/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,9 @@ function getMoneyRequestInformation(moneyRequestInformation: MoneyRequestInforma
20282028
}),
20292029
});
20302030

2031-
const shouldCreateNewMoneyRequestReport = isSplitExpense ? false : shouldCreateNewMoneyRequestReportReportUtils(iouReport, chatReport, isScanRequest, betas, action);
2031+
const shouldCreateNewMoneyRequestReport = isSplitExpense
2032+
? false
2033+
: shouldCreateNewMoneyRequestReportReportUtils(iouReport, chatReport, isScanRequest, betas, action, !!moneyRequestReportID);
20322034

20332035
// Generate IDs upfront so we can pass them to buildOptimisticExpenseReport for formula computation
20342036
const optimisticTransactionID = existingTransactionID ?? NumberUtils.rand64();

0 commit comments

Comments
 (0)