Anda di halaman 1dari 3

Nit 100088260

1
0
0
0
8
8
2
6
0
Dim pos As Integer = Nit.Length - 1 8
_Correlativo = Nit.Substring(0, pos) 10008826
_DigitoVerificador = Right$(Nit, 1).ToUpper 0
Dim Factor As Integer = _Correlativo.Length + 1 9
Dim Suma As Integer = 0, Valor As Integer = 0
For x As Integer = 0 To _Correlativo.Length - 1 De 0 A 7
x=0
Valor = Convert.ToInt32(Nit.Substring(x, 1)) 1
Suma = Suma + (Valor * Factor) 0+(1*9) 9
Factor = Factor - 1 8
X=1
Valor = Convert.ToInt32(Nit.Substring(x, 1)) 0
Suma = Suma + (Valor * Factor) 9+(0*8) 9
Factor = Factor - 1 7
x=2
Valor = Convert.ToInt32(Nit.Substring(x, 1)) 0
Suma = Suma + (Valor * Factor) 9+(0*7) 9
Factor = Factor - 1 6
x=3
Valor = Convert.ToInt32(Nit.Substring(x, 1)) 0
Suma = Suma + (Valor * Factor) 9+(0*6) 9
Factor = Factor - 1 5
x=4
Valor = Convert.ToInt32(Nit.Substring(x, 1)) 8
Suma = Suma + (Valor * Factor) 9+(8*5) 49
Factor = Factor - 1 4
x=5
Valor = Convert.ToInt32(Nit.Substring(x, 1)) 8
Suma = Suma + (Valor * Factor) 49+(8*4) 81
Factor = Factor - 1 3
x=6
Valor = Convert.ToInt32(Nit.Substring(x, 1)) 2
Suma = Suma + (Valor * Factor) 81+(2*3) 87
Factor = Factor - 1 2
x=7
Valor = Convert.ToInt32(Nit.Substring(x, 1)) 6
Suma = Suma + (Valor * Factor) 87+(6*2) 99
Factor = Factor - 1 1
end for
Dim xMOd11 As Double = 0
xMOd11 = (11 - (Suma Mod 11)) Mod 11 (11-(99 mod 11)) mod 11
Dim s As String = Convert.ToString(xMOd11) 11
If ((xMOd11 = 10 And DigitoVerificador = "K") Or (s = DigitoVerificador)) Then Si (11=10 y 0 ='K') Ó (11=11)
Return True
End If
Return False
(11-(0))mod 11 mod 11 0

'K') Ó (11=11)

Anda mungkin juga menyukai