fix(setup): count only submitted documents in the sales person heatmap

(cherry picked from commit 1674287d0b)
This commit is contained in:
R-Jayaraman
2026-10-22 18:24:58 +00:00
committed by Mergify
parent 60a52ac6b6
commit e2bb607fe1
@@ -139,6 +139,7 @@ def get_timeline_data(doctype: str, name: str) -> dict[int, int]:
.on(transaction.name == sales_team.parent)
.select(UnixTimestamp(transaction[date_field]), Count("*"))
.where(sales_team.sales_person == name)
.where(transaction.docstatus == 1)
.where(transaction[date_field] > CurDate() - Interval(years=1))
.groupby(transaction[date_field])
.run()