-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$250] For one expense reports on the Search page: Show a View
button when the only expense is a scanning receipt and pending Expensify Card transaction
#54996
Comments
Current assignee @JmillsExpensify is eligible for the Bug assigner, not assigning anyone new. |
Edited by proposal-police: This proposal was edited at 2025-01-09 11:52:04 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.For one expense reports on the Search page: Show a View button when the only expense is a scanning receipt and pending Expensify Card transaction What is the root cause of that problem?We already have the case for pending Expensify Card transactions, but we did not consider the case for reports with only scanning receipt transactions. What changes do you think we should make in order to solve the problem?
const hasOnlyOneScanTransaction = allReportTransactions.length === 1 && !!TransactionUtils.hasReceipt(allReportTransactions.at(0)) and then use it as: if (IOU.canApproveIOU(report, policy) && !hasOnlyOneScanTransaction&& isAllowedToApproveExpenseReport && !hasOnlyPendingTransactions)
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional) |
View
button when the only expense is a scanning receipt and pending Expensify Card transactionView
button when the only expense is a scanning receipt and pending Expensify Card transaction
Job added to Upwork: https://www.upwork.com/jobs/~021877348968624827220 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Show a View button for one-expense reports with either a scanning receipt or a pending Expensify Card transaction. The current implementation handles pending transactions but not scanning receipts, causing confusion as the Approve button is shown unnecessarily. What is the root cause of that problem?The logic prevents the Approve button for pending transactions but doesn't account for scanning receipts. This oversight leads to the Approve button appearing incorrectly, creating a poor user experience. What changes do you think we should make in order to solve the problem?
const hasOnlyOneScanTransaction = allReportTransactions.length === 1 && !!TransactionUtils.hasReceipt(allReportTransactions.at(0));
if (IOU.canApproveIOU(report, policy) && !hasOnlyOneScanTransaction && isAllowedToApproveExpenseReport && !hasOnlyPendingTransactions) {
return CONST.SEARCH.ACTION_TYPES.APPROVE;
}
const hasOnlyOneScanTransaction = allTransactions.length === 1 && !!TransactionUtils.hasReceipt(allTransactions.at(0));
const shouldShowApproveButton = useMemo(() => IOU.canApproveIOU(moneyRequestReport, policy) && !hasOnlyOneScanTransaction && !hasOnlyPendingTransactions, [moneyRequestReport, policy, hasOnlyOneScanTransaction, hasOnlyPendingTransactions]);
|
🚨 Edited by proposal-police: This proposal was edited at 2025-01-10 11:07:17 UTC. Edited by proposal-police: This proposal was edited at 2025-01-10 11:07:17 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.For one expense reports on the Search page: Show a View button when the only expense is a scanning receipt and pending Expensify Card transaction What is the root cause of that problem?We're showing the approve button if we can approve and we don't have only pending card transactions. Lines 312 to 314 in 6ce82c8
What changes do you think we should make in order to solve the problem?For scanning requests, we already check this in Lines 7324 to 7336 in 219e66d
Lines 312 to 314 in 6ce82c8
OPTIONAL: We can remove Any refactor can be discussed more while reviewing proposal/PR. What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?We can add a test case for What alternative solutions did you explore? (Optional)NA 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. |
📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Thanks everyone for the proposals. @Shahidullah-Muffakir Sorry, but your proposal is incorrect. @azr-arch Your proposal is also wrong. |
@nkdengineer Your RCA looks correct, but I have some questions regarding your solution
Question for @JmillsExpensify
But I see if the transaction has scanning receipt, it will not show |
@shubham1206agra, Could you please clarify what exactly is incorrect in my proposal? Thanks. |
@shubham1206agra You're right, we can remove this condition.
@JmillsExpensify Is this a possible case? |
Catching up ya'll. Sorry for the delay.
I think this was a misunderstanding. I'm saying that if the only expense on the report is a scanning receipt or pending card transaction – btw, the same is true if all expenses on the report are either scanning/pending, then we wouldn't show the However, if an report contains 5 expenses, one of which is scanning/pending, we would and should show the |
This is possible, though it's functionally the same as what I noted above. It's a report with only scanning/pending expenses. In that case, we'd show |
@JmillsExpensify I mean to say that if the report contains mixture of partial transaction and pending card transaction, will the user be able to approve the expense report? |
|
@shubham1206agra What do you mean? |
@nkdengineer Partial transaction is a better check than failed scan receipts. |
@shubham1206agra Updated proposal |
@nkdengineer's proposal looks good to me 🎀👀🎀 C+ reviewed |
Current assignee @luacmartins is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Agree that proposal looks good. Let's add the test case for |
📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@shubham1206agra The PR is ready for review. |
This issue has not been updated in over 15 days. @JmillsExpensify, @luacmartins, @shubham1206agra, @nkdengineer eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
PR is in review |
@nkdengineer @shubham1206agra it seems like QA can still see an approve option for scanfailed transactions - #56824. Let's take a look into it. |
Will take a look today |
@luacmartins I followed the step in #56824 but it works for me. |
@shubham1206agra Can you reproduce #56824? |
I'm also unable to reproduce. I'll ask QA to try again |
@nkdengineer left a comment here, but I think the issue is that the submitted receipt is only missing the amount after the scan fails. Let's investigate this further. |
Problem
We currently show an
Approve
button on theReports
page when the following are true:This is confusing, because approving the report will do nothing, as neither scanning receipts or pending transactions can be approved (their expense data is not final).
Solution
Rather than show/promote actions on the
Reports
page that do nothing, let's instead promote the ability toView
a one-expense report that only has a scanning receipt or pending card transactions. Because after all, that's all you can do, view the one-expense report. To do so, we will:View
button on the report row on theReports
page for these one-expense reportsApprove
button shows in the report header, when opened (Note: This should already be the case, though let's discuss in this issue)And that's it.
For the sake of clarity, this issue applies to both one expense reports with either a scanning receipt or a pending Expensify Card transactions, and any expense reports where every expenses is a scanning receipt or pending Expensify Card transaction. If a scanning receipt or a pending ECard transaction is on a multi-expense report, then it's possible to approve said report, so that case is out of scope and doesn't apply to this issue.
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @nkdengineerThe text was updated successfully, but these errors were encountered: