feat: add status filter for completed and closed work orders to equipment queries

main
MrWaradana 2 weeks ago
parent 835224a854
commit 1d786b30bf

@ -3,6 +3,7 @@ def get_where_query_sql(assetnum, worktype):
where where
(a.asset_unit = '3' OR a.asset_unit='00') (a.asset_unit = '3' OR a.asset_unit='00')
and a.wonum not like 'T%' and a.wonum not like 'T%'
and a.status in ('COMP', 'CLOSE')
AND a.asset_assetnum = '{assetnum}' AND a.asset_assetnum = '{assetnum}'
{f"AND a.worktype = '{worktype}'" if worktype != 'CM' else "AND a.worktype in ('CM', 'PROACTIVE', 'EM')"} {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 ""} {f"AND a.wojp8 != 'S1'" if worktype == 'CM' else ""}
@ -22,6 +23,7 @@ def get_where_query_sql_all_worktype(assetnum):
where where
(a.asset_unit = '3' OR a.asset_unit='00') (a.asset_unit = '3' OR a.asset_unit='00')
and a.wonum not like 'T%' and a.wonum not like 'T%'
and a.status in ('COMP', 'CLOSE')
AND a.asset_assetnum = '{assetnum}' AND a.asset_assetnum = '{assetnum}'
AND ( AND (
(a.worktype = 'CM' AND a.wojp8 != 'S1') (a.worktype = 'CM' AND a.wojp8 != 'S1')

Loading…
Cancel
Save