From 1d786b30bfd5cf1ee90c3fccfac027d93e2e791b Mon Sep 17 00:00:00 2001 From: MrWaradana Date: Mon, 29 Dec 2025 14:57:25 +0700 Subject: [PATCH] feat: add status filter for completed and closed work orders to equipment queries --- src/modules/equipment/where_query_sql.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/equipment/where_query_sql.py b/src/modules/equipment/where_query_sql.py index e65a1b6..5ccba25 100644 --- a/src/modules/equipment/where_query_sql.py +++ b/src/modules/equipment/where_query_sql.py @@ -3,6 +3,7 @@ def get_where_query_sql(assetnum, worktype): where (a.asset_unit = '3' OR a.asset_unit='00') and a.wonum not like 'T%' + and a.status in ('COMP', 'CLOSE') AND a.asset_assetnum = '{assetnum}' {f"AND a.worktype = '{worktype}'" if worktype != 'CM' else "AND a.worktype in ('CM', 'PROACTIVE', 'EM')"} {f"AND a.wojp8 != 'S1'" if worktype == 'CM' else ""} @@ -22,6 +23,7 @@ def get_where_query_sql_all_worktype(assetnum): where (a.asset_unit = '3' OR a.asset_unit='00') and a.wonum not like 'T%' + and a.status in ('COMP', 'CLOSE') AND a.asset_assetnum = '{assetnum}' AND ( (a.worktype = 'CM' AND a.wojp8 != 'S1')