refactor: date filters should be explicit

This commit is contained in:
ruthra kumar
2024-07-31 14:01:27 +05:30
parent 930ecb3170
commit 40c166a0a0

View File

@@ -147,6 +147,10 @@ class SalesPipelineAnalytics:
conditions.append(
["expected_closing", "between", [self.filters.get("from_date"), self.filters.get("to_date")]]
)
elif self.filters.get("from_date") and not self.filters.get("to_date"):
conditions.append(["expected_closing", ">=", self.filters.get("from_date")])
elif not self.filters.get("from_date") and self.filters.get("to_date"):
conditions.append(["expected_closing", "<=", self.filters.get("to_date")])
return conditions