AbetoDesign_FactuGES2/Source/Base/Utiles/uIBANUtils.pas
2016-04-12 15:48:31 +00:00

40 lines
786 B
ObjectPascal

unit uIBANUtils;
interface
uses
SysUtils, Classes, IBAN;
function EsCodigoIBANValido(AIBAN : string): boolean;
function GenerarCodigoIBAN(CodEntidad, CodOficina, DC, CodCuenta : string): string;
implementation
function EsCodigoIBANValido(AIBAN : string): boolean;
var
auxIBAN : TIBAN;
begin
auxIBAN := TIBAN.Create;
try
Result := auxIBAN.checkIBANCode(AIBAN);
finally
FreeAndNil(auxIBAN);
end;
end;
function GenerarCodigoIBAN(CodEntidad, CodOficina, DC, CodCuenta : string): string;
var
auxIBAN : TIBAN;
begin
auxIBAN := TIBAN.Create;
try
auxIBAN.Country := 'ES';
auxIBAN.BankCode := CodEntidad + CodOficina + DC + CodCuenta;
Result := auxIBAN.IBAN;
finally
FreeAndNil(auxIBAN);
end;
end;
end.