sigesp 0.8.96-20220530 → 0.8.99-20220616

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.
@@ -3717,8 +3717,8 @@ class MCargosNominas extends MBasicModel {
3717
3717
  this.denominacionNomina = e.dennom;
3718
3718
  this.idDtNomina = parseInt(e.id_dt_carnom);
3719
3719
  this.periodoActualNomina = e.peractnom;
3720
- this.calculada = e.calculado == '1' ? true : false;
3721
- this.prenomina = e.prenomina == '1' ? true : false;
3720
+ (e.calculado) ? this.calculada = parseInt(e.calculado) > 0 ? true : false : this.calculada = false;
3721
+ (e.prenomina) ? this.prenomina = parseInt(e.prenomina) > 0 ? true : false : this.prenomina = false;
3722
3722
  this.estatus = this.calculada ? 'Calculada' :
3723
3723
  !this.calculada && this.prenomina ? 'Pre-Calculada' : 'Sin Calcular';
3724
3724
  this.editables = (this.calculada || this.prenomina) ? false : true;
@@ -3777,8 +3777,8 @@ class MNominaSimple extends MBasicModel {
3777
3777
  this.idPeriodoActual = +e.id_periodoactual;
3778
3778
  this.totalPeriodo = parseFloat(e.totper),
3779
3779
  this.estatusPeriodo = parseInt(e.cerper);
3780
- this.calculada = e.calculado == '1' ? true : false;
3781
- this.prenomina = e.prenomina == '1' ? true : false;
3780
+ (e.calculado) ? this.calculada = parseInt(e.calculado) > 0 ? true : false : this.calculada = false;
3781
+ (e.prenomina) ? this.prenomina = parseInt(e.prenomina) > 0 ? true : false : this.prenomina = false;
3782
3782
  this.estatus = this.calculada ? 'Calculada' :
3783
3783
  !this.calculada && this.prenomina ? 'Pre-Calculada' : 'Sin Calcular';
3784
3784
  this.editable = (this.calculada || this.prenomina) ? false : true;
@@ -5608,37 +5608,17 @@ class SigespService {
5608
5608
  return formGroup.get(name);
5609
5609
  }
5610
5610
  /**
5611
- * @description Función para escribir solo decimales (Usar en evento keypress)
5611
+ * @description Previene que se escriban letras en el input (Usar en keypress)
5612
5612
  * @param event Evento del teclado
5613
5613
  * @return boolean
5614
5614
  * @author Miguel Ramírez
5615
+ * @modificado como onlyNumero para corregir codigo, usar currency-input si quiere usar decimales
5615
5616
  */
5616
5617
  onlyDecimal(event) {
5617
- // console.log(event);
5618
- let contPoint = 0;
5619
- let number = event.target.value + event.key;
5620
- // console.log(number);
5621
- if (this.onlyNumbers(event) || event.key === ',') {
5622
- for (let i = 0; i < number.length; i++) {
5623
- if (number.charAt(i) === ',') {
5624
- contPoint++;
5625
- }
5626
- }
5627
- if (contPoint > 1) {
5628
- return false;
5629
- }
5630
- else {
5631
- if (number.indexOf(',') !== -1) {
5632
- if (number.substring(number.indexOf(',') + 1, number.length).length > 2) {
5633
- return false;
5634
- }
5635
- }
5636
- return true;
5637
- }
5638
- }
5639
- else {
5640
- return false;
5618
+ if (!isNaN(+event.key) && event.keyCode != 32) {
5619
+ return true;
5641
5620
  }
5621
+ return false;
5642
5622
  }
5643
5623
  /**
5644
5624
  * @description Previene que se escriban letras en el input (Usar en keypress)
@@ -5648,7 +5628,7 @@ class SigespService {
5648
5628
  */
5649
5629
  onlyNumbers(event) {
5650
5630
  // console.log(event);
5651
- if (!isNaN(+event.key) || event.keyCode == 8) {
5631
+ if (!isNaN(+event.key) && event.keyCode != 32) {
5652
5632
  return true;
5653
5633
  }
5654
5634
  return false;
@@ -6509,13 +6489,16 @@ class SigespService {
6509
6489
  return this.http.get(`${this.URL}/dao/sss/derechos_usuario_dao.php?idComponent=${this.currentComponent.id}&column=${column}`, { headers: this.getHttpHeaders() });
6510
6490
  }
6511
6491
  /**
6512
- * @description Retorna los headers para hacer las peticiones
6513
- * @return HttpHeaders
6514
- * @author Miguel Ramírez
6515
- */
6516
- getHttpHeaders() {
6492
+ * @description Retorna los headers para hacer las peticiones
6493
+ * @params type: Tipo MIME permitido por defecto se toma application/json
6494
+ * @return HttpHeaders
6495
+ * @author Miguel Ramírez
6496
+ * @date-update: 15-06-2022
6497
+ */
6498
+ getHttpHeaders(type) {
6499
+ !type ? type = 'application/json' : '';
6517
6500
  const headers = new HttpHeaders({
6518
- 'Content-Type': 'application/json',
6501
+ 'Content-Type': type,
6519
6502
  'Authorization': `${this.usuarioActivo.token}`
6520
6503
  });
6521
6504
  return headers;