Skip to content

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

Closed

Description

@IuliiaHerets

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: 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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 15, 2024
  2. melvin-bot commented on Oct 15, 2024

    @melvin-bot

    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.

  3. IuliiaHerets commented on Oct 15, 2024

    @IuliiaHerets
    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

  4. mkzie2 commented on Oct 15, 2024

    @mkzie2
    Contributor

    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 ?? {};

  5. NJ-2020 commented on Oct 15, 2024

    @NJ-2020
    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?

    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)

  6. nyomanjyotisa commented on Oct 15, 2024

    @nyomanjyotisa
    Member

    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,
    
  7. melvin-bot commented on Oct 18, 2024

    @melvin-bot

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

  8. melvin-bot commented on Oct 22, 2024

    @melvin-bot

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

  9. JmillsExpensify commented on Oct 24, 2024

    @JmillsExpensify
    Contributor

    @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.

  10. luacmartins commented on Oct 24, 2024

    @luacmartins
    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.

  11. 78 remaining items

  12. melvin-bot commented on Jan 13, 2025

    @melvin-bot

    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
  13. melvin-bot commented on Jan 13, 2025

    @melvin-bot

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

  14. JmillsExpensify commented on Jan 13, 2025

    @JmillsExpensify
    Contributor

    Payment summary:

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

  15. NJ-2020 commented on Jan 13, 2025

    @NJ-2020
    Contributor

    Yes

  16. ishpaul777 commented on Jan 13, 2025

    @ishpaul777
    Contributor

    yes thats correct @JmillsExpensify

  17. melvin-bot commented on Jan 17, 2025

    @melvin-bot

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

  18. ishpaul777 commented on Jan 17, 2025

    @ishpaul777
    Contributor

    this is awaiting payment

  19. melvin-bot commented on Jan 21, 2025

    @melvin-bot

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

  20. JmillsExpensify commented on Jan 21, 2025

    @JmillsExpensify
    Contributor

    Apologies both. Offers sent.

  21. NJ-2020 commented on Jan 22, 2025

    @NJ-2020
    Contributor

    Done offer accepted

  22. JmillsExpensify commented on Jan 22, 2025

    @JmillsExpensify
    Contributor

    All contracts paid out. Thanks everyone.

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions