Skip to content
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

[HOLD for payment 2025-01-13][$250] Invoice - In search, Invoice doesn't displays merchant text "expense" #50794

Closed
2 of 6 tasks
IuliiaHerets opened this issue Oct 15, 2024 · 58 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Oct 15, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v9.0.49-0
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team

Action Performed:

Pre-condition:Keep invoice enabled in a workspace

  1. Go to https://staging.new.expensify.com/home

  2. Tap fab--send invoice

  3. Create an invoice

  4. Navigate to LHN -- Search

  5. Navigate to invoice section

  6. Note preview doesn't show merchant field text "expense"

  7. Tap on the invoice and note "expense" text in merchant field

Expected Result:

In search, Invoice must display merchant text "expense".

Actual Result:

In search, Invoice doesn't displays merchant text "expense".

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6635152_1728992359843.Screenrecorder-2024-10-15-16-59-50-476_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021858799282486189977
  • Upwork Job ID: 1858799282486189977
  • Last Price Increase: 2024-11-19
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 15, 2024
Copy link

melvin-bot bot commented Oct 15, 2024

Triggered auto assignment to @JmillsExpensify (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.

@IuliiaHerets
Copy link
Author

@JmillsExpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@mkzie2
Copy link
Contributor

mkzie2 commented Oct 15, 2024

Proposal

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

In search, Invoice doesn't displays merchant text "expense".

What is the root cause of that problem?

Sometime when we create a send invoice, merchant param is an empty string then BE returns merchant as Expense.

I think the current problem here is the Expense merchant appears in REPORTPREVIEW action. That is how we're displaying merchant in other places like here, here and here

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

We should fix to not display Expense merchant in the report preview action. To do that we can add the same check that we use to display the merchant in other places

const shouldShowMerchant =
  !!formattedMerchant &&
  formattedMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT &&
  formattedMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT &&
  !(hasOnlyTransactionsWithPendingRoutes && !totalDisplaySpend);
const shouldShowSingleRequestMerchantOrDescription =
  numberOfRequests === 1 && (!!shouldShowMerchant || !!formattedDescription) && !(hasOnlyTransactionsWithPendingRoutes && !totalDisplaySpend);

const shouldShowSingleRequestMerchantOrDescription =

What alternative solutions did you explore? (Optional)

When we create a send invoice, we can fallback merchant as CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT here

const {amount = 0, currency = '', created = '', merchant = '', category = '', tag = '', taxCode = '', taxAmount = 0, billable, comment, participants} = transaction ?? {};

@NJ-2020
Copy link
Contributor

NJ-2020 commented Oct 15, 2024

Proposal

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

Invoice - In search, Invoice doesn't displays merchant text "expense"

What is the root cause of that problem?

Right here if the merchant value is equal to Expense we return empty string

const formattedMerchant = merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT || merchant === CONST.TRANSACTION.DEFAULT_MERCHANT ? '' : merchant;

merchant === CONST.TRANSACTION.DEFAULT_MERCHANT ? ''

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

We should remove this code: merchant === CONST.TRANSACTION.DEFAULT_MERCHANT ? ''

What alternative solutions did you explore? (Optional)

@nyomanjyotisa
Copy link
Contributor

Proposal

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

Invoice - In search, Invoice doesn't displays merchant text "expense"

What is the root cause of that problem?

We don't display the merchant if the merchant is 'Expense'

const formattedMerchant = merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT || merchant === CONST.TRANSACTION.DEFAULT_MERCHANT ? '' : merchant;

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

If we need to display the merchant although it is Expense for Invoices we can update the following code

const formattedMerchant = merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT || merchant === CONST.TRANSACTION.DEFAULT_MERCHANT ? '' : merchant;

const formattedMerchant = merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT || (merchant === CONST.TRANSACTION.DEFAULT_MERCHANT && transactionItem.reportType != CONST.REPORT.TYPE.INVOICE) ? '' : merchant;

And update this to show the merchant column

return merchant !== '' && merchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && merchant !== CONST.TRANSACTION.DEFAULT_MERCHANT;

return merchant !== '' && merchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && !(merchant === CONST.TRANSACTION.DEFAULT_MERCHANT && item.reportType != CONST.REPORT.TYPE.INVOICE);

What alternative solutions did you explore? (Optional)

ALTERNATIVE 1
If we want to always display the merchant for all reportType change to the following

const formattedMerchant = merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT ? '' : merchant;
return merchant !== '' && merchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;

ALTERNATIVE 2
Also the merchant set to Expense because the merchant param we pass to the API is empty string, if we want to set it to empty or (none) can can update the following code

merchant: transaction?.merchant ?? '',

merchant: transaction?.merchant ?? CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT,

@melvin-bot melvin-bot bot added the Overdue label Oct 17, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

@JmillsExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Oct 22, 2024

@JmillsExpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@JmillsExpensify
Copy link

@luacmartins is this by design in a sense? In that we require a merchant for all expenses, and set a default one for certain cases, but we don't show them in previews and potentially search? If not, I'll triage I just wasn't sure.

@melvin-bot melvin-bot bot removed the Overdue label Oct 24, 2024
@luacmartins
Copy link
Contributor

Hmm maybe in this case we'd expect it show. The design doc says:

The Merchant and Description columns will show based on the same logic already in use for the expense previews in Inbox. In other words, Merchant will always be shown for workspace expenses, because Merchant is required and triggers violations. Off-workspace, we’ll show Merchant as long as at least one value isn’t “Expense” or “Unknown merchant”, based on existing logic. In all other cases, we’ll show Description as long as at least one expense has one (and if a description is long, we’ll truncate with an ellipsis, just like any other column).

Given this is a workspace expense, we should show it according to the doc. That being said, we are definitely intentionally hiding it, but I can't recall if we decided to change the behavior in another discussion or it was just a mistake during implementation.

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
Copy link

melvin-bot bot commented Oct 29, 2024

@JmillsExpensify this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Oct 29, 2024

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

@JmillsExpensify
Copy link

Cool, I'll go ahead and ask in #billpay to double check.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 30, 2024
Copy link

melvin-bot bot commented Nov 4, 2024

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

@JmillsExpensify
Copy link

Still haven't prioritized this.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 6, 2024
@JmillsExpensify
Copy link

Created an internal discussion here: https://expensify.slack.com/archives/CSL3XBCCR/p1731332905419419

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 11, 2024
Copy link

melvin-bot bot commented Nov 15, 2024

@JmillsExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@JmillsExpensify
Copy link

Alright, so we agree internally that we should be showing the Expense merchant on the Search page, so I'll open this up to the community so that we can get this resolved.

@melvin-bot melvin-bot bot removed the Overdue label Nov 19, 2024
@luacmartins luacmartins added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Jan 3, 2025
@melvin-bot melvin-bot bot added the Overdue label Jan 6, 2025
@ishpaul777
Copy link
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:
  • [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/42980/files#r1904439515

  • [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: this was part of orignal design so not a critical bug

  • [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. Not required we added automated test which are enough

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jan 6, 2025
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-01-08][$250] Invoice - In search, Invoice doesn't displays merchant text "expense" [HOLD for payment 2025-01-13] [HOLD for payment 2024-01-08][$250] Invoice - In search, Invoice doesn't displays merchant text "expense" Jan 6, 2025
@melvin-bot melvin-bot bot removed the Overdue label Jan 6, 2025
Copy link

melvin-bot bot commented Jan 6, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.80-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-01-13. 🎊

For reference, here are some details about the assignees on this issue:

  • @NJ-2020 requires payment (Needs manual offer from BZ)
  • @ishpaul777 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Jan 6, 2025

@ishpaul777 @JmillsExpensify @ishpaul777 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@luacmartins luacmartins changed the title [HOLD for payment 2025-01-13] [HOLD for payment 2024-01-08][$250] Invoice - In search, Invoice doesn't displays merchant text "expense" [HOLD for payment 2025-01-13][$250] Invoice - In search, Invoice doesn't displays merchant text "expense" Jan 9, 2025
@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jan 10, 2025
Copy link

melvin-bot bot commented Jan 13, 2025

Payment Summary

Upwork Job

  • ROLE: @NJ-2020 paid $(AMOUNT) via Upwork (LINK)
  • ROLE: @ishpaul777 paid $(AMOUNT) via Upwork (LINK)

BugZero Checklist (@JmillsExpensify)

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

Copy link

melvin-bot bot commented Jan 13, 2025

@JmillsExpensify, @luacmartins, @MonilBhavsar, @NJ-2020, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@JmillsExpensify
Copy link

Payment summary:

It looks like the Upwork automation failed. Is that right?

@melvin-bot melvin-bot bot removed the Overdue label Jan 13, 2025
@NJ-2020
Copy link
Contributor

NJ-2020 commented Jan 13, 2025

Yes

@ishpaul777
Copy link
Contributor

yes thats correct @JmillsExpensify

@melvin-bot melvin-bot bot added the Overdue label Jan 16, 2025
Copy link

melvin-bot bot commented Jan 17, 2025

@JmillsExpensify, @luacmartins, @MonilBhavsar, @NJ-2020, @ishpaul777 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@ishpaul777
Copy link
Contributor

this is awaiting payment

Copy link

melvin-bot bot commented Jan 21, 2025

@JmillsExpensify, @luacmartins, @MonilBhavsar, @NJ-2020, @ishpaul777 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@JmillsExpensify
Copy link

Apologies both. Offers sent.

@melvin-bot melvin-bot bot removed the Overdue label Jan 21, 2025
@NJ-2020
Copy link
Contributor

NJ-2020 commented Jan 22, 2025

Done offer accepted

@JmillsExpensify
Copy link

All contracts paid out. Thanks everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants