diff --git a/App/DomainModels/PurpleEnvelopeReportHelper.asp b/App/DomainModels/PurpleEnvelopeReportHelper.asp index 12766dd..6c08273 100644 --- a/App/DomainModels/PurpleEnvelopeReportHelper.asp +++ b/App/DomainModels/PurpleEnvelopeReportHelper.asp @@ -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