@@ -4566,7 +4566,7 @@ function getReportPreviewMessage(
45664566 }
45674567
45684568 const containsNonReimbursable = hasNonReimbursableTransactions ( report . reportID ) ;
4569- const { totalDisplaySpend : totalAmount , reimbursableSpend } = getMoneyRequestSpendBreakdown ( report ) ;
4569+ const { totalDisplaySpend : totalAmount } = getMoneyRequestSpendBreakdown ( report ) ;
45704570
45714571 const parentReport = getParentReport ( report ) ;
45724572 const policyName = getPolicyName ( { report : parentReport ?? report , policy} ) ;
@@ -4600,7 +4600,6 @@ function getReportPreviewMessage(
46004600
46014601 // Show Paid preview message if it's settled or if the amount is paid & stuck at receivers end for only chat reports.
46024602 if ( isSettled ( report . reportID ) || ( report . isWaitingOnBankAccount && isPreviewMessageForParentChatReport ) ) {
4603- const formattedReimbursableAmount = convertToDisplayString ( reimbursableSpend , report . currency ) ;
46044603 // A settled report preview message can come in three formats "paid ... elsewhere" or "paid ... with Expensify"
46054604 let translatePhraseKey : TranslationPaths = 'iou.paidElsewhere' ;
46064605 if ( isPreviewMessageForParentChatReport ) {
@@ -4626,7 +4625,7 @@ function getReportPreviewMessage(
46264625 const payerDisplayName = isPreviewMessageForParentChatReport ? payerName : actualPayerName ;
46274626
46284627 return translateLocal ( translatePhraseKey , {
4629- amount : formattedReimbursableAmount ,
4628+ amount : '' ,
46304629 payer : payerDisplayName ?? '' ,
46314630 last4Digits : reportPolicy ?. achAccount ?. accountNumber ?. slice ( - 4 ) ?? '' ,
46324631 } ) ;
@@ -5141,11 +5140,20 @@ function getReportNameInternal({
51415140
51425141 if ( isMoneyRequestAction ( parentReportAction ) ) {
51435142 const originalMessage = getOriginalMessage ( parentReportAction ) ;
5143+ const reportPolicy = allPolicies ?. [ `${ ONYXKEYS . COLLECTION . POLICY } ${ report ?. policyID } ` ] ;
5144+ const last4Digits = reportPolicy ?. achAccount ?. accountNumber . slice ( - 4 ) ?? '' ;
5145+
51445146 if ( originalMessage ?. type === CONST . IOU . REPORT_ACTION_TYPE . PAY ) {
51455147 if ( originalMessage . paymentType === CONST . IOU . PAYMENT_TYPE . ELSEWHERE ) {
51465148 return translateLocal ( 'iou.paidElsewhere' ) ;
51475149 }
5148- if ( originalMessage . paymentType === CONST . IOU . PAYMENT_TYPE . VBBA || originalMessage . paymentType === CONST . IOU . PAYMENT_TYPE . EXPENSIFY ) {
5150+ if ( originalMessage . paymentType === CONST . IOU . PAYMENT_TYPE . VBBA ) {
5151+ if ( originalMessage . automaticAction ) {
5152+ return translateLocal ( 'iou.automaticallyPaidWithBusinessBankAccount' , { last4Digits} ) ;
5153+ }
5154+ return translateLocal ( 'iou.businessBankAccount' , { last4Digits} ) ;
5155+ }
5156+ if ( originalMessage . paymentType === CONST . IOU . PAYMENT_TYPE . EXPENSIFY ) {
51495157 if ( originalMessage . automaticAction ) {
51505158 return translateLocal ( 'iou.automaticallyPaidWithExpensify' ) ;
51515159 }
@@ -9211,12 +9219,6 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry<ReportAction>,
92119219
92129220 let translationKey : TranslationPaths ;
92139221 if ( originalMessage ?. type === CONST . IOU . REPORT_ACTION_TYPE . PAY ) {
9214- // The `REPORT_ACTION_TYPE.PAY` action type is used for both fulfilling existing requests and sending money. To
9215- // differentiate between these two scenarios, we check if the `originalMessage` contains the `IOUDetails`
9216- // property. If it does, it indicates that this is a 'Pay someone' action.
9217- const { amount, currency} = originalMessage ?. IOUDetails ?? originalMessage ?? { } ;
9218- const formattedAmount = convertToDisplayString ( Math . abs ( amount ) , currency ) ?? '' ;
9219-
92209222 const reportPolicy = allPolicies ?. [ `${ ONYXKEYS . COLLECTION . POLICY } ${ report ?. policyID } ` ] ;
92219223 const last4Digits = reportPolicy ?. achAccount ?. accountNumber . slice ( - 4 ) ?? '' ;
92229224
@@ -9227,19 +9229,21 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry<ReportAction>,
92279229 case CONST . IOU . PAYMENT_TYPE . EXPENSIFY :
92289230 case CONST . IOU . PAYMENT_TYPE . VBBA :
92299231 if ( isInvoice ) {
9230- return translateLocal ( payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal' , { amount : formattedAmount , last4Digits} ) ;
9232+ return translateLocal ( payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal' , { amount : '' , last4Digits} ) ;
92319233 }
92329234 translationKey = 'iou.businessBankAccount' ;
9233- if ( automaticAction ) {
9235+ if ( automaticAction && originalMessage . paymentType === CONST . IOU . PAYMENT_TYPE . EXPENSIFY ) {
92349236 translationKey = 'iou.automaticallyPaidWithExpensify' ;
9237+ } else {
9238+ translationKey = 'iou.automaticallyPaidWithBusinessBankAccount' ;
92359239 }
92369240 break ;
92379241 default :
92389242 translationKey = 'iou.payerPaidAmount' ;
92399243 break ;
92409244 }
92419245
9242- return translateLocal ( translationKey , { amount : formattedAmount , payer : '' , last4Digits} ) ;
9246+ return translateLocal ( translationKey , { amount : '' , payer : '' , last4Digits} ) ;
92439247 }
92449248
92459249 const amount = getTransactionAmount ( transaction , ! isEmptyObject ( iouReport ) && isExpenseReport ( iouReport ) ) ?? 0 ;
0 commit comments