Bladeren bron

Consolidado total en proyecciones de instrumentos

Oscar José Nuñez Chávez 5 jaren geleden
bovenliggende
commit
01480aea78

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

@@ -419,12 +419,14 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </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">
@@ -436,6 +438,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="ingreso_bruto">
@@ -447,6 +450,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="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -457,36 +465,63 @@
                     : (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="costo_cedeval">
               <th mat-header-cell *matHeaderCellDef>Costo CEDEVAL</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_cedeval | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_costo_cedeval | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
                 {{ 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="costo_transferencia">
               <th mat-header-cell *matHeaderCellDef>Costo transferencia</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_transferencia | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_costo_transferencia
+                    | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="costo_banco">
               <th mat-header-cell *matHeaderCellDef>Costo banco</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_banco | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{ consolidado_proyeccion.total_costo_banco | number: "1.2-4" }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="otros_costos">
               <th mat-header-cell *matHeaderCellDef>Otros costos</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.otros_costos | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_otros_costos | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
 
             <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
@@ -670,12 +705,14 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </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">
@@ -687,6 +724,7 @@
                     : row.fecha_pago
                 }}
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="ingreso_bruto">
@@ -698,6 +736,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="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -708,40 +751,68 @@
                     : (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="costo_cedeval">
               <th mat-header-cell *matHeaderCellDef>Costo CEDEVAL</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_cedeval | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_costo_cedeval | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
                 {{ 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="costo_transferencia">
               <th mat-header-cell *matHeaderCellDef>Costo transferencia</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_transferencia | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_costo_transferencia
+                    | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="costo_banco">
               <th mat-header-cell *matHeaderCellDef>Costo banco</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_banco | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{ consolidado_proyeccion.total_costo_banco | number: "1.2-4" }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="otros_costos">
               <th mat-header-cell *matHeaderCellDef>Otros costos</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.otros_costos | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_otros_costos | 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

+ 9 - 1
src/app/components/instruments/pbur/pbur.component.ts

@@ -92,6 +92,8 @@ export class PBUR implements InstrumentComponent {
 
   dataSource = new MatTableDataSource(this.proyecciones);
   dataSource2 = new MatTableDataSource(this.proyecciones);
+  consolidado_proyeccion: any;
+
   @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
   @ViewChild(MatSort, { static: true }) sort: MatSort;
   fecha_vencimiento: any;
@@ -113,6 +115,7 @@ export class PBUR implements InstrumentComponent {
       this.instrument_work.proyecciones != 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;
@@ -298,8 +301,13 @@ export class PBUR implements InstrumentComponent {
           this.comision_casa = ans["result"]["comision_casa"];
           this.interes_acumulado = ans["result"]["interes_acumulado"];
           this.fecha_inicio_vigencia = ans["result"]["fecha_inicio_vigencia"];
-          this.proyecciones = ans["result"]["proyecciones"];
           this.fecha_vencimiento = ans["result"]["fecha_vencimiento"];
+          this.proyecciones = ans["result"]["proyecciones"];
+
+          if (this.proyecciones != undefined && this.proyecciones.length > 0) {
+            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.proyecciones;
+          }
 
           if (this.f.valor_par.value == true) {
             this.hasProjections = true;

+ 75 - 6
src/app/components/instruments/vcn/vcn.component.html

@@ -389,9 +389,7 @@
         </div>
         <div class="col-sm-6">
           <h4>Precio porcentaje:</h4>
-          <div class="field">
-            {{ precio_porcentaje | number: "1.2-4" }}
-          </div>
+          <div class="field">{{ precio_porcentaje | number: "1.2-4" }} %</div>
         </div>
         <div class="col-sm-6">
           <h4>Rendimiento neto:</h4>
@@ -434,12 +432,14 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </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">
@@ -451,8 +451,8 @@
                     : 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>
               <td mat-cell *matCellDef="let row">
@@ -462,6 +462,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="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -472,44 +477,73 @@
                     : (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="costo_cedeval">
               <th mat-header-cell *matHeaderCellDef>Costo CEDEVAL</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_cedeval | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_costo_cedeval | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
                 {{ 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="costo_transferencia">
               <th mat-header-cell *matHeaderCellDef>Costo transferencia</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_transferencia | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_costo_transferencia
+                    | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="costo_banco">
               <th mat-header-cell *matHeaderCellDef>Costo banco</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_banco | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{ consolidado_proyeccion.total_costo_banco | number: "1.2-4" }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="otros_costos">
               <th mat-header-cell *matHeaderCellDef>Otros costos</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.otros_costos | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_otros_costos | 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
-            [pageSizeOptions]="[10, 15, 25]"
+            [pageSizeOptions]="[5, 10, 25, dataSource2.data.length]"
+            [length]="dataSource2.data.length"
             [pageIndex]="0"
             [pageSize]="10"
           ></mat-paginator>
@@ -684,12 +718,14 @@
               <td mat-cell *matCellDef="let row">
                 {{ row.posicion }}
               </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">
@@ -701,8 +737,8 @@
                     : 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>
               <td mat-cell *matCellDef="let row">
@@ -712,6 +748,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="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -722,40 +763,68 @@
                     : (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="costo_cedeval">
               <th mat-header-cell *matHeaderCellDef>Costo CEDEVAL</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_cedeval | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_costo_cedeval | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
                 {{ 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="costo_transferencia">
               <th mat-header-cell *matHeaderCellDef>Costo transferencia</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_transferencia | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_costo_transferencia
+                    | number: "1.2-4"
+                }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="costo_banco">
               <th mat-header-cell *matHeaderCellDef>Costo banco</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.costo_banco | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{ consolidado_proyeccion.total_costo_banco | number: "1.2-4" }}
+              </td>
             </ng-container>
             <ng-container matColumnDef="otros_costos">
               <th mat-header-cell *matHeaderCellDef>Otros costos</th>
               <td mat-cell *matCellDef="let row">
                 {{ row.otros_costos | number: "1.2-4" }}
               </td>
+              <td mat-footer-cell *matFooterCellDef>
+                {{
+                  consolidado_proyeccion.total_otros_costos | 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

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

@@ -94,6 +94,7 @@ export class VCN implements InstrumentComponent {
   @ViewChild(MatSort, { static: true }) sort: MatSort;
   dataSource = new MatTableDataSource(this.proyecciones);
   dataSource2 = new MatTableDataSource(this.proyecciones);
+  consolidado_proyeccion: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -113,6 +114,7 @@ export class VCN implements InstrumentComponent {
       this.instrument_work.proyecciones != 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;
@@ -311,6 +313,11 @@ export class VCN implements InstrumentComponent {
           this.fecha_inicio_vigencia = ans["result"]["fecha_inicio_vigencia"];
           this.proyecciones = ans["result"]["proyecciones"];
 
+          if (this.proyecciones != undefined && this.proyecciones.length > 0) {
+            this.consolidado_proyeccion = this.proyecciones.pop();
+            this.proyecciones;
+          }
+
           if (this.f.valor_par.value == true) {
             this.hasProjections = true;
           } else {