@@ -38,7 +38,7 @@ import {
3838} from '@libs/TransactionUtils' ;
3939import CONST from '@src/CONST' ;
4040import type { TranslationPaths } from '@src/languages/types' ;
41- import type { PersonalDetails , Report , TransactionViolation } from '@src/types/onyx' ;
41+ import type { PersonalDetails , Policy , Report , TransactionViolation } from '@src/types/onyx' ;
4242import type { SearchTransactionAction } from '@src/types/onyx/SearchResults' ;
4343import CategoryCell from './DataCells/CategoryCell' ;
4444import ChatBubbleCell from './DataCells/ChatBubbleCell' ;
@@ -86,6 +86,9 @@ type TransactionWithOptionalSearchFields = TransactionWithOptionalHighlight & {
8686
8787 /** Report to which the transaction belongs */
8888 report ?: Report ;
89+
90+ /** Policy to which the transaction belongs */
91+ policy ?: Policy ;
8992} ;
9093
9194type TransactionItemRowProps = {
@@ -190,6 +193,21 @@ function TransactionItemRow({
190193 const merchant = useMemo ( ( ) => getMerchantName ( transactionItem , translate ) , [ transactionItem , translate ] ) ;
191194 const description = getDescription ( transactionItem ) ;
192195
196+ const formattedTaxRate = useMemo ( ( ) => {
197+ const taxRateName = transactionItem ?. policy ?. taxRates ?. taxes ?. [ transactionItem . taxCode ?? '' ] ?. name ?? '' ;
198+ const taxRateValue = transactionItem ?. policy ?. taxRates ?. taxes ?. [ transactionItem . taxCode ?? '' ] ?. value ?? '' ;
199+
200+ if ( ! taxRateName && ! taxRateValue ) {
201+ return '' ;
202+ }
203+
204+ if ( ! taxRateValue ) {
205+ return taxRateName ;
206+ }
207+
208+ return `${ taxRateName } (${ taxRateValue } )` ;
209+ } , [ transactionItem ?. policy ?. taxRates ?. taxes , transactionItem . taxCode ] ) ;
210+
193211 // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
194212 const merchantOrDescription = merchant || description ;
195213
@@ -454,9 +472,17 @@ function TransactionItemRow({
454472 < TextCell text = { transactionItem . reportID === CONST . REPORT . UNREPORTED_REPORT_ID ? '' : getBase62ReportID ( Number ( transactionItem . reportID ) ) } />
455473 </ View >
456474 ) ,
457- [ CONST . SEARCH . TABLE_COLUMNS . TAX ] : (
475+ [ CONST . SEARCH . TABLE_COLUMNS . TAX_RATE ] : (
476+ < View
477+ key = { CONST . SEARCH . TABLE_COLUMNS . TAX_RATE }
478+ style = { [ StyleUtils . getReportTableColumnStyles ( CONST . SEARCH . TABLE_COLUMNS . TAX_RATE ) ] }
479+ >
480+ < TextCell text = { formattedTaxRate } />
481+ </ View >
482+ ) ,
483+ [ CONST . SEARCH . TABLE_COLUMNS . TAX_AMOUNT ] : (
458484 < View
459- key = { CONST . SEARCH . TABLE_COLUMNS . TAX }
485+ key = { CONST . SEARCH . TABLE_COLUMNS . TAX_AMOUNT }
460486 style = { [ StyleUtils . getReportTableColumnStyles ( CONST . SEARCH . TABLE_COLUMNS . TAX_AMOUNT , undefined , undefined , isTaxAmountColumnWide ) ] }
461487 >
462488 < TaxCell
@@ -508,6 +534,7 @@ function TransactionItemRow({
508534 isAmountColumnWide ,
509535 isTaxAmountColumnWide ,
510536 isLargeScreenWidth ,
537+ formattedTaxRate ,
511538 ] ,
512539 ) ;
513540 const shouldRenderChatBubbleCell = useMemo ( ( ) => {
0 commit comments