NAME
Business::ES::NIF - Validate Spanish NIF, NIE and CIF numbers
VERSION
version 0.15
SYNOPSIS
use Business::ES::NIF;
my $NIF = Business::ES::NIF->new( nif => '01234567L' , vies => 0 , iso3166 => 0 );
$NIF->VIES(1);
$NIF->set('B01234567');
$NIF->set('ESB012345670');
$NIF->status();
Dump:
bless( {
'nif' => '01234567L',
'vies' => 0,
'extra' => 'NIF',
'type' => 'NIF',
}, 'NIF' );
bless( {
'nif' => 'B01234567',
'vies' => 1,
'vies_check' => 0,
'extra' => 'Sociedad Limitada - S.L',
'type' => 'CIF',
'vies_error' => 'Invalid VAT Number (false)'
}, 'NIF' );
DESCRIPTION
Validate a Spanish NIF / CIF / NIE
Referencias: http://es.wikipedia.org/wiki/Numero_de_identificacion_fiscal
Se puede activar la comprobacion sobre el VIES ( Business::Tax::VAT::Validation )
NAME
Business::ES::NIF - Validate Spanish NIF, NIE and CIF numbers
EXPORT
SUBROUTINES/METHODS
nif
status
my $status = $obj->status;
provincia
my $city = $obj->provincia;
iso3166
Activa el formato de salida compatible con ISO 3166-1 alpha-2. Si está habilitado, el método nif()
devolverá el número fiscal precedido por "ES".
Por defecto, iso3166
está desactivado.
vat
Devuelve en formato ISO3166 con prefijo "ES"
my $vat = $obj->vat;
VIES
Se fija a 1 para validar
vies_check
my $ok = $nif->vies_check;
vies_error
warn $nif->vies_error unless $nif->vies_check;
type
Devuelve el tipo (NIF, NIE, CIF, CIFe, NIFe)
my $tipo = $obj->type;
extra
Devuelve una descripcion extra del tipo, por ejemplo:
"Sociedad Anonima - S.A", "NIE", "NIF Especial (KLM)" ...
my $desc = $obj->extra;
error
Devuelve el mensaje de error (si existe) cuando el NIF no es valido
warn $obj->error unless $obj->is_valid;
is_nif
$obj->is_nif
Devuelve verdadero si el tipo detectado es un NIF (Número de Identificación Fiscal para personas físicas españolas).
is_nife
$obj->is_nife
Devuelve verdadero si el tipo detectado es un NIF especial (K, L o M), utilizado por menores de edad, residentes o asimilados.
is_nie
$obj->is_nie
Devuelve verdadero si el tipo detectado es un NIE (Número de Identificación de Extranjeros).
is_cif
$obj->is_cif
Devuelve verdadero si el tipo detectado es un CIF (Código de Identificación Fiscal para entidades jurídicas).
is_cife
$obj->is_cife
Devuelve verdadero si el tipo detectado es un CIF especial (entidades del estado, corporaciones, etc.).
new
new method
set
Set NIF
is_valid
check
_check_vies
Valida el NIF contra el sistema europeo VIES. Devuelve 1 si es correcto.
AUTHOR
Harun Delgado, <hdp at djmania.es>
https://djmania.es
BUGS
Please report any bugs or feature requests to bug-business-es-nif at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Business-ES-NIF. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Business::ES::NIF
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHOR
H <>
COPYRIGHT AND LICENSE
This software is copyright (c) 2025 by H.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.