|
1 | 1 | import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; |
2 | | -import {isApproveAction, isExportAction, isPrimaryPayAction} from '@libs/ReportPrimaryActionUtils'; |
3 | | -import {hasOnlyNonReimbursableTransactions, isArchivedReport, isCurrentUserSubmitter, isOpenExpenseReport} from '@libs/ReportUtils'; |
| 2 | +import {isApproveAction, isExportAction, isPrimaryPayAction, isSubmitAction} from '@libs/ReportPrimaryActionUtils'; |
| 3 | +import {hasOnlyNonReimbursableTransactions} from '@libs/ReportUtils'; |
4 | 4 | import createOnyxDerivedValueConfig from '@userActions/OnyxDerived/createOnyxDerivedValueConfig'; |
5 | 5 | import CONST from '@src/CONST'; |
6 | 6 | import ONYXKEYS from '@src/ONYXKEYS'; |
@@ -58,8 +58,7 @@ const createTodosReportsAndTransactions = ({ |
58 | 58 | const reportActions = Object.values(allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`] ?? []); |
59 | 59 | const reportTransactions = transactionsByReportID[report.reportID] ?? []; |
60 | 60 | const reportMetadata = allReportMetadata?.[`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report.reportID}`]; |
61 | | - const shouldShowInSubmitTodo = isOpenExpenseReport(report) && isCurrentUserSubmitter(report) && reportTransactions.length > 0 && !isArchivedReport(reportNameValuePair); |
62 | | - if (shouldShowInSubmitTodo) { |
| 61 | + if (isSubmitAction(report, reportTransactions, reportMetadata, policy, reportNameValuePair, undefined, login, currentUserAccountID)) { |
63 | 62 | reportsToSubmit.push(report); |
64 | 63 | } |
65 | 64 | if (isApproveAction(report, reportTransactions, currentUserAccountID, reportMetadata, policy)) { |
|
0 commit comments