Replace machinetypeid 33-43 checks with pctypeid throughout codebase

- PCs now identified by pctypeid IS NOT NULL (not machinetypeid >= 33)
- Equipment identified by pctypeid IS NULL (not machinetypeid < 33)
- Updated 8 files: search.asp, savemachineedit.asp, displaymachine.asp,
  displaypc.asp, displaypcs.asp, machine_map.asp, displaymachines.asp, api.asp
- Simplified queries and removed redundant machinetypeid checks
- Updated all related comments to reflect new pattern

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-09 07:24:20 -05:00
parent a52dd2e932
commit 81f905f0b0
8 changed files with 26 additions and 39 deletions

View File

@@ -140,7 +140,7 @@ Set rsStatus = Nothing
"LEFT JOIN communications c ON c.machineid = m.machineid AND c.isprimary = 1 " & _
"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 " & _
"LEFT JOIN machines eq ON (eq.machineid = mr.related_machineid OR eq.machineid = mr.machineid) AND eq.machineid <> m.machineid AND eq.pctypeid IS NULL " & _
"WHERE m.isactive = 1 AND m.pctypeid IS NOT NULL"
' Apply filters