iptdevs-design-system 3.1.682 → 3.1.683

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ import { MessageService } from 'primeng/api';
9
9
  import * as i6$2 from 'primeng/tabview';
10
10
  import { TabViewModule } from 'primeng/tabview';
11
11
  import * as i1$1 from '@angular/forms';
12
- import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
12
+ import { Validators, FormsModule, ReactiveFormsModule, FormControl } from '@angular/forms';
13
13
  import Swal from 'sweetalert2';
14
14
  import * as i1$2 from '@angular/common/http';
15
15
  import { HttpHeaders } from '@angular/common/http';
@@ -7484,11 +7484,12 @@ class CodSelfFormStepFourComponent extends CodSelfManagedSteps {
7484
7484
  { code: 1, key: 'in', name: 'Instalaciones' },
7485
7485
  { code: 2, key: 'tr', name: 'Transferencia' },
7486
7486
  ];
7487
+ this.studentIdCardType = new FormControl();
7487
7488
  this.initForm();
7488
7489
  }
7489
7490
  ngOnInit() {
7490
- // this.getParamenters();
7491
7491
  this.startLocalStorageWork();
7492
+ this.subscribeToStudentIdCardTypeChanges();
7492
7493
  this.getDataUser();
7493
7494
  console.log('idTypes', this.idTypes);
7494
7495
  }
@@ -7501,9 +7502,16 @@ class CodSelfFormStepFourComponent extends CodSelfManagedSteps {
7501
7502
  invoicing_document: ['', [Validators.required]],
7502
7503
  });
7503
7504
  }
7505
+ subscribeToStudentIdCardTypeChanges() {
7506
+ this.studentIdCardType.valueChanges.subscribe(value => {
7507
+ this.updateBillingDataFields(value);
7508
+ });
7509
+ }
7504
7510
  getDataUser() {
7505
7511
  const typeIdCard = this.localStorageCOD.getCodFormData(1, 'student_id_card_type');
7506
- console.log(typeIdCard);
7512
+ this.studentIdCardType.setValue(typeIdCard);
7513
+ }
7514
+ updateBillingDataFields(typeIdCard) {
7507
7515
  if (typeIdCard != null && typeIdCard != "2") {
7508
7516
  const nameStudent = this.localStorageCOD.getCodFormData(1, 'student_name');
7509
7517
  const lastNameStudent = this.localStorageCOD.getCodFormData(1, 'student_last_name');
@@ -7521,29 +7529,23 @@ class CodSelfFormStepFourComponent extends CodSelfManagedSteps {
7521
7529
  }
7522
7530
  back() {
7523
7531
  if (!this.isSelectionOptionPayments && !this.isEditBillingData) {
7524
- // Volver a la edición de datos de facturación
7525
7532
  this.isEditBillingData = true;
7526
7533
  }
7527
7534
  else if (!this.isSelectionOptionPayments && this.isEditBillingData) {
7528
- // Volver a la selección de opciones de pago
7529
7535
  this.isSelectionOptionPayments = true;
7530
7536
  }
7531
7537
  else {
7532
- // Volver al paso anterior
7533
7538
  this.completed.emit(2);
7534
7539
  }
7535
7540
  }
7536
7541
  next() {
7537
7542
  if (this.isSelectionOptionPayments) {
7538
- // Avanzar a la edición de datos de facturación
7539
7543
  this.isSelectionOptionPayments = false;
7540
7544
  }
7541
7545
  else if (!this.isEditBillingData) {
7542
- // Finalizar la edición de datos de facturación
7543
7546
  this.isEditBillingData = true;
7544
7547
  }
7545
7548
  else {
7546
- // Completar el formulario y proceder
7547
7549
  this.sendForm();
7548
7550
  }
7549
7551
  }
@@ -7555,25 +7557,15 @@ class CodSelfFormStepFourComponent extends CodSelfManagedSteps {
7555
7557
  });
7556
7558
  }
7557
7559
  editBillingData() {
7558
- // Activar la edición de datos de facturación
7559
7560
  this.isEditBillingData = false;
7560
7561
  }
7561
7562
  updateDatosBillingData() {
7562
- // Guardar datos de facturación y regresar a la vista de resumen
7563
7563
  this.isEditBillingData = true;
7564
7564
  }
7565
- // getParamenters() {
7566
- // this.parameterService.getCardTypes('col').subscribe((response) => {
7567
- // this.idTypes = response.data;
7568
- // });
7569
- // }
7570
7565
  sendForm() {
7571
- // Aquí va la lógica para enviar el formulario
7572
7566
  this.codSelfFormStepFour.markAllAsTouched();
7573
- // if (this.codSelfFormStepFour.invalid || this.termsCheckboxStatus === false) return;
7574
7567
  this.action.emit('create');
7575
7568
  console.log('Ejecuta endpoint');
7576
- // this.completed.emit(4);
7577
7569
  }
7578
7570
  onReject() {
7579
7571
  this.messageService.clear('confirm');
@@ -7603,7 +7595,6 @@ class CodSelfFormStepFourComponent extends CodSelfManagedSteps {
7603
7595
  this.codSelfFormStepFour.controls['invoicing_idType'].setValue(null);
7604
7596
  }
7605
7597
  }
7606
- // Método para determinar la vista basada en el código de la opción de pago seleccionada
7607
7598
  getViewBasedOnPaymentOption() {
7608
7599
  if (this.selectedOptionPayments?.code === 1) {
7609
7600
  return 'in';