Update pages to use pctypeid instead of machinetypeid IN (33-43)

- PCs identified by pctypeid IS NOT NULL instead of machinetypeid list
- Equipment identified by pctypeid IS NULL instead of NOT IN list
- Fixed devicecamera.asp: IDF dropdown uses machinetypeid 17, not 34
- Fixed displaypcs.asp: measuring tool filter uses pctypeid = 7

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-08 15:46:48 -05:00
parent e2e7cb1466
commit 659e8bad4b
18 changed files with 26 additions and 26 deletions

View File

@@ -48,7 +48,7 @@ deviceTypeFilter = Request.QueryString("devicetype")
Dim rsUnlinked, unlinkedCount
unlinkedCount = 0
Set rsUnlinked = objConn.Execute("SELECT COUNT(*) as cnt FROM machines m " & _
"WHERE m.machinetypeid IN (41, 42, 43) AND m.isactive = 1 " & _
"WHERE m.pctypeid = 7 AND m.isactive = 1 " & _
"AND NOT EXISTS (SELECT 1 FROM machinerelationships mr WHERE (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) AND mr.relationshiptypeid = 3 AND mr.isactive = 1)")
If Not rsUnlinked.EOF Then
unlinkedCount = CLng(rsUnlinked("cnt") & "")
@@ -141,7 +141,7 @@ Set rsStatus = Nothing
"LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _
"LEFT JOIN machinerelationships mr ON (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) AND mr.isactive = 1 AND mr.relationshiptypeid = 3 " & _
"LEFT JOIN machines eq ON (eq.machineid = mr.related_machineid OR eq.machineid = mr.machineid) AND eq.machineid <> m.machineid AND eq.machinetypeid < 33 " & _
"WHERE m.isactive = 1 AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)"
"WHERE m.isactive = 1 AND m.pctypeid IS NOT NULL"
' Apply filters
whereClause = ""
@@ -162,7 +162,7 @@ Set rsStatus = Nothing
' Filter for specialized PCs needing equipment relationships
If needsRelationshipFilter = "1" Then
whereClause = whereClause & "AND m.machinetypeid IN (41, 42, 43) " & _
whereClause = whereClause & "AND m.pctypeid = 7 " & _
"AND NOT EXISTS (SELECT 1 FROM machinerelationships mr WHERE (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) AND mr.relationshiptypeid = 3 AND mr.isactive = 1) "
End If