File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,8 +16,9 @@ import useThemeStyles from '@hooks/useThemeStyles';
1616import { fetchUnreportedExpenses } from '@libs/actions/UnreportedExpenses' ;
1717import interceptAnonymousUser from '@libs/interceptAnonymousUser' ;
1818import type { AddUnreportedExpensesParamList } from '@libs/Navigation/types' ;
19+ import { canSubmitPerDiemExpenseFromWorkspace } from '@libs/PolicyUtils' ;
1920import { shouldRestrictUserBillableActions } from '@libs/SubscriptionUtils' ;
20- import { createUnreportedExpenseSections } from '@libs/TransactionUtils' ;
21+ import { createUnreportedExpenseSections , isPerDiemRequest } from '@libs/TransactionUtils' ;
2122import Navigation from '@navigation/Navigation' ;
2223import type { PlatformStackScreenProps } from '@navigation/PlatformStackNavigation/types' ;
2324import { startMoneyRequest } from '@userActions/IOU' ;
@@ -49,7 +50,18 @@ function AddUnreportedExpense({route}: AddUnreportedExpensePageType) {
4950 if ( ! transactions ) {
5051 return [ ] ;
5152 }
52- return Object . values ( transactions || { } ) . filter ( ( item ) => item ?. reportID === CONST . REPORT . UNREPORTED_REPORT_ID || item ?. reportID === '' ) ;
53+ return Object . values ( transactions || { } ) . filter ( ( item ) => {
54+ const isUnreported = item ?. reportID === CONST . REPORT . UNREPORTED_REPORT_ID || item ?. reportID === '' ;
55+ if ( ! isUnreported ) {
56+ return false ;
57+ }
58+
59+ if ( isPerDiemRequest ( item ) ) {
60+ return canSubmitPerDiemExpenseFromWorkspace ( policy ) ;
61+ }
62+
63+ return true ;
64+ } ) ;
5365 }
5466
5567 const [ transactions = [ ] ] = useOnyx ( ONYXKEYS . COLLECTION . TRANSACTION , {
You can’t perform that action at this time.
0 commit comments