[NO QA] Add Amount debited and Amount reimbursed filters, columns and sorting - #97708
Draft
ishpaul777 wants to merge 29 commits into
Draft
[NO QA] Add Amount debited and Amount reimbursed filters, columns and sorting#97708ishpaul777 wants to merge 29 commits into
ishpaul777 wants to merge 29 commits into
Conversation
…s until a settlement converts
SortableTableHeader only makes a header pressable when isColumnSortable is set, so without it the columns rendered as plain labels and the sort Auth supports could not be reached. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
getSortedData re-sorts the page by the mapped property, which for these two columns is a raw amount in whichever currency that settlement used. Ranking GBP 10250 against USD 12000 that way puts them in the wrong order. Unmapped columns fall through with the data untouched, which is the order Auth already computed from a common-currency sort key. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
typecheck and TranslateTest both fail on a key that only exists in en.ts. The generateTranslations bot skips pull requests from forks, so these are written by hand. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The list is built at module scope, so the name resolves the moment the file loads and grouping by category throws instead of rendering.
The helper answered "does this column have data" for every column, which read as a double negative for the ones it knows nothing about. Bail out on a transaction array first, then ask the question only of the two conversion columns, matching the expense report branch above.
The server communicates its order through orderedKeys, which the client never reads, so a column with no sorting property leaves the rows in the order the response object happened to be keyed in and clicking the header does nothing. Point both columns at their amount, the way the total column already works.
Sorting ascending puts the groups without that amount first, so an all-domestic first page would drop the column, taking the header and the Sort by option with it.
The new keys precede amount in the grammar so it cannot match them first.
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
A payment pays a whole report, so an expense has no debited or reimbursed amount of its own to show or filter on.
…655933-fx-filters-and-columns
Sorting ascending puts the reports without that amount first, so an all-domestic first page would drop the column, taking the header and the Sort by option with it.
The currency list refactor removed the bare convertToDisplayString these three call sites relied on, leaving main unable to typecheck.
…paul/655933-fx-filters-and-columns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
A cross-border reimbursement moves two amounts: the company is debited in the currency it settles in, and the employee is credited in the currency of their deposit account. #97167 shows those on withdrawal groups in the reconciliation dashboard. This adds them as filters and as columns on expense reports.
amountDebited/amountReimbursed, withamount-debited/amount-reimbursedas the readable form used in saved searches and URLs.Decisions worth a look:
amountin the parser grammar, otherwiseamountmatches first and swallowsamountDebitedasamountfollowed by stray text.total, which is also absent from the expense filter menu.Needs Expensify/Auth#23431, which accepts the two filter keys and the two sort keys. Stacked on #97167, so only eleven commits belong to this PR, and one of those - "Restore the currency formatter the cross-border payment messages use" - is the same fix as #97723, carried here only so this branch can typecheck until that lands on main.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/655933
PROPOSAL: N/A, internal
Tests
Requires a workspace whose reports were paid with a currency conversion, since Auth records these amounts on the payment. Locally that means a workspace on a Corpay withdrawal account paying a member whose deposit account is in another currency, with at least one report left unconverted for comparison.
amount-debited:<value>.amountDebited:100directly into the search bar and verify it parses as a filter chip rather than as free text, then reload the page and verify the filter survives in the URL.Offline tests
Search results come from the server, so with no connection the list keeps showing the last loaded results. Applying either filter offline shows the offline indicator and no results change until the connection returns, the same as every other search filter. Column selection is local, so enabling or disabling the two columns works offline against already-loaded rows.
QA Steps
Same as Tests, on a workspace configured for global reimbursement whose reports have been paid across borders.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari