feat: add download receipts option to report - #96947
Conversation
|
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 |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 272c367568
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }, | ||
| [CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD_RECEIPTS]: { | ||
| value: CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD_RECEIPTS, | ||
| text: translate('common.downloadReceipts'), |
There was a problem hiding this comment.
Update all generated locales for receipts copy
When the user’s locale is one of the other supported locales (de/fr/it/ja/nl/pl/pt-BR/zh-hans), the new common.downloadReceipts and exportDownload.receiptsFailedBody keys are absent from those generated language files (checked with rg "downloadReceipts|receiptsFailedBody" src/languages/{de,fr,it,ja,nl,pl,pt-BR,zh-hans}.ts). translate() treats missing keys as an error in development and as missing/raw text in production/staging, so opening this new menu item or seeing the receipts failure state is broken outside en/es. Please regenerate/update every locale for both new keys.
Useful? React with 👍 / 👎.
|
🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Tried to test this but I don't see any |
|
|
||
| options.push(CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD_PDF); | ||
|
|
||
| options.push(CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD_RECEIPTS); |
There was a problem hiding this comment.
Bug: missing empty-state handling for reports with no receipts
DOWNLOAD_RECEIPTS is pushed unconditionally so the option is shown even on reports made up entirely of manually expenses that have zero receipt images
|
@truph01 please fix the failing checks and fill the Tests section |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
@JmillsExpensify I added QA test, could you test again by following it? |
|
@daledah I resolved your comments. Could you review again? |
|
Not sure if we're addressing this later, though the first option should read: |
|
Second feedback: If I try to download an eReceipt, then I go through the entire flow and it says it's successful, but it doesn't look like anything ever downloads. |
|
Downloading a normal receipt works great. I got the zip and I unzipped successfully on my computer. |
@JmillsExpensify Is "Download report" a feature request? If so, I think it is out of scope for this issue. |
@JmillsExpensify I think that's because, in step 1. Request two expenses with receipts to workspace, none of the expenses actually have a receipt attached, right? I've updated the PR so that, if a report doesn't contain any expenses with receipts, the Download receipts button won't be shown. |
|
@codex review |
@mollfpr @daledah I updated PR. Here is the result: Screen.Recording.2026-07-30.at.17.46.31.mov |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 108a2a0e25
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const exportType = displayedExport?.exportType; | ||
| const failedReportCount = displayedExport?.failedReportCount ?? 0; | ||
| const reportCount = displayedExport?.reportCount ?? 0; | ||
| const receiptCount = displayedExport?.receiptCount; |
There was a problem hiding this comment.
Handle partial failures for receipt zips
When ExportReceiptsToZip finishes with a usable zip but some receipts failed, the export status includes a failedReceiptCount alongside receiptCount; this modal only reads receiptCount and the existing partial-failure branch only checks failedReportCount, so that case is shown as a full success and auto-downloads without warning that receipts are missing. Please carry the receipt failure count through the Onyx type and use it to render receipt-specific partial-failure copy before users rely on an incomplete archive.
Useful? React with 👍 / 👎.
|
@daledah All good now. Could you review it again? |
|
🚧 mollfpr has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Works for me on |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb Chromeandroid-mweb.moviOS: HybridAppios.moviOS: mWeb Safariios-mweb.movMacOS: Chrome / SafariScreen.Recording.2026-07-31.at.11.10.57.mov |
|
@truph01 please merge main to fix the jest test |
|
|
||
| options.push(CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD_PDF); | ||
|
|
||
| if (reportTransactions.some(hasReceiptTransactionUtils)) { |
There was a problem hiding this comment.
@truph01 could you please add some unit tests to cover this logic?
|
@daledah All good now! |
Perfect, this is what I'd expect. |
JmillsExpensify
left a comment
There was a problem hiding this comment.
Looks good to me for the v1.
|
🚧 mollfpr has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mollfpr in version: 9.4.49-0 🚀
|
Help site review — changes required ✅This PR adds a Download receipts option to the More menu on an expense report, which downloads all receipts on that report as a single zip file. That's a user-facing feature, so the help site needs an update. Docs draft PR: #97740 What I documentedI added the new flow to
Verification noteI verified the label ( @truph01, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
Explanation of Change
Fixed Issues
$ #95356
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests
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
Screen.Recording.2026-07-31.at.13.34.03.mov
Android: mWeb Chrome
Screen.Recording.2026-07-31.at.13.38.51.mov
iOS: Native
Screen.Recording.2026-07-31.at.13.09.09.mov
iOS: mWeb Safari
Screen.Recording.2026-07-31.at.13.37.59.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-29.at.17.50.29.mov