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.
@@ -1329,11 +1329,15 @@ class MCentroCosto extends MBasicModel {
1329
1329
  super();
1330
1330
  this.idEmpresa = 0;
1331
1331
  this.idEnterprise = 0;
1332
+ this.usuarios = [];
1332
1333
  if (centroCosto) {
1333
1334
  this.idEmpresa = +centroCosto.id_empresa;
1334
1335
  this.idEnterprise = +centroCosto.id_enterprise;
1335
1336
  this.centro = centroCosto.centro ? centroCosto.centro : centroCosto.codcencos;
1336
1337
  this.denominacion = centroCosto.denominacion;
1338
+ if (centroCosto.usuarios) {
1339
+ this.usuarios = centroCosto.usuarios.map(e => new MUsuarioCentroCosto(e));
1340
+ }
1337
1341
  }
1338
1342
  else {
1339
1343
  this.isNew = true;
@@ -1346,6 +1350,7 @@ class MCentroCosto extends MBasicModel {
1346
1350
  id_enterprise: this.idEnterprise.toString(),
1347
1351
  codcencos: this.centro,
1348
1352
  denominacion: this.denominacion,
1353
+ usuarios: this.usuarios.map(e => e.dataInterface()),
1349
1354
  };
1350
1355
  }
1351
1356
  }
@@ -1362,7 +1367,7 @@ class MUsuarioCentroCosto extends MBasicModel {
1362
1367
  this.idEnterprise = +e.id_enterprise;
1363
1368
  this.codigoCentroCosto = e.codcencos;
1364
1369
  this.usuario = e.codusu;
1365
- this.usuario = e.codusu;
1370
+ this.idDtCentro = +e.id_dt_cencos;
1366
1371
  }
1367
1372
  else {
1368
1373
  this.isNew = true;
@@ -5698,11 +5703,11 @@ class SigespService {
5698
5703
  * @return Promise<any[]>
5699
5704
  * @author Miguel Ramírez
5700
5705
  */
5701
- getBudgetStructureComplete() {
5706
+ getBudgetStructureComplete(nivel) {
5702
5707
  return __awaiter(this, void 0, void 0, function* () {
5703
5708
  return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
5704
5709
  let data = [];
5705
- yield this.getBudgetStructureFive(5).subscribe(result => {
5710
+ yield this.getBudgetStructureFive(nivel).subscribe(result => {
5706
5711
  data.push(...result);
5707
5712
  });
5708
5713
  // await this.getBudgetStructureThreeComplete(3).subscribe(result => {
@@ -5985,14 +5990,18 @@ class SigespService {
5985
5990
  * @description Obtiene los centros de costo
5986
5991
  * @return Observable<MCentroCosto[]>
5987
5992
  * @author Miguel Ramírez
5988
- * modificado 9-11-2022
5993
+ * @param id:idusurio o id del ecntro de costo
5994
+ * modificado 28-12-2022
5989
5995
  */
5990
- getCentroCosto(tipo) {
5991
- 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) => {
5992
- if (res.success) {
5993
- res.data = res.data.map(e => new MCentroCosto(e));
5996
+ getCentroCosto(tipo = null, id) {
5997
+ return this.http.get(`${this.URL}/dao/scg/centro_costo_dao.php?tipo=${tipo}&id=${id}`, { headers: this.getHttpHeaders() }).pipe(retry(3), catchError(this.handlerError), map((resp) => {
5998
+ if (tipo == 'all') {
5999
+ resp = resp.data.map(element => new MCentroCosto(element));
5994
6000
  }
5995
- return res;
6001
+ else {
6002
+ resp.data.map(element => new MCentroCosto(element));
6003
+ }
6004
+ return resp;
5996
6005
  }));
5997
6006
  }
5998
6007
  /**
@@ -6009,7 +6018,7 @@ class SigespService {
6009
6018
  }));
6010
6019
  }
6011
6020
  getUserCostCenters(codigo) {
6012
- return this.http.get(`${this.URL}/dao/scg/control_numero_usuario_dao.php?codigo=${codigo}`, { headers: this.getHttpHeaders() }).pipe(retry(3), catchError(this.handlerError), map((res) => {
6021
+ return this.http.get(`${this.URL}/dao/scg/centro_costo_usuario_dao.php?codigo=${codigo}`, { headers: this.getHttpHeaders() }).pipe(retry(3), catchError(this.handlerError), map((res) => {
6013
6022
  if (res.success) {
6014
6023
  res.data = res.data.map(element => new MUsuarioCentroCosto(element));
6015
6024
  }
@@ -7708,7 +7717,7 @@ SharedModule.decorators = [
7708
7717
  TableSelectComponent,
7709
7718
  CatalogoEstructurasComponent,
7710
7719
  CatalogoDobleInputComponent,
7711
- IsoCurrencyPipe
7720
+ IsoCurrencyPipe,
7712
7721
  ],
7713
7722
  imports: [
7714
7723
  CommonModule,