Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros temas > Trucos
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Los mejores trucos

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 09-05-2007
Avatar de jhonny
jhonny jhonny is offline
Jhonny Suárez
 
Registrado: may 2003
Ubicación: Colombia
Posts: 7.058
Poder: 29
jhonny Va camino a la famajhonny Va camino a la fama
Calcular el digito de verificación de un NIT

Las empresas privadas colombianas necesitan tener un dígito de verificación al final de su Nit (Numero de identificación tributaria), el cual les sirve para identificarse ante la "Cámara y comercio", a continuación una función muy simple que devuelve dicho Dígito de verificación según el nit:

Código Delphi [-]
function DigitoVerificacion(Nit :string) :Integer;
var
  i, j, vTotal :Integer;
const
  ValFijos :array[1..15] of Word = (3,7,13,17,19,23,29,37,41,43,47,53,59,67,71);
begin
  vTotal := 0;
  j := 0;
  for i := Length(Nit) downto 1 do
  begin
    inc(j);
    vTotal := vTotal + (StrToInt(Nit[i]) * ValFijos[j]);
  end;
  vTotal := vTotal - (vTotal div 11) * 11;

  if vTotal > 1 then
    vTotal := 11-vTotal;
  
  Result := vTotal;
end;
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 23:31:54.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi