Quellcode durchsuchen

Fix missing precincts with short ballot numbers in ballot range report

The >= 4 digit guard was a Lansing-specific assumption that excluded ballot
numbers shorter than 4 digits. Changed to require only 1+ digit and use the
full numeric value so all precincts (e.g. FH 2-44) appear in the report.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
master
Daniel Covington vor 2 Tagen
Ursprung
Commit
a3d7383152
1 geänderte Dateien mit 7 neuen und 9 gelöschten Zeilen
  1. +7
    -9
      App/DomainModels/PurpleEnvelopeReportHelper.asp

+ 7
- 9
App/DomainModels/PurpleEnvelopeReportHelper.asp Datei anzeigen

@@ -81,12 +81,11 @@ Class PurpleEnvelopeReportHelper_Class
End Function

Public Function BuildBallotRangesWithMissing(ByVal rs)
' Groups raw PRECINCT/BALLOT_NUMBER rows by precinct, extracts last 4 digits of
' the numeric portion (matching the PowerShell InkjetRecords analysis script),
' computes min/max and any missing numbers in that range, then returns rows
' sorted by precinct in descending order.
' Groups raw PRECINCT/BALLOT_NUMBER rows by precinct, strips non-digits from each
' ballot number, computes min/max and any missing numbers in that range, then
' returns rows sorted by precinct in descending order.
dim precinctNums : set precinctNums = CreateObject("Scripting.Dictionary")
dim precinct, rawNum, digits, i, ch, last4Str
dim precinct, rawNum, digits, i, ch

Do Until rs.EOF
precinct = Trim(rs("PRECINCT") & "")
@@ -98,12 +97,11 @@ Class PurpleEnvelopeReportHelper_Class
If ch >= "0" And ch <= "9" Then digits = digits & ch
Next

If Len(digits) >= 4 Then
last4Str = Mid(digits, Len(digits) - 3, 4)
If Len(digits) > 0 Then
If precinctNums.Exists(precinct) Then
precinctNums(precinct) = precinctNums(precinct) & "," & last4Str
precinctNums(precinct) = precinctNums(precinct) & "," & digits
Else
precinctNums.Add precinct, last4Str
precinctNums.Add precinct, digits
End If
End If
rs.MoveNext


Laden…
Abbrechen
Speichern

Powered by TurnKey Linux.