diff --git a/backend/gestion/handlers/stats.go b/backend/gestion/handlers/stats.go index 7e8444cc..8d402172 100644 --- a/backend/gestion/handlers/stats.go +++ b/backend/gestion/handlers/stats.go @@ -117,7 +117,7 @@ func GetAdminStats(c *gin.Context) { ci.produit AS name, SUM(ci.quantite) AS total_quantity, COUNT(DISTINCT ci.command_id) AS order_count, - SUM(ci.prix * ci.quantite) AS revenue, + SUM(ci.prix) AS revenue, COALESCE(p.category, '') AS category, COALESCE(cat.color, '#7c3aed') AS category_color FROM command_items ci @@ -156,7 +156,7 @@ func GetAdminStats(c *gin.Context) { ci.quantite AS quantity, COUNT(DISTINCT ci.command_id) AS order_count, SUM(ci.quantite) AS total_sold, - SUM(ci.prix * ci.quantite) AS revenue, + SUM(ci.prix) AS revenue, COALESCE(cat.color, '#7c3aed') AS category_color FROM command_items ci JOIN commandes c ON c.id = ci.command_id