sigesp 0.9.18-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.
@@ -779,18 +779,42 @@ class MCuentaInstitucional {
779
779
  }
780
780
  }
781
781
 
782
- class MMoneda {
782
+ class MMoneda extends MBasicModel {
783
783
  constructor(moneda) {
784
- this.codigo = moneda.codigo;
785
- this.denominacion = moneda.denominacion;
786
- this.iso = moneda.iso;
787
- this.simbolo = moneda.simbolo;
784
+ super();
785
+ this.codigo = '';
786
+ this.denominacion = '';
787
+ this.iso = '';
788
+ this.simbolo = '';
789
+ this.separadorDecimal = '';
790
+ this.separadorMiles = '';
791
+ this.decimales = 0;
792
+ if (moneda) {
793
+ this.codigo = moneda.codmon;
794
+ this.denominacion = moneda.denmon;
795
+ this.iso = moneda.codiso;
796
+ this.simbolo = moneda.simmon;
797
+ this.separadorDecimal = moneda.separadordec;
798
+ this.separadorMiles = moneda.separadormil;
799
+ this.decimales = parseInt(moneda.decimal);
800
+ }
801
+ }
802
+ dataInterface() {
803
+ return {
804
+ codmon: this.codigo,
805
+ denmon: this.denominacion,
806
+ codiso: this.iso,
807
+ simmon: this.simbolo,
808
+ separadordec: this.separadorDecimal,
809
+ separadormil: this.separadorMiles,
810
+ decimal: this.decimales.toString(),
811
+ };
788
812
  }
789
813
  }
790
814
  class MMonedaConfig extends MBasicModel {
791
815
  constructor(moneda) {
792
816
  super();
793
- this.codigo = null;
817
+ this.codigo = '';
794
818
  this.denominacion = '';
795
819
  this.codigoIso = '';
796
820
  this.simbolo = '';
@@ -1305,11 +1329,15 @@ class MCentroCosto extends MBasicModel {
1305
1329
  super();
1306
1330
  this.idEmpresa = 0;
1307
1331
  this.idEnterprise = 0;
1332
+ this.usuarios = [];
1308
1333
  if (centroCosto) {
1309
1334
  this.idEmpresa = +centroCosto.id_empresa;
1310
1335
  this.idEnterprise = +centroCosto.id_enterprise;
1311
1336
  this.centro = centroCosto.centro ? centroCosto.centro : centroCosto.codcencos;
1312
1337
  this.denominacion = centroCosto.denominacion;
1338
+ if (centroCosto.usuarios) {
1339
+ this.usuarios = centroCosto.usuarios.map(e => new MUsuarioCentroCosto(e));
1340
+ }
1313
1341
  }
1314
1342
  else {
1315
1343
  this.isNew = true;
@@ -1322,6 +1350,7 @@ class MCentroCosto extends MBasicModel {
1322
1350
  id_enterprise: this.idEnterprise.toString(),
1323
1351
  codcencos: this.centro,
1324
1352
  denominacion: this.denominacion,
1353
+ usuarios: this.usuarios.map(e => e.dataInterface()),
1325
1354
  };
1326
1355
  }
1327
1356
  }
@@ -1338,7 +1367,7 @@ class MUsuarioCentroCosto extends MBasicModel {
1338
1367
  this.idEnterprise = +e.id_enterprise;
1339
1368
  this.codigoCentroCosto = e.codcencos;
1340
1369
  this.usuario = e.codusu;
1341
- this.usuario = e.codusu;
1370
+ this.idDtCentro = +e.id_dt_cencos;
1342
1371
  }
1343
1372
  else {
1344
1373
  this.isNew = true;
@@ -5674,11 +5703,11 @@ class SigespService {
5674
5703
  * @return Promise<any[]>
5675
5704
  * @author Miguel Ramírez
5676
5705
  */
5677
- getBudgetStructureComplete() {
5706
+ getBudgetStructureComplete(nivel) {
5678
5707
  return __awaiter(this, void 0, void 0, function* () {
5679
5708
  return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
5680
5709
  let data = [];
5681
- yield this.getBudgetStructureFive(5).subscribe(result => {
5710
+ yield this.getBudgetStructureFive(nivel).subscribe(result => {
5682
5711
  data.push(...result);
5683
5712
  });
5684
5713
  // await this.getBudgetStructureThreeComplete(3).subscribe(result => {
@@ -5961,14 +5990,18 @@ class SigespService {
5961
5990
  * @description Obtiene los centros de costo
5962
5991
  * @return Observable<MCentroCosto[]>
5963
5992
  * @author Miguel Ramírez
5964
- * modificado 9-11-2022
5993
+ * @param id:idusurio o id del ecntro de costo
5994
+ * modificado 28-12-2022
5965
5995
  */
5966
- getCentroCosto(tipo) {
5967
- 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) => {
5968
- if (res.success) {
5969
- 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));
5970
6000
  }
5971
- return res;
6001
+ else {
6002
+ resp.data.map(element => new MCentroCosto(element));
6003
+ }
6004
+ return resp;
5972
6005
  }));
5973
6006
  }
5974
6007
  /**
@@ -5985,7 +6018,7 @@ class SigespService {
5985
6018
  }));
5986
6019
  }
5987
6020
  getUserCostCenters(codigo) {
5988
- 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) => {
5989
6022
  if (res.success) {
5990
6023
  res.data = res.data.map(element => new MUsuarioCentroCosto(element));
5991
6024
  }
@@ -6297,7 +6330,7 @@ class SigespService {
6297
6330
  let coins = yield this.getMonedas('todas').toPromise();
6298
6331
  let dialogRef = this.dialog.open(CatalogoComponent, {
6299
6332
  data: {
6300
- columns: ['codigo', 'denominacion', 'iso', 'simbolo'],
6333
+ columns: ['codigo', 'denominacion', 'codigoIso', 'simbolo'],
6301
6334
  title: 'Catálogo de Monedas',
6302
6335
  columnNames: ['código', 'denominación', 'iso', 'simbolo'],
6303
6336
  dataSource: coins
@@ -7684,7 +7717,7 @@ SharedModule.decorators = [
7684
7717
  TableSelectComponent,
7685
7718
  CatalogoEstructurasComponent,
7686
7719
  CatalogoDobleInputComponent,
7687
- IsoCurrencyPipe
7720
+ IsoCurrencyPipe,
7688
7721
  ],
7689
7722
  imports: [
7690
7723
  CommonModule,