Skip to content

[Due for payment 2025-04-03] [$250] Invoice - Invoice can be downloaded from Reports but not from invoice details page #58346

Closed

Description

@mitarachim

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.1.12-5
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+130302kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Invoice feature is enabled.
  1. Go to staging.new.expensify.com
  2. Go to FAB > Send invoice.
  3. Send an invoice to any user.
  4. Go to Reports > Invoices.
  5. Select the invoice via checkmark.
  6. Click on the dropdown.
  7. Note that download option is available.
  8. Click on the invoice.
  9. Click on the report header.

Expected Result:

Download option should be accessible from invoice details page.

Actual Result:

Download option is not accessible from invoice details page.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6769449_1741844335007.20250313_133536.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021902155072665785104
  • Upwork Job ID: 1902155072665785104
  • Last Price Increase: 2025-03-19
Issue OwnerCurrent Issue Owner: @adelekennedy

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 13, 2025
  2. melvin-bot commented on Mar 13, 2025

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. daledah commented on Mar 13, 2025

    @daledah
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-03-13 06:31:50 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Download option is not accessible from invoice details page.

    What is the root cause of that problem?

    We are just showing download option for money request report

    if (isMoneyRequestReport) {
    items.push({
    key: CONST.REPORT_DETAILS_MENU_ITEM.DOWNLOAD_CSV,
    translationKey: 'common.downloadAsCSV',
    icon: Expensicons.Table,
    isAnonymousAction: false,
    action: () => {
    if (isOffline) {
    setOfflineModalVisible(true);
    return;
    }
    exportReportToCSV({reportID: report.reportID, transactionIDList}, () => {
    setDownloadErrorModalVisible(true);
    });
    },
    });

    What changes do you think we should make in order to solve the problem?

    We should add || isInvoiceReport to this condition

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. bernhardoj commented on Mar 13, 2025

    @bernhardoj
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Invoice can't be downloaded from the report details page.

    What is the root cause of that problem?

    Currently, we only show the download option for IOU/expense report.

    if (isMoneyRequestReport) {
    items.push({
    key: CONST.REPORT_DETAILS_MENU_ITEM.DOWNLOAD_CSV,
    translationKey: 'common.downloadAsCSV',
    icon: Expensicons.Table,

    And downloading requires the transaction ID list and it currently returns empty for non IOU/expense report.

    const transactionIDList = useMemo(() => {
    if (!isMoneyRequestReport || !transactions) {
    return [];
    }
    return transactions.map((transaction) => transaction.transactionID);
    }, [isMoneyRequestReport, transactions]);

    What changes do you think we should make in order to solve the problem?

    First, show the download button for invoice report too.

    if (isMoneyRequestReport || isInvoiceReport) {
    

    Second, we need to include the transaction ID list for invoice report too.

    const transactionIDList = useMemo(() => {
        if ((!isMoneyRequestReport && !isInvoiceReport) || !transactions) {
            return [];
        }
        return transactions.map((transaction) => transaction.transactionID);
    }, [isMoneyRequestReport, isInvoiceReport, transactions]);
    

    To simplify it, we can even check if caseID is money report.

    const caseID = useMemo((): CaseID => {
    // 3. MoneyReportHeader
    if (isMoneyRequestReport || isInvoiceReport) {
    return CASES.MONEY_REPORT;
    }

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We can render ReportDetailsPage and pass the invoice report as prop and verify the Download option is visible. We can also test if the transaction ID list is not empty by spying the exportReportToCSV and assert it's being called with the transaction ID list.

  5. samranahm commented on Mar 13, 2025

    @samranahm
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Invoice - Invoice can be downloaded from Reports but not from invoice details page

    What is the root cause of that problem?

    We are only displaying download as csv on MoneyRequestReport

    if (isMoneyRequestReport) {
    items.push({
    key: CONST.REPORT_DETAILS_MENU_ITEM.DOWNLOAD_CSV,
    translationKey: 'common.downloadAsCSV',

    What changes do you think we should make in order to solve the problem?

    We should add another exception || isInvoiceReport

    and update our

    const transactionIDList = useMemo(() => {
    if (!isMoneyRequestReport || !transactions) {
    return [];

    to

    const transactionIDList = useMemo(() => {
    if ((!isMoneyRequestReport && !isInvoiceReport) || !transactions) {
        return [];
    }

    so that we did not return empty array on isInvoiceReport leading to trigger

    exportReportToCSV({reportID: report.reportID, transactionIDList}, () => {
        setDownloadErrorModalVisible(true);

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We should add another

    N/A

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  6. github-actions commented on Mar 13, 2025

    @github-actions
    Contributor

    ⚠️ @samranahm Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  7. melvin-bot commented on Mar 18, 2025

    @melvin-bot

    @mallenexpensify Huh... This is 4 days overdue. Who can take care of this?

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 19, 2025
  9. changed the title [-]Invoice - Invoice can be downloaded from Reports but not from invoice details page[/-] [+][$250] Invoice - Invoice can be downloaded from Reports but not from invoice details page[/+] on Mar 19, 2025
  10. melvin-bot commented on Mar 19, 2025

    @melvin-bot
  11. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 19, 2025
  12. 33 remaining items

  13. ahmedGaber93 commented on Apr 2, 2025

    @ahmedGaber93
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other: Applause Internal Team
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/50137/files#r2025132648

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    • You have a workspace and "Invoice" feature is enabled.

    Test:

    1. Send an invoice to any user
    2. Open the invoice report
    3. Open the report details by pressing on the report header
    4. Verify the "download" item is displayed and you are able to download the invoice

    Do we agree 👍 or 👎

  14. melvin-bot commented on Apr 3, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1902155072665785104/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. bernhardoj commented on Apr 3, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  16. melvin-bot commented on Apr 8, 2025

    @melvin-bot

    @mallenexpensify Eep! 4 days overdue now. Issues have feelings too...

  17. ahmedGaber93 commented on Apr 10, 2025

    @ahmedGaber93
    Contributor

    @adelekennedy bump for payment summary

  18. adelekennedy commented on Apr 10, 2025

    @adelekennedy
    Contributor

    Payments due:
    @ahmedGaber93 owed $250 via NewDot
    @bernhardoj owed $250 via NewDot

  19. JmillsExpensify commented on Apr 14, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  20. JmillsExpensify commented on Apr 25, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @ahmedGaber93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions