Closed francisrubio06 closed 2 years ago
Thanks for reporting this. If you know a reliable source describing the format and validation I'd be more than happy to adapt the code. As it stands now it is mostly built up using bits and pieces that were provided by various people.
The current module first determines if the RUC is a natural, public or juridical number (based on the third digit) and then does the validation based on that. Both 0993370026001 and 1793189624001 are classified as juridical numbers (third digit is a 9) and the corresponding check digit validation fails. The 1793189624001 number validates as public RUC but 0993370026001 does not.
Without more documentation this is sadly very hard to fix properly.
The _isvalid method returns false with two RUCs already registered in the government.
RUC: 0993370026001
RUC: 1793189624001