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] Pay with Expensify displayed for approved card expenses for the submitter #53804

Open
1 of 8 tasks
m-natarajan opened this issue Dec 10, 2024 · 33 comments
Open
1 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Hot Pick Ready for an engineer to pick up and run with Needs Reproduction Reproducible steps needed

Comments

@m-natarajan
Copy link

m-natarajan commented Dec 10, 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: @heyjennahay
Slack conversation (hyperlinked to channel name): #migrate

Action Performed:

  1. Submit a report in OldDot with a mix of card and OOP expense
  2. The expense auto approved as per the workspace rules
  3. Login to the NewDot with the same account and open the report

Expected Result:

No Pay with Expensify option as the report is auto approved

Actual Result:

Pay with Expensify displayed for approved card expenses for the submitter

Email also received for approver (Not payer) with Pay Button for auto approved report

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 (6)

image (7)

image (8)

image (10)

{
      "chatReportID": "5173333429439527",
      "chatType": "",
      "currency": "EUR",
      "description": "",
      "errorFields": {},
      "hasOutstandingChildRequest": false,
      "hasOutstandingChildTask": false,
      "hasParentAccess": true,
      "isCancelledIOU": false,
      "isOwnPolicyExpenseChat": false,
      "isPinned": false,
      "isWaitingOnBankAccount": false,
      "lastActionType": "EXPORTINTEGRATION",
      "lastActorAccountID": "10903701",
      "lastMessageHtml": "Concierge exported this report to NetSuite. View out of pocket expenses. View company card expenses",
      "lastMessageText": "Concierge exported this report to NetSuite. View out of pocket expenses. View c…",
      "lastReadSequenceNumber": 0,
      "lastReadTime": "2024-11-13 12:07:56.542",
      "lastVisibleActionCreated": "2024-11-12 18:40:16.849",
      "lastVisibleActionLastModified": "2024-11-12 18:40:16.849",
      "managerID": 1381556,
      "nonReimbursableTotal": -1335,
      "notificationPreference": "hidden",
      "oldPolicyName": "",
      "ownerAccountID": 2840332,
      "parentReportActionID": "4437845246722994423",
      "parentReportID": "5173333429439527",
      "participants": {
            "1381556": {
                  "hidden": true,
                  "notificationPreference": "hidden"
            },
            "2840332": {
                  "hidden": true,
                  "notificationPreference": "hidden"
            },
            "9645353": {
                  "hidden": true,
                  "notificationPreference": "hidden"
            },
            "9662119": {
                  "hidden": true,
                  "notificationPreference": "hidden"
            },
            "9713816": {
                  "hidden": true,
                  "notificationPreference": "hidden"
            },
            "10903701": {
                  "hidden": false,
                  "notificationPreference": "always"
            }
      },
      "permissions": [],
      "policyID": "9106A4CE5D9D5ACE",
      "private_isArchived": "",
      "reportID": "6376119163420666",
      "reportName": "[Expenses - Expensify NL] Jenna's Expenses 2024-11-05 #R00TCZ9Vza7G",
      "stateNum": 2,
      "statusNum": 3,
      "total": -5090,
      "type": "expense",
      "unheldNonReimbursableTotal": -1335,
      "unheldTotal": -5090,
      "welcomeMessage": "",
      "writeCapability": "all",
      "isLoadingPrivateNotes": false,
      "privateNotes": {
            "2840332": {
                  "note": ""
            }
      }
}
{isFromFullPolicy: false, id: '9106A4CE5D9D5ACE', name: 'Expenses - Expensify NL', role: 'user', type: 'corporate', …}
address
: 
addressStreet
: 
"Markt 14"
city
: 
""
country
: 
"NL"
state
: 
""
zipCode
: 
"6211 CJ Maastricht"
approvalMode
: 
"ADVANCED"
approver
: 
""
areCategoriesEnabled
: 
true
areCompanyCardsEnabled
: 
false
areConnectionsEnabled
: 
true
areDistanceRatesEnabled
: 
true
areExpensifyCardsEnabled
: 
false
areInvoicesEnabled
: 
false
arePerDiemRatesEnabled
: 
false
areReportFieldsEnabled
: 
true
areRulesEnabled
: 
false
areTagsEnabled
: 
true
areWorkflowsEnabled
: 
true
autoReimbursement
: 
limit
: 
0
autoReimbursementLimit
: 
0
autoReporting
: 
true
autoReportingFrequency
: 
"weekly"
autoReportingOffset
: 
1
avatarURL
: 
""
chatReportIDAdmins
: 
75474096
chatReportIDAnnounce
: 
75474095
connections
: 
netsuite
: 
accountID
: 
"4681086"
config
: 
{autoSync: {…}}
lastErrorSyncDate
: 
""
lastSync
: 
{errorDate: '', errorMessage: '', isAuthenticationError: false, isConnected: true, isSuccessful: true, …}
lastSyncDate
: 
"2024-11-12T17:12:46+0000"
options
: 
{config: {…}, data: {…}}
source
: 
"AUTOSYNC"
tokenID
: 
"QUUW1RWhSd4rGFLzLP78M7QXW+W6P0RpLvEVu8PrmiiS12hr3hUqvJjr0c8cHNj5c0g15hMX91+VlnPZqKqo3lg0jVXsThtU001mdFwynvA=;FpyKvYtNxXNgnGfjUJ9hZA==;9SqCDSQrwuHnpFllZagC81BfHIbowLWp4Vfr4k9EGDE0kPsurnjtvqQ1mR29XRIV63Yu+60gADbOm9S8/vfGtA=="
tokenSecret
: 
"/x7iQQf3qrzneg6tsLitvIFLBpug1W25BNRna/HvdggoGO3DvrafKMCuIKnjYJyt48zPoIKwiraIFB1XltqxqVS2GLnrpouu6O59NmZ+36E=;9Hobe3d6/iOlIcovF36YMg==;MPpu6Rtj6ybtRZoqw9wtmXwd+cFz4CCwrr6npiMeAAJ7gniZMoNe0JP0aR60WEz+HaoOQ6T9pDV+y9ON7ef9hQ=="
verified
: 
true
customUnits
: 
5d39c8cc2bcfc
: 
attributes
: 
{taxEnabled: false, unit: 'mi'}
customUnitID
: 
"5d39c8cc2bcfc"
defaultCategory
: 
""
enabled
: 
true
name
: 
"Distance"
rates
: 
{5d39c8cc2bd17: {…}}
defaultBillable
: 
false
description
: 
""
disabledFields
: 
defaultBillable
: 
true
reimbursable
: 
true
eReceipts
: 
false
employeeList
: 
[email protected]
: 
email
: 
"[email protected]"
role
: 
"admin"
submitsTo
: 
"[email protected]"
[email protected]
: 
email
: 
"[email protected]"
role
: 
"admin"
submitsTo
: 
"[email protected]"
[email protected]
: 
email
: 
"[email protected]"
role
: 
"auditor"
submitsTo
: 
"[email protected]"
[email protected]
: 
email
: 
"[email protected]"
role
: 
"user"
rules
: 
[{…}]
submitsTo
: 
"[email protected]"
[email protected]
: 
email
: 
"[email protected]"
role
: 
"auditor"
submitsTo
: 
"[email protected]"
[email protected]
: 
approvalLimit
: 
500000
email
: 
"[email protected]"
overLimitForwardsTo
: 
"[email protected]"
role
: 
"user"
submitsTo
: 
"[email protected]"
[email protected]
: 
approvalLimit
: 
500000
email
: 
"[email protected]"
overLimitForwardsTo
: 
"[email protected]"
role
: 
"user"
submitsTo
: 
"[email protected]"
[email protected]
: 
email
: 
"[email protected]"
role
: 
"user"
rules
: 
[{…}]
submitsTo
: 
"[email protected]"
fieldList
: 
expensify_field_id_SUPPLIER_ADDRESS
: 
deletable
: 
false
disabledOptions
: 
[]
externalIDs
: 
[]
fieldID
: 
"field_id_SUPPLIER_ADDRESS"
isTax
: 
false
keys
: 
[]
name
: 
"Supplier Address"
orderWeight
: 
0
origin
: 
"currencyDefault"
target
: 
"invoice"
type
: 
"text"
values
: 
[]
expensify_field_id_VAT_NUMBER
: 
deletable
: 
false
disabledOptions
: 
[]
externalIDs
: 
[]
fieldID
: 
"field_id_VAT_NUMBER"
isTax
: 
false
keys
: 
[]
name
: 
"VAT Number"
orderWeight
: 
0
origin
: 
"currencyDefault"
target
: 
"invoice"
type
: 
"text"
values
: 
[]
text_title
: 
defaultValue
: 
"[{report:policyname}] {report:submit:from|frontPart}'s Expenses {report:startdate} #{report:id}"
deletable
: 
true
disabledOptions
: 
[]
externalIDs
: 
[]
fieldID
: 
"text_title"
isTax
: 
false
keys
: 
[]
name
: 
"title"
orderWeight
: 
0
target
: 
"expense"
type
: 
"formula"
values
: 
[]
harvesting
: 
enabled
: 
true
hasMultipleTagLists
: 
false
id
: 
"9106A4CE5D9D5ACE"
invoice
: 
markUp
: 
0
isFromFullPolicy
: 
false
isPolicyExpenseChatEnabled
: 
true
lastModified
: 
1731431566581022
maxExpenseAge
: 
365
maxExpenseAmount
: 
100000000
maxExpenseAmountNoReceipt
: 
20000
mccGroup
: 
airlines
: 
category
: 
"Travel Airfare & Transportation"
groupID
: 
"airlines"
commuter
: 
category
: 
"Travel Airfare & Transportation"
groupID
: 
"commuter"
gas
: 
category
: 
"Travel Airfare & Transportation"
groupID
: 
"gas"
goods
: 
category
: 
"Uncategorized"
groupID
: 
"goods"
groceries
: 
category
: 
"Uncategorized"
groupID
: 
"groceries"
hotel
: 
category
: 
"Travel Accommodation"
groupID
: 
"hotel"
mail
: 
category
: 
"Facilities Printing & Shipping"
groupID
: 
"mail"
meals
: 
category
: 
"Uncategorized"
groupID
: 
"meals"
rental
: 
category
: 
"Travel Airfare & Transportation"
groupID
: 
"rental"
services
: 
category
: 
"Uncategorized"
groupID
: 
"services"
taxi
: 
category
: 
"Travel Airfare & Transportation"
groupID
: 
"taxi"
uncategorized
: 
category
: 
"Uncategorized"
groupID
: 
"uncategorized"
utilities
: 
category
: 
"Facilities Utilities & Internet"
groupID
: 
"utilities"
name
: 
"Expenses - Expensify NL"
outputCurrency
: 
"EUR"
owner
: 
"[email protected]"
ownerAccountID
: 
10903701
preventSelfApproval
: 
true
reimbursementChoice
: 
"reimburseYes"
requiresCategory
: 
true
requiresTag
: 
false
role
: 
"user"
rules
: 
approvalRules
: 
Array(0)
length
: 
0
expenseRules
: 
Array(10)
0
: 
{applyWhen: Array(1), id: '621cffb8e47ee', tax: {…}}
1
: 
{applyWhen: Array(1), id: '6306223d8cd72', tax: {…}}
2
: 
{applyWhen: Array(1), id: '64345e1b166f9', tax: {…}}
3
: 
{applyWhen: Array(1), id: '6488eb48ec5a4', tax: {…}}
4
: 
{applyWhen: Array(1), id: '6488eb5121b6a', tax: {…}}
5
: 
{applyWhen: Array(1), id: '651a2ad2a4ddf', tax: {…}}
6
: 
{applyWhen: Array(1), id: '66044c6684393', tax: {…}}
7
: 
{applyWhen: Array(1), id: '66044c750da64', tax: {…}}
8
: 
{applyWhen: Array(1), id: '66044c8395a3e', tax: {…}}
9
: 
{applyWhen: Array(1), id: '66044c96cff22', tax: {…}}
length
: 
10
shouldShowAutoApprovalOptions
: 
false
shouldShowAutoReimbursementLimitOption
: 
false
shouldShowCustomReportTitleOption
: 
false
tax
: 
trackingEnabled
: 
true
taxRates
: 
defaultExternalID
: 
"180"
defaultValue
: 
"0%"
foreignTaxDefault
: 
"180"
name
: 
"Tax"
taxes
: 
179
: 
{name: 'NL-BTW Standard 21%', value: '21%'}
180
: 
{name: 'NL-BTW 0%', value: '0%'}
199
: 
{name: 'NL-BTW exempt 0%', value: '0%'}
200
: 
{name: 'NL-Non-EU purchase 21%', value: '21%'}
201
: 
{name: 'NL-BTW Reduced 9%', value: '9%'}
202
: 
{name: 'NL-EU purchase (goods) 21%', value: '21%'}
203
: 
{name: 'NL-EU purchase (services) 21%', value: '21%'}
type
: 
"corporate"

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021868165410808201052
  • Upwork Job ID: 1868165410808201052
  • Last Price Increase: 2024-12-15
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Dec 10, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

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

@flaviadefaria flaviadefaria moved this to First Cohort - HIGH in [#whatsnext] #migrate Dec 10, 2024
@melvin-bot melvin-bot bot added the Overdue label Dec 12, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

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

@alexpensify alexpensify added the External Added to denote the issue can be worked on by a contributor label Dec 15, 2024
@melvin-bot melvin-bot bot changed the title Pay with Expensify displayed for approved card expenses for the submitter [$250] Pay with Expensify displayed for approved card expenses for the submitter Dec 15, 2024
Copy link

melvin-bot bot commented Dec 15, 2024

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

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

melvin-bot bot commented Dec 15, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Dec 15, 2024
@alexpensify
Copy link
Contributor

@getusha - We are waiting for proposals here, but keep me posted if this is more BE. Thanks!


Heads up, I will be offline until Wednesday, December 18, 2024, and will not actively watch over this GitHub during that period.

If this GitHub requires an urgent update, please ask for help in the #expensify-open-source Slack Room. If the inquiry can wait, I'll review it when I return online.

@darkdubdeep
Copy link

darkdubdeep commented Dec 15, 2024

PROPOSAL:

Hi, to solve this problem I would like to break it down into several steps:

  1. Find out which parameter from the backend is responsible for the autopayment
  2. Find the component in the frontend codebase and check if there is a logic for rendering the "pay with Expensify" button (if yes, then the problem is probably in the backend and some data is missing)
  3. If the problem is not in the backend, implement a conditional rendering of "pay with Expensify" depends on data from backend

Contributor details
Upwork Profile Link: https://www.upwork.com/freelancers/~01e8ec4808aef63e9b
Your Expensify account email: [email protected]

If you need more information about my experience please contact me here

Ilnur

Copy link

melvin-bot bot commented Dec 15, 2024

📣 @darkdubdeep! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@narefyev91
Copy link
Contributor

Hi, I'm Nicolay from Callstack - expert contributor group - and I would like to work on this issue.

@melvin-bot melvin-bot bot added the Overdue label Dec 17, 2024
@melvin-bot melvin-bot bot removed Help Wanted Apply this label when an issue is open to proposals by contributors Overdue labels Dec 17, 2024
Copy link

melvin-bot bot commented Dec 20, 2024

@alexpensify, @Julesssss, @narefyev91, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 20, 2024
@narefyev91
Copy link
Contributor

Will drop my findings here:
Was not able to simulate such behaviour on dev env - unfortunately
But based on provided data above - we can found potential problem:
If we check code - which is related to view Pay button we can see that those lines of code define - which buttons we will see - either both "Pay with Expensify" and "Pay elsewhere" or just "Pay elsewhere".
In our current case we should not see "Pay with Expensify" button.
Screenshot 2024-12-20 at 13 20 04

A little bit strange check for onlyShowPayElsewhere - but it should be true to just show pay button
Which means that canIOUBePaid should be false.
If we check function canIOUBePaid we have return in boolean format (based on provided onyx data - we landing to last return):
Screenshot 2024-12-20 at 13 25 28

If we go line by line and check with onyx data - we will see that the response here will be finally true - which is not our case. We expecting false here.
All the lines expect the first one is working fine based on Onyx data.
Inside isPayer - which should be false in our case - we see this block which will be fired in our case:
Screenshot 2024-12-20 at 13 29 57

We will get to this block as well:
policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES
And there we can see that right check will be true - because isApproved = true. And based on the Onyx data above - we do not have achAccount information - that's why !policy?.achAccount?.reimburser will also be true

If we will have policy?.achAccount?.reimburser which will be returned from API side - we will not see "Pay with Expensify" button.

Seems like the same issue is happened with Email - "Email also received for approver (Not payer) with Pay Button for auto approved report" - technically we do not keep in count that report was already auto approved.
Seems for me - we need someone from BE team to check - why don't we have information about policy?.achAccount?.reimburse if expense was auto-approved.

Let me know wdyt @getusha

@alexpensify
Copy link
Contributor

We are waiting for @getusha's feedback here

@Julesssss
Copy link
Contributor

For example, I am creating a card expense and auto-submitting in OldDot, but my user can't see the Pay button (my admin recipient can, as expected).

User
Screenshot 2025-01-06 at 16 33 15

Admin
Screenshot 2025-01-06 at 16 33 07

Copy link

melvin-bot bot commented Jan 7, 2025

@alexpensify @Julesssss @narefyev91 @getusha this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@Julesssss Julesssss added Weekly KSv2 and removed Daily KSv2 labels Jan 7, 2025
@melvin-bot melvin-bot bot added the Overdue label Jan 16, 2025
@alexpensify
Copy link
Contributor

Adding it back to my testing list to confirm if I can continue to replicate

@melvin-bot melvin-bot bot removed the Overdue label Jan 17, 2025
@flaviadefaria flaviadefaria moved this to Second Cohort - MEDIUM or LOW in [#whatsnext] #migrate Jan 21, 2025
@dylanexpensify
Copy link
Contributor

Just for viz, Puneet brought this up here as happening to him.

@Julesssss
Copy link
Contributor

As far as I can tell we still don't have reproducable steps. Last attempt.

@melvin-bot melvin-bot bot removed the Overdue label Jan 27, 2025
@tgolen
Copy link
Contributor

tgolen commented Jan 28, 2025

I believe I also had this happen to me and I reported it in slack today.

@Julesssss
Copy link
Contributor

I'm unable to prioritise this and we're struggling to hand it off.

@melvin-bot melvin-bot bot removed the Overdue label Feb 5, 2025
@joekaufmanexpensify
Copy link
Contributor

@narefyev91 tagged you here for when you have a sec for what might be a similar bug. Interested in your thoughts!

@joekaufmanexpensify
Copy link
Contributor

Consolidating this issue here as we think it is likely same RCA.

The bug there is that we're showing the pay button on report that has already been paid in certain situations, similar to how we're showing the pay button here on approved card expenses that don't need to be paid.

@Julesssss
Copy link
Contributor

I'm still not going to be able to prioritise this in the next few weeks. I forgot that I had previously assigned myself, so I'm going to unnassign myself -- lets seek a volunteer who will be able to move this forward more quickly. Here's the latest details for the task.

@Julesssss Julesssss removed their assignment Feb 11, 2025
@garrettmknight garrettmknight added the Hot Pick Ready for an engineer to pick up and run with label Feb 11, 2025
@trjExpensify
Copy link
Contributor

Noting that I've seen this on one of my expense reports today:

Image
  • The report has a mixture of reimbursable and non-reimbursable expenses
  • The report was auto-submitted and auto-approved

@melvin-bot melvin-bot bot added the Overdue label Feb 20, 2025
@alexpensify
Copy link
Contributor

Weekly Update: This one has moved to a Hot Pick!

@melvin-bot melvin-bot bot removed the Overdue label Feb 21, 2025
@flaviadefaria flaviadefaria added Daily KSv2 and removed Weekly KSv2 labels Feb 25, 2025
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 External Added to denote the issue can be worked on by a contributor Hot Pick Ready for an engineer to pick up and run with Needs Reproduction Reproducible steps needed
Projects
Status: Second Cohort - MEDIUM or LOW
Development

No branches or pull requests