sigesp 0.9.19-20221221 → 0.9.20-20221228

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.
@@ -1649,11 +1649,15 @@
1649
1649
  var _this = _super.call(this) || this;
1650
1650
  _this.idEmpresa = 0;
1651
1651
  _this.idEnterprise = 0;
1652
+ _this.usuarios = [];
1652
1653
  if (centroCosto) {
1653
1654
  _this.idEmpresa = +centroCosto.id_empresa;
1654
1655
  _this.idEnterprise = +centroCosto.id_enterprise;
1655
1656
  _this.centro = centroCosto.centro ? centroCosto.centro : centroCosto.codcencos;
1656
1657
  _this.denominacion = centroCosto.denominacion;
1658
+ if (centroCosto.usuarios) {
1659
+ _this.usuarios = centroCosto.usuarios.map(function (e) { return new MUsuarioCentroCosto(e); });
1660
+ }
1657
1661
  }
1658
1662
  else {
1659
1663
  _this.isNew = true;
@@ -1667,6 +1671,7 @@
1667
1671
  id_enterprise: this.idEnterprise.toString(),
1668
1672
  codcencos: this.centro,
1669
1673
  denominacion: this.denominacion,
1674
+ usuarios: this.usuarios.map(function (e) { return e.dataInterface(); }),
1670
1675
  };
1671
1676
  };
1672
1677
  return MCentroCosto;
@@ -1685,7 +1690,7 @@
1685
1690
  _this.idEnterprise = +e.id_enterprise;
1686
1691
  _this.codigoCentroCosto = e.codcencos;
1687
1692
  _this.usuario = e.codusu;
1688
- _this.usuario = e.codusu;
1693
+ _this.idDtCentro = +e.id_dt_cencos;
1689
1694
  }
1690
1695
  else {
1691
1696
  _this.isNew = true;
@@ -6191,7 +6196,7 @@
6191
6196
  * @return Promise<any[]>
6192
6197
  * @author Miguel Ramírez
6193
6198
  */
6194
- SigespService.prototype.getBudgetStructureComplete = function () {
6199
+ SigespService.prototype.getBudgetStructureComplete = function (nivel) {
6195
6200
  return __awaiter(this, void 0, void 0, function () {
6196
6201
  var _this = this;
6197
6202
  return __generator(this, function (_a) {
@@ -6201,7 +6206,7 @@
6201
6206
  switch (_a.label) {
6202
6207
  case 0:
6203
6208
  data = [];
6204
- return [4 /*yield*/, this.getBudgetStructureFive(5).subscribe(function (result) {
6209
+ return [4 /*yield*/, this.getBudgetStructureFive(nivel).subscribe(function (result) {
6205
6210
  data.push.apply(data, __spread(result));
6206
6211
  })];
6207
6212
  case 1:
@@ -6497,14 +6502,19 @@
6497
6502
  * @description Obtiene los centros de costo
6498
6503
  * @return Observable<MCentroCosto[]>
6499
6504
  * @author Miguel Ramírez
6500
- * modificado 9-11-2022
6505
+ * @param id:idusurio o id del ecntro de costo
6506
+ * modificado 28-12-2022
6501
6507
  */
6502
- SigespService.prototype.getCentroCosto = function (tipo) {
6503
- return this.http.get(this.URL + "/dao/scg/centro_costo_dao.php?codigo=" + tipo, { headers: this.getHttpHeaders() }).pipe(operators.retry(3), operators.catchError(this.handlerError), operators.map(function (res) {
6504
- if (res.success) {
6505
- res.data = res.data.map(function (e) { return new MCentroCosto(e); });
6508
+ SigespService.prototype.getCentroCosto = function (tipo, id) {
6509
+ if (tipo === void 0) { tipo = null; }
6510
+ return this.http.get(this.URL + "/dao/scg/centro_costo_dao.php?tipo=" + tipo + "&id=" + id, { headers: this.getHttpHeaders() }).pipe(operators.retry(3), operators.catchError(this.handlerError), operators.map(function (resp) {
6511
+ if (tipo == 'all') {
6512
+ resp = resp.data.map(function (element) { return new MCentroCosto(element); });
6506
6513
  }
6507
- return res;
6514
+ else {
6515
+ resp.data.map(function (element) { return new MCentroCosto(element); });
6516
+ }
6517
+ return resp;
6508
6518
  }));
6509
6519
  };
6510
6520
  /**
@@ -6521,7 +6531,7 @@
6521
6531
  }));
6522
6532
  };
6523
6533
  SigespService.prototype.getUserCostCenters = function (codigo) {
6524
- return this.http.get(this.URL + "/dao/scg/control_numero_usuario_dao.php?codigo=" + codigo, { headers: this.getHttpHeaders() }).pipe(operators.retry(3), operators.catchError(this.handlerError), operators.map(function (res) {
6534
+ return this.http.get(this.URL + "/dao/scg/centro_costo_usuario_dao.php?codigo=" + codigo, { headers: this.getHttpHeaders() }).pipe(operators.retry(3), operators.catchError(this.handlerError), operators.map(function (res) {
6525
6535
  if (res.success) {
6526
6536
  res.data = res.data.map(function (element) { return new MUsuarioCentroCosto(element); });
6527
6537
  }
@@ -8358,7 +8368,7 @@
8358
8368
  TableSelectComponent,
8359
8369
  CatalogoEstructurasComponent,
8360
8370
  CatalogoDobleInputComponent,
8361
- IsoCurrencyPipe
8371
+ IsoCurrencyPipe,
8362
8372
  ],
8363
8373
  imports: [
8364
8374
  common.CommonModule,