Posted By

eliluminado on 02/13/12


Tagged

cuit


Versions (?)

Validar CUIT


 / Published in: JavaScript
 

URL: http://www.codigopython.com.ar/

Funcion para validar el numero de CUIT obtenido de la pagina de la AFIP

  1. function esCUITValida(inputValor) {
  2. inputString = inputValor.toString()
  3. if (inputString.length == 11) {
  4. var Caracters_1_2 = inputString.charAt(0) + inputString.charAt(1)
  5. if (Caracters_1_2 == "20" || Caracters_1_2 == "23" || Caracters_1_2 == "24" || Caracters_1_2 == "27" || Caracters_1_2 == "30" || Caracters_1_2 == "33" || Caracters_1_2 == "34") {
  6. var Count = inputString.charAt(0) * 5 + inputString.charAt(1) * 4 + inputString.charAt(2) * 3 + inputString.charAt(3) * 2 + inputString.charAt(4) * 7 + inputString.charAt(5) * 6 + inputString.charAt(6) * 5 + inputString.charAt(7) * 4 + inputString.charAt(8) * 3 + inputString.charAt(9) * 2 + inputString.charAt(10) * 1
  7. Division = Count / 11;
  8. if (Division == Math.floor(Division)) {
  9. return true
  10. }
  11. }
  12. }
  13. return false
  14. }

Report this snippet  

You need to login to post a comment.