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

[$250] Notification email is inaccurate for approved expense report which are paid by corporate card #52620

Open
1 of 8 tasks
m-natarajan opened this issue Nov 15, 2024 · 31 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Overdue

Comments

@m-natarajan
Copy link

m-natarajan commented Nov 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:
Reproducible in staging?: Needs reproduction
Reproducible in production?: Needs reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @saracouto
Slack conversation (hyperlinked to channel name): ts_external_expensify_bugs

Action Performed:

  1. Approve a submitted expense which are Paid with expensify card

Expected Result:

Email notification mentioning the payer/approver has paid the expense, No message from concierge regarding payment as this expense is done with corporate card

Actual Result:

  1. Email notification says approver got paid from expensify
  2. Message from concierge that expense is paid
  3. There is a mention about $0.00 expense

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence

image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021859169766336598808
  • Upwork Job ID: 1859169766336598808
  • Last Price Increase: 2024-11-20
Issue OwnerCurrent Issue Owner: @hoangzinh
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Nov 15, 2024
Copy link

melvin-bot bot commented Nov 15, 2024

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

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@melvin-bot melvin-bot bot added the Overdue label Nov 18, 2024
Copy link

melvin-bot bot commented Nov 19, 2024

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

@sonialiap
Copy link
Contributor

Asked Sara if she's seen multiple cases of this

@melvin-bot melvin-bot bot removed the Overdue label Nov 19, 2024
@sonialiap sonialiap removed the Needs Reproduction Reproducible steps needed label Nov 19, 2024
@sonialiap
Copy link
Contributor

Sara confirms this behavior happened again, reproduced

@sonialiap sonialiap added the External Added to denote the issue can be worked on by a contributor label Nov 20, 2024
@melvin-bot melvin-bot bot changed the title Notification email is inaccurate for approved expense report which are paid by corporate card [$250] Notification email is inaccurate for approved expense report which are paid by corporate card Nov 20, 2024
Copy link

melvin-bot bot commented Nov 20, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021859169766336598808

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 20, 2024
Copy link

melvin-bot bot commented Nov 20, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (External)

@ikevin127
Copy link
Contributor

Email templating is handled on the BE side -> this issue can only be fixed by the Internal team.

@hoangzinh
Copy link
Contributor

Agree, it should be "Internal" issue

@sonialiap sonialiap added Internal Requires API changes or must be handled by Expensify staff and removed External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Nov 25, 2024
@melvin-bot melvin-bot bot removed the Overdue label Nov 25, 2024
@melvin-bot melvin-bot bot added the Overdue label Nov 28, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

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

@hoangzinh
Copy link
Contributor

not overdue, still waiting an internal engineer pick up this issue

@sonialiap
Copy link
Contributor

not overdue

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 2, 2024
@sonialiap
Copy link
Contributor

posten in slack

@melvin-bot melvin-bot bot removed the Overdue label Dec 5, 2024
@tgolen
Copy link
Contributor

tgolen commented Dec 5, 2024

@sonialiap can you please get a few more examples of that email from other accounts or make sure that this is reproducible on your account?

There are a few things that stand out to me:

  • If they are expensify card transactions, why are they being "paid back" at all? Shouldn't they be non-reimbursible?
  • If they are expensify card transactions, why are they shown as "cash" transactions in the email?

@melvin-bot melvin-bot bot added the Overdue label Dec 9, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

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

@sonialiap
Copy link
Contributor

@tgolen the report has one reimbursable cash expense and two non-reimbursable expenses (ID: R00WJstnjV3Q (Long ID: 7056912391146520))

image

Errors:

  • the email says the reportTotal was paid. It should only list the reimbursableTotal
  • the email "workspaceName paid you $$" in the email sent to the approver. The approver isn't the one getting paid, they shouldn't receive this email
  • the CC expenses are marked as cash in the email. They shouldn't be

Maybe the "you were paid" email shouldn't even mention the non-reimbursable expenses. Seems odd to have them included

image

@melvin-bot melvin-bot bot removed the Overdue label Dec 10, 2024
@muttmuure muttmuure moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 10, 2024
@tgolen
Copy link
Contributor

tgolen commented Dec 10, 2024

@Beamanator It looks like you might be familiar with this. Would you be open to fixing it?

@Beamanator Beamanator self-assigned this Dec 11, 2024
@Beamanator Beamanator removed the Hot Pick Ready for an engineer to pick up and run with label Dec 11, 2024
@Beamanator
Copy link
Contributor

Innnnnnteresting, yeah i'm happy to look into this one!

@Beamanator
Copy link
Contributor

oh wait this looks eerily similar to another issue - at least part of the bug(s) here

@Beamanator
Copy link
Contributor

ok ya at least for the email subject line, that looks related to #52800 - which was fixed by https://github.com/Expensify/Web-Expensify/pull/44516 - which went to prod 2 weeks ago...

I asked in slack (this thread) if we have any more recent examples of buggy email notifications.

So at least this part should have been fixed already:

the email "workspaceName paid you $$" in the email sent to the approver. The approver isn't the one getting paid, they shouldn't receive this email

@Beamanator
Copy link
Contributor

  • the email says the reportTotal was paid. It should only list the reimbursableTotal

Fairrrr - PR to fix this should be here: https://github.com/Expensify/Web-Expensify/pull/44740

  • the CC expenses are marked as cash in the email. They shouldn't be

Also very fairrr

@Beamanator
Copy link
Contributor

Yooo @rlinoz @blimpich @jasperhuangg got a Comment email question for y'all!

In ReportUtils::formatCommentsForEmailNotificationParams, I see us only getting the report actions in the expense report, i don't see us getting any transaction data & adding it to the report comment data 🤔

Do any of y'all have an idea how we can tell if we should put something like Card • Done in the comment preview instead of Cash • Paid? I think we'd have to figure out if the report action has IOUTransactionID, then get some data from that transaction (its reimbursable status), and pass that along?

If you look in this comment, you can see that it looooks like we send Cash • Paid always in those comments, even if sometimes it's related to a card transaction 🤔

@blimpich
Copy link
Contributor

Yeah I think I added that relatively recently. I was not aware it was ever anything other than Cash • Paid, which in retrospect is pretty naive of me. Do we have logic somewhere in App that decides whether to show Card • Done vs Cash • Paid?

@Beamanator
Copy link
Contributor

Nice! Seems like I asked the right people! 😅

Do we have logic somewhere in App that decides whether to show Card • Done vs Cash • Paid?

I thinkkkk yes, it looks like it's somewhere around here:

const getPreviewHeaderText = (): string => {
let message = showCashOrCard;
if (isDistanceRequest) {
message = translate('common.distance');
} else if (isScanning) {
message = translate('common.receipt');
} else if (isBillSplit) {
message = translate('iou.split');
}
if (isSettled && !iouReport?.isCancelledIOU && !isPartialHold) {
message += ` ${CONST.DOT_SEPARATOR} ${getSettledMessage()}`;
return message;
}

@blimpich
Copy link
Contributor

Sweet! Well I think we basically just need to replicate this logic either in Comment.php or where we are creating the Report comment notifications. Not entirely sure how that would look but it seems like isDistanceRequest, isScanning can both be derived from the transaction object using TransactionUtils.

@Beamanator
Copy link
Contributor

I like that idea! BTW I'm only 50% today (heading out soon) and out tomorrow, so ifffff any of y'all wanna try to work on that for next week, feel free! 🤣

@blimpich
Copy link
Contributor

Lol my plate is full at the moment but I'll keep it on the radar 📡

@sonialiap
Copy link
Contributor

I'm OOO Dec 16-20, but I don't think this needs a BZ leave buddy, not assigning anyone

@melvin-bot melvin-bot bot added the Overdue label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Overdue
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

9 participants