File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,8 +99,13 @@ function AddExistingExpense({route}: AddExistingExpensePageType) {
9999 if ( ! transactions ) {
100100 return [ ] ;
101101 }
102+ const isIOU = isIOUReport ( report ) ;
102103 return Object . values ( transactions || { } ) . filter ( ( item ) => {
103104 const isUnreported = isUnreportedTransaction ( item ) ;
105+ if ( isIOU && ! isUnreported ) {
106+ return false ;
107+ }
108+
104109 const isOnOpenExpenseReport = ! ! ( item ?. reportID && ( allOpenReports ?. [ item . reportID ] ?? openReportDrafts ?. [ item . reportID ] ) ) ;
105110 if ( ! isUnreported && ! isOnOpenExpenseReport ) {
106111 return false ;
@@ -121,13 +126,13 @@ function AddExistingExpense({route}: AddExistingExpensePageType) {
121126
122127 const transactionAmount = getTransactionDetails ( item ) ?. amount ?? 0 ;
123128
124- // Negative values are not allowed for unreported expenses
125- if ( transactionAmount < 0 ) {
129+ // Only block negative amounts for unreported expenses.
130+ if ( transactionAmount < 0 && isUnreported ) {
126131 return false ;
127132 }
128133
129134 // Zero amount expenses are not allowed in IOU reports
130- if ( isIOUReport ( report ) && transactionAmount === 0 ) {
135+ if ( isIOU && transactionAmount === 0 ) {
131136 return false ;
132137 }
133138
You can’t perform that action at this time.
0 commit comments