diff --git a/src/CONST/index.ts b/src/CONST/index.ts index f88ade495d2f..48819c93f275 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -6690,6 +6690,7 @@ const CONST = { DATE: this.TABLE_COLUMNS.DATE, SUBMITTED: this.TABLE_COLUMNS.SUBMITTED, APPROVED: this.TABLE_COLUMNS.APPROVED, + POSTED: this.TABLE_COLUMNS.POSTED, MERCHANT: this.TABLE_COLUMNS.MERCHANT, FROM: this.TABLE_COLUMNS.FROM, TO: this.TABLE_COLUMNS.TO, @@ -6781,6 +6782,7 @@ const CONST = { DATE: 'date', SUBMITTED: 'submitted', APPROVED: 'approved', + POSTED: 'posted', MERCHANT: 'merchant', DESCRIPTION: 'description', FROM: 'from', diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 77ea13755312..e72b153e325c 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -1041,7 +1041,7 @@ function Search({ navigation.setParams({q: newQuery, rawQuery: undefined}); }; - const {shouldShowYearCreated, shouldShowYearSubmitted, shouldShowYearApproved} = shouldShowYearUtil(searchResults?.data, isExpenseReportType ?? false); + const {shouldShowYearCreated, shouldShowYearSubmitted, shouldShowYearApproved, shouldShowYearPosted} = shouldShowYearUtil(searchResults?.data, isExpenseReportType ?? false); const {shouldShowAmountInWideColumn, shouldShowTaxAmountInWideColumn} = getWideAmountIndicators(searchResults?.data); const shouldShowSorting = !validGroupBy; const shouldShowTableHeader = isLargeScreenWidth && !isChat && !validGroupBy; @@ -1074,6 +1074,7 @@ function Search({ shouldShowYear={shouldShowYearCreated} shouldShowYearSubmitted={shouldShowYearSubmitted} shouldShowYearApproved={shouldShowYearApproved} + shouldShowYearPosted={shouldShowYearPosted} isAmountColumnWide={shouldShowAmountInWideColumn} isTaxAmountColumnWide={shouldShowTaxAmountInWideColumn} shouldShowSorting={shouldShowSorting} diff --git a/src/components/SelectionListWithSections/Search/TransactionListItem.tsx b/src/components/SelectionListWithSections/Search/TransactionListItem.tsx index b25f96635983..d790cb5a86d5 100644 --- a/src/components/SelectionListWithSections/Search/TransactionListItem.tsx +++ b/src/components/SelectionListWithSections/Search/TransactionListItem.tsx @@ -97,13 +97,14 @@ function TransactionListItem({ backgroundColor: theme.highlightBG, }); - const {amountColumnSize, dateColumnSize, taxAmountColumnSize, submittedColumnSize, approvedColumnSize} = useMemo(() => { + const {amountColumnSize, dateColumnSize, taxAmountColumnSize, submittedColumnSize, approvedColumnSize, postedColumnSize} = useMemo(() => { return { amountColumnSize: transactionItem.isAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, taxAmountColumnSize: transactionItem.isTaxAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, dateColumnSize: transactionItem.shouldShowYear ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, submittedColumnSize: transactionItem.shouldShowYearSubmitted ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, approvedColumnSize: transactionItem.shouldShowYearApproved ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, + postedColumnSize: transactionItem.shouldShowYearPosted ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, }; }, [ transactionItem.isAmountColumnWide, @@ -111,6 +112,7 @@ function TransactionListItem({ transactionItem.shouldShowYear, transactionItem.shouldShowYearSubmitted, transactionItem.shouldShowYearApproved, + transactionItem.shouldShowYearPosted, ]); const transactionViolations = useMemo(() => { @@ -193,6 +195,7 @@ function TransactionListItem({ dateColumnSize={dateColumnSize} submittedColumnSize={submittedColumnSize} approvedColumnSize={approvedColumnSize} + postedColumnSize={postedColumnSize} amountColumnSize={amountColumnSize} taxAmountColumnSize={taxAmountColumnSize} shouldShowCheckbox={!!canSelectMultiple} diff --git a/src/components/SelectionListWithSections/SearchTableHeader.tsx b/src/components/SelectionListWithSections/SearchTableHeader.tsx index 250a13725754..d55e102ac7ea 100644 --- a/src/components/SelectionListWithSections/SearchTableHeader.tsx +++ b/src/components/SelectionListWithSections/SearchTableHeader.tsx @@ -42,6 +42,10 @@ const getExpenseHeaders = (groupBy?: SearchGroupBy): SearchColumnConfig[] => [ columnName: CONST.SEARCH.TABLE_COLUMNS.APPROVED, translationKey: 'search.filters.approved', }, + { + columnName: CONST.SEARCH.TABLE_COLUMNS.POSTED, + translationKey: 'search.filters.posted', + }, { columnName: CONST.SEARCH.TABLE_COLUMNS.MERCHANT, translationKey: 'common.merchant', @@ -215,6 +219,7 @@ type SearchTableHeaderProps = { shouldShowYear: boolean; shouldShowYearSubmitted?: boolean; shouldShowYearApproved?: boolean; + shouldShowYearPosted?: boolean; isAmountColumnWide: boolean; isTaxAmountColumnWide: boolean; shouldShowSorting: boolean; @@ -232,6 +237,7 @@ function SearchTableHeader({ shouldShowYear, shouldShowYearSubmitted, shouldShowYearApproved, + shouldShowYearPosted, shouldShowSorting, canSelectMultiple, isAmountColumnWide, @@ -272,6 +278,7 @@ function SearchTableHeader({ dateColumnSize={shouldShowYear ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} submittedColumnSize={shouldShowYearSubmitted ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} approvedColumnSize={shouldShowYearApproved ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} + postedColumnSize={shouldShowYearPosted ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} amountColumnSize={isAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} taxAmountColumnSize={isTaxAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} shouldShowSorting={shouldShowSorting} diff --git a/src/components/SelectionListWithSections/SortableTableHeader.tsx b/src/components/SelectionListWithSections/SortableTableHeader.tsx index 1920bd750e18..728b36c5b685 100644 --- a/src/components/SelectionListWithSections/SortableTableHeader.tsx +++ b/src/components/SelectionListWithSections/SortableTableHeader.tsx @@ -27,6 +27,7 @@ type SearchTableHeaderProps = { dateColumnSize: TableColumnSize; submittedColumnSize?: TableColumnSize; approvedColumnSize?: TableColumnSize; + postedColumnSize?: TableColumnSize; amountColumnSize: TableColumnSize; taxAmountColumnSize: TableColumnSize; containerStyles?: StyleProp; @@ -43,6 +44,7 @@ function SortableTableHeader({ dateColumnSize, submittedColumnSize, approvedColumnSize, + postedColumnSize, containerStyles, shouldShowSorting, onSortPress, @@ -83,6 +85,7 @@ function SortableTableHeader({ !!areAllOptionalColumnsHidden, submittedColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE, approvedColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE, + postedColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE, ), ]} isSortable={isSortable} diff --git a/src/components/SelectionListWithSections/types.ts b/src/components/SelectionListWithSections/types.ts index 9db2323fbd90..6f9e89a728ec 100644 --- a/src/components/SelectionListWithSections/types.ts +++ b/src/components/SelectionListWithSections/types.ts @@ -249,6 +249,9 @@ type TransactionListItemType = ListItem & /** The date the report was approved */ approved?: string; + /** The date the report was posted */ + posted?: string; + /** Policy to which the transaction belongs */ policy: Policy | undefined; @@ -297,6 +300,11 @@ type TransactionListItemType = ListItem & */ shouldShowYearApproved: boolean; + /** Whether we should show the year for the posted date. + * This is true if at least one transaction in the dataset was posted in past years + */ + shouldShowYearPosted: boolean; + isAmountColumnWide: boolean; isTaxAmountColumnWide: boolean; diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 6753c6741a92..8b3606761416 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -92,6 +92,7 @@ type TransactionItemRowProps = { dateColumnSize: TableColumnSize; submittedColumnSize?: TableColumnSize; approvedColumnSize?: TableColumnSize; + postedColumnSize?: TableColumnSize; amountColumnSize: TableColumnSize; taxAmountColumnSize: TableColumnSize; onCheckboxPress?: (transactionID: string) => void; @@ -136,6 +137,7 @@ function TransactionItemRow({ dateColumnSize, submittedColumnSize, approvedColumnSize, + postedColumnSize, amountColumnSize, taxAmountColumnSize, onCheckboxPress = () => {}, @@ -169,6 +171,7 @@ function TransactionItemRow({ const isDateColumnWide = dateColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE; const isSubmittedColumnWide = submittedColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE; const isApprovedColumnWide = approvedColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE; + const isPostedColumnWide = postedColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE; const isAmountColumnWide = amountColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE; const isTaxAmountColumnWide = taxAmountColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE; @@ -284,6 +287,18 @@ function TransactionItemRow({ /> ), + [CONST.SEARCH.TABLE_COLUMNS.POSTED]: ( + + + + ), [CONST.SEARCH.TABLE_COLUMNS.CATEGORY]: ( { +): Pick { const isExpenseReport = report?.type === CONST.REPORT.TYPE.EXPENSE; const fromName = getDisplayNameOrDefault(from); @@ -670,12 +671,16 @@ function getTransactionItemCommonFormattedProperties( const submitted = report?.submitted; const approved = report?.approved; + // Posted date is in the YYYYMMDD format, so we format it to YYYY-MM-DD here since JS's Date constructor interprets it as an invalid date. + const posted = !transactionItem?.posted ? '' : `${transactionItem?.posted.slice(0, 4)}-${transactionItem?.posted.slice(4, 6)}-${transactionItem?.posted.slice(6, 8)}`; + return { formattedFrom, formattedTo, date, submitted, approved, + posted, formattedTotal, formattedMerchant, }; @@ -858,6 +863,7 @@ type ShouldShowYearResult = { shouldShowYearCreated: boolean; shouldShowYearSubmitted: boolean; shouldShowYearApproved: boolean; + shouldShowYearPosted: boolean; }; /** @@ -874,6 +880,7 @@ function shouldShowYear( shouldShowYearCreated: false, shouldShowYearSubmitted: false, shouldShowYearApproved: false, + shouldShowYearPosted: false, }; const currentYear = new Date().getFullYear(); @@ -908,10 +915,16 @@ function shouldShowYear( if (item.approved && DateUtils.doesDateBelongToAPastYear(item.approved)) { result.shouldShowYearApproved = true; } + + // Posted date is in the YYYYMMDD format, so we extract the year manually here since JS's Date constructor interprets it as an invalid date. + if (item?.posted) { + const postedYear = parseInt(item.posted.slice(0, 4), 10); + result.shouldShowYearPosted = postedYear !== currentYear; + } } // Early exit if all flags are true - if (result.shouldShowYearCreated && result.shouldShowYearSubmitted) { + if (result.shouldShowYearCreated && result.shouldShowYearSubmitted && result.shouldShowYearApproved && result.shouldShowYearPosted) { return result; } } @@ -931,6 +944,12 @@ function shouldShowYear( if (report?.approved && DateUtils.doesDateBelongToAPastYear(report.approved)) { result.shouldShowYearApproved = true; } + + // Posted date is in the YYYYMMDD format, so we extract the year manually here since JS's Date constructor interprets it as an invalid date. + if (item?.posted) { + const postedYear = parseInt(item.posted.slice(0, 4), 10); + result.shouldShowYearPosted = postedYear !== currentYear; + } } else if (!checkOnlyReports && isReportActionEntry(key)) { const item = data[key]; for (const action of Object.values(item)) { @@ -954,7 +973,7 @@ function shouldShowYear( } // Early exit if all flags are true - if (result.shouldShowYearCreated && result.shouldShowYearSubmitted) { + if (result.shouldShowYearCreated && result.shouldShowYearSubmitted && result.shouldShowYearApproved && result.shouldShowYearPosted) { return result; } } @@ -1111,7 +1130,7 @@ function getTransactionsSections( isActionLoadingSet: ReadonlySet | undefined, ): [TransactionListItemType[], number] { const shouldShowMerchant = getShouldShowMerchant(data); - const {shouldShowYearCreated, shouldShowYearSubmitted, shouldShowYearApproved} = shouldShowYear(data); + const {shouldShowYearCreated, shouldShowYearSubmitted, shouldShowYearApproved, shouldShowYearPosted} = shouldShowYear(data); const {shouldShowAmountInWideColumn, shouldShowTaxAmountInWideColumn} = getWideAmountIndicators(data); // Pre-filter transaction keys to avoid repeated checks @@ -1160,7 +1179,7 @@ function getTransactionsSections( const from = reportAction?.actorAccountID ? (personalDetailsMap.get(reportAction.actorAccountID.toString()) ?? emptyPersonalDetails) : emptyPersonalDetails; const to = getToFieldValueForTransaction(transactionItem, report, data.personalDetailsList, reportAction); - const {formattedFrom, formattedTo, formattedTotal, formattedMerchant, date, submitted, approved} = getTransactionItemCommonFormattedProperties( + const {formattedFrom, formattedTo, formattedTotal, formattedMerchant, date, submitted, approved, posted} = getTransactionItemCommonFormattedProperties( transactionItem, from, to, @@ -1187,10 +1206,12 @@ function getTransactionsSections( date, submitted, approved, + posted, shouldShowMerchant, shouldShowYear: shouldShowYearCreated, shouldShowYearSubmitted, shouldShowYearApproved, + shouldShowYearPosted, isAmountColumnWide: shouldShowAmountInWideColumn, isTaxAmountColumnWide: shouldShowTaxAmountInWideColumn, violations: transactionViolations, @@ -1566,6 +1587,7 @@ function getReportSections( shouldShowYearCreated: shouldShowYearCreatedTransaction, shouldShowYearSubmitted: shouldShowYearSubmittedTransaction, shouldShowYearApproved: shouldShowYearApprovedTransaction, + shouldShowYearPosted: shouldShowYearPostedTransaction, } = shouldShowYear(data); const {shouldShowAmountInWideColumn, shouldShowTaxAmountInWideColumn} = getWideAmountIndicators(data); const {moneyRequestReportActionsByTransactionID, holdReportActionsByTransactionID} = createReportActionsLookupMaps(data); @@ -1717,6 +1739,7 @@ function getReportSections( shouldShowYear: shouldShowYearCreatedTransaction, shouldShowYearSubmitted: shouldShowYearSubmittedTransaction, shouldShowYearApproved: shouldShowYearApprovedTransaction, + shouldShowYearPosted: shouldShowYearPostedTransaction, keyForList: transactionItem.transactionID, violations: transactionViolations, isAmountColumnWide: shouldShowAmountInWideColumn, @@ -2209,6 +2232,8 @@ function getSearchColumnTranslationKey(columnId: SearchCustomColumnIds): Transla return 'common.submitted'; case CONST.SEARCH.TABLE_COLUMNS.APPROVED: return 'search.filters.approved'; + case CONST.SEARCH.TABLE_COLUMNS.POSTED: + return 'search.filters.posted'; case CONST.SEARCH.TABLE_COLUMNS.MERCHANT: return 'common.merchant'; case CONST.SEARCH.TABLE_COLUMNS.FROM: @@ -2679,6 +2704,7 @@ function getColumnsToShow( [CONST.SEARCH.TABLE_COLUMNS.DATE]: true, [CONST.SEARCH.TABLE_COLUMNS.SUBMITTED]: false, [CONST.SEARCH.TABLE_COLUMNS.APPROVED]: false, + [CONST.SEARCH.TABLE_COLUMNS.POSTED]: false, [CONST.SEARCH.TABLE_COLUMNS.MERCHANT]: false, [CONST.SEARCH.TABLE_COLUMNS.DESCRIPTION]: false, [CONST.SEARCH.TABLE_COLUMNS.FROM]: false, @@ -2890,7 +2916,7 @@ function getTableMinWidth(columns: SearchColumnType[]) { minWidth += 80; } else if (column === CONST.SEARCH.TABLE_COLUMNS.DATE) { minWidth += 48; - } else if (column === CONST.SEARCH.TABLE_COLUMNS.SUBMITTED || column === CONST.SEARCH.TABLE_COLUMNS.APPROVED) { + } else if (column === CONST.SEARCH.TABLE_COLUMNS.SUBMITTED || column === CONST.SEARCH.TABLE_COLUMNS.APPROVED || column === CONST.SEARCH.TABLE_COLUMNS.POSTED) { minWidth += 72; } else if (column === CONST.SEARCH.TABLE_COLUMNS.TYPE) { minWidth += 20; diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index be6adc1f30db..d1cb7ea5711c 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1726,6 +1726,7 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ isDateColumnFullWidth = false, isSubmittedColumnWide = false, isApprovedColumnWide = false, + isPostedColumnWide = false, ): ViewStyle => { let columnWidth; switch (columnName) { @@ -1745,6 +1746,9 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ case CONST.SEARCH.TABLE_COLUMNS.APPROVED: columnWidth = {...getWidthStyle(isApprovedColumnWide ? variables.w92 : variables.w72)}; break; + case CONST.SEARCH.TABLE_COLUMNS.POSTED: + columnWidth = {...getWidthStyle(isPostedColumnWide ? variables.w92 : variables.w72)}; + break; case CONST.SEARCH.TABLE_COLUMNS.DATE: // We will remove this variable & param, but in a follow up PR. We are duplicating the logic here to "use" the variable // to prevent eslint errors. This will be removed diff --git a/src/types/onyx/SearchResults.ts b/src/types/onyx/SearchResults.ts index 08b66a5086af..8e273aa050bf 100644 --- a/src/types/onyx/SearchResults.ts +++ b/src/types/onyx/SearchResults.ts @@ -169,6 +169,9 @@ type SearchTransaction = { /** The group currency if the transaction is grouped. Defaults to the active policy currency if group has no target currency */ groupCurrency?: string; + + /** The card transaction's posted date */ + posted?: string; }; /** Model of tasks search result */ diff --git a/tests/unit/MoneyRequestReportUtilsTest.ts b/tests/unit/MoneyRequestReportUtilsTest.ts index b56254c74b23..230e7cc55997 100644 --- a/tests/unit/MoneyRequestReportUtilsTest.ts +++ b/tests/unit/MoneyRequestReportUtilsTest.ts @@ -65,6 +65,7 @@ const transactionItemBaseMock: TransactionListItemType = { created: '2024-12-21', submitted: '2024-12-21', approved: undefined, + posted: undefined, currency: 'USD', date: '2024-12-21', formattedFrom: 'Admin', @@ -91,6 +92,7 @@ const transactionItemBaseMock: TransactionListItemType = { shouldShowYear: true, shouldShowYearSubmitted: true, shouldShowYearApproved: false, + shouldShowYearPosted: false, isAmountColumnWide: false, isTaxAmountColumnWide: false, tag: '', diff --git a/tests/unit/Search/SearchUIUtilsTest.ts b/tests/unit/Search/SearchUIUtilsTest.ts index 09d581ade300..97c46b3549e6 100644 --- a/tests/unit/Search/SearchUIUtilsTest.ts +++ b/tests/unit/Search/SearchUIUtilsTest.ts @@ -775,6 +775,7 @@ const transactionsListItems = [ created: '2024-12-21', submitted: undefined, approved: undefined, + posted: '', currency: 'USD', date: '2024-12-21', formattedFrom: 'Admin', @@ -801,6 +802,7 @@ const transactionsListItems = [ shouldShowYear: true, shouldShowYearSubmitted: true, shouldShowYearApproved: false, + shouldShowYearPosted: false, isAmountColumnWide: false, isTaxAmountColumnWide: false, tag: '', @@ -831,6 +833,7 @@ const transactionsListItems = [ created: '2024-12-21', submitted: '2024-12-21 13:05:20', approved: undefined, + posted: '', currency: 'USD', date: '2024-12-21', formattedFrom: 'Admin', @@ -856,6 +859,7 @@ const transactionsListItems = [ shouldShowYear: true, shouldShowYearSubmitted: true, shouldShowYearApproved: false, + shouldShowYearPosted: false, isAmountColumnWide: false, isTaxAmountColumnWide: false, tag: '', @@ -897,6 +901,7 @@ const transactionsListItems = [ created: '2025-03-05', submitted: '2025-03-05', approved: undefined, + posted: '', currency: 'VND', hasEReceipt: false, merchant: '(none)', @@ -929,6 +934,7 @@ const transactionsListItems = [ shouldShowYear: true, shouldShowYearSubmitted: true, shouldShowYearApproved: false, + shouldShowYearPosted: false, keyForList: '3', isAmountColumnWide: false, isTaxAmountColumnWide: false, @@ -958,6 +964,7 @@ const transactionsListItems = [ created: '2025-03-05', submitted: '2025-03-05', approved: undefined, + posted: '', currency: 'VND', hasEReceipt: false, merchant: '(none)', @@ -990,6 +997,7 @@ const transactionsListItems = [ shouldShowYear: true, shouldShowYearSubmitted: true, shouldShowYearApproved: false, + shouldShowYearPosted: false, keyForList: '4', isAmountColumnWide: false, isTaxAmountColumnWide: false, @@ -1082,6 +1090,7 @@ const transactionReportGroupListItems = [ shouldShowYear: true, shouldShowYearSubmitted: true, shouldShowYearApproved: false, + shouldShowYearPosted: false, isAmountColumnWide: false, isTaxAmountColumnWide: false, tag: '', @@ -1188,6 +1197,7 @@ const transactionReportGroupListItems = [ shouldShowYear: true, shouldShowYearSubmitted: true, shouldShowYearApproved: false, + shouldShowYearPosted: false, isAmountColumnWide: false, isTaxAmountColumnWide: false, tag: '', @@ -1306,6 +1316,7 @@ const transactionReportGroupListItems = [ shouldShowYear: true, shouldShowYearSubmitted: true, shouldShowYearApproved: false, + shouldShowYearPosted: false, keyForList: '3', isAmountColumnWide: false, isTaxAmountColumnWide: false, @@ -1365,6 +1376,7 @@ const transactionReportGroupListItems = [ shouldShowYear: true, shouldShowYearSubmitted: true, shouldShowYearApproved: false, + shouldShowYearPosted: false, keyForList: '4', isAmountColumnWide: false, isTaxAmountColumnWide: false, @@ -1861,7 +1873,7 @@ describe('SearchUIUtils', () => { expect(distanceTransaction).toBeDefined(); expect(distanceTransaction?.iouRequestType).toBe(CONST.IOU.REQUEST_TYPE.DISTANCE); - const expectedPropertyCount = 50; + const expectedPropertyCount = 52; expect(Object.keys(distanceTransaction ?? {}).length).toBe(expectedPropertyCount); }); @@ -1894,7 +1906,7 @@ describe('SearchUIUtils', () => { expect(distanceTransaction).toBeDefined(); expect(distanceTransaction?.iouRequestType).toBe(CONST.IOU.REQUEST_TYPE.DISTANCE); - const expectedPropertyCount = 48; + const expectedPropertyCount = 49; expect(Object.keys(distanceTransaction ?? {}).length).toBe(expectedPropertyCount); }); diff --git a/tests/unit/Search/handleActionButtonPressTest.ts b/tests/unit/Search/handleActionButtonPressTest.ts index 3da97338f22b..bfb339a6c348 100644 --- a/tests/unit/Search/handleActionButtonPressTest.ts +++ b/tests/unit/Search/handleActionButtonPressTest.ts @@ -18,6 +18,7 @@ const mockReportItemWithHold = { created: '2024-12-04 23:18:33', submitted: '2024-12-04', approved: undefined, + posted: undefined, currency: 'USD', isOneTransactionReport: false, isPolicyExpenseChat: false, @@ -68,6 +69,7 @@ const mockReportItemWithHold = { shouldShowYear: false, shouldShowYearSubmitted: false, shouldShowYearApproved: false, + shouldShowYearPosted: false, transactions: [ { report: { @@ -114,6 +116,7 @@ const mockReportItemWithHold = { parentTransactionID: '', submitted: '2024-12-04', approved: undefined, + posted: undefined, policyID: '48D7178DE42EE9F9', reportID: '1350959062018695', reportType: 'expense', @@ -159,6 +162,7 @@ const mockReportItemWithHold = { shouldShowYear: false, shouldShowYearSubmitted: false, shouldShowYearApproved: false, + shouldShowYearPosted: false, keyForList: '1049531721038862176', isAmountColumnWide: false, isTaxAmountColumnWide: false, @@ -197,6 +201,7 @@ const mockReportItemWithHold = { created: '2024-12-04', submitted: '2024-12-04', approved: undefined, + posted: undefined, currency: 'USD', hasEReceipt: false, merchant: 'Forbes', @@ -229,6 +234,7 @@ const mockReportItemWithHold = { shouldShowYear: false, shouldShowYearSubmitted: false, shouldShowYearApproved: false, + shouldShowYearPosted: false, keyForList: '5345995386715609966', isAmountColumnWide: false, isTaxAmountColumnWide: false, diff --git a/tests/unit/TransactionGroupListItemTest.tsx b/tests/unit/TransactionGroupListItemTest.tsx index 17d04c835034..a6d46d6544bc 100644 --- a/tests/unit/TransactionGroupListItemTest.tsx +++ b/tests/unit/TransactionGroupListItemTest.tsx @@ -33,6 +33,7 @@ const mockTransaction: TransactionListItemType = { created: '2025-09-19', submitted: '2025-09-19', approved: undefined, + posted: undefined, currency: 'USD', policy: { id: '06F34677820A4D07', @@ -69,6 +70,7 @@ const mockTransaction: TransactionListItemType = { shouldShowYear: true, shouldShowYearSubmitted: false, shouldShowYearApproved: false, + shouldShowYearPosted: false, keyForList: '1', isAmountColumnWide: false, isTaxAmountColumnWide: false,