Skip to content

[Bug] Dashboard totalRevenue incorrectly includes cancelled orders #4

@vinamra1102

Description

@vinamra1102

Description

The revenue calculation on the Dashboard sums all orders regardless
of their status. This means cancelled orders are counted towards
totalRevenue, showing inflated/incorrect earnings to the entrepreneur.

Location

client/src/pages/Dashboard.jsx line 82

Current Behavior

Total revenue includes cancelled orders in the sum.

Expected Behavior

Only non-cancelled orders (pending, confirmed, shipped, delivered)
should be counted in totalRevenue.

Proposed Fix

// Before
orders.reduce((sum, o) => sum + o.total, 0)

// After
orders
  .filter(o => o.status !== 'cancelled')
  .reduce((sum, o) => sum + o.total, 0)

Labels

level:beginner type:bug

I am a GSSoC 2026 contributor and would like to work on this issue.
Can I get this assigned to me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions