From bdc2cf306d1fea079a79d51754192b100e179298 Mon Sep 17 00:00:00 2001 From: cosmicvulpes Date: Fri, 30 Jan 2026 22:01:51 +0530 Subject: [PATCH] fix: hide tax columns for time expenses in TransactionItemRow Time expenses do not support taxes (established in #77748). This fix hides TAX_RATE and TAX_AMOUNT columns for time expense transactions in the Reports > Expenses view. Fixes #80208 --- src/components/TransactionItemRow/index.tsx | 13 +++++++---- tests/ui/TransactionItemRowRBRTest.tsx | 26 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 4012925a6a47a..3aa97beb8ff85 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -41,6 +41,7 @@ import { isAmountMissing, isMerchantMissing, isScanning, + isTimeRequest, isUnreportedAndHasInvalidDistanceRateTransaction, } from '@libs/TransactionUtils'; import CONST from '@src/CONST'; @@ -528,7 +529,7 @@ function TransactionItemRow({ key={CONST.SEARCH.TABLE_COLUMNS.TAX_RATE} style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.TAX_RATE)]} > - + ), [CONST.SEARCH.TABLE_COLUMNS.TAX_AMOUNT]: ( @@ -536,10 +537,12 @@ function TransactionItemRow({ key={CONST.SEARCH.TABLE_COLUMNS.TAX_AMOUNT} style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.TAX_AMOUNT, undefined, undefined, isTaxAmountColumnWide)]} > - + {isTimeRequest(transactionItem) ? null : ( + + )} ), [CONST.SEARCH.TABLE_COLUMNS.POLICY_NAME]: ( diff --git a/tests/ui/TransactionItemRowRBRTest.tsx b/tests/ui/TransactionItemRowRBRTest.tsx index 3b24ed1ab444a..13b4f47600df8 100644 --- a/tests/ui/TransactionItemRowRBRTest.tsx +++ b/tests/ui/TransactionItemRowRBRTest.tsx @@ -283,6 +283,32 @@ describe('TransactionItemRowRBR', () => { expect(screen.getByText('Unexpected error posting the comment. Please try again later. Missing category.')).toBeOnTheScreen(); }); + it('should not display tax columns for time expense transactions', async () => { + const mockTimeTransaction = createBaseTransaction({ + iouRequestType: CONST.IOU.REQUEST_TYPE.TIME, + taxAmount: 1000, + taxCode: 'TAX_CODE_1', + taxValue: '10%', + }); + await Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION}${MOCK_TRANSACTION_ID}`, mockTimeTransaction); + + render( + + + , + ); + await waitForBatchedUpdates(); + + expect(screen.queryByText('10%')).not.toBeOnTheScreen(); + expect(screen.queryByText('$10.00')).not.toBeOnTheScreen(); + }); + it('should display RBR message for transaction with violations, errors, and missing merchant error', async () => { // Given a transaction with violations, errors, and missing merchant error const mockViolations: TransactionViolations = [