sigesp 0.9.19-20221221 → 0.9.21-20221229

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.
@@ -64,6 +64,7 @@ class MUsuarioPrefijo extends MBasicModel {
64
64
  constructor(e) {
65
65
  super();
66
66
  this.idEmpresa = 0;
67
+ this.idEnteprise = 0;
67
68
  this.id = 0;
68
69
  this.idUsuario = 0;
69
70
  this.idDtPrefijo = 0;
@@ -74,6 +75,7 @@ class MUsuarioPrefijo extends MBasicModel {
74
75
  this.estatusActivo = true;
75
76
  if (e) {
76
77
  this.idEmpresa = +e.id_empresa;
78
+ this.idEnteprise = +e.id_enterprise;
77
79
  this.id = +e.id;
78
80
  this.idUsuario = +e.id_usuario;
79
81
  this.idDtPrefijo = +e.id_dt_prefijo;
@@ -90,6 +92,7 @@ class MUsuarioPrefijo extends MBasicModel {
90
92
  dataInterface() {
91
93
  return {
92
94
  id_empresa: this.idEmpresa.toString(),
95
+ id_enterprise: this.idEnteprise.toString(),
93
96
  id: this.id.toString(),
94
97
  id_usuario: this.idUsuario.toString(),
95
98
  id_dt_prefijo: this.idDtPrefijo.toString(),
@@ -106,6 +109,7 @@ class MPrefijo extends MBasicModel {
106
109
  constructor(e) {
107
110
  super();
108
111
  this.idEmpresa = 0;
112
+ this.idEnterprise = 0;
109
113
  this.id = 0;
110
114
  this.prefijo = '';
111
115
  this.procede = '';
@@ -121,6 +125,7 @@ class MPrefijo extends MBasicModel {
121
125
  this.usuarios = [];
122
126
  if (e) {
123
127
  this.idEmpresa = +e.id_empresa;
128
+ this.idEnterprise = +e.id_enterprise;
124
129
  this.id = +e.id;
125
130
  this.prefijo = e.prefijo;
126
131
  this.procede = e.procede;
@@ -144,6 +149,7 @@ class MPrefijo extends MBasicModel {
144
149
  dataInterface() {
145
150
  return {
146
151
  id_empresa: this.idEmpresa.toString(),
152
+ id_enterprise: this.idEnterprise.toString(),
147
153
  id: this.id.toString(),
148
154
  prefijo: this.prefijo,
149
155
  procede: this.procede,
@@ -1329,11 +1335,15 @@ class MCentroCosto extends MBasicModel {
1329
1335
  super();
1330
1336
  this.idEmpresa = 0;
1331
1337
  this.idEnterprise = 0;
1338
+ this.usuarios = [];
1332
1339
  if (centroCosto) {
1333
1340
  this.idEmpresa = +centroCosto.id_empresa;
1334
1341
  this.idEnterprise = +centroCosto.id_enterprise;
1335
1342
  this.centro = centroCosto.centro ? centroCosto.centro : centroCosto.codcencos;
1336
1343
  this.denominacion = centroCosto.denominacion;
1344
+ if (centroCosto.usuarios) {
1345
+ this.usuarios = centroCosto.usuarios.map(e => new MUsuarioCentroCosto(e));
1346
+ }
1337
1347
  }
1338
1348
  else {
1339
1349
  this.isNew = true;
@@ -1346,6 +1356,7 @@ class MCentroCosto extends MBasicModel {
1346
1356
  id_enterprise: this.idEnterprise.toString(),
1347
1357
  codcencos: this.centro,
1348
1358
  denominacion: this.denominacion,
1359
+ usuarios: this.usuarios.map(e => e.dataInterface()),
1349
1360
  };
1350
1361
  }
1351
1362
  }
@@ -1362,7 +1373,7 @@ class MUsuarioCentroCosto extends MBasicModel {
1362
1373
  this.idEnterprise = +e.id_enterprise;
1363
1374
  this.codigoCentroCosto = e.codcencos;
1364
1375
  this.usuario = e.codusu;
1365
- this.usuario = e.codusu;
1376
+ this.idDtCentro = +e.id_dt_cencos;
1366
1377
  }
1367
1378
  else {
1368
1379
  this.isNew = true;
@@ -5698,11 +5709,11 @@ class SigespService {
5698
5709
  * @return Promise<any[]>
5699
5710
  * @author Miguel Ramírez
5700
5711
  */
5701
- getBudgetStructureComplete() {
5712
+ getBudgetStructureComplete(nivel) {
5702
5713
  return __awaiter(this, void 0, void 0, function* () {
5703
5714
  return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
5704
5715
  let data = [];
5705
- yield this.getBudgetStructureFive(5).subscribe(result => {
5716
+ yield this.getBudgetStructureFive(nivel).subscribe(result => {
5706
5717
  data.push(...result);
5707
5718
  });
5708
5719
  // await this.getBudgetStructureThreeComplete(3).subscribe(result => {
@@ -5985,14 +5996,18 @@ class SigespService {
5985
5996
  * @description Obtiene los centros de costo
5986
5997
  * @return Observable<MCentroCosto[]>
5987
5998
  * @author Miguel Ramírez
5988
- * modificado 9-11-2022
5999
+ * @param id:idusurio o id del ecntro de costo
6000
+ * modificado 28-12-2022
5989
6001
  */
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));
6002
+ getCentroCosto(tipo = null, id) {
6003
+ 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) => {
6004
+ if (tipo == 'all') {
6005
+ resp = resp.data.map(element => new MCentroCosto(element));
5994
6006
  }
5995
- return res;
6007
+ else {
6008
+ resp.data.map(element => new MCentroCosto(element));
6009
+ }
6010
+ return resp;
5996
6011
  }));
5997
6012
  }
5998
6013
  /**
@@ -6009,7 +6024,7 @@ class SigespService {
6009
6024
  }));
6010
6025
  }
6011
6026
  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) => {
6027
+ 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
6028
  if (res.success) {
6014
6029
  res.data = res.data.map(element => new MUsuarioCentroCosto(element));
6015
6030
  }
@@ -7708,7 +7723,7 @@ SharedModule.decorators = [
7708
7723
  TableSelectComponent,
7709
7724
  CatalogoEstructurasComponent,
7710
7725
  CatalogoDobleInputComponent,
7711
- IsoCurrencyPipe
7726
+ IsoCurrencyPipe,
7712
7727
  ],
7713
7728
  imports: [
7714
7729
  CommonModule,