Преглед изворни кода

ajuste en guardado de proyecciones en propuestas de inversion

Oscar José Nuñez Chávez пре 5 година
родитељ
комит
9b3c2fdb39

+ 4 - 5
src/app/components/instruments/bonos/bonos.component.ts

@@ -147,10 +147,9 @@ export class BONO implements InstrumentComponent {
       this.instrument_work.proyecciones != ""
     ) {
       this.hasProjections = true;
-      this.consolidado_proyeccion = this.instrument_work.proyecciones.slice(
-        0,
-        -1
-      );
+      this.consolidado_proyeccion = this.instrument_work.proyecciones[
+        this.instrument_work.proyecciones.length - 1
+      ];
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -158,7 +157,7 @@ export class BONO implements InstrumentComponent {
       }
       this.instrument_work_summary = this.instrument_work;
 
-      this.dataSource2.data = this.instrument_work.proyecciones;
+      this.dataSource2.data = this.instrument_work.proyecciones.slice(0, -1);
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
     } else {

+ 4 - 5
src/app/components/instruments/certificados/certificados.component.ts

@@ -147,10 +147,9 @@ export class CINV implements InstrumentComponent {
       this.instrument_work.proyecciones != ""
     ) {
       this.hasProjections = true;
-      this.consolidado_proyeccion = this.instrument_work.proyecciones.slice(
-        0,
-        -1
-      );
+      this.consolidado_proyeccion = this.instrument_work.proyecciones[
+        this.instrument_work.proyecciones.length - 1
+      ];
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -158,7 +157,7 @@ export class CINV implements InstrumentComponent {
       }
       this.instrument_work_summary = this.instrument_work;
 
-      this.dataSource2.data = this.instrument_work.proyecciones;
+      this.dataSource2.data = this.instrument_work.proyecciones.slice(0, -1);
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
     } else {

+ 4 - 5
src/app/components/instruments/cete/cete.component.ts

@@ -117,14 +117,13 @@ export class CETE implements InstrumentComponent {
       (this.instrument_work.proyecciones != "" ||
         this.instrument_work != undefined)
     ) {
+      this.consolidado_proyeccion = this.instrument_work.proyecciones[
+        this.instrument_work.proyecciones.length - 1
+      ];
       this.hasProjections = true;
-      this.dataSource2.data = this.instrument_work.proyecciones;
+      this.dataSource2.data = this.instrument_work.proyecciones.slice(0, -1);
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
-      this.consolidado_proyeccion = this.instrument_work.proyecciones.slice(
-        0,
-        -1
-      );
     } else {
       this.hasProjections = false;
     }

+ 4 - 5
src/app/components/instruments/dap/dap.component.ts

@@ -117,13 +117,12 @@ export class DAP implements InstrumentComponent {
         this.instrument_work != undefined)
     ) {
       this.hasProjections = true;
-      this.dataSource2.data = this.instrument_work.proyecciones;
+      this.consolidado_proyeccion = this.instrument_work.proyecciones[
+        this.instrument_work.proyecciones.length - 1
+      ];
+      this.dataSource2.data = this.instrument_work.proyecciones.slice(0, -1);
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
-      this.consolidado_proyeccion = this.instrument_work.proyecciones.slice(
-        0,
-        -1
-      );
     } else {
       this.hasProjections = false;
     }

+ 4 - 5
src/app/components/instruments/eurobonos/eurobonos.component.ts

@@ -147,10 +147,9 @@ export class EURB implements InstrumentComponent {
       this.instrument_work.proyecciones != ""
     ) {
       this.hasProjections = true;
-      this.consolidado_proyeccion = this.instrument_work.proyecciones.slice(
-        0,
-        -1
-      );
+      this.consolidado_proyeccion = this.instrument_work.proyecciones[
+        this.instrument_work.proyecciones.length - 1
+      ];
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -158,7 +157,7 @@ export class EURB implements InstrumentComponent {
       }
       this.instrument_work_summary = this.instrument_work;
 
-      this.dataSource2.data = this.instrument_work.proyecciones;
+      this.dataSource2.data = this.instrument_work.proyecciones.slice(0, -1);
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
     } else {

+ 4 - 2
src/app/components/instruments/fondos/fondos.component.ts

@@ -130,7 +130,9 @@ export class FINV implements InstrumentComponent {
     ) {
       this.hasProjections = true;
 
-      this.consolidado_proyeccion = this.instrument_work.proyecciones.pop();
+      this.consolidado_proyeccion = this.instrument_work.proyecciones[
+        this.instrument_work.proyecciones.length - 1
+      ];
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -138,7 +140,7 @@ export class FINV implements InstrumentComponent {
       }
       this.instrument_work_summary = this.instrument_work;
 
-      this.dataSource2.data = this.instrument_work.proyecciones;
+      this.dataSource2.data = this.instrument_work.proyecciones.slice(0, -1);
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
     } else {

+ 5 - 3
src/app/components/instruments/pbur/pbur.component.ts

@@ -123,10 +123,12 @@ export class PBUR implements InstrumentComponent {
       this.instrument_work.proyecciones != undefined
     ) {
       this.hasProjections = true;
-      this.dataSource2.data = this.instrument_work.proyecciones;
+      this.dataSource2.data = this.instrument_work.proyecciones.slice(0, -1);
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
-      this.consolidado_proyeccion = this.instrument_work.proyecciones.pop();
+      this.consolidado_proyeccion = this.instrument_work.proyecciones[
+        this.instrument_work.proyecciones.length - 1
+      ];
     } else {
       this.hasProjections = false;
     }
@@ -313,7 +315,7 @@ export class PBUR implements InstrumentComponent {
           this.proyecciones = ans["result"]["proyecciones"];
 
           if (this.proyecciones != undefined && this.proyecciones.length > 0) {
-            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.consolidado_proyeccion = this.proyecciones.slice(0, -1);
             this.proyecciones = ans["result"]["proyecciones"];
           }
 

+ 5 - 5
src/app/components/instruments/titulos/titulos.component.ts

@@ -156,10 +156,9 @@ export class TIT implements InstrumentComponent {
       this.instrument_work.proyecciones != ""
     ) {
       this.hasProjections = true;
-      this.consolidado_proyeccion = this.instrument_work.proyecciones.slice(
-        0,
-        -1
-      );
+      this.consolidado_proyeccion = this.instrument_work.proyecciones[
+        this.instrument_work.proyecciones.length - 1
+      ];
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -167,12 +166,13 @@ export class TIT implements InstrumentComponent {
       }
       this.instrument_work_summary = this.instrument_work;
 
-      this.dataSource2.data = this.instrument_work.proyecciones;
+      this.dataSource2.data = this.instrument_work.proyecciones.slice(0, -1);
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
     } else {
       this.hasProjections = false;
     }
+
     if (!this.instrument_exists) {
       this.amortizaciones = this.instrument_work.amortizacion_porcentajes;
     }

+ 4 - 5
src/app/components/instruments/vcn/vcn.component.ts

@@ -122,13 +122,12 @@ export class VCN implements InstrumentComponent {
       this.instrument_work.proyecciones != undefined
     ) {
       this.hasProjections = true;
-      this.dataSource2.data = this.instrument_work.proyecciones;
+      this.dataSource2.data = this.instrument_work.proyecciones.slice(0, -1);
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
-      this.consolidado_proyeccion = this.instrument_work.proyecciones.slice(
-        0,
-        -1
-      );
+      this.consolidado_proyeccion = this.instrument_work.proyecciones[
+        this.instrument_work.proyecciones.length - 1
+      ];
     } else {
       this.hasProjections = false;
     }