@@ -59,10 +59,10 @@ import {
59
59
isTripRoom as isTripRoomReportUtils ,
60
60
isWaitingForSubmissionFromCurrentUser as isWaitingForSubmissionFromCurrentUserReportUtils ,
61
61
} from '@libs/ReportUtils' ;
62
- import { getMerchant , hasPendingUI , isCardTransaction , isPartialMerchant , isPending , shouldShowBrokenConnectionViolationForMultipleTransactions } from '@libs/TransactionUtils' ;
62
+ import { getMerchant , hasPendingUI , isCardTransaction , isPartialMerchant , isPending } from '@libs/TransactionUtils' ;
63
63
import colors from '@styles/theme/colors' ;
64
64
import variables from '@styles/variables' ;
65
- import { approveMoneyRequest , canApproveIOU , canIOUBePaid as canIOUBePaidIOUActions , canSubmitReport , payInvoice , payMoneyRequest , startMoneyRequest , submitReport } from '@userActions/IOU' ;
65
+ import { approveMoneyRequest , canIOUBePaid as canIOUBePaidIOUActions , payInvoice , payMoneyRequest , startMoneyRequest , submitReport } from '@userActions/IOU' ;
66
66
import Timing from '@userActions/Timing' ;
67
67
import CONST from '@src/CONST' ;
68
68
import type { TranslationPaths } from '@src/languages/types' ;
@@ -115,7 +115,6 @@ function MoneyRequestReportPreviewContent({
115
115
onPress,
116
116
} : MoneyRequestReportPreviewContentProps ) {
117
117
const lastTransaction = transactions ?. at ( 0 ) ;
118
- const transactionIDList = transactions ?. map ( ( reportTransaction ) => reportTransaction . transactionID ) ?? [ ] ;
119
118
const shouldShowEmptyPlaceholder = transactions . length === 0 ;
120
119
const theme = useTheme ( ) ;
121
120
const styles = useThemeStyles ( ) ;
@@ -181,7 +180,6 @@ function MoneyRequestReportPreviewContent({
181
180
const numberOfPendingRequests = transactionsWithReceipts . filter ( ( transaction ) => isPending ( transaction ) && isCardTransaction ( transaction ) ) . length ;
182
181
183
182
const shouldShowRTERViolationMessage = numberOfRequests === 1 && hasPendingUI ( lastTransaction , lastTransactionViolations ) ;
184
- const shouldShowBrokenConnectionViolation = numberOfRequests === 1 && shouldShowBrokenConnectionViolationForMultipleTransactions ( transactionIDList , iouReport , policy , violations ) ;
185
183
const shouldShowOnlyPayElsewhere = useMemo ( ( ) => ! canIOUBePaid && getCanIOUBePaid ( true ) , [ canIOUBePaid , getCanIOUBePaid ] ) ;
186
184
187
185
const hasReceipts = transactionsWithReceipts . length > 0 ;
@@ -193,8 +191,6 @@ function MoneyRequestReportPreviewContent({
193
191
formattedMerchant = undefined ;
194
192
}
195
193
196
- const filteredTransactions = transactions ?. filter ( ( transaction ) => transaction ) ?? [ ] ;
197
-
198
194
// The submit button should be success green color only if the user is submitter and the policy does not have Scheduled Submit turned on
199
195
const isWaitingForSubmissionFromCurrentUser = useMemo ( ( ) => isWaitingForSubmissionFromCurrentUserReportUtils ( chatReport , policy ) , [ chatReport , policy ] ) ;
200
196
const [ isNoDelegateAccessMenuVisible , setIsNoDelegateAccessMenuVisible ] = useState ( false ) ;
@@ -234,10 +230,6 @@ function MoneyRequestReportPreviewContent({
234
230
}
235
231
} ;
236
232
237
- const shouldShowApproveButton = useMemo ( ( ) => canApproveIOU ( iouReport , policy , transactions ) , [ iouReport , policy , transactions ] ) || isApprovedAnimationRunning ;
238
- const shouldShowSubmitButton = canSubmitReport ( iouReport , policy , filteredTransactions , violations , isIouReportArchived ) ;
239
- const shouldShowSettlementButton = ! shouldShowSubmitButton && ( shouldShowPayButton || shouldShowApproveButton ) && ! shouldShowRTERViolationMessage && ! shouldShowBrokenConnectionViolation ;
240
-
241
233
const previewMessage = useMemo ( ( ) => {
242
234
if ( isScanning ) {
243
235
return totalDisplaySpend ? `${ translate ( 'common.receipt' ) } ${ CONST . DOT_SEPARATOR } ${ translate ( 'common.scanning' ) } ` : `${ translate ( 'common.receipt' ) } ` ;
@@ -556,7 +548,7 @@ function MoneyRequestReportPreviewContent({
556
548
iconFill = { theme . danger }
557
549
iconHoverFill = { theme . danger }
558
550
text = { translate ( 'common.review' , {
559
- amount : shouldShowSettlementButton ? getTotalAmountForIOUReportPreviewButton ( iouReport , policy , reportPreviewAction ) : '' ,
551
+ amount : getTotalAmountForIOUReportPreviewButton ( iouReport , policy , reportPreviewAction ) ,
560
552
} ) }
561
553
onPress = { ( ) => openReportFromPreview ( ) }
562
554
/>
0 commit comments