fix: add include closed orders option in so/po trends report v15

This commit is contained in:
Nihantra Patel
2024-10-08 18:48:11 +05:30
parent cf0fa0db7b
commit 5660e8b26d
3 changed files with 18 additions and 2 deletions

View File

@@ -74,8 +74,10 @@ def get_data(filters, conditions):
if conditions["based_on_select"] in ["t1.project,", "t2.project,"]:
cond = " and " + conditions["based_on_select"][:-1] + " IS Not NULL"
if conditions.get("trans") in ["Sales Order", "Purchase Order"]:
cond += " and t1.status != 'Closed'"
if not filters.get("include_closed_orders"):
if conditions.get("trans") in ["Sales Order", "Purchase Order"]:
cond += " and t1.status != 'Closed'"
if conditions.get("trans") == "Quotation" and filters.get("group_by") == "Customer":
cond += " and t1.quotation_to = 'Customer'"