Explorar o código

Modificación de RFC

JeanBenitez %!s(int64=3) %!d(string=hai) anos
pai
achega
2413cfab53

+ 5 - 6
vacaciones/src/app/components/mco/mcomau/mcomau-form/mcomau-form.component.ts

@@ -124,10 +124,10 @@ export class MCOMAUFORMComponent implements OnInit {
         ape_m: new FormControl(this.usuario.APELLIDO_MATERNO),
         rfc_usuario: new FormControl(
           this.usuario.RFCUSUARIO,
-          [Validators.required, Validators.pattern( "^(([A-ZÑ&]{4})([0-9]{2})([0][13578]|[1][02])(([0][1-9]|[12][\\d])|[3][01])([A-Z0-9]{3}))|" +
-          "(([A-ZÑ&]{4})([0-9]{2})([0][13456789]|[1][012])(([0][1-9]|[12][\\d])|[3][0])([A-Z0-9]{3}))|" +
-          "(([A-ZÑ&]{4})([02468][048]|[13579][26])[0][2]([0][1-9]|[12][\\d])([A-Z0-9]{3}))|" +
-          "(([A-ZÑ&]{4})([0-9]{2})[0][2]([0][1-9]|[1][0-9]|[2][0-8])([A-Z0-9]{3}))$;")]
+          [
+            Validators.required, 
+            Validators.pattern("(([A-ZÑ&]{4})([0-9]{2})([0][123456789]|[1][012])([0][1-9]|[1][0-9]|[2][0-9]|[3][0-1])([A-Z0-9]{3}))")
+          ]
         ),
         email: new FormControl(this.usuario.EMAIL, Validators.email),
         fecha_ingreso_laboral: new FormControl(new Date(anio, mes-1, dia), Validators.required),
@@ -159,8 +159,7 @@ export class MCOMAUFORMComponent implements OnInit {
         rfc_usuario: new FormControl('', [
           Validators.required,
           Validators.minLength(13),
-          Validators.pattern(
-            "(([A-ZÑ&]{4})([0-9]{2})([0][123456789]|[1][012])([0][1-9]|[1][0-9]|[2][0-9]|[3][0-1])([A-Z0-9]{3}))" )]),
+          Validators.pattern("(([A-ZÑ&]{4})([0-9]{2})([0][123456789]|[1][012])([0][1-9]|[1][0-9]|[2][0-9]|[3][0-1])([A-Z0-9]{3}))" )]),
         fecha_ingreso_laboral: new FormControl('', Validators.required),
         email: new FormControl('', Validators.email),
         password: new FormControl('', [Validators.required, Validators.min(8)]),

+ 2 - 9
vacaciones/src/app/components/mco/mcompv/mcompv-form/mcompv-form.component.ts

@@ -398,7 +398,6 @@ export class MCOMPVFORMComponent implements AfterViewInit {
     let obj_add: any = {};
     // Si la tabla esta vacia
     if (this.dataSource.data.length == 0) {
-      console.log(anio);
       
       // Si el año inicial es mayor a 1, entonces se especifica que el rango del año inicial será 1 
       if (anio > 1) {
@@ -440,15 +439,9 @@ export class MCOMPVFORMComponent implements AfterViewInit {
           for (let index2 = primero; index2 <= ultimo; index2++) {
             
             
-            
-            if (index2 == anio) {
-              console.log(this.dataSource.data[index].anio);
-              console.log(primero);
-              console.log(ultimo);
-              console.log("==========");
-              
+            // Si un año coincide en los que estan en el rango de años
+            if (index2 == anio) {              
               let dias = this.dataSource.data[index].dias;
-              
               this.snackAlert(
                 `El año ${anio} ya está registrado con ${dias} ${
                   dias > 1 ? 'días' : 'día'

+ 1 - 1
vacaciones/src/app/components/mco/mcomun/mcomun-form/mcomun-form.component.html

@@ -29,7 +29,7 @@
               placeholder="ROPL951201"
               formControlName="rfc_unidad"
               required
-              maxlength="12"
+              maxlength="13"
               class="mayusculas"
             />
             <mat-icon matSuffix>perm_contact_calendar</mat-icon>

+ 10 - 9
vacaciones/src/app/components/mco/mcomun/mcomun-form/mcomun-form.component.ts

@@ -30,13 +30,15 @@ export class MCOMUNFORMComponent implements OnInit {
     if (this.data.action == 'Registrar') {
       return new FormGroup({
         nombre: new FormControl('', Validators.required),
-        rfc_unidad: new FormControl('', [Validators.required, Validators.pattern("^(([A-ZÑ&]{3})([0-9]{2})([0][13578]|[1][02])(([0][1-9]|[12][\\d])|[3][01])([A-Z0-9]{3}))|" +
-        "(([A-ZÑ&]{3})([0-9]{2})([0][13456789]|[1][012])(([0][1-9]|[12][\\d])|[3][0])([A-Z0-9]{3}))|" +
-        "(([A-ZÑ&]{3})([02468][048]|[13579][26])[0][2]([0][1-9]|[12][\\d])([A-Z0-9]{3}))|" +
-        "(([A-ZÑ&]{3})([0-9]{2})[0][2]([0][1-9]|[1][0-9]|[2][0-8])([A-Z0-9]{3}))$;")]),
+        rfc_unidad: new FormControl('', 
+        [
+          Validators.required, 
+          Validators.pattern("(([A-ZÑ&]{4})([0-9]{2})([0][123456789]|[1][012])([0][1-9]|[1][0-9]|[2][0-9]|[3][0-1])([A-Z0-9]{3}))")
+        ]
+        ),
         rfc_empresa: new FormControl(
           this.usuario_session.RFCEMPRESA,
-          [ Validators.minLength(12)]
+          [ Validators.minLength(13)]
         ),
         id_usuario_registra: new FormControl(
           this._encService.desencriptar(this.usuario_session.IDUSUARIO),
@@ -51,10 +53,9 @@ export class MCOMUNFORMComponent implements OnInit {
         ),
         rfc_unidad: new FormControl(
           { value: this.data.item.RFCUNIDAD, disabled: true },
-          [Validators.required, Validators.pattern("^(([A-ZÑ&]{3})([0-9]{2})([0][13578]|[1][02])(([0][1-9]|[12][\\d])|[3][01])([A-Z0-9]{3}))|" +
-          "(([A-ZÑ&]{3})([0-9]{2})([0][13456789]|[1][012])(([0][1-9]|[12][\\d])|[3][0])([A-Z0-9]{3}))|" +
-          "(([A-ZÑ&]{3})([02468][048]|[13579][26])[0][2]([0][1-9]|[12][\\d])([A-Z0-9]{3}))|" +
-          "(([A-ZÑ&]{3})([0-9]{2})[0][2]([0][1-9]|[1][0-9]|[2][0-8])([A-Z0-9]{3}))$;")]
+          [ Validators.required, 
+            Validators.pattern("(([A-ZÑ&]{4})([0-9]{2})([0][123456789]|[1][012])([0][1-9]|[1][0-9]|[2][0-9]|[3][0-1])([A-Z0-9]{3}))")
+          ]
         ),
         rfc_empresa: new FormControl(
           this._encService.desencriptar(this.usuario_session.RFCEMPRESA),