-
Notifications
You must be signed in to change notification settings - Fork 4k
feat: add download receipts option to report #96947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
272c367
f189514
d545c24
f89f64d
bc8a249
10b2715
c6790f8
108a2a0
ede5e7e
8bd76ab
1a0b0f1
e16ef6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types'; | |
| import {useExportDownloadStatus} from '@components/MoneyReportHeaderActions/ExportDownloadStatusContext'; | ||
| import type {PopoverMenuItem} from '@components/PopoverMenu'; | ||
|
|
||
| import {exportReceiptsToZip} from '@libs/actions/Export'; | ||
| import {openOldDotLink} from '@libs/actions/Link'; | ||
| import {exportReportToCSV, exportReportToPDF, exportToIntegration, markAsManuallyExported} from '@libs/actions/Report'; | ||
| import {getExportTemplates, queueExportSearchWithTemplate} from '@libs/actions/Search'; | ||
|
|
@@ -264,6 +265,23 @@ function useExportActions({reportID, policy, onPDFModalOpen}: UseExportActionsPa | |
| exportReportToPDF({reportID: moneyRequestReport.reportID}); | ||
| }, | ||
| }, | ||
| [CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD_RECEIPTS]: { | ||
| value: CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD_RECEIPTS, | ||
| text: translate('common.downloadReceipts'), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the user’s locale is one of the other supported locales (de/fr/it/ja/nl/pl/pt-BR/zh-hans), the new Useful? React with 👍 / 👎.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved |
||
| icon: expensifyIcons.Download, | ||
| sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.DOWNLOAD_RECEIPTS, | ||
| onSelected: () => { | ||
| if (isOffline) { | ||
| showOfflineModal(); | ||
| return; | ||
| } | ||
| if (!moneyRequestReport?.reportID) { | ||
| return; | ||
| } | ||
| const exportID = exportReceiptsToZip([moneyRequestReport.reportID]); | ||
| trackExport(exportID); | ||
| }, | ||
| }, | ||
| [CONST.REPORT.SECONDARY_ACTIONS.PRINT]: { | ||
| value: CONST.REPORT.SECONDARY_ACTIONS.PRINT, | ||
| text: translate('common.print'), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
ExportReceiptsToZipfinishes with a usable zip but some receipts failed, the export status includes afailedReceiptCountalongsidereceiptCount; this modal only readsreceiptCountand the existing partial-failure branch only checksfailedReportCount, 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 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved via ede5e7e