ソースを参照

Totales para tablas de proyecciones

Francisco huezo 5 年 前
コミット
22f065547c

+ 35 - 1
src/app/components/instruments/bonos/bonos.component.html

@@ -971,7 +971,7 @@
     </div>
     <br />
     <!-- Tabla de proyecciones del instrumento-->
-    <div class="instrument-calcs">
+    <div *ngIf="hasProjections" class="instrument-calcs">
       <div class="row">
         <div class="col-12">
           <span class="badge badge-success badge-custom"
@@ -987,6 +987,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -994,6 +995,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="fecha_pago">
@@ -1005,6 +1007,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -1015,6 +1018,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -1025,6 +1033,11 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="impuesto">
@@ -1036,10 +1049,14 @@
                     : row.impuesto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{ consolidado_proyeccion.total_impuesto | number: "1.2-4" }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
             <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
         </div>
       </div>
@@ -1522,6 +1539,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -1529,6 +1547,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <!-- Country Column -->
@@ -1541,6 +1560,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <!-- Country Column -->
@@ -1553,6 +1573,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="ingreso_neto">
@@ -1564,6 +1589,11 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="impuesto">
@@ -1575,10 +1605,14 @@
                     : row.impuesto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{ consolidado_proyeccion.total_impuesto | number: "1.2-4" }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
             <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
         </div>
       </div>

+ 7 - 0
src/app/components/instruments/bonos/bonos.component.ts

@@ -127,6 +127,7 @@ export class BONO implements InstrumentComponent {
   ytm_vencimiento_porcentaje_compra: any;
   ytm_vencimiento_porcentaje_venta: any;
   comision_bolsa_venta: any;
+  consolidado_proyeccion: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -146,6 +147,7 @@ export class BONO implements InstrumentComponent {
       this.instrument_work.proyecciones != ""
     ) {
       this.hasProjections = true;
+      this.consolidado_proyeccion = this.instrument_work.proyecciones.pop();
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -533,6 +535,11 @@ export class BONO implements InstrumentComponent {
 
           // Proyecciones
           this.proyecciones = ans["result"]["proyecciones"];
+          if (this.proyecciones != undefined && this.proyecciones.length > 0) {
+            this.hasProjections = true;
+            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.proyecciones;
+          }
 
           this.operation_result = true;
           this.dataSource.data = this.proyecciones;

+ 38 - 2
src/app/components/instruments/certificados/certificados.component.html

@@ -971,7 +971,7 @@
     </div>
     <br />
     <!-- Tabla de proyecciones del instrumento-->
-    <div class="instrument-calcs">
+    <div *ngIf="hasProjections" class="instrument-calcs">
       <div class="row">
         <div class="col-12">
           <span class="badge badge-success badge-custom"
@@ -987,6 +987,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -994,6 +995,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="fecha_pago">
@@ -1005,6 +1007,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -1015,6 +1018,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -1025,6 +1033,11 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="impuesto">
@@ -1036,10 +1049,14 @@
                     : row.impuesto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{ consolidado_proyeccion.total_impuesto | number: "1.2-4" }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
             <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>            
           </table>
         </div>
       </div>
@@ -1521,6 +1538,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -1528,6 +1546,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <!-- Country Column -->
@@ -1540,6 +1559,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <!-- Country Column -->
@@ -1552,6 +1572,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="ingreso_neto">
@@ -1563,6 +1588,11 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="impuesto">
@@ -1574,10 +1604,16 @@
                     : row.impuesto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_impuesto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
-            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>            
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
         </div>
       </div>

+ 7 - 0
src/app/components/instruments/certificados/certificados.component.ts

@@ -127,6 +127,7 @@ export class CINV implements InstrumentComponent {
   ytm_vencimiento_porcentaje_compra: any;
   ytm_vencimiento_porcentaje_venta: any;
   comision_bolsa_venta: any;
+  consolidado_proyeccion: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -146,6 +147,7 @@ export class CINV implements InstrumentComponent {
       this.instrument_work.proyecciones != ""
     ) {
       this.hasProjections = true;
+      this.consolidado_proyeccion = this.instrument_work.proyecciones.pop();
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -535,6 +537,11 @@ export class CINV implements InstrumentComponent {
 
           // Proyecciones
           this.proyecciones = ans["result"]["proyecciones"];
+          if (this.proyecciones != undefined && this.proyecciones.length > 0) {            
+            this.hasProjections = true;
+            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.proyecciones;
+          }
 
           this.operation_result = true;
           this.dataSource.data = this.proyecciones;

+ 30 - 2
src/app/components/instruments/cete/cete.component.html

@@ -366,7 +366,7 @@
           >
         </div>
 
-        <div class="cete-table-container">
+        <div *ngIf="hasProjections" class="cete-table-container">
           <table mat-table [dataSource]="dataSource" class="example-table">
             <!-- Name Column -->
             <ng-container matColumnDef="posicion">
@@ -374,6 +374,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -381,6 +382,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <!-- Country Column -->
@@ -393,6 +395,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -403,6 +406,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="ingreso_neto">
@@ -414,10 +422,16 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
-            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>            
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
 
           <mat-paginator
@@ -582,6 +596,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -589,6 +604,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <!-- Country Column -->
@@ -601,6 +617,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <!-- Country Column -->
@@ -613,6 +630,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="ingreso_neto">
@@ -624,10 +646,16 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
             <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
 
           <mat-paginator

+ 8 - 0
src/app/components/instruments/cete/cete.component.ts

@@ -95,6 +95,7 @@ export class CETE implements InstrumentComponent {
   dataSource2 = new MatTableDataSource(this.proyecciones);
   hasProjections: boolean;
   fecha_vencimiento: any;
+  consolidado_proyeccion: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -114,6 +115,7 @@ export class CETE implements InstrumentComponent {
         this.instrument_work != undefined)
     ) {
       this.hasProjections = true;
+      this.consolidado_proyeccion = this.instrument_work.proyecciones.pop();
       this.dataSource2.data = this.instrument_work.proyecciones;
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
@@ -291,6 +293,12 @@ export class CETE implements InstrumentComponent {
           this.fecha_vencimiento = ans["result"]["fecha_vencimiento"];
 
           this.dataSource.data = this.proyecciones;
+          this.proyecciones = ans["result"]["proyecciones"];
+          if (this.proyecciones != undefined && this.proyecciones.length > 0) {            
+            this.hasProjections = true;
+            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.proyecciones;
+          }
           this.dataSource.paginator = this.paginator;
           this.dataSource.sort = this.sort;
 

+ 42 - 4
src/app/components/instruments/dap/dap.component.html

@@ -242,7 +242,7 @@
     </div>
     <br />
     <!-- Tabla de proyecciones del instrumento-->
-    <div class="instrument-calcs">
+    <div *ngIf="hasProjections" class="instrument-calcs">
       <div class="row">
         <div class="col-12">
           <span class="badge badge-success badge-custom"
@@ -257,12 +257,14 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <ng-container matColumnDef="plazo">
               <th mat-header-cell *matHeaderCellDef>Plazo</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
-              </td>
+              </td>              
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="fecha_pago">
@@ -274,6 +276,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -285,6 +288,11 @@
                     : (row.ingreso_bruto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
@@ -296,6 +304,11 @@
                     : (row.renta | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_renta | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -307,10 +320,16 @@
                     : (row.ingreso_neto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
-            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>            
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
 
           <mat-paginator
@@ -452,12 +471,14 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <ng-container matColumnDef="plazo">
               <th mat-header-cell *matHeaderCellDef>Plazo</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="fecha_pago">
@@ -469,6 +490,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -480,6 +502,11 @@
                     : (row.ingreso_bruto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
@@ -491,6 +518,11 @@
                     : (row.renta | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_renta | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -502,10 +534,16 @@
                     : (row.ingreso_neto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
-            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>            
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
 
           <mat-paginator

+ 7 - 0
src/app/components/instruments/dap/dap.component.ts

@@ -93,6 +93,7 @@ export class DAP implements InstrumentComponent {
   hasProjections: boolean;
   numero_certificado: any;
   fecha_vencimiento: any;
+  consolidado_proyeccion: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -112,6 +113,7 @@ export class DAP implements InstrumentComponent {
         this.instrument_work != undefined)
     ) {
       this.hasProjections = true;
+      this.consolidado_proyeccion = this.instrument_work.proyecciones.pop();
       this.dataSource2.data = this.instrument_work.proyecciones;
       this.dataSource2.paginator = this.paginator;
       this.dataSource2.sort = this.sort;
@@ -225,6 +227,11 @@ export class DAP implements InstrumentComponent {
           this.proyecciones = ans["result"]["proyecciones"];
           this.numero_certificado = ans["result"]["numero_certificado"];
           this.fecha_vencimiento = ans["result"]["fecha_vencimiento"];
+          if (this.proyecciones != undefined && this.proyecciones.length > 0) {            
+            this.hasProjections = true;
+            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.proyecciones;
+          }
 
           this.dataSource.data = this.proyecciones;
           this.dataSource.paginator = this.paginator;

+ 34 - 3
src/app/components/instruments/eurobonos/eurobonos.component.html

@@ -971,7 +971,7 @@
     </div>
     <br />
     <!-- Tabla de proyecciones del instrumento-->
-    <div class="instrument-calcs">
+    <div *ngIf="hasProjections" class="instrument-calcs">
       <div class="row">
         <div class="col-12">
           <span class="badge badge-success badge-custom"
@@ -986,7 +986,8 @@
               <th mat-header-cell *matHeaderCellDef>#</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
-              </td>
+              </td>              
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -994,6 +995,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="fecha_pago">
@@ -1005,6 +1007,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -1015,6 +1018,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -1025,6 +1033,11 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="impuesto">
@@ -1036,10 +1049,14 @@
                     : row.impuesto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{ consolidado_proyeccion.total_impuesto | number: "1.2-4" }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
             <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
         </div>
       </div>
@@ -1521,6 +1538,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -1528,6 +1546,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <!-- Country Column -->
@@ -1540,6 +1559,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <!-- Country Column -->
@@ -1552,6 +1572,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="ingreso_neto">
@@ -1563,6 +1588,11 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="impuesto">
@@ -1577,7 +1607,8 @@
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
-            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>            
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
         </div>
       </div>

+ 8 - 1
src/app/components/instruments/eurobonos/eurobonos.component.ts

@@ -127,6 +127,7 @@ export class EURB implements InstrumentComponent {
   ytm_vencimiento_porcentaje_compra: any;
   ytm_vencimiento_porcentaje_venta: any;
   comision_bolsa_venta: any;
+  consolidado_proyeccion: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -145,7 +146,8 @@ export class EURB implements InstrumentComponent {
       this.instrument_work != undefined &&
       this.instrument_work.proyecciones != ""
     ) {
-      this.hasProjections = true;
+      this.hasProjections = true;      
+      this.consolidado_proyeccion = this.instrument_work.proyecciones.pop();
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -534,6 +536,11 @@ export class EURB implements InstrumentComponent {
 
           // Proyecciones
           this.proyecciones = ans["result"]["proyecciones"];
+          if (this.proyecciones != undefined && this.proyecciones.length > 0) {            
+            this.hasProjections = true;
+            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.proyecciones;
+          }
 
           this.operation_result = true;
           this.dataSource.data = this.proyecciones;

+ 59 - 2
src/app/components/instruments/fondos/fondos.component.html

@@ -420,7 +420,7 @@
     </div>
     <br />
     <!-- Tabla de proyecciones del instrumento-->
-    <div class="instrument-calcs">
+    <div *ngIf="hasProjections" class="instrument-calcs">
       <div class="row">
         <div class="col-12">
           <span class="badge badge-success badge-custom"
@@ -436,13 +436,14 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
               <th mat-header-cell *matHeaderCellDef>Plazo</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
-              </td>
+              </td><td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="fecha_pago">
@@ -454,6 +455,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -464,6 +466,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -474,6 +481,11 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="dividendo_porcentaje">
               <th mat-header-cell *matHeaderCellDef>Dividendo (%)</th>
@@ -485,6 +497,11 @@
                     : row.dividendo_porcentaje
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_dividendo_porcentaje | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="rendimiento_porcentaje">
               <th mat-header-cell *matHeaderCellDef>Rendimiento (%)</th>
@@ -496,6 +513,11 @@
                     : row.rendimiento_porcentaje
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_rendimiento_porcentaje | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="rendimiento">
               <th mat-header-cell *matHeaderCellDef>Rendimiento ($)</th>
@@ -506,10 +528,16 @@
                     : row.rendimiento
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_rendimiento | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
             <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
         </div>
       </div>
@@ -669,6 +697,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -676,6 +705,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="fecha_pago">
@@ -687,6 +717,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -697,6 +728,11 @@
                     : row.ingreso_bruto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -707,6 +743,11 @@
                     : row.ingreso_neto
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="dividendo_porcentaje">
               <th mat-header-cell *matHeaderCellDef>Dividendo (%)</th>
@@ -718,6 +759,11 @@
                     : row.dividendo_porcentaje
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_dividendo_porcentaje | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="rendimiento_porcentaje">
               <th mat-header-cell *matHeaderCellDef>Rendimiento (%)</th>
@@ -729,6 +775,11 @@
                     : row.rendimiento_porcentaje
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_rendimiento_porcentaje | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="rendimiento">
               <th mat-header-cell *matHeaderCellDef>Rendimiento ($)</th>
@@ -738,11 +789,17 @@
                     ? "-"
                     : row.rendimiento
                 }}
+              </td>              
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_rendimiento | number: "1.2-4"
+                }}
               </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
             <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
         </div>
       </div>

+ 7 - 0
src/app/components/instruments/fondos/fondos.component.ts

@@ -108,6 +108,7 @@ export class FINV implements InstrumentComponent {
   dividendo_porcentaje: any;
   fecha_operacion: any;
   fecha_liquidacion: any;
+  consolidado_proyeccion: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -127,6 +128,7 @@ export class FINV implements InstrumentComponent {
       this.instrument_work.proyecciones != ""
     ) {
       this.hasProjections = true;
+      this.consolidado_proyeccion = this.instrument_work.proyecciones.pop();
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -315,6 +317,11 @@ export class FINV implements InstrumentComponent {
 
           // Proyecciones
           this.proyecciones = ans["result"]["proyecciones"];
+          if (this.proyecciones != undefined && this.proyecciones.length > 0) {            
+            this.hasProjections = true;
+            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.proyecciones;
+          }
 
           this.operation_result = true;
           this.dataSource.data = this.proyecciones;

+ 1 - 0
src/app/components/instruments/pbur/pbur.component.html

@@ -526,6 +526,7 @@
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
             <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
 
           <mat-paginator

+ 81 - 3
src/app/components/instruments/titulos/titulos.component.html

@@ -1026,7 +1026,7 @@
     </div>
     <br />
     <!-- Tabla de proyecciones del instrumento-->
-    <div class="instrument-calcs">
+    <div *ngIf="hasProjections" class="instrument-calcs">
       <div class="row">
         <div class="col-12">
           <span class="badge badge-success badge-custom"
@@ -1042,6 +1042,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -1049,6 +1050,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="fecha_pago">
@@ -1060,6 +1062,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="cuota">
@@ -1071,6 +1074,11 @@
                     : (row.cuota | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_cuota | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="amortizacion_porcentaje">
               <th mat-header-cell *matHeaderCellDef>Porcentaje amortización</th>
@@ -1082,6 +1090,11 @@
                     : (row.amortizacion_porcentaje | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_amortizacion_porcentaje | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="amortizacion_capital">
               <th mat-header-cell *matHeaderCellDef>Amortización capital</th>
@@ -1093,6 +1106,11 @@
                     : (row.amortizacion_capital | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_amortizacion_capital | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -1103,6 +1121,11 @@
                     : (row.ingreso_bruto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="impuesto">
               <th mat-header-cell *matHeaderCellDef>Impuesto</th>
@@ -1113,6 +1136,11 @@
                     : (row.impuesto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_impuesto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -1123,6 +1151,11 @@
                     : (row.ingreso_neto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="saldo">
@@ -1134,10 +1167,16 @@
                     : (row.saldo | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_saldo | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
-            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>            
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
 
           <mat-paginator
@@ -1627,6 +1666,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>TOTAL</td>
             </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="plazo">
@@ -1634,6 +1674,7 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.plazo }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="fecha_pago">
@@ -1645,6 +1686,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="cuota">
@@ -1656,6 +1698,11 @@
                     : (row.cuota | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_cuota | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="amortizacion_porcentaje">
               <th mat-header-cell *matHeaderCellDef>Porcentaje amortización</th>
@@ -1667,6 +1714,11 @@
                     : (row.amortizacion_porcentaje | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_amortizacion_porcentaje | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="amortizacion_capital">
               <th mat-header-cell *matHeaderCellDef>Amortización capital</th>
@@ -1678,6 +1730,11 @@
                     : (row.amortizacion_capital | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_amortizacion_capital | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
@@ -1688,6 +1745,11 @@
                     : (row.ingreso_bruto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="impuesto">
               <th mat-header-cell *matHeaderCellDef>Impuesto</th>
@@ -1698,6 +1760,11 @@
                     : (row.impuesto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_impuesto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -1708,6 +1775,11 @@
                     : (row.ingreso_neto | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <ng-container matColumnDef="saldo">
@@ -1719,10 +1791,16 @@
                     : (row.saldo | number: "1.2-4")
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_saldo | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
-            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
+            <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>            
+            <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
           </table>
         </div>
       </div>

+ 15 - 0
src/app/components/instruments/titulos/titulos.component.ts

@@ -136,6 +136,7 @@ export class TIT implements InstrumentComponent {
   ytm_vencimiento_porcentaje_compra: any;
   ytm_vencimiento_porcentaje_venta: any;
   comision_bolsa_venta: any;
+  consolidado_proyeccion: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -155,6 +156,7 @@ export class TIT implements InstrumentComponent {
       this.instrument_work.proyecciones != ""
     ) {
       this.hasProjections = true;
+      this.consolidado_proyeccion = this.instrument_work.proyecciones.pop();
       this.operation_results_work = this.instrument_work["resultado_operacion"];
 
       if (this.instrument_work["instrumento"] != undefined) {
@@ -179,6 +181,14 @@ export class TIT implements InstrumentComponent {
     }
 
     this.investmentProposalForm = this.formBuilder.group({
+      costo_cedeval: [
+        this.instrument_exists ? "" : this.instrument_work.costo_cedeval,
+        [
+          Validators.required,
+          Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
+        ]
+      ],
+      
       costo_transferencia: [
         this.instrument_exists ? "" : this.instrument_work.costo_transferencia,
         [
@@ -594,6 +604,11 @@ export class TIT implements InstrumentComponent {
 
           // Proyecciones
           this.proyecciones = ans["result"]["proyecciones"];
+          if (this.proyecciones != undefined && this.proyecciones.length > 0) {            
+            this.hasProjections = true;
+            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.proyecciones;
+          }
 
           this.dataSource.data = this.proyecciones;
           this.dataSource2.data = this.proyecciones;