kaoecoito / sintegra-ie Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/sintegra-ie
Automatically exported from code.google.com/p/sintegra-ie
Pelo que verifiquei a sua biblioteca não valida a IE "isento".
Original issue reported on code.google.com by [email protected]
on 10 Jan 2014 at 2:39
Não está considerando IE antiga com 14 digitos.
Correção sugerida:
<code language="java">
package br.gov.sintegra.ie.estados;
import br.gov.sintegra.ie.InscricaoEstadualBase;
/**
*
* @author kaoe
*/
public class InscricaoEstadualPE extends InscricaoEstadualBase {
private static final Integer[] MULTIPLICADOR_9_1 = {8,7,6,5,4,3,2};
private static final Integer[] MULTIPLICADOR_9_2 = {9,8,7,6,5,4,3,2};
private static final Integer[] MULTIPLICADOR_14_1 = {5,4,3,2,1,9,8,7,6,5,4,3,2};
@Override
public boolean validar(String numero) {
boolean valido = false;
String ie = String.format("%09d", Long.valueOf(limpar(numero, "[^0-9]")));
if (ie.length()==9) {
Integer[] numeros = split(ie);
Integer[] calculo1 = multiplicar(numeros, MULTIPLICADOR_9_1);
int soma = somar(calculo1);
int digito = 11 - modulo11(soma);
if (digito == 10 || digito == 11) digito = 0;
if (numeros[7]==digito) {
Integer[] calculo2 = multiplicar(numeros, MULTIPLICADOR_9_2);
soma = somar(calculo2);
digito = 11 - modulo11(soma);
if (digito == 10 || digito == 11) digito = 0;
valido = numeros[8]==digito;
}
}
if (ie.length()==14) {
Integer[] numeros = split(ie);
Integer[] calculo1 = multiplicar(numeros, MULTIPLICADOR_14_1);
int soma = somar(calculo1);
int digito = 11 - modulo11(soma);
if (digito > 9) digito = digito-10;
valido = numeros[13]==digito;
}
return valido;
}
}
</code>
Original issue reported on code.google.com by [email protected]
on 11 May 2013 at 1:30
Teste realizado com inscricao: 3720734590007
Solução:
Mudar código de: (linha 25)
int digito = dezena(soma) - soma;
if (numeros1[12]==digito) {
Para:
int digito = dezena(soma) - soma;
if (digito == 10 || digito == 11) digito = 0;
if (numeros1[12]==digito) {
Original issue reported on code.google.com by [email protected]
on 11 May 2013 at 12:48
Não valida a IE "134244079" do MS, mas a IE é válida, tanto que retorna OK
na consulta pelo site.
Original issue reported on code.google.com by [email protected]
on 19 Dec 2013 at 10:08
Tentei validar a IE "131834312" (13.183.431-2) com a sigla MT e retorna false.
Consultei o número do sefaz e bate com o cadastro da empresa.
Original issue reported on code.google.com by [email protected]
on 7 May 2013 at 7:55
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.