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

Expense-Unable to delete expense in submitted report in controlWS when frequency set to manual #53195

Open
3 of 8 tasks
IuliiaHerets opened this issue Nov 27, 2024 · 4 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@IuliiaHerets
Copy link

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: 9.0.67.0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Issue reported by: Applause Internal Team

Action Performed:

Precondition: admin created a collect policy and upgraded to control, enabled workflow, toggled Delay submission on and set submission frequency to manual

  1. Go to https://staging.new.expensify.com/and log in as a member of workspace
  2. Navigate to the workspace chat
  3. Create an expense and submit the report
  4. Open the combined report
  5. Click on the header and delete the expense

Expected Result:

The expense is deleted

Actual Result:

The error message "Unexpected error deleting this expense. Please try again later." is displayed, expense is not deleted

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6677634_1732676281757.Recording__986.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 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.

@JmillsExpensify
Copy link

Interesting. I suspect this'll be a backend issue, though I thought this was addressed by @youssef-lr as part of the instant submit project (which made all processing reports editable).

@youssef-lr
Copy link
Contributor

@JmillsExpensify seems like that report was in the Closed state because the workspace doesn't have approvals? I think in the frontend we should hide the delete expense button for closed reports.

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 27, 2024

Edited by proposal-police: This proposal was edited at 2024-11-27 18:58:54 UTC.

Proposal

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

Expense-Unable to delete expense in submitted report in controlWS when frequency set to manual

What is the root cause of that problem?

The report is automatically closed due to submit-only policy but we are not hiding delete button for closed reports

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

Because we can neither add nor delete a transaction from a closed report we should return false in canAddOrDeleteTransactions when the report is a closed one

App/src/libs/ReportUtils.ts

Lines 1778 to 1780 in 084a711

function canAddOrDeleteTransactions(moneyRequestReport: OnyxEntry<Report>): boolean {
if (!isMoneyRequestReport(moneyRequestReport) || isArchivedRoom(moneyRequestReport)) {
return false;

    if (!isMoneyRequestReport(moneyRequestReport) || isArchivedRoom(moneyRequestReport) || isClosedReport(moneyRequestReport)) {
        return false;

We can add similar not closed report checks to show approve, submit and pay buttons if needed

What alternative solutions did you explore? (Optional)

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
Projects
Status: No status
Development

No branches or pull requests

4 participants