Validate_Generate_CNPJ ( fnType ; CNPJ )
A variation of Francisco Carlos Otani's
Average rating: 4.3 (41 votes) Log in to vote
Duana A.S. Designs, LLC
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
The Brazilian Government IRS employs a Modulus 11 Algorithm variation to calculate a tax-oriented cadastral number -- compulsory to all companies countrywide -- entitled "CNPJ".
Francisco Carlos Otani wrote a useful CF (http://www.briandunning.com/cf/1215) to validate the cadastral number checksum digits, which are the last two of a series of 14 numerical digits. Looking at Otani's CF code, I realized it could be restructured modularly; it would be concurrently conciser and more abstract, hence used as the starting point to another Modulus 11 Algorithm variation. Also, since it validated checksum numbers, the CF could as well spawn them.
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.