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
| @@ -81,12 +81,11 @@ Class PurpleEnvelopeReportHelper_Class | |||||
| End Function | End Function | ||||
| Public Function BuildBallotRangesWithMissing(ByVal rs) | 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 precinctNums : set precinctNums = CreateObject("Scripting.Dictionary") | ||||
| dim precinct, rawNum, digits, i, ch, last4Str | |||||
| dim precinct, rawNum, digits, i, ch | |||||
| Do Until rs.EOF | Do Until rs.EOF | ||||
| precinct = Trim(rs("PRECINCT") & "") | precinct = Trim(rs("PRECINCT") & "") | ||||
| @@ -98,12 +97,11 @@ Class PurpleEnvelopeReportHelper_Class | |||||
| If ch >= "0" And ch <= "9" Then digits = digits & ch | If ch >= "0" And ch <= "9" Then digits = digits & ch | ||||
| Next | Next | ||||
| If Len(digits) >= 4 Then | |||||
| last4Str = Mid(digits, Len(digits) - 3, 4) | |||||
| If Len(digits) > 0 Then | |||||
| If precinctNums.Exists(precinct) Then | If precinctNums.Exists(precinct) Then | ||||
| precinctNums(precinct) = precinctNums(precinct) & "," & last4Str | |||||
| precinctNums(precinct) = precinctNums(precinct) & "," & digits | |||||
| Else | Else | ||||
| precinctNums.Add precinct, last4Str | |||||
| precinctNums.Add precinct, digits | |||||
| End If | End If | ||||
| End If | End If | ||||
| rs.MoveNext | rs.MoveNext | ||||
Powered by TurnKey Linux.