sigesp 1.1.21-20241106 → 1.1.23-20241113

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.
@@ -2628,7 +2628,7 @@ class MComprobantePresupuestarioIngresos {
2628
2628
  // TERMINAR EL MODELO
2629
2629
 
2630
2630
  class MCuentaIngresos extends MBasicModel {
2631
- constructor(cuenta = null, isNew = false) {
2631
+ constructor(cuenta = null) {
2632
2632
  super();
2633
2633
  this.idEmpresa = 0;
2634
2634
  this.idEnterprise = 0;
@@ -2637,7 +2637,6 @@ class MCuentaIngresos extends MBasicModel {
2637
2637
  this.denominacion = '';
2638
2638
  this.cuenta = null;
2639
2639
  this.cuentaContable = null;
2640
- this.cuentaONCOP = null;
2641
2640
  this.clasificador = null;
2642
2641
  this.referencia = null;
2643
2642
  this.estado = null;
@@ -2700,8 +2699,6 @@ class MCuentaIngresos extends MBasicModel {
2700
2699
  this.noviembre = parseInt(cuenta.noviembre);
2701
2700
  this.diciembre = parseInt(cuenta.diciembre);
2702
2701
  this.clasificador = cuenta.codcuecla;
2703
- this.cuentaONCOP = cuenta.cueoncop;
2704
- this.isNew = isNew;
2705
2702
  this.idEP1 = parseInt(cuenta.id_ep1);
2706
2703
  this.idEP2 = parseInt(cuenta.id_ep2);
2707
2704
  this.idEP3 = parseInt(cuenta.id_ep3);
@@ -2710,6 +2707,49 @@ class MCuentaIngresos extends MBasicModel {
2710
2707
  this.id = cuenta.id_del_spicta ? parseInt(cuenta.id_del_spicta) : 0;
2711
2708
  this.estructura = cuenta.estructura ? cuenta.estructura : "";
2712
2709
  }
2710
+ else {
2711
+ this.isNew = true;
2712
+ }
2713
+ }
2714
+ dataInterface() {
2715
+ return {
2716
+ id_enterprise: this.idEnterprise.toString(),
2717
+ perfiscal: this.periodoFiscal.toString(),
2718
+ abril: this.abril.toString(),
2719
+ agosto: this.agosto.toString(),
2720
+ aumento: this.aumento.toString(),
2721
+ cobrado: this.cobrado.toString(),
2722
+ cobrado_anticipado: this.anticipoCobrado.toString(),
2723
+ denspi: this.denominacion.toString(),
2724
+ devengado: this.devengado.toString(),
2725
+ diciembre: this.diciembre.toString(),
2726
+ disminucion: this.disminucion.toString(),
2727
+ distribuir: this.distribuir.toString(),
2728
+ enero: this.enero.toString(),
2729
+ febrero: this.febrero.toString(),
2730
+ id_empresa: this.idEmpresa.toString(),
2731
+ julio: this.julio.toString(),
2732
+ junio: this.junio.toString(),
2733
+ marzo: this.marzo.toString(),
2734
+ mayo: this.mayo.toString(),
2735
+ nivel: this.nivel.toString(),
2736
+ noviembre: this.noviembre.toString(),
2737
+ octubre: this.octubre.toString(),
2738
+ previsto: this.previsto.toString(),
2739
+ referencia: this.referencia.toString(),
2740
+ sc_cuenta: this.cuentaContable,
2741
+ septiembre: this.septiembre.toString(),
2742
+ spi_cuenta: this.cuenta.toString(),
2743
+ stamov: this.estado.toString(),
2744
+ codcuecla: this.clasificador.toString(),
2745
+ id_ep1: this.idEP1.toString(),
2746
+ id_ep2: this.idEP2.toString(),
2747
+ id_ep3: this.idEP3.toString(),
2748
+ id_ep4: this.idEP4.toString(),
2749
+ id_ep5: this.idEP5.toString(),
2750
+ id_del_spicta: this.id.toString(),
2751
+ estructura: this.estructura.toString(),
2752
+ };
2713
2753
  }
2714
2754
  }
2715
2755
 
@@ -6769,15 +6809,15 @@ class SigespService {
6769
6809
  * @returns
6770
6810
  */
6771
6811
  getBudgetStructureComplete(tipo = 'completa', idEnterprise, periodoFiscal, codigo = '') {
6772
- return this.http.get(`${this.URL}/dao/spg/estructura_presupuestaria_dao.php?tipo=${tipo}$e=${idEnterprise}$per=${periodoFiscal}&cod=${codigo}`, { headers: this.getHttpHeaders() }).pipe(map((resp) => resp.data.map(e => new MEstructuras(e))));
6812
+ return this.http.get(`${this.URL}/dao/spg/estructura_presupuestaria_dao.php?tipo=${tipo}&e=${idEnterprise}&per=${periodoFiscal}&cod=${codigo}`, { headers: this.getHttpHeaders() }).pipe(map((resp) => resp.data.map(e => new MEstructuras(e))));
6773
6813
  }
6774
6814
  /**
6775
6815
  * @description Obtiene las configuraciones de la estructura presupuestaria
6776
6816
  * @return Observable<MConfigurationSPG[]>
6777
6817
  * @author Miguel Ramírez
6778
6818
  */
6779
- getConfigurationSPG(idEnterprise, periodoFical) {
6780
- return this.http.get(`${this.URL}/dao/spg/configuracion_presupuestaria_dao.php?e=${idEnterprise}&periodo=${periodoFical}`, { headers: this.getHttpHeaders() }).pipe(retry(3), catchError(this.handlerError), map((resp) => new MConfigurationSPG(resp.data[0])));
6819
+ getConfigurationSPG(idEnterprise, periodoFiscal) {
6820
+ return this.http.get(`${this.URL}/dao/spg/configuracion_presupuestaria_dao.php?e=${idEnterprise}&periodo=${periodoFiscal}`, { headers: this.getHttpHeaders() }).pipe(retry(3), catchError(this.handlerError), map((resp) => new MConfigurationSPG(resp.data[0])));
6781
6821
  }
6782
6822
  /**
6783
6823
  * @description Obtiene las configuraciones de los proveedores
@@ -6839,8 +6879,8 @@ class SigespService {
6839
6879
  * @return Observable<MFuenteFinanciamiento[]>
6840
6880
  * @author Miguel Ramírez
6841
6881
  */
6842
- getFuenteFinanciamiento() {
6843
- return this.http.get(`${this.URL}/dao/spg/fuente_financiamiento_dao.php`, { headers: this.getHttpHeaders() }).pipe(retry(3), catchError(this.handlerError), map((resp) => resp.data.map(element => new MFuenteFinanciamiento(element))));
6882
+ getFuenteFinanciamiento(idEnterprise, periodoFiscal) {
6883
+ return this.http.get(`${this.URL}/dao/spg/fuente_financiamiento_dao.php?e=${idEnterprise}&per=${periodoFiscal}`, { headers: this.getHttpHeaders() }).pipe(retry(3), catchError(this.handlerError), map((resp) => resp.data.map(element => new MFuenteFinanciamiento(element))));
6844
6884
  }
6845
6885
  /**
6846
6886
  * @description Obtiene los centros de costo
@@ -7213,9 +7253,9 @@ class SigespService {
7213
7253
  * @return Promise<McuentaInstitucional>
7214
7254
  * @author Miguel Ramírez
7215
7255
  */
7216
- openDialogCuentasInstitucionales(idEnterprise, periodoFical) {
7256
+ openDialogCuentasInstitucionales(idEnterprise, periodoFiscal) {
7217
7257
  return __awaiter(this, void 0, void 0, function* () {
7218
- let accounts = yield this.getCuentasInstitucionales(idEnterprise, periodoFical).toPromise();
7258
+ let accounts = yield this.getCuentasInstitucionales(idEnterprise, periodoFiscal).toPromise();
7219
7259
  let dialogRef = this.dialog.open(CatalogoComponent, {
7220
7260
  data: {
7221
7261
  columns: ['cuenta', 'denominacion'],
@@ -7234,8 +7274,8 @@ class SigespService {
7234
7274
  * @return Observable<MCuentaInstitucional[]>
7235
7275
  * @author Miguel Ramírez
7236
7276
  */
7237
- getCuentasInstitucionales(idEnterprise, periodoFical, inventory) {
7238
- return this.http.get(`${this.URL}/dao/scg/cuentas_dao.php?e=${idEnterprise}&periodo=${periodoFical}${(inventory) ? '&inventory=true' : ''}`, { headers: this.getHttpHeaders() }).pipe(map((resp) => resp.data.map(element => new MCuentaInstitucional(element))));
7277
+ getCuentasInstitucionales(idEnterprise, periodoFiscal, inventory) {
7278
+ return this.http.get(`${this.URL}/dao/scg/cuentas_dao.php?e=${idEnterprise}&periodo=${periodoFiscal}${(inventory) ? '&inventory=true' : ''}`, { headers: this.getHttpHeaders() }).pipe(map((resp) => resp.data.map(element => new MCuentaInstitucional(element))));
7239
7279
  }
7240
7280
  /**
7241
7281
  * @description Abre el dialog de las cuentas de presupuesto (Recursos y Egresos)
@@ -7266,6 +7306,48 @@ class SigespService {
7266
7306
  getCuentasPresupuesto(filter) {
7267
7307
  return this.http.get(`${this.URL}/dao/scg/plan_unico_cuentas_dao.php?filter=${filter}`, { headers: this.getHttpHeaders() }).pipe(map((res) => res.data.map(element => new MCuentaPresupuesto(element))));
7268
7308
  }
7309
+ /**
7310
+ * @description Abre el cátalogo de cuentas de la tabla "spg_cuentas"
7311
+ * @returns Promise<MCuentaEgresos>
7312
+ * @author Carlos Albornoz
7313
+ * @params presupuesto: Indica si se a trabajar con estructura de presupuesto o no
7314
+ */
7315
+ openCatalogoCuentasEgreso(idEnterprise, periodoFiscal, titulo, presupuesto = true, ancho = "1000px") {
7316
+ return __awaiter(this, void 0, void 0, function* () {
7317
+ let cuentas = [];
7318
+ yield this.getExpenseAccounts(idEnterprise, periodoFiscal).toPromise().then(res => {
7319
+ cuentas = res;
7320
+ cuentas = cuentas.filter(e => {
7321
+ return e.status == "C";
7322
+ }).map(e => {
7323
+ e['provStatus'] = e.status == "C" ? "Movimientos" : "Totalizadora";
7324
+ return e;
7325
+ });
7326
+ });
7327
+ if (presupuesto) {
7328
+ return this.openCatalogoDosInputs(["cuenta", "denominacion", "estructura", "provStatus"], titulo, cuentas, [{
7329
+ placeholder: "Cuenta",
7330
+ property: "cuenta"
7331
+ }, {
7332
+ placeholder: "Estructura",
7333
+ property: "estructura"
7334
+ }], ["Cuenta", "Denominación", "Estructura", "Estado"], ancho);
7335
+ }
7336
+ else {
7337
+ let filteredAccounts = [];
7338
+ cuentas.forEach(c => {
7339
+ if (!filteredAccounts.find(e => e.cuenta == c.cuenta)) {
7340
+ filteredAccounts.push(c);
7341
+ }
7342
+ });
7343
+ return this.openCatalogoGenerico(["cuenta", "denominacion", "provStatus"], titulo, filteredAccounts, ["Cuenta", "Denominación", "Estado"], ancho);
7344
+ }
7345
+ });
7346
+ }
7347
+ getExpenseAccounts(idEnterprise, periodoFiscal) {
7348
+ return this.http.get(`${this.URL}/dao/spg/cuentas_egresos_dao.php?e=${idEnterprise}&periodo=${periodoFiscal}`, { headers: this.getHttpHeaders() })
7349
+ .pipe(map((res) => res.data.map(element => new MCuentaEgresos(element))));
7350
+ }
7269
7351
  /**
7270
7352
  * @description Abre el cátalogo de cuentas de la tabla "scg_plan_unico_re"
7271
7353
  * @returns Promise<MCuentaPresupuesto>
@@ -7304,10 +7386,10 @@ class SigespService {
7304
7386
  * @author Carlos Albornoz
7305
7387
  * @params presupuesto: Indica si se a trabajar con estructura de presupuesto o no
7306
7388
  */
7307
- openCatalogoCuentasIngreso(titulo, presupuesto = true, ancho = "1000px") {
7389
+ openCatalogoCuentasIngreso(idEnterprise, periodoFiscal, nivel, idEP, titulo, ancho = "1000px", presupuesto = false) {
7308
7390
  return __awaiter(this, void 0, void 0, function* () {
7309
7391
  let cuentas = [];
7310
- yield this.getIncomeAccounts().toPromise().then((res) => {
7392
+ yield this.getIncomeAccounts('default', idEnterprise, periodoFiscal, nivel, idEP).toPromise().then((res) => {
7311
7393
  cuentas = res.data;
7312
7394
  cuentas = cuentas.filter(e => {
7313
7395
  return e.estado == "C";
@@ -7336,8 +7418,8 @@ class SigespService {
7336
7418
  }
7337
7419
  });
7338
7420
  }
7339
- getUnidadAdministrativa(tipo, idEnterprise, periodoFical, idUnidadOrganizativa) {
7340
- return this.http.get(`${this.URL}/dao/spg/unidad_administrativa_dao.php?tipo=${tipo}&e=${idEnterprise}&periodo=${periodoFical}&id=${idUnidadOrganizativa}`, { headers: this.getHttpHeaders() })
7421
+ getUnidadAdministrativa(tipo, idEnterprise, periodoFiscal, idUnidadOrganizativa) {
7422
+ return this.http.get(`${this.URL}/dao/spg/unidad_administrativa_dao.php?tipo=${tipo}&e=${idEnterprise}&periodo=${periodoFiscal}&id=${idUnidadOrganizativa}`, { headers: this.getHttpHeaders() })
7341
7423
  .pipe(map((res) => {
7342
7424
  if (res.success) {
7343
7425
  res.data = res.data.map(e => new MAdministrativeUnit(e));
@@ -7704,8 +7786,8 @@ class SigespService {
7704
7786
  return res;
7705
7787
  }));
7706
7788
  }
7707
- getIncomeAccounts(onlyAvailable = false) {
7708
- return this.http.get(`${this.URL}/dao/spi/cuentas_ingresos_dao.php${onlyAvailable ? '?available=true' : ''}`, { headers: this.getHttpHeaders() }).pipe(map((res) => {
7789
+ getIncomeAccounts(tipo, idEnterprise, periodoFiscal, nivel = 0, idEP, estatus = '') {
7790
+ return this.http.get(`${this.URL}/dao/spi/cuentas_ingresos_dao.php?tipo=${tipo}&e=${idEnterprise}&per=${periodoFiscal}&niv=${nivel}&ep=${idEP}&est=${estatus}`, { headers: this.getHttpHeaders() }).pipe(map((res) => {
7709
7791
  if (res.success) {
7710
7792
  res.data = res.data.map(e => new MCuentaIngresos(e));
7711
7793
  }