Business::DK::CVR - Danish CVR (VAT Registration) number generator/validator
This documentation describes version 0.12 of Business::DK::CVR
use Business::DK::CVR qw(validate); my $rv; eval { $rv = validate(27355021); }; if ($@) { die "Code is not of the expected format - $@"; } if ($rv) { print "Code is valid"; } else { print "Code is not valid"; } #Using with Params::Validate #See also examples/ use Params::Validate qw(:all); use Business::DK::CVR qw(validateCVR); eval { check_cvr(cvr => 27355021); }; if ($@) { print "CVR is not valid - $@\n"; } eval { check_cvr(cvr => 27355020); }; if ($@) { print "CVR is not valid - $@\n"; } sub check_cvr { validate( @_, { cvr => { callbacks => { 'validate_cvr' => sub { validateCVR($_[0]); } } } } ); print "$_[0] is a valid CVR\n"; }
CVR is a company registration number used in conjuction with VAT handling in Denmark.
If you want to use this module with Data::FormValidator please check: Data::FormValidator::Constraints::Business::DK::CVR
The function takes a single argument, a 10 digit CVR number.
The function returns 1 (true) in case of a valid CVR number argument and 0 (false) in case of an invalid CVR number argument.
If the argument is a valid argument the sum is calculated by _calculate_sum based on the argument and the controlcifers array.
The sum returned is checked using a modulus caluculation and based on its validity either 1 or 0 is returned.
Better name for export. This is just a wrapper for "validate"
Generate is a function which generates valid CVR numbers, it is by no means an authority, since CVRs are generated and distributed by danish tax authorities, but it can be used to generate example CVRs for testing and so on.
This function takes an integer and calculates the sum bases on the the controlcifer array.
Business::DK::CVR exports on request:
The amount requested exceeds the maximum possible valid CVRs 9090908
The number of valid CVRs are limited, so if the user requests a number of CVRs to be generated which exceeds the upper limit, this error is instantiated. See: "generate".
The module requires no special configuration or environment to run.
Params::Validate
Exporter
Carp
Scalar::Util
Class::InsideOut
English
Readonly
The module has no known incompatibilities.
The module has no known bugs or limitations.
Coverage of the test suite is at 100%
Please report issue via GitHub
https://github.com/jonasbn/perl-business-dk-cvr/issues
Alternativly report issues via CPAN RT:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-DK-CVR
or by sending mail to
bug-Business-DK-CVR@rt.cpan.org
Jonas B., (jonasbn) - <jonasbn@cpan.org>
<jonasbn@cpan.org>
Karen Etheridge (ETHER)
Andreas König (ANDK)
Neil Bowers (NEILB)
Mohammad S Anwar (MANWAR)
Business-DK-CVR and related is (C) by Jonas B., (jonasbn) 2006-2020
Business-DK-CVR is released under the Artistic License 2.0
To install Business::DK::CVR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::DK::CVR
CPAN shell
perl -MCPAN -e shell install Business::DK::CVR
For more information on module installation, please visit the detailed CPAN module installation guide.