RFC is the mexican taxpayer is provided by Mexico tax authority (SAT). Following rules apply:
The RFC consists of 3 parts: 1. Letters and characters extracted from the name of the taxpayer. - If the taxpayer is a company, this part is the first 3 characters of the RFC. - If the taxpayer is a person, this part is the first 4 characters of the RFC. 2. The following 6 characters, which represents a valid date in the format YYMMDD. This is the taxpayer's date of registration at SAT 3. Last 3 characters: A checksum. I don't have a reliable algorithm to calculate this. The only rule applied here is that the last character must be a number or the letter 'A'.
Was developed and tested with Yii 1.1.9.
Copy satRfc.php to a subfolder of protected (e.g.: protected/extensions/validators) Call it as a regular validator.
class MyModel extends CModel { //[....] public function rules() { return array( //[....] array('rfc', 'ext.validators.satRfcValidator'), ); } }
Be the first person to leave a comment
Please login to leave your comment.