.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Business::BR::IE 3pm" .TH Business::BR::IE 3pm "2022-10-13" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Business::BR::IE \- Perl module to test for correct IE numbers .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Business::BR::IE qw(test_ie canon_ie format_ie random_ie); \& \& test_ie(\*(Aqsp\*(Aq, \*(Aq110.042.490.114\*(Aq) # 1 \& test_ie(\*(Aqpr\*(Aq, \*(Aq123.45678\-50\*(Aq) # 1 \& test_ie(\*(Aqac\*(Aq, \*(Aq01.004.823/001\-12\*(Aq) # 1 \& test_ie(\*(Aqal\*(Aq, \*(Aq24.000.004\-8\*(Aq) # 1 \& test_ie(\*(Aqam\*(Aq, \*(Aq04.117.161\-6\*(Aq) # 1 \& test_ie(\*(Aqba\*(Aq, \*(Aq123456\-63\*(Aq) # 1 \& test_ie(\*(Aqma\*(Aq, \*(Aq12.000.038\-5\*(Aq) # 1 \& test_ie(\*(Aqmg\*(Aq, \*(Aq062.307.904/0081\*(Aq) #1 \& test_ie(\*(Aqrr\*(Aq, \*(Aq24.006.628\-1\*(Aq) # 1 \& test_ie(\*(Aqap\*(Aq, \*(Aq03.012.345\-9\*(Aq) # 1 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1YET TO COME.\s0 Handles \s-1IE\s0 for the states of Acre (\s-1AC\s0), Alagoas (\s-1AL\s0), Amapá (\s-1AP\s0), Amazonas (\s-1AM\s0), Bahia (\s-1BA\s0), Maranhão (\s-1MA\s0), Minas Gerais (\s-1MG\s0), Paraná (\s-1PR\s0), Rondônia (\s-1RO\s0), Roraima (\s-1RR\s0) and Sao Paulo (\s-1SP\s0) by now. .SS "\s-1EXPORT\s0" .IX Subsection "EXPORT" \&\f(CW\*(C`test_ie\*(C'\fR is exported by default. \f(CW\*(C`canon_ie\*(C'\fR, \f(CW\*(C`format_ie\*(C'\fR, \&\f(CW\*(C`random_ie\*(C'\fR and \f(CW\*(C`parse_ie\*(C'\fR can be exported on demand. .SH "DETAILS" .IX Header "DETAILS" Each state has its own rules for \s-1IE\s0 numbers. In this section, we gloss over each one of these .SS "\s-1AC\s0" .IX Subsection "AC" The state of Acre uses: .IP "\(bu" 4 13\-digits number .IP "\(bu" 4 the last two are check digits .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq01.004.823/001\-12\*(Aq\fR .IP "\(bu" 4 if the IE-AC number is decomposed into digits like this .Sp .Vb 1 \& a_1 a_2 a_3 a_4 a_5 a_6 a_7 a_8 a_9 a_10 a_11 d_1 d_2 .Ve .Sp it is correct if .Sp .Vb 1 \& a_1 a_2 = 0 1 .Ve .Sp (that is, it always begin with \*(L"01\*(R") and if it satisfies the check equations: .Sp .Vb 3 \& 4 a_1 + 3 a_2 + 2 a_3 + 9 a_4 + 8 a_5 + 7 a_6 + 6 a_7 + \& 5 a_8 + 4 a_9 + 3 a_10 + 2 a_11 + d_1 = 0 (mod 11) or \& = 1 (mod 11) (if d_1 = 0) \& \& 5 a_1 + 4 a_2 + 3 a_3 + 2 a_4 + 9 a_5 + 8 a_6 + 7 a_7 + \& 6 a_8 + 5 a_9 + 4 a_10 + 3 a_11 + 2 d_1 + d_2 = 0 (mod 11) or \& = 1 (mod 11) (if d_2 = 0) .Ve .SS "\s-1AL\s0" .IX Subsection "AL" The state of Alagoas uses: .IP "\(bu" 4 9\-digits number .IP "\(bu" 4 the last one is a check digit .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq24.000.004\-8\*(Aq\fR .IP "\(bu" 4 if the IE-AL number is decomposed into digits like this .Sp .Vb 1 \& a_1 a_2 a_3 a_4 a_5 a_6 a_7 a_8 d_1 .Ve .Sp it is correct if it always begin with \*(L"24\*(R" (the code for the state of Alagoas), .Sp .Vb 1 \& a_1 a_2 = 2 4 .Ve .Sp if the following digit identifies a valid company type .Sp .Vb 8 \& 0 \- "normal" \& 1 \- "normal" \& 3 \- "produtor rural" \& 5 \- "substituta" \& 6 \- "empresa pequeno porte" \& 7 \- "micro empresa ambulante" \& 8 \- "micro empresa" \& 9 \- "especial" .Ve .Sp and if it satisfies the check equation: .Sp .Vb 3 \& ( 9 a_1 + 2 a_2 + 3 a_3 + 4 a_4 + 5 a_5 \& 6 a_6 + 7 a_7 + 8 a_8 ) * 10 \- d_1 = 0 (mod 11) or \& = 10 (mod 11) (if d_1 = 0) .Ve .SS "\s-1AM\s0" .IX Subsection "AM" The state of Amazonas uses: .IP "\(bu" 4 9\-digits number .IP "\(bu" 4 the last one is a check digit .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq11.111.111\-0\*(Aq\fR .IP "\(bu" 4 if the IE-AM number is decomposed into digits like this .Sp .Vb 1 \& a_1 a_2 a_3 a_4 a_5 a_6 a_7 a_8 d_1 .Ve .Sp it is correct if it satisfies the check equation: .Sp .Vb 3 \& 9 a_1 + 8 a_2 + 7 a_3 + 6 a_4 + 5 a_5 \& 4 a_6 + 3 a_7 + 2 a_8 + d_1 = 0 (mod 11) or \& = 1 (mod 11) (if d_1 = 0) .Ve .SS "\s-1BA\s0" .IX Subsection "BA" The state of Bahia uses: .IP "\(bu" 4 8\-digits number .IP "\(bu" 4 the last two are check digits .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq123456\-63\*(Aq\fR .SS "\s-1MA\s0" .IX Subsection "MA" The state of Maranhão uses: .IP "\(bu" 4 9\-digits number .IP "\(bu" 4 the 9th is a check digit .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq12.000.038\-5\*(Aq\fR .IP "\(bu" 4 if the IE-MA number is decomposed into digits like this .Sp .Vb 1 \& a_1 a_2 a_3 a_4 a_5 a_6 a_7 a_8 d_1 .Ve .Sp it is correct if it always begin with \*(L"12\*(R" (the code for the state of Maranhão), .Sp .Vb 1 \& a_1 a_2 = 1 2 .Ve .Sp and if it satisfies the check equation: .Sp .Vb 3 \& ( 9 a_1 + 8 a_2 + 7 a_3 + 6 a_4 + 5 a_5 \& 4 a_6 + 3 a_7 + 2 a_8 ) \- d_1 = 0 (mod 11) or \& = 10 (mod 11) (if d_1 = 0) .Ve .SS "\s-1MG\s0" .IX Subsection "MG" The state of Minas Gerais uses: .IP "\(bu" 4 13\-digits number .IP "\(bu" 4 the 11th and 12th are check digits .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq062.307.904/0081\*(Aq\fR .IP "\(bu" 4 to determine if \s-1IE/MG\s0 number is correct, the computation rules in .Sp .Vb 1 \& http://www.sintegra.gov.br/Cad_Estados/cad_MG.html .Ve .Sp must be followed. (Yes, they are boring and hard to describe.) .SS "\s-1PR\s0" .IX Subsection "PR" The state of Paraná uses: .IP "\(bu" 4 10\-digits number .IP "\(bu" 4 the 9th and 10th are check digits .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq123.45678\-50\*(Aq\fR .SS "\s-1RO\s0" .IX Subsection "RO" The state of Rondônia uses: .IP "\(bu" 4 14\-digits number .IP "\(bu" 4 the 14th is a check digit .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq0000000062521\-3\*(Aq\fR .IP "\(bu" 4 if the IE-RO number is decomposed into digits like this .Sp .Vb 1 \& a_1 a_2 a_3 a_4 a_5 a_6 a_7 a_8 a_9 a_10 a_11 a_12 a_13 d_1 .Ve .Sp it is correct if it satisfies the check equation: .Sp .Vb 4 \& ( 6 a_1 + 5 a_2 + 4 a_3 + 3 a_4 + 2 a_5 + \& 9 a_6 + 8 a_7 + 7 a_8 + 6 a_9 + 5 a_10 + \& 4 a_11 + 3 a_12 + 2 a_13 + d_1 = 0 (mod 11) or \& = 1 (mod 11) if d_1 = 0 .Ve .SS "\s-1RR\s0" .IX Subsection "RR" The state of Roraima uses: .IP "\(bu" 4 9\-digits number .IP "\(bu" 4 the 9th is a check digit .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq24.006.628\-1\*(Aq\fR .IP "\(bu" 4 if the IE-RR number is decomposed into digits like this .Sp .Vb 1 \& a_1 a_2 a_3 a_4 a_5 a_6 a_7 a_8 d_1 .Ve .Sp it is correct if it always begin with \*(L"24\*(R" (the code for the state of Roraima), .Sp .Vb 1 \& a_1 a_2 = 2 4 .Ve .Sp and if it satisfies the check equation: .Sp .Vb 2 \& ( 1 a_1 + 2 a_2 + 3 a_3 + 4 a_4 + 5 a_5 \& 6 a_6 + 7 a_7 + 8 a_8 ) \- d_1 = 0 (mod 9) .Ve .SS "\s-1SP\s0" .IX Subsection "SP" The state of São Paulo uses: .IP "\(bu" 4 12\-digits number .IP "\(bu" 4 the 9th and 12nd are check digits .IP "\(bu" 4 the usual formatting is like \f(CW\*(Aq110.042.490.114\*(Aq\fR .SH "BUGS" .IX Header "BUGS" .IP "\(bu" 4 This documentation is faulty .IP "\(bu" 4 If you want handling more than \s-1AC, AL, AM, MA, MG, PR, RO, RO\s0 and \s-1SP,\s0 you'll have to wait for the next releases .IP "\(bu" 4 The handling of IE-SP does not include yet the special rule for testing correctness of registrations of rural producers. .IP "\(bu" 4 the case of unfair digits must be handled satisfactorily (in this and other Business::BR::Ids modules) .SH "SEE ALSO" .IX Header "SEE ALSO" Please reports bugs via \s-1CPAN RT,\s0 http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business\-BR\-Ids By doing so, the author will receive your reports and patches, as well as the problem and solutions will be documented. .SH "AUTHOR" .IX Header "AUTHOR" A. R. Ferreira, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2005\-2007 by A. R. Ferreira .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 936:" 4 .IX Item "Around line 936:" Non-ASCII character seen before =encoding in 'Amapá'. Assuming \s-1CP1252\s0