From 5b3ffccad6b26e75a48489c8ceec4852bd710788 Mon Sep 17 00:00:00 2001 From: Xor290 Date: Fri, 23 Oct 2026 09:18:58 +0200 Subject: [PATCH] chore: build --- backend/gestion/db/db_stat.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/gestion/db/db_stat.go b/backend/gestion/db/db_stat.go index 2a0fac28..a72765b7 100644 --- a/backend/gestion/db/db_stat.go +++ b/backend/gestion/db/db_stat.go @@ -362,9 +362,10 @@ func (d *Database) DailyOrdersCount() (int64, error) { // ── Résumé global ──────────────────────────────────────────────────────────── -// TotalOrders renvoie le nombre total de commandes filtré par le reset "commandes". +// TotalOrders renvoie le nombre de commandes actives (même périmètre que le +// dashboard : pending/assigned/en_route/arrived/livre), filtré par le reset "commandes". func (d *Database) TotalOrders(resetAt time.Time) (int64, error) { - where, args := statusFilterClause("status != 'cancelled'", resetAt, "created_at") + where, args := statusFilterClause("status IN ('pending', 'assigned', 'en_route', 'arrived', 'livre')", resetAt, "created_at") var total int64 err := d.GDB.Raw(`SELECT COUNT(*) FROM commandes WHERE `+where, args...).Scan(&total).Error return total, err