sigesp 0.9.3-20221025 → 0.9.4-2022-11-20

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.
@@ -2533,12 +2533,14 @@ class MServiceCharge extends MBasicModel {
2533
2533
  this.serviceId = null;
2534
2534
  this.denomination = '';
2535
2535
  this.code = '';
2536
+ this.status = false;
2536
2537
  if (ser) {
2537
2538
  this.companyId = parseInt(ser.id_empresa);
2538
2539
  this.id = parseInt(ser.id_cargo);
2539
2540
  this.serviceId = parseInt(ser.id_servicio);
2540
2541
  this.denomination = ser.dencar;
2541
2542
  this.code = ser.codcar;
2543
+ this.status = ser.estcarpri == '1' ? true : false;
2542
2544
  }
2543
2545
  else {
2544
2546
  this.isNew = true;
@@ -2551,6 +2553,7 @@ class MServiceCharge extends MBasicModel {
2551
2553
  id_servicio: this.serviceId.toString(),
2552
2554
  codcar: this.code,
2553
2555
  dencar: this.denomination,
2556
+ estcarpri: this.status ? '1' : '0'
2554
2557
  };
2555
2558
  }
2556
2559
  }
@@ -5497,16 +5500,15 @@ class SigespService {
5497
5500
  * @description Obtiene los centros de costo
5498
5501
  * @return Observable<MCentroCosto[]>
5499
5502
  * @author Miguel Ramírez
5503
+ * modificado 9-11-2022
5500
5504
  */
5501
- getCentroCosto() {
5502
- const request = {
5503
- operacion: 'obtenerData',
5504
- sigesp_conexion: {
5505
- servidor: this.URL,
5506
- usuario: this.usuarioActivo.getInterface()
5505
+ getCentroCosto(tipo) {
5506
+ return this.http.get(`${this.URL}/dao/scg/centro_costo_dao.php?codigo=${tipo}`, { headers: this.getHttpHeaders() }).pipe(retry(3), catchError(this.handlerError), map((res) => {
5507
+ if (res.success) {
5508
+ res.data = res.data.map(e => new MCentroCosto(e));
5507
5509
  }
5508
- };
5509
- return this.http.post(`${this.URL}/dao/scg/centrocosto_dao.php`, request).pipe(retry(3), catchError(this.handlerError), map((resp) => resp.map(element => new MCentroCosto(element))));
5510
+ return res;
5511
+ }));
5510
5512
  }
5511
5513
  /**
5512
5514
  * @description Obtiene los centros de costo