Skip to content

[HOLD for payment 2024-02-07] [ECARD TRANSACTIONS] We're showing the total amount in the pay button, which includes non-reimbursable expenses, rather than the reimbursable total #34618

Closed

Description

@kevinksullivan

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


Issue reported by: @kevinksullivan
Slack conversation: https://expensify.slack.com/archives/C05DWUDHVK7/p1705442308576449

Action Performed:

  1. Create a free workspace and set it as your default
  2. Incur a charge on an Expensify Card
  3. Add a manual request
  4. Tap into the report containing both expenses

Expected Result:

The pay button should only include the reimbursable total

Actual Result:

The pay button includes both the reimbursable and non-reimbursable total

image

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010be8d278766b8dcd
  • Upwork Job ID: 1748128883556716544
  • Last Price Increase: 2024-01-18
Issue OwnerCurrent Issue Owner: @CortneyOfstad

Activity

  1. added
    Daily
    Bug
    on Jan 16, 2024
  2. melvin-bot commented on Jan 16, 2024

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. moved this to Release 4: Card Experience in [#whatsnext] Wave 05 - Deprecate Freeon Jan 17, 2024
  4. added
    Internal
    on Jan 18, 2024
  5. melvin-bot commented on Jan 18, 2024

    @melvin-bot
  6. melvin-bot commented on Jan 18, 2024

    @melvin-bot

    Triggered auto assignment to Contributor Plus for review of internal employee PR - @ntdiary (Internal)

  7. grgia commented on Jan 19, 2024

    @grgia
    Contributor

    Notes for internal employee

    For some context see this PR where I discussed how report.total does include the non-reimbursable amount.

    Therefore, I think we can fix this by doing the equivalent of this:

    diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
    index e653d79a74..b310fe79a3 100644
    --- a/src/libs/ReportUtils.ts
    +++ b/src/libs/ReportUtils.ts
    @@ -1705,28 +1705,6 @@ function hasNonReimbursableTransactions(iouReportID: string | undefined): boolea
    diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
    index e653d79a74..b310fe79a3 100644
    --- a/src/libs/ReportUtils.ts
    +++ b/src/libs/ReportUtils.ts
    @@ -1705,28 +1705,6 @@ function hasNonReimbursableTransactions(iouReportID: string | undefined): boolea
         return transactions.filter((transaction) => transaction.reimbursable === false).length > 0;
     }
    
    -function getMoneyRequestReimbursableTotal(report: OnyxEntry<Report>, allReportsDict: OnyxCollection<Report> = null): number {
    -    const allAvailableReports = allReportsDict ?? allReports;
    -    let moneyRequestReport: OnyxEntry<Report> | undefined;
    -    if (isMoneyRequestReport(report)) {
    -        moneyRequestReport = report;
    -    }
    -    if (allAvailableReports && report?.iouReportID) {
    -        moneyRequestReport = allAvailableReports[`${ONYXKEYS.COLLECTION.REPORT}${report.iouReportID}`];
    -    }
    -    if (moneyRequestReport) {
    -        const total = moneyRequestReport?.total ?? 0;
    -
    -        if (total !== 0) {
    -            // There is a possibility that if the Expense report has a negative total.
    -            // This is because there are instances where you can get a credit back on your card,
    -            // or you enter a negative expense to “offset” future expenses
    -            return isExpenseReport(moneyRequestReport) ? total * -1 : Math.abs(total);
    -        }
    -    }
    -    return 0;
    -}
    -
     function getMoneyRequestSpendBreakdown(report: OnyxEntry<Report>, allReportsDict: OnyxCollection<Report> = null): SpendBreakdown {
         const allAvailableReports = allReportsDict ?? allReports;
         let moneyRequestReport;
    @@ -1764,6 +1742,11 @@ function getMoneyRequestSpendBreakdown(report: OnyxEntry<Report>, allReportsDict
         };
     }
    
    +function getMoneyRequestReimbursableTotal(report: OnyxEntry<Report>, allReportsDict: OnyxCollection<Report> = null): number {
    +    return getMoneyRequestSpendBreakdown(report, allReportsDict).reimbursableSpend;
    +}
    +
    +
     /**
      * Get the title for a policy expense chat which depends on the role of the policy member seeing this report
      */
    (END)
    

    but I am labelling as internal as I want to be sure that the amount that the user is charged is correct as well

  8. added
    Hot Pick
    on Jan 19, 2024
  9. 35 remaining items

  10. CortneyOfstad commented on Feb 7, 2024

    @CortneyOfstad
    Contributor

    Perfect and for the payment — $500 correct @luacmartins? I'm thinking so, but just wanted a gut check. Thanks!

  11. luacmartins commented on Feb 7, 2024

    @luacmartins
    Contributor

    Yes!

  12. CortneyOfstad commented on Feb 7, 2024

    @CortneyOfstad
    Contributor

    Perfect! @rushatgabhane below is the payment summary request for you!

    Payment Summary

    @rushatgabhane (reviewer) — to be paid $500 via NewDot

  13. CortneyOfstad commented on Feb 7, 2024

    @CortneyOfstad
    Contributor

    (not going to close this until the payment is accepted in NewDot 👍 )

  14. CortneyOfstad commented on Feb 9, 2024

    @CortneyOfstad
    Contributor

    @rushatgabhane have you requested payment in NewDot?

  15. CortneyOfstad commented on Feb 12, 2024

    @CortneyOfstad
    Contributor

    Bump @rushatgabhane ^^^ thanks!

  16. rushatgabhane commented on Feb 12, 2024

    @rushatgabhane
    Member
  17. JmillsExpensify commented on Feb 12, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @rushatgabhane based on this comment.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyInternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions