Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cecf886
Add receipt-type search filter constants and screen
allgandalf Jun 21, 2026
9f4c165
Add receipt-type advanced filter form types
allgandalf Jun 21, 2026
65b0b4a
Parse receipt-type in the search grammar
allgandalf Jun 21, 2026
b375cc1
Register the receipt-type filter page route
allgandalf Jun 21, 2026
34ec00a
Add the receipt-type filter page
allgandalf Jun 21, 2026
5848633
Render receipt-type in the advanced filter components
allgandalf Jun 21, 2026
d817c1f
Show receipt-type in search filter display and options
allgandalf Jun 21, 2026
791c2ff
Build and parse receipt-type query filter values
allgandalf Jun 21, 2026
191362d
Add receipt-type translation key helper
allgandalf Jun 21, 2026
ccad8b8
Add receipt-type to advanced search filter hooks
allgandalf Jun 21, 2026
96c19b7
Add receipt-type filter translations
allgandalf Jun 21, 2026
8dbce6a
Test the receipt-type search filter
allgandalf Jun 21, 2026
46f3fb7
Merge branch 'Expensify:main' into search-receipt-type-filter
allgandalf Jun 21, 2026
6b12640
Remove redundant manual memoization in receipt type page
allgandalf Jun 21, 2026
de91640
Clear conflicting negated receipt types on positive selection
allgandalf Jun 21, 2026
9ad7564
Merge branch 'Expensify:main' into search-receipt-type-filter
allgandalf Jun 22, 2026
57c0ec6
Merge branch 'Expensify:main' into search-receipt-type-filter
allgandalf Jun 26, 2026
b29c110
Hoist receipt type lookup to a Set in the receipt type page
allgandalf Jun 26, 2026
1c31e9a
Clear conflicting negated receipt types on the generic filter picker …
allgandalf Jun 26, 2026
4ee6fda
Merge branch 'Expensify:main' into search-receipt-type-filter
allgandalf Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6407,6 +6407,11 @@ const CONST = {
PER_DIEM: 'perDiem',
TIME: 'time',
},
RECEIPT_TYPE: {
ERECEIPT: 'ereceipt',
ITEMIZED: 'itemized',
HOTEL: 'hotel',
},
WITHDRAWAL_TYPE: {
EXPENSIFY_CARD: 'expensify-card',
REIMBURSEMENT: 'reimbursement',
Expand Down Expand Up @@ -6786,6 +6791,7 @@ const CONST = {
DATE: 'date',
AMOUNT: 'amount',
EXPENSE_TYPE: 'expenseType',
RECEIPT_TYPE: 'receiptType',
CURRENCY: 'currency',
GROUP_CURRENCY: 'groupCurrency',
MERCHANT: 'merchant',
Expand Down Expand Up @@ -6861,6 +6867,7 @@ const CONST = {
AMOUNT: 'amount',
TOTAL: 'total',
EXPENSE_TYPE: 'expense-type',
RECEIPT_TYPE: 'receipt-type',
CURRENCY: 'currency',
GROUP_CURRENCY: 'group-currency',
MERCHANT: 'merchant',
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const SCREENS = {
ADVANCED_FILTERS_CARD_RHP: 'Search_Advanced_Filters_Card_RHP',
ADVANCED_FILTERS_TAX_RATE_RHP: 'Search_Advanced_Filters_Tax_Rate_RHP',
ADVANCED_FILTERS_EXPENSE_TYPE_RHP: 'Search_Advanced_Filters_Expense_Type_RHP',
ADVANCED_FILTERS_RECEIPT_TYPE_RHP: 'Search_Advanced_Filters_Receipt_Type_RHP',
ADVANCED_FILTERS_WITHDRAWAL_TYPE_RHP: 'Search_Advanced_Filters_Withdrawal_Type_RHP',
ADVANCED_FILTERS_WITHDRAWAL_STATUS_RHP: 'Search_Advanced_Filters_Withdrawal_Status_RHP',
ADVANCED_FILTERS_IS_RHP: 'Search_Advanced_Filters_Is_RHP',
Expand Down
2 changes: 2 additions & 0 deletions src/components/Search/FilterComponents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type MultiSelectFilterKeys =
| typeof CONST.SEARCH.SYNTAX_FILTER_KEYS.HAS
| typeof CONST.SEARCH.SYNTAX_FILTER_KEYS.IS
| typeof CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPENSE_TYPE
| typeof CONST.SEARCH.SYNTAX_FILTER_KEYS.RECEIPT_TYPE
| typeof CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_STATUS
| typeof CONST.SEARCH.SYNTAX_FILTER_KEYS.STATUS;
type MultiSelectFilterComponentsProps = SearchFilterCommonProps<SearchAdvancedFiltersForm[MultiSelectFilterKeys] | undefined> & {
Expand Down Expand Up @@ -214,6 +215,7 @@ function FilterComponents({filterKey, value, type, policyIDs, policyIDQuery, sel
case CONST.SEARCH.SYNTAX_FILTER_KEYS.HAS:
case CONST.SEARCH.SYNTAX_FILTER_KEYS.IS:
case CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPENSE_TYPE:
case CONST.SEARCH.SYNTAX_FILTER_KEYS.RECEIPT_TYPE:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear receiptTypeNot on the generic picker path

Fresh evidence after the follow-up fix: SearchAdvancedFiltersBase still routes every filter row through ROUTES.SEARCH_ADVANCED_FILTERS_CONTENT, so this generic multiselect is the path used from the Filters list, not the dedicated receipt-type page. When the current query contains -receipt-type:hotel, this path only merges {receiptType: ['hotel']} and leaves the existing receiptTypeNot in the draft filters; applying then serializes both -receiptType:hotel and receiptType:hotel, making the search unsatisfiable for that selected value.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, the dedicated page isn't the path the Filters list uses. fixed in 1c31e9a, the generic content page (SearchAdvancedFiltersContentBase) now drops the conflicting values from receiptTypeNot when a positive receipt-type selection is applied.

case CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_STATUS:
case CONST.SEARCH.SYNTAX_FILTER_KEYS.STATUS: {
return (
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useAdvancedSearchFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const typeFiltersKeys = {
CONST.SEARCH.SYNTAX_FILTER_KEYS.PURCHASE_AMOUNT,
CONST.SEARCH.SYNTAX_FILTER_KEYS.PURCHASE_CURRENCY,
CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPENSE_TYPE,
CONST.SEARCH.SYNTAX_FILTER_KEYS.RECEIPT_TYPE,
CONST.SEARCH.SYNTAX_FILTER_KEYS.REPORT_ID,
CONST.SEARCH.SYNTAX_FILTER_KEYS.REPORT_FIELD,
CONST.SEARCH.SYNTAX_FILTER_KEYS.HAS,
Expand Down
11 changes: 11 additions & 0 deletions src/hooks/useAutocompleteSuggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const DATA_TYPE_VALUES = Object.values(CONST.SEARCH.DATA_TYPES);
const GROUP_BY_FRIENDLY_VALUES = Object.values(CONST.SEARCH.GROUP_BY).map((value) => getUserFriendlyValue(value));
const VIEW_FRIENDLY_VALUES = Object.values(CONST.SEARCH.VIEW).map((value) => getUserFriendlyValue(value));
const EXPENSE_TYPE_FRIENDLY_VALUES = Object.values(CONST.SEARCH.TRANSACTION_TYPE).map((value) => getUserFriendlyValue(value));
const RECEIPT_TYPE_FRIENDLY_VALUES = Object.values(CONST.SEARCH.RECEIPT_TYPE).map((value) => getUserFriendlyValue(value));
const WITHDRAWAL_TYPE_VALUES = Object.values(CONST.SEARCH.WITHDRAWAL_TYPE);
const WITHDRAWAL_STATUS_VALUES = Object.values(CONST.SEARCH.SETTLEMENT_STATUS);
const BOOLEAN_VALUES = Object.values(CONST.SEARCH.BOOLEAN);
Expand Down Expand Up @@ -367,6 +368,16 @@ function useAutocompleteSuggestions({
text: expenseType,
}));
}
case CONST.SEARCH.SYNTAX_FILTER_KEYS.RECEIPT_TYPE: {
const filteredReceiptTypes = RECEIPT_TYPE_FRIENDLY_VALUES.filter(
(receiptType) => receiptType.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(receiptType),
).sort();

return filteredReceiptTypes.map((receiptType) => ({
filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.RECEIPT_TYPE,
text: receiptType,
}));
}
case CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE: {
const filteredWithdrawalTypes = WITHDRAWAL_TYPE_VALUES.filter(
(withdrawalType) => withdrawalType.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(withdrawalType),
Expand Down
6 changes: 6 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8577,6 +8577,12 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
noMerchant: 'Kein Händler',
noTag: 'Kein Tag',
expenseType: 'Ausgabenart',
receiptType: 'Belegart',
receiptTypeValues: {
ereceipt: 'eBeleg',
itemized: 'Aufgeschlüsselt',
hotel: 'Hotel',
},
withdrawalType: 'Auszahlungsart',
recentSearches: 'Letzte Suchen',
recentChats: 'Neueste Chats',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8670,6 +8670,12 @@ const translations = {
noMerchant: 'No merchant',
noTag: 'No tag',
expenseType: 'Expense type',
receiptType: 'Receipt type',
receiptTypeValues: {
ereceipt: 'eReceipt',
itemized: 'Itemized',
hotel: 'Hotel',
},
withdrawalType: 'Withdrawal type',
recentSearches: 'Recent searches',
recentChats: 'Recent chats',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8378,6 +8378,12 @@ ${amount} para ${merchant} - ${date}`,
noMerchant: 'Sin comerciante',
noTag: 'Sin etiqueta',
expenseType: 'Tipo de gasto',
receiptType: 'Tipo de recibo',
receiptTypeValues: {
ereceipt: 'Recibo electrónico',
itemized: 'Detallado',
hotel: 'Hotel',
},
withdrawalType: 'Tipo de retiro',
recentSearches: 'Búsquedas recientes',
recentChats: 'Chats recientes',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8611,6 +8611,12 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
noMerchant: 'Aucun commerçant',
noTag: 'Aucun tag',
expenseType: 'Type de dépense',
receiptType: 'Type de reçu',
receiptTypeValues: {
ereceipt: 'eReçu',
itemized: 'Détaillé',
hotel: 'Hôtel',
},
withdrawalType: 'Type de retrait',
recentSearches: 'Recherches récentes',
recentChats: 'Discussions récentes',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8566,6 +8566,12 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
noMerchant: 'Nessun esercente',
noTag: 'Nessun tag',
expenseType: 'Tipo di spesa',
receiptType: 'Tipo di ricevuta',
receiptTypeValues: {
ereceipt: 'eRicevuta',
itemized: 'Dettagliata',
hotel: 'Hotel',
},
withdrawalType: 'Tipo di prelievo',
recentSearches: 'Ricerche recenti',
recentChats: 'Chat recenti',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8459,6 +8459,12 @@ ${reportName}`,
noMerchant: '店舗なし',
noTag: 'タグなし',
expenseType: '経費の種類',
receiptType: '領収書の種類',
receiptTypeValues: {
ereceipt: '電子領収書',
itemized: '明細',
hotel: 'ホテル',
},
withdrawalType: '出金の種類',
recentSearches: '最近の検索',
recentChats: '最近のチャット',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8521,6 +8521,12 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
noMerchant: 'Geen handelaar',
noTag: 'Geen tag',
expenseType: 'Onkostentype',
receiptType: 'Bontype',
receiptTypeValues: {
ereceipt: 'eBon',
itemized: 'Gespecificeerd',
hotel: 'Hotel',
},
withdrawalType: 'Type opname',
recentSearches: 'Recente zoekopdrachten',
recentChats: 'Recente chats',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8526,6 +8526,12 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
noMerchant: 'Brak sprzedawcy',
noTag: 'Brak tagu',
expenseType: 'Typ wydatku',
receiptType: 'Typ paragonu',
receiptTypeValues: {
ereceipt: 'eParagon',
itemized: 'Szczegółowy',
hotel: 'Hotel',
},
withdrawalType: 'Typ wypłaty',
recentSearches: 'Ostatnie wyszukiwania',
recentChats: 'Ostatnie czaty',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8511,6 +8511,12 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
noMerchant: 'Sem comerciante',
noTag: 'Sem tag',
expenseType: 'Tipo de despesa',
receiptType: 'Tipo de recibo',
receiptTypeValues: {
ereceipt: 'Recibo eletrônico',
itemized: 'Detalhado',
hotel: 'Hotel',
},
withdrawalType: 'Tipo de saque',
recentSearches: 'Pesquisas recentes',
recentChats: 'Chats recentes',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8289,6 +8289,12 @@ ${reportName}`,
noMerchant: '无商家',
noTag: '无标签',
expenseType: '报销类型',
receiptType: '收据类型',
receiptTypeValues: {
ereceipt: '电子收据',
itemized: '明细',
hotel: '酒店',
},
withdrawalType: '提款类型',
recentSearches: '最近搜索',
recentChats: '最近聊天',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,7 @@ const SearchAdvancedFiltersModalStackNavigator = createModalStackNavigator({
[SCREENS.SEARCH.ADVANCED_FILTERS_CARD_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_TAX_RATE_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersTaxRatePage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_EXPENSE_TYPE_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersExpenseTypePage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_RECEIPT_TYPE_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersReceiptTypePage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_WITHDRAWAL_TYPE_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersWithdrawalTypePage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_WITHDRAWAL_STATUS_RHP]: () =>
require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersWithdrawalStatusPage').default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const SEARCH_TO_RHP: Partial<Record<keyof SearchFullscreenNavigatorParamList, st
SCREENS.SEARCH.ADVANCED_FILTERS_KEYWORD_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_TAX_RATE_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_EXPENSE_TYPE_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_RECEIPT_TYPE_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_WITHDRAWAL_TYPE_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_WITHDRAWAL_STATUS_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_IS_RHP,
Expand Down
4 changes: 4 additions & 0 deletions src/libs/SearchAutocompleteUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function getAutocompleteQueryWithComma(prevQuery: string, newQuery: string) {
}

const userFriendlyExpenseTypeList = Object.values(CONST.SEARCH.TRANSACTION_TYPE).map((value) => getUserFriendlyValue(value));
const userFriendlyReceiptTypeList = Object.values(CONST.SEARCH.RECEIPT_TYPE).map((value) => getUserFriendlyValue(value));
const userFriendlyGroupByList = Object.values(CONST.SEARCH.GROUP_BY).map((value) => getUserFriendlyValue(value));
const userFriendlyViewList = Object.values(CONST.SEARCH.VIEW).map((value) => getUserFriendlyValue(value));
const userFriendlyStatusList = Object.values({
Expand Down Expand Up @@ -159,6 +160,7 @@ function filterOutRangesWithCorrectValue(

const typeList = Object.values(CONST.SEARCH.DATA_TYPES) as string[];
const expenseTypeList = userFriendlyExpenseTypeList;
const receiptTypeList = userFriendlyReceiptTypeList;
const withdrawalTypeList = Object.values(CONST.SEARCH.WITHDRAWAL_TYPE) as string[];
const withdrawalStatusList = Object.values(CONST.SEARCH.SETTLEMENT_STATUS) as string[];
const statusList = userFriendlyStatusList;
Expand Down Expand Up @@ -197,6 +199,8 @@ function filterOutRangesWithCorrectValue(
return typeList.includes(range.value);
case CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPENSE_TYPE:
return expenseTypeList.includes(range.value);
case CONST.SEARCH.SYNTAX_FILTER_KEYS.RECEIPT_TYPE:
return receiptTypeList.includes(range.value);
case CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE:
return withdrawalTypeList.includes(range.value);
case CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_STATUS:
Expand Down
Loading
Loading