Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/pages/AddUnreportedExpense.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import interceptAnonymousUser from '@libs/interceptAnonymousUser';
import type {AddUnreportedExpensesParamList} from '@libs/Navigation/types';
import Permissions from '@libs/Permissions';
import {canSubmitPerDiemExpenseFromWorkspace, getPerDiemCustomUnit} from '@libs/PolicyUtils';
import {isIOUReport} from '@libs/ReportUtils';
import {getTransactionDetails, isIOUReport} from '@libs/ReportUtils';
import {shouldRestrictUserBillableActions} from '@libs/SubscriptionUtils';
import tokenizedSearch from '@libs/tokenizedSearch';
import {createUnreportedExpenseSections, getAmount, getCurrency, getDescription, getMerchant, isPerDiemRequest} from '@libs/TransactionUtils';
Expand Down Expand Up @@ -74,6 +74,11 @@ function AddUnreportedExpense({route}: AddUnreportedExpensePageType) {
return false;
}

// Negative values are not allowed for unreported expenses
if ((getTransactionDetails(item)?.amount ?? 0) < 0) {
return false;
}

if (isPerDiemRequest(item)) {
// Only show per diem expenses if the target workspace has per diem enabled and the per diem expense was created in the same workspace
const workspacePerDiemUnit = getPerDiemCustomUnit(policy);
Expand Down
Loading