Selaa lähdekoodia

Merge branch 'development' of https://git.grupomerelec.com/onunez/frontend-inversiones into feature-formato

ahernandez 5 vuotta sitten
vanhempi
commit
c291651cad
23 muutettua tiedostoa jossa 2153 lisäystä ja 463 poistoa
  1. 103 29
      src/app/components/instruments/bonos/bonos.component.html
  2. 132 113
      src/app/components/instruments/bonos/bonos.component.ts
  3. 122 26
      src/app/components/instruments/certificados/certificados.component.html
  4. 143 115
      src/app/components/instruments/certificados/certificados.component.ts
  5. 124 28
      src/app/components/instruments/eurobonos/eurobonos.component.html
  6. 143 114
      src/app/components/instruments/eurobonos/eurobonos.component.ts
  7. 2 2
      src/app/components/investment-proposals/approve/approve.component.ts
  8. 18 10
      src/app/components/investment-proposals/investment-proposals.component.ts
  9. 2 2
      src/app/components/investment-proposals/payment-approval/payment-approval.component.ts
  10. 2 3
      src/app/components/investment-proposals/payment-info/payment-info.component.html
  11. 33 17
      src/app/components/investment-proposals/payment-info/payment-info.component.ts
  12. 2 2
      src/app/components/investment-proposals/payment-requirement/payment-requirement.component.ts
  13. 3 0
      src/app/components/investment-proposals/proposal-detail/proposal-detail.component.ts
  14. 2 2
      src/app/components/investment-proposals/review/review.component.ts
  15. 360 0
      src/app/components/investments/costs/pemp/pemp.costs.component.html
  16. 225 0
      src/app/components/investments/costs/pemp/pemp.costs.component.ts
  17. 487 0
      src/app/components/investments/costs/pper/pper.costs.component.html
  18. 231 0
      src/app/components/investments/costs/pper/pper.costs.component.ts
  19. 2 0
      src/app/components/investments/investments.component.ts
  20. 4 0
      src/app/layouts/admin/admin.module.ts
  21. 10 0
      src/app/layouts/admin/admin.routing.ts
  22. 2 0
      src/app/models/investment-proposal-form.ts
  23. 1 0
      src/app/services/instrument-calculations.service.ts

+ 103 - 29
src/app/components/instruments/bonos/bonos.component.html

@@ -19,16 +19,17 @@
           <option
           <option
             *ngFor="let item of ejecuciones"
             *ngFor="let item of ejecuciones"
             [value]="item.codigo"
             [value]="item.codigo"
-            [selected]="item.codigo == ejecucion"
+            [selected]="item.codigo == tipoEjecucion"
           >
           >
             {{ item.nombre }}</option
             {{ item.nombre }}</option
           >
           >
         </select>
         </select>
       </div>
       </div>
-
       <br />
       <br />
-
-      <div class=" col-md-6 col-sm-12 border border-light">
+    </div>
+    <br />
+    <div class="row">
+      <div class=" col-md-12 col-sm-12 border border-light">
         <div class="row no-gutters">
         <div class="row no-gutters">
           <!-- Valor nominal compra -->
           <!-- Valor nominal compra -->
 
 
@@ -445,8 +446,13 @@
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
-
-      <div class=" col-md-6 col-sm-12 border border-light">
+    </div>
+    <br />
+    <div class="row">
+      <div
+        class=" col-md-12 col-sm-12 border border-light"
+        *ngIf="tipoEjecucion == 1"
+      >
         <div class="row no-gutters">
         <div class="row no-gutters">
           <div class="col-12">
           <div class="col-12">
             <h5>Venta</h5>
             <h5>Venta</h5>
@@ -874,7 +880,9 @@
             {{ fecha_inicio_vigencia }}
             {{ fecha_inicio_vigencia }}
           </div>
           </div>
         </div>
         </div>
+      </div>
 
 
+      <div class="row" *ngIf="tipoEjecucion == 1">
         <div class="col-12">
         <div class="col-12">
           <h3>
           <h3>
             Instrumento de venta
             Instrumento de venta
@@ -950,71 +958,113 @@
             $USD {{ valor_transado_venta | number: "1.2-4" }}
             $USD {{ valor_transado_venta | number: "1.2-4" }}
           </div>
           </div>
         </div>
         </div>
-
+      </div>
+      <div class="row">
         <div class="row align-container" *ngIf="operation_result">
         <div class="row align-container" *ngIf="operation_result">
           <div class="col-12">
           <div class="col-12">
             <h3>
             <h3>
               Resultado de la operación
               Resultado de la operación
             </h3>
             </h3>
           </div>
           </div>
+
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Monto a recibir:</h4>
-            <div class="field">$USD {{ monto_recibir | number: "1.2-4" }}</div>
+            <h4>Valor nominal compra:</h4>
+            <div class="field">
+              $USD{{ operation_results_work.valor_transado_compra }}
+            </div>
           </div>
           </div>
+
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Días tenencia total:</h4>
             <h4>Días tenencia total:</h4>
             <div class="field">
             <div class="field">
-              {{ dias_tenencia_total }}
+              {{ operation_results_work.dias_tenencia_total }}
             </div>
             </div>
           </div>
           </div>
+
+          <div class="col-sm-4">
+            <h4>Precio compra:</h4>
+            <div class="field">
+              {{ operation_results_work.precio_compra }}
+            </div>
+          </div>
+
+          <div class="col-sm-4">
+            <h4>Precio venta:</h4>
+            <div class="field">
+              {{ operation_results_work.precio_venta }}
+            </div>
+          </div>
+
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Ingresos intereses:</h4>
             <h4>Ingresos intereses:</h4>
             <div class="field">
             <div class="field">
-              $USD {{ ingresos_intereses | number: "1.2-4" }}
+              $USD
+              {{ operation_results_work.ingresos_intereses | number: "1.2-4" }}
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Costos totales:</h4>
             <h4>Costos totales:</h4>
-            <div class="field">$USD {{ costos_totales | number: "1.2-4" }}</div>
+            <div class="field">
+              $USD {{ operation_results_work.costos_totales | number: "1.2-4" }}
+            </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Ganancia / Pérdida total:</h4>
+            <h4>Ganancia o pérdida total:</h4>
             <div class="field">
             <div class="field">
-              $USD {{ ganancia_perdida_total | number: "1.2-4" }}
+              $USD
+              {{
+                operation_results_work.ganancia_perdida_total_neto
+                  | number: "1.2-4"
+              }}
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Ganancia / Pérdida de capital:</h4>
+            <h4>Ganancia o pérdida de capital:</h4>
             <div class="field">
             <div class="field">
-              {{ ganancia_perdida_capital_porcentaje | number: "1.2-4" }}%
+              {{
+                operation_results_work.ganancia_perdida_capital_porcentaje
+                  | number: "1.2-4"
+              }}%
             </div>
             </div>
           </div>
           </div>
 
 
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Interés (%):</h4>
             <h4>Interés (%):</h4>
             <div class="field">
             <div class="field">
-              {{ intereses_porcentaje | number: "1.2-4" }} %
+              {{
+                operation_results_work.intereses_porcentaje | number: "1.2-4"
+              }}
+              %
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Interés neto antes de impuesto (%):</h4>
             <h4>Interés neto antes de impuesto (%):</h4>
             <div class="field">
             <div class="field">
-              {{ neto_antes_impuesto_porcentaje | number: "1.2-4" }}
+              {{
+                operation_results_work.neto_antes_renta_porcentaje
+                  | number: "1.2-4"
+              }}
               %
               %
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Interés neto después de impuesto (%):</h4>
             <h4>Interés neto después de impuesto (%):</h4>
             <div class="field">
             <div class="field">
-              {{ neto_despues_impuesto_porcentaje | number: "1.2-4" }}
+              {{
+                operation_results_work.neto_despues_renta_porcentaje
+                  | number: "1.2-4"
+              }}
               %
               %
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Total de ingresos recibidos:</h4>
+            <h4>Total Ingresos Recibidos:</h4>
             <div class="field">
             <div class="field">
               $USD
               $USD
-              {{ total_ingresos_recibidos | number: "1.2-4" }}
+              {{
+                operation_results_work.total_ingresos_recibidos
+                  | number: "1.2-4"
+              }}
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
@@ -1331,8 +1381,7 @@
       </div>
       </div>
     </div>
     </div>
 
 
-    <!--
-    <div class="row">
+    <div class="row" *ngIf="tipoEjecucion == 1">
       <div class="col-12">
       <div class="col-12">
         <h3>
         <h3>
           Instrumento de venta
           Instrumento de venta
@@ -1511,7 +1560,7 @@
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
         <h4>Valor nominal compra:</h4>
         <h4>Valor nominal compra:</h4>
         <div class="field">
         <div class="field">
-          $USD{{ operation_results_work.valor_nominal_compra }}
+          $USD{{ operation_results_work.valor_transado_compra }}
         </div>
         </div>
       </div>
       </div>
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
@@ -1520,6 +1569,21 @@
           {{ operation_results_work.dias_tenencia_total }}
           {{ operation_results_work.dias_tenencia_total }}
         </div>
         </div>
       </div>
       </div>
+
+      <div class="col-lg-3 col-md-4 col-sm-6">
+        <h4>Precio compra:</h4>
+        <div class="field">
+          {{ operation_results_work.precio_compra }}
+        </div>
+      </div>
+
+      <div class="col-lg-3 col-md-4 col-sm-6">
+        <h4>Precio venta:</h4>
+        <div class="field">
+          {{ operation_results_work.precio_venta }}
+        </div>
+      </div>
+
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
         <h4>Ingresos intereses:</h4>
         <h4>Ingresos intereses:</h4>
         <div class="field">
         <div class="field">
@@ -1536,7 +1600,9 @@
         <h4>Ganancia o pérdida total:</h4>
         <h4>Ganancia o pérdida total:</h4>
         <div class="field">
         <div class="field">
           $USD
           $USD
-          {{ operation_results_work.ganancia_perdida_total | number: "1.2-4" }}
+          {{
+            operation_results_work.ganancia_perdida_total_neto | number: "1.2-4"
+          }}
         </div>
         </div>
       </div>
       </div>
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
@@ -1559,8 +1625,7 @@
         <h4>Interés neto antes de impuesto (%):</h4>
         <h4>Interés neto antes de impuesto (%):</h4>
         <div class="field">
         <div class="field">
           {{
           {{
-            operation_results_work.neto_antes_impuesto_porcentaje
-              | number: "1.2-4"
+            operation_results_work.neto_antes_renta_porcentaje | number: "1.2-4"
           }}
           }}
           %
           %
         </div>
         </div>
@@ -1569,14 +1634,23 @@
         <h4>Interés neto después de impuesto (%):</h4>
         <h4>Interés neto después de impuesto (%):</h4>
         <div class="field">
         <div class="field">
           {{
           {{
-            operation_results_work.neto_despues_impuesto_porcentaje
+            operation_results_work.neto_despues_renta_porcentaje
               | number: "1.2-4"
               | number: "1.2-4"
           }}
           }}
           %
           %
         </div>
         </div>
       </div>
       </div>
+      <div class="col-lg-3 col-md-4 col-sm-6">
+        <h4>Total Ingresos Recibidos:</h4>
+        <div class="field">
+          $USD
+          {{
+            operation_results_work.total_ingresos_recibidos | number: "1.2-4"
+          }}
+        </div>
+      </div>
     </div>
     </div>
-  -->
+
     <br />
     <br />
     <div *ngIf="hasProjections" class="instrument-calcs-summary">
     <div *ngIf="hasProjections" class="instrument-calcs-summary">
       <div class="row">
       <div class="row">

+ 132 - 113
src/app/components/instruments/bonos/bonos.component.ts

@@ -128,12 +128,11 @@ export class BONO implements InstrumentComponent {
   ytm_vencimiento_porcentaje_venta: any;
   ytm_vencimiento_porcentaje_venta: any;
   comision_bolsa_venta: any;
   comision_bolsa_venta: any;
   consolidado_proyeccion: any;
   consolidado_proyeccion: any;
-  ejecucion: boolean = false;
   ejecuciones = [
   ejecuciones = [
     { codigo: 1, nombre: "Completa" },
     { codigo: 1, nombre: "Completa" },
     { codigo: 0, nombre: "Parcial" }
     { codigo: 0, nombre: "Parcial" }
   ];
   ];
-  tipoEjecucion: number;
+  tipoEjecucion: number = 0;
 
 
   constructor(
   constructor(
     private formBuilder: FormBuilder,
     private formBuilder: FormBuilder,
@@ -144,7 +143,6 @@ export class BONO implements InstrumentComponent {
     public datepipe: DatePipe
     public datepipe: DatePipe
   ) {
   ) {
     this.instrument_work = this.formDataService.getWork();
     this.instrument_work = this.formDataService.getWork();
-
     this.instrument_exists = this.instrument_work == undefined;
     this.instrument_exists = this.instrument_work == undefined;
     this.general = this.formDataService.getGeneralInfo();
     this.general = this.formDataService.getGeneralInfo();
 
 
@@ -177,8 +175,14 @@ export class BONO implements InstrumentComponent {
       this.operation_result = true;
       this.operation_result = true;
     }
     }
 
 
+    if (+this.instrument_work["valor_nominal_venta"] > 0) {
+      this.tipoEjecucion = 1;
+    }
+    console.log("EJECUCION");
+    console.log(this.tipoEjecucion);
+
     this.investmentProposalForm = this.formBuilder.group({
     this.investmentProposalForm = this.formBuilder.group({
-      ejecucion: [this.instrument_exists ? "" : this.ejecucion],
+      ejecucion: [this.instrument_exists ? "" : this.tipoEjecucion],
 
 
       renta_porcentaje: [
       renta_porcentaje: [
         this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
         this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
@@ -418,6 +422,7 @@ export class BONO implements InstrumentComponent {
           id_periodicidad: +this.general.periodicidad
           id_periodicidad: +this.general.periodicidad
         },
         },
         {
         {
+          completo: this.tipoEjecucion,
           renta_porcentaje: +this.f.renta_porcentaje.value,
           renta_porcentaje: +this.f.renta_porcentaje.value,
           costo_cedeval: +this.f.costo_cedeval.value,
           costo_cedeval: +this.f.costo_cedeval.value,
           costo_transferencia: +this.f.costo_transferencia.value,
           costo_transferencia: +this.f.costo_transferencia.value,
@@ -439,19 +444,31 @@ export class BONO implements InstrumentComponent {
           comision_bolsa_porcentaje_venta: this.f
           comision_bolsa_porcentaje_venta: this.f
             .comision_bolsa_porcentaje_venta.value,
             .comision_bolsa_porcentaje_venta.value,
 
 
-          fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
-            .singleDate.formatted,
-          fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
-            .singleDate.formatted,
-          fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
-            .singleDate.formatted,
-
-          fecha_vencimiento_venta: this.f.fecha_vencimiento_venta.value
-            .singleDate.formatted,
-          fecha_ultima_cupon_venta: this.f.fecha_ultima_cupon_venta.value
-            .singleDate.formatted,
-          fecha_liquidacion_venta: this.f.fecha_liquidacion_venta.value
-            .singleDate.formatted
+          fecha_vencimiento_compra:
+            this.f.fecha_vencimiento_compra.value == ""
+              ? ""
+              : this.f.fecha_vencimiento_compra.value.singleDate.formatted,
+          fecha_ultima_cupon_compra:
+            this.f.fecha_ultima_cupon_compra.value == ""
+              ? ""
+              : this.f.fecha_ultima_cupon_compra.value.singleDate.formatted,
+          fecha_liquidacion_compra:
+            this.f.fecha_liquidacion_compra.value == ""
+              ? ""
+              : this.f.fecha_liquidacion_compra.value.singleDate.formatted,
+
+          fecha_vencimiento_venta:
+            this.f.fecha_vencimiento_venta.value == ""
+              ? ""
+              : this.f.fecha_vencimiento_venta.value.singleDate.formatted,
+          fecha_ultima_cupon_venta:
+            this.f.fecha_ultima_cupon_venta.value == ""
+              ? ""
+              : this.f.fecha_ultima_cupon_venta.value.singleDate.formatted,
+          fecha_liquidacion_venta:
+            this.f.fecha_liquidacion_venta.value == ""
+              ? ""
+              : this.f.fecha_liquidacion_venta.value.singleDate.formatted
         }
         }
       )
       )
       .subscribe(
       .subscribe(
@@ -492,64 +509,43 @@ export class BONO implements InstrumentComponent {
             ans["result"]["instrumento_compra"]["fecha_inicio_vigencia"];
             ans["result"]["instrumento_compra"]["fecha_inicio_vigencia"];
 
 
           // Instrumento de venta
           // Instrumento de venta
-          this.comision_casa_venta =
-            ans["result"]["instrumento_venta"]["comision_casa_venta"];
-          this.comision_bolsa_venta =
-            ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
-          this.fecha_siguiente_cupon_venta =
-            ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
-          this.dias_vencimiento_venta =
-            ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
-          this.dias_acumulados_venta =
-            ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
-          this.ytm_vencimiento_comision_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "ytm_vencimiento_comision_porcentaje_venta"
-            ];
-          this.ytm_vencimiento_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "ytm_vencimiento_porcentaje_venta"
-            ];
-          this.interes_acumulado_venta =
-            ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
-          this.interes_acumulado_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "interes_acumulado_porcentaje_venta"
-            ];
-          this.precio_sucio_porcentaje_venta =
-            ans["result"]["instrumento_venta"]["precio_sucio_porcentaje_venta"];
-          this.valor_transado_venta =
-            ans["result"]["instrumento_venta"]["valor_transado_venta"];
-          this.monto_recibir =
-            ans["result"]["instrumento_venta"]["monto_recibir"];
-
-          // Resultado de la operacion
-          this.dias_tenencia_total =
-            ans["result"]["resultado_operacion"]["dias_tenencia_total"];
-          this.ganancia_perdida_capital =
-            ans["result"]["resultado_operacion"]["ganancia_perdida_capital"];
-          this.ingresos_intereses =
-            ans["result"]["resultado_operacion"]["ingresos_intereses"];
-          this.costos_totales =
-            ans["result"]["resultado_operacion"]["costos_totales"];
-          this.ganancia_perdida_total =
-            ans["result"]["resultado_operacion"]["ganancia_perdida_total"];
-          this.ganancia_perdida_capital_porcentaje =
-            ans["result"]["resultado_operacion"][
-              "ganancia_perdida_capital_porcentaje"
-            ];
-          this.intereses_porcentaje =
-            ans["result"]["resultado_operacion"]["intereses_porcentaje"];
-          this.neto_antes_impuesto_porcentaje =
-            ans["result"]["resultado_operacion"][
-              "neto_antes_impuesto_porcentaje"
-            ];
-          this.neto_despues_impuesto_porcentaje =
-            ans["result"]["resultado_operacion"][
-              "neto_despues_impuesto_porcentaje"
-            ];
-          this.total_ingresos_recibidos =
-            ans["result"]["resultado_operacion"]["total_ingresos_recibidos"];
+          if (this.tipoEjecucion == 1) {
+            this.comision_casa_venta =
+              ans["result"]["instrumento_venta"]["comision_casa_venta"];
+            this.comision_bolsa_venta =
+              ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
+            this.fecha_siguiente_cupon_venta =
+              ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
+            this.dias_vencimiento_venta =
+              ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
+            this.dias_acumulados_venta =
+              ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
+            this.ytm_vencimiento_comision_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "ytm_vencimiento_comision_porcentaje_venta"
+              ];
+            this.ytm_vencimiento_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "ytm_vencimiento_porcentaje_venta"
+              ];
+            this.interes_acumulado_venta =
+              ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
+            this.interes_acumulado_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "interes_acumulado_porcentaje_venta"
+              ];
+            this.precio_sucio_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "precio_sucio_porcentaje_venta"
+              ];
+            this.valor_transado_venta =
+              ans["result"]["instrumento_venta"]["valor_transado_venta"];
+            this.monto_recibir =
+              ans["result"]["instrumento_venta"]["monto_recibir"];
+
+            this.operation_results_work = ans["result"]["resultado_operacion"];
+            this.operation_result = true;
+          }
 
 
           // Proyecciones
           // Proyecciones
           this.proyecciones = ans["result"]["proyecciones"];
           this.proyecciones = ans["result"]["proyecciones"];
@@ -561,13 +557,14 @@ export class BONO implements InstrumentComponent {
             this.proyecciones = ans["result"]["proyecciones"];
             this.proyecciones = ans["result"]["proyecciones"];
           }
           }
 
 
-          this.operation_result = true;
           this.dataSource.data = this.proyecciones.slice(0, -1);
           this.dataSource.data = this.proyecciones.slice(0, -1);
           this.dataSource2.data = this.proyecciones.slice(0, -1);
           this.dataSource2.data = this.proyecciones.slice(0, -1);
           this.dataSource.paginator = this.paginator;
           this.dataSource.paginator = this.paginator;
           this.dataSource.sort = this.sort;
           this.dataSource.sort = this.sort;
 
 
           this.bonosObject = {
           this.bonosObject = {
+            completo: this.tipoEjecucion,
+            cancelado: this.tipoEjecucion,
             renta_porcentaje: this.investmentProposalForm.value
             renta_porcentaje: this.investmentProposalForm.value
               .renta_porcentaje,
               .renta_porcentaje,
             costo_cedeval: this.investmentProposalForm.value.costo_cedeval,
             costo_cedeval: this.investmentProposalForm.value.costo_cedeval,
@@ -585,18 +582,6 @@ export class BONO implements InstrumentComponent {
             comision_bolsa_porcentaje_compra: this.investmentProposalForm.value
             comision_bolsa_porcentaje_compra: this.investmentProposalForm.value
               .comision_bolsa_porcentaje_compra,
               .comision_bolsa_porcentaje_compra,
 
 
-            valor_nominal_venta: this.investmentProposalForm.value
-              .valor_nominal_venta,
-            precio_venta: this.investmentProposalForm.value.precio_venta,
-            precio_vencimiento_venta: this.investmentProposalForm.value
-              .precio_vencimiento_venta,
-            cupon_porcentaje_venta: this.investmentProposalForm.value
-              .cupon_porcentaje_venta,
-            comision_casa_porcentaje_venta: this.investmentProposalForm.value
-              .comision_casa_porcentaje_venta,
-            comision_bolsa_porcentaje_venta: this.investmentProposalForm.value
-              .comision_bolsa_porcentaje_venta,
-
             fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
             fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
               .singleDate.formatted,
               .singleDate.formatted,
             fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
             fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
@@ -604,13 +589,6 @@ export class BONO implements InstrumentComponent {
             fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
             fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
               .singleDate.formatted,
               .singleDate.formatted,
 
 
-            fecha_vencimiento_venta: this.f.fecha_vencimiento_venta.value
-              .singleDate.formatted,
-            fecha_ultima_cupon_venta: this.f.fecha_ultima_cupon_venta.value
-              .singleDate.formatted,
-            fecha_liquidacion_venta: this.f.fecha_liquidacion_venta.value
-              .singleDate.formatted,
-
             // Instrumento de compra
             // Instrumento de compra
 
 
             comision_casa_compra: this.comision_casa_compra,
             comision_casa_compra: this.comision_casa_compra,
@@ -629,24 +607,7 @@ export class BONO implements InstrumentComponent {
             valor_transado_compra: this.valor_transado_compra,
             valor_transado_compra: this.valor_transado_compra,
             monto_pagar: this.monto_pagar,
             monto_pagar: this.monto_pagar,
             fecha_inicio_vigencia: this.fecha_inicio_vigencia,
             fecha_inicio_vigencia: this.fecha_inicio_vigencia,
-            // Instrumento de venta
-
-            comision_casa_venta: this.comision_casa_venta,
-            comision_bolsa_venta: this.comision_bolsa_venta,
-
-            fecha_siguiente_cupon_venta: this.fecha_siguiente_cupon_venta,
-            dias_vencimiento_venta: this.dias_vencimiento_venta,
-            dias_acumulados_venta: this.dias_acumulados_venta,
-            ytm_vencimiento_porcentaje_venta: this
-              .ytm_vencimiento_porcentaje_venta,
-            ytm_vencimiento_comision_porcentaje_venta: this
-              .ytm_vencimiento_comision_porcentaje_venta,
-
-            interes_acumulado_venta: this.interes_acumulado_venta,
-            interes_acumulado_porcentaje_venta: this
-              .interes_acumulado_porcentaje_venta,
-            precio_sucio_porcentaje_venta: this.precio_sucio_porcentaje_venta,
-            valor_transado_venta: this.valor_transado_venta,
+
             // Resultado de la operacion
             // Resultado de la operacion
             /*
             /*
             monto_recibir: this.monto_recibir,
             monto_recibir: this.monto_recibir,
@@ -664,8 +625,66 @@ export class BONO implements InstrumentComponent {
             total_ingresos_recibidos: this.total_ingresos_recibidos,
             total_ingresos_recibidos: this.total_ingresos_recibidos,
             */
             */
             // Proyecciones
             // Proyecciones
+
             proyecciones: this.proyecciones
             proyecciones: this.proyecciones
           };
           };
+          if (this.tipoEjecucion == 1) {
+            this.bonosObject[
+              "valor_nominal_venta"
+            ] = this.investmentProposalForm.value.valor_nominal_venta;
+            this.bonosObject[
+              "precio_venta"
+            ] = this.investmentProposalForm.value.precio_venta;
+            this.bonosObject[
+              "precio_vencimiento_venta"
+            ] = this.investmentProposalForm.value.precio_vencimiento_venta;
+            this.bonosObject[
+              "comision_casa_porcentaje_venta"
+            ] = this.investmentProposalForm.value.comision_casa_porcentaje_venta;
+            this.bonosObject[
+              "comision_bolsa_porcentaje_venta"
+            ] = this.investmentProposalForm.value.comision_bolsa_porcentaje_venta;
+            this.bonosObject[
+              "fecha_vencimiento_venta"
+            ] = this.f.fecha_vencimiento_venta.value.singleDate.formatted;
+            this.bonosObject[
+              "fecha_ultima_cupon_venta"
+            ] = this.f.fecha_ultima_cupon_venta.value.singleDate.formatted;
+            this.bonosObject[
+              "fecha_liquidacion_venta"
+            ] = this.f.fecha_liquidacion_venta.value.singleDate.formatted;
+            this.bonosObject["comision_casa_venta"] = this.comision_casa_venta;
+            this.bonosObject[
+              "comision_bolsa_venta"
+            ] = this.comision_bolsa_venta;
+            this.bonosObject[
+              "fecha_siguiente_cupon_venta"
+            ] = this.fecha_siguiente_cupon_venta;
+            this.bonosObject[
+              "dias_vencimiento_venta"
+            ] = this.dias_vencimiento_venta;
+            this.bonosObject[
+              "dias_acumulados_venta"
+            ] = this.dias_acumulados_venta;
+            this.bonosObject[
+              "ytm_vencimiento_porcentaje_venta"
+            ] = this.ytm_vencimiento_porcentaje_venta;
+            this.bonosObject[
+              "ytm_vencimiento_comision_porcentaje_venta"
+            ] = this.ytm_vencimiento_comision_porcentaje_venta;
+            this.bonosObject[
+              "interes_acumulado_venta"
+            ] = this.interes_acumulado_venta;
+            this.bonosObject[
+              "interes_acumulado_porcentaje_venta"
+            ] = this.interes_acumulado_porcentaje_venta;
+            this.bonosObject[
+              "precio_sucio_porcentaje_venta"
+            ] = this.precio_sucio_porcentaje_venta;
+            this.bonosObject[
+              "valor_transado_venta"
+            ] = this.valor_transado_venta;
+          }
 
 
           this.formDataService.setWork(this.bonosObject);
           this.formDataService.setWork(this.bonosObject);
           Swal.close();
           Swal.close();

+ 122 - 26
src/app/components/instruments/certificados/certificados.component.html

@@ -7,7 +7,29 @@
     [formGroup]="investmentProposalForm"
     [formGroup]="investmentProposalForm"
   >
   >
     <div class="row">
     <div class="row">
-      <div class=" col-md-6 col-sm-12 border border-light">
+      <div class="col-6">
+        <div class="form-group">
+          <label>Tipo de ejecución: </label>
+        </div>
+        <select
+          class="custom-select"
+          formControlName="ejecucion"
+          (change)="toggle_ejecucion($event.target.value)"
+        >
+          <option
+            *ngFor="let item of ejecuciones"
+            [value]="item.codigo"
+            [selected]="item.codigo == tipoEjecucion"
+          >
+            {{ item.nombre }}</option
+          >
+        </select>
+      </div>
+      <br />
+    </div>
+    <br />
+    <div class="row">
+      <div class=" col-md-12 col-sm-12 border border-light">
         <div class="row no-gutters">
         <div class="row no-gutters">
           <!-- Valor nominal compra -->
           <!-- Valor nominal compra -->
 
 
@@ -424,8 +446,13 @@
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
-
-      <div class=" col-md-6 col-sm-12 border border-light">
+    </div>
+    <br />
+    <div class="row">
+      <div
+        class=" col-md-12 col-sm-12 border border-light"
+        *ngIf="tipoEjecucion == 1"
+      >
         <div class="row no-gutters">
         <div class="row no-gutters">
           <div class="col-12">
           <div class="col-12">
             <h5>Venta</h5>
             <h5>Venta</h5>
@@ -853,7 +880,9 @@
             {{ fecha_inicio_vigencia }}
             {{ fecha_inicio_vigencia }}
           </div>
           </div>
         </div>
         </div>
+      </div>
 
 
+      <div class="row" *ngIf="tipoEjecucion == 1">
         <div class="col-12">
         <div class="col-12">
           <h3>
           <h3>
             Instrumento de venta
             Instrumento de venta
@@ -929,71 +958,113 @@
             $USD {{ valor_transado_venta | number: "1.2-4" }}
             $USD {{ valor_transado_venta | number: "1.2-4" }}
           </div>
           </div>
         </div>
         </div>
-
+      </div>
+      <div class="row">
         <div class="row align-container" *ngIf="operation_result">
         <div class="row align-container" *ngIf="operation_result">
           <div class="col-12">
           <div class="col-12">
             <h3>
             <h3>
               Resultado de la operación
               Resultado de la operación
             </h3>
             </h3>
           </div>
           </div>
+
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Monto a recibir:</h4>
-            <div class="field">$USD {{ monto_recibir | number: "1.2-4" }}</div>
+            <h4>Valor nominal compra:</h4>
+            <div class="field">
+              $USD{{ operation_results_work.valor_transado_compra }}
+            </div>
           </div>
           </div>
+
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Días tenencia total:</h4>
             <h4>Días tenencia total:</h4>
             <div class="field">
             <div class="field">
-              {{ dias_tenencia_total }}
+              {{ operation_results_work.dias_tenencia_total }}
             </div>
             </div>
           </div>
           </div>
+
+          <div class="col-sm-4">
+            <h4>Precio compra:</h4>
+            <div class="field">
+              {{ operation_results_work.precio_compra }}
+            </div>
+          </div>
+
+          <div class="col-sm-4">
+            <h4>Precio venta:</h4>
+            <div class="field">
+              {{ operation_results_work.precio_venta }}
+            </div>
+          </div>
+
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Ingresos intereses:</h4>
             <h4>Ingresos intereses:</h4>
             <div class="field">
             <div class="field">
-              $USD {{ ingresos_intereses | number: "1.2-4" }}
+              $USD
+              {{ operation_results_work.ingresos_intereses | number: "1.2-4" }}
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Costos totales:</h4>
             <h4>Costos totales:</h4>
-            <div class="field">$USD {{ costos_totales | number: "1.2-4" }}</div>
+            <div class="field">
+              $USD {{ operation_results_work.costos_totales | number: "1.2-4" }}
+            </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Ganancia / Pérdida total:</h4>
+            <h4>Ganancia o pérdida total:</h4>
             <div class="field">
             <div class="field">
-              $USD {{ ganancia_perdida_total | number: "1.2-4" }}
+              $USD
+              {{
+                operation_results_work.ganancia_perdida_total_neto
+                  | number: "1.2-4"
+              }}
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Ganancia / Pérdida de capital:</h4>
+            <h4>Ganancia o pérdida de capital:</h4>
             <div class="field">
             <div class="field">
-              {{ ganancia_perdida_capital_porcentaje | number: "1.2-4" }}%
+              {{
+                operation_results_work.ganancia_perdida_capital_porcentaje
+                  | number: "1.2-4"
+              }}%
             </div>
             </div>
           </div>
           </div>
 
 
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Interés (%):</h4>
             <h4>Interés (%):</h4>
             <div class="field">
             <div class="field">
-              {{ intereses_porcentaje | number: "1.2-4" }} %
+              {{
+                operation_results_work.intereses_porcentaje | number: "1.2-4"
+              }}
+              %
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Interés neto antes de impuesto (%):</h4>
             <h4>Interés neto antes de impuesto (%):</h4>
             <div class="field">
             <div class="field">
-              {{ neto_antes_impuesto_porcentaje | number: "1.2-4" }}
+              {{
+                operation_results_work.neto_antes_renta_porcentaje
+                  | number: "1.2-4"
+              }}
               %
               %
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Interés neto después de impuesto (%):</h4>
             <h4>Interés neto después de impuesto (%):</h4>
             <div class="field">
             <div class="field">
-              {{ neto_despues_impuesto_porcentaje | number: "1.2-4" }}
+              {{
+                operation_results_work.neto_despues_renta_porcentaje
+                  | number: "1.2-4"
+              }}
               %
               %
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Total de ingresos recibidos:</h4>
+            <h4>Total Ingresos Recibidos:</h4>
             <div class="field">
             <div class="field">
               $USD
               $USD
-              {{ total_ingresos_recibidos | number: "1.2-4" }}
+              {{
+                operation_results_work.total_ingresos_recibidos
+                  | number: "1.2-4"
+              }}
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
@@ -1309,8 +1380,8 @@
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
-    <!--
-    <div class="row">
+
+    <div class="row" *ngIf="tipoEjecucion == 1">
       <div class="col-12">
       <div class="col-12">
         <h3>
         <h3>
           Instrumento de venta
           Instrumento de venta
@@ -1489,7 +1560,7 @@
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
         <h4>Valor nominal compra:</h4>
         <h4>Valor nominal compra:</h4>
         <div class="field">
         <div class="field">
-          $USD{{ operation_results_work.valor_nominal_compra }}
+          $USD{{ operation_results_work.valor_transado_compra }}
         </div>
         </div>
       </div>
       </div>
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
@@ -1498,6 +1569,21 @@
           {{ operation_results_work.dias_tenencia_total }}
           {{ operation_results_work.dias_tenencia_total }}
         </div>
         </div>
       </div>
       </div>
+
+      <div class="col-lg-3 col-md-4 col-sm-6">
+        <h4>Precio compra:</h4>
+        <div class="field">
+          {{ operation_results_work.precio_compra }}
+        </div>
+      </div>
+
+      <div class="col-lg-3 col-md-4 col-sm-6">
+        <h4>Precio venta:</h4>
+        <div class="field">
+          {{ operation_results_work.precio_venta }}
+        </div>
+      </div>
+
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
         <h4>Ingresos intereses:</h4>
         <h4>Ingresos intereses:</h4>
         <div class="field">
         <div class="field">
@@ -1514,7 +1600,9 @@
         <h4>Ganancia o pérdida total:</h4>
         <h4>Ganancia o pérdida total:</h4>
         <div class="field">
         <div class="field">
           $USD
           $USD
-          {{ operation_results_work.ganancia_perdida_total | number: "1.2-4" }}
+          {{
+            operation_results_work.ganancia_perdida_total_neto | number: "1.2-4"
+          }}
         </div>
         </div>
       </div>
       </div>
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
@@ -1537,8 +1625,7 @@
         <h4>Interés neto antes de impuesto (%):</h4>
         <h4>Interés neto antes de impuesto (%):</h4>
         <div class="field">
         <div class="field">
           {{
           {{
-            operation_results_work.neto_antes_impuesto_porcentaje
-              | number: "1.2-4"
+            operation_results_work.neto_antes_renta_porcentaje | number: "1.2-4"
           }}
           }}
           %
           %
         </div>
         </div>
@@ -1547,14 +1634,23 @@
         <h4>Interés neto después de impuesto (%):</h4>
         <h4>Interés neto después de impuesto (%):</h4>
         <div class="field">
         <div class="field">
           {{
           {{
-            operation_results_work.neto_despues_impuesto_porcentaje
+            operation_results_work.neto_despues_renta_porcentaje
               | number: "1.2-4"
               | number: "1.2-4"
           }}
           }}
           %
           %
         </div>
         </div>
       </div>
       </div>
+      <div class="col-lg-3 col-md-4 col-sm-6">
+        <h4>Total Ingresos Recibidos:</h4>
+        <div class="field">
+          $USD
+          {{
+            operation_results_work.total_ingresos_recibidos | number: "1.2-4"
+          }}
+        </div>
+      </div>
     </div>
     </div>
-  -->
+
     <br />
     <br />
     <div *ngIf="hasProjections" class="instrument-calcs-summary">
     <div *ngIf="hasProjections" class="instrument-calcs-summary">
       <div class="row">
       <div class="row">

+ 143 - 115
src/app/components/instruments/certificados/certificados.component.ts

@@ -128,6 +128,11 @@ export class CINV implements InstrumentComponent {
   ytm_vencimiento_porcentaje_venta: any;
   ytm_vencimiento_porcentaje_venta: any;
   comision_bolsa_venta: any;
   comision_bolsa_venta: any;
   consolidado_proyeccion: any;
   consolidado_proyeccion: any;
+  ejecuciones = [
+    { codigo: 1, nombre: "Completa" },
+    { codigo: 0, nombre: "Parcial" }
+  ];
+  tipoEjecucion: number = 0;
 
 
   constructor(
   constructor(
     private formBuilder: FormBuilder,
     private formBuilder: FormBuilder,
@@ -138,7 +143,6 @@ export class CINV implements InstrumentComponent {
     public datepipe: DatePipe
     public datepipe: DatePipe
   ) {
   ) {
     this.instrument_work = this.formDataService.getWork();
     this.instrument_work = this.formDataService.getWork();
-
     this.instrument_exists = this.instrument_work == undefined;
     this.instrument_exists = this.instrument_work == undefined;
     this.general = this.formDataService.getGeneralInfo();
     this.general = this.formDataService.getGeneralInfo();
 
 
@@ -171,7 +175,15 @@ export class CINV implements InstrumentComponent {
       this.operation_result = true;
       this.operation_result = true;
     }
     }
 
 
+    if (+this.instrument_work["valor_nominal_venta"] > 0) {
+      this.tipoEjecucion = 1;
+    }
+    console.log("EJECUCION");
+    console.log(this.tipoEjecucion);
+
     this.investmentProposalForm = this.formBuilder.group({
     this.investmentProposalForm = this.formBuilder.group({
+      ejecucion: [this.instrument_exists ? "" : this.tipoEjecucion],
+
       renta_porcentaje: [
       renta_porcentaje: [
         this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
         this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
         [
         [
@@ -410,6 +422,7 @@ export class CINV implements InstrumentComponent {
           id_periodicidad: +this.general.periodicidad
           id_periodicidad: +this.general.periodicidad
         },
         },
         {
         {
+          completo: this.tipoEjecucion,
           renta_porcentaje: +this.f.renta_porcentaje.value,
           renta_porcentaje: +this.f.renta_porcentaje.value,
           costo_cedeval: +this.f.costo_cedeval.value,
           costo_cedeval: +this.f.costo_cedeval.value,
           costo_transferencia: +this.f.costo_transferencia.value,
           costo_transferencia: +this.f.costo_transferencia.value,
@@ -431,19 +444,31 @@ export class CINV implements InstrumentComponent {
           comision_bolsa_porcentaje_venta: this.f
           comision_bolsa_porcentaje_venta: this.f
             .comision_bolsa_porcentaje_venta.value,
             .comision_bolsa_porcentaje_venta.value,
 
 
-          fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
-            .singleDate.formatted,
-          fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
-            .singleDate.formatted,
-          fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
-            .singleDate.formatted,
-
-          fecha_vencimiento_venta: this.f.fecha_vencimiento_venta.value
-            .singleDate.formatted,
-          fecha_ultima_cupon_venta: this.f.fecha_ultima_cupon_venta.value
-            .singleDate.formatted,
-          fecha_liquidacion_venta: this.f.fecha_liquidacion_venta.value
-            .singleDate.formatted
+          fecha_vencimiento_compra:
+            this.f.fecha_vencimiento_compra.value == ""
+              ? ""
+              : this.f.fecha_vencimiento_compra.value.singleDate.formatted,
+          fecha_ultima_cupon_compra:
+            this.f.fecha_ultima_cupon_compra.value == ""
+              ? ""
+              : this.f.fecha_ultima_cupon_compra.value.singleDate.formatted,
+          fecha_liquidacion_compra:
+            this.f.fecha_liquidacion_compra.value == ""
+              ? ""
+              : this.f.fecha_liquidacion_compra.value.singleDate.formatted,
+
+          fecha_vencimiento_venta:
+            this.f.fecha_vencimiento_venta.value == ""
+              ? ""
+              : this.f.fecha_vencimiento_venta.value.singleDate.formatted,
+          fecha_ultima_cupon_venta:
+            this.f.fecha_ultima_cupon_venta.value == ""
+              ? ""
+              : this.f.fecha_ultima_cupon_venta.value.singleDate.formatted,
+          fecha_liquidacion_venta:
+            this.f.fecha_liquidacion_venta.value == ""
+              ? ""
+              : this.f.fecha_liquidacion_venta.value.singleDate.formatted
         }
         }
       )
       )
       .subscribe(
       .subscribe(
@@ -484,66 +509,43 @@ export class CINV implements InstrumentComponent {
             ans["result"]["instrumento_compra"]["fecha_inicio_vigencia"];
             ans["result"]["instrumento_compra"]["fecha_inicio_vigencia"];
 
 
           // Instrumento de venta
           // Instrumento de venta
-          this.comision_casa_venta =
-            ans["result"]["instrumento_venta"]["comision_casa_venta"];
-
-          this.comision_bolsa_venta =
-            ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
-
-          this.fecha_siguiente_cupon_venta =
-            ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
-          this.dias_vencimiento_venta =
-            ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
-          this.dias_acumulados_venta =
-            ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
-          this.ytm_vencimiento_comision_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "ytm_vencimiento_comision_porcentaje_venta"
-            ];
-          this.ytm_vencimiento_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "ytm_vencimiento_porcentaje_venta"
-            ];
-          this.interes_acumulado_venta =
-            ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
-          this.interes_acumulado_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "interes_acumulado_porcentaje_venta"
-            ];
-          this.precio_sucio_porcentaje_venta =
-            ans["result"]["instrumento_venta"]["precio_sucio_porcentaje_venta"];
-          this.valor_transado_venta =
-            ans["result"]["instrumento_venta"]["valor_transado_venta"];
-          this.monto_recibir =
-            ans["result"]["instrumento_venta"]["monto_recibir"];
-
-          // Resultado de la operacion
-          this.dias_tenencia_total =
-            ans["result"]["resultado_operacion"]["dias_tenencia_total"];
-          this.ganancia_perdida_capital =
-            ans["result"]["resultado_operacion"]["ganancia_perdida_capital"];
-          this.ingresos_intereses =
-            ans["result"]["resultado_operacion"]["ingresos_intereses"];
-          this.costos_totales =
-            ans["result"]["resultado_operacion"]["costos_totales"];
-          this.ganancia_perdida_total =
-            ans["result"]["resultado_operacion"]["ganancia_perdida_total"];
-          this.ganancia_perdida_capital_porcentaje =
-            ans["result"]["resultado_operacion"][
-              "ganancia_perdida_capital_porcentaje"
-            ];
-          this.intereses_porcentaje =
-            ans["result"]["resultado_operacion"]["intereses_porcentaje"];
-          this.neto_antes_impuesto_porcentaje =
-            ans["result"]["resultado_operacion"][
-              "neto_antes_impuesto_porcentaje"
-            ];
-          this.neto_despues_impuesto_porcentaje =
-            ans["result"]["resultado_operacion"][
-              "neto_despues_impuesto_porcentaje"
-            ];
-          this.total_ingresos_recibidos =
-            ans["result"]["resultado_operacion"]["total_ingresos_recibidos"];
+          if (this.tipoEjecucion == 1) {
+            this.comision_casa_venta =
+              ans["result"]["instrumento_venta"]["comision_casa_venta"];
+            this.comision_bolsa_venta =
+              ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
+            this.fecha_siguiente_cupon_venta =
+              ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
+            this.dias_vencimiento_venta =
+              ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
+            this.dias_acumulados_venta =
+              ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
+            this.ytm_vencimiento_comision_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "ytm_vencimiento_comision_porcentaje_venta"
+              ];
+            this.ytm_vencimiento_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "ytm_vencimiento_porcentaje_venta"
+              ];
+            this.interes_acumulado_venta =
+              ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
+            this.interes_acumulado_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "interes_acumulado_porcentaje_venta"
+              ];
+            this.precio_sucio_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "precio_sucio_porcentaje_venta"
+              ];
+            this.valor_transado_venta =
+              ans["result"]["instrumento_venta"]["valor_transado_venta"];
+            this.monto_recibir =
+              ans["result"]["instrumento_venta"]["monto_recibir"];
+
+            this.operation_results_work = ans["result"]["resultado_operacion"];
+            this.operation_result = true;
+          }
 
 
           // Proyecciones
           // Proyecciones
           this.proyecciones = ans["result"]["proyecciones"];
           this.proyecciones = ans["result"]["proyecciones"];
@@ -555,14 +557,14 @@ export class CINV implements InstrumentComponent {
             this.proyecciones = ans["result"]["proyecciones"];
             this.proyecciones = ans["result"]["proyecciones"];
           }
           }
 
 
-          this.operation_result = true;
           this.dataSource.data = this.proyecciones.slice(0, -1);
           this.dataSource.data = this.proyecciones.slice(0, -1);
           this.dataSource2.data = this.proyecciones.slice(0, -1);
           this.dataSource2.data = this.proyecciones.slice(0, -1);
           this.dataSource.paginator = this.paginator;
           this.dataSource.paginator = this.paginator;
           this.dataSource.sort = this.sort;
           this.dataSource.sort = this.sort;
 
 
-          // Obj
           this.bonosObject = {
           this.bonosObject = {
+            completo: this.tipoEjecucion,
+            cancelado: this.tipoEjecucion,
             renta_porcentaje: this.investmentProposalForm.value
             renta_porcentaje: this.investmentProposalForm.value
               .renta_porcentaje,
               .renta_porcentaje,
             costo_cedeval: this.investmentProposalForm.value.costo_cedeval,
             costo_cedeval: this.investmentProposalForm.value.costo_cedeval,
@@ -580,18 +582,6 @@ export class CINV implements InstrumentComponent {
             comision_bolsa_porcentaje_compra: this.investmentProposalForm.value
             comision_bolsa_porcentaje_compra: this.investmentProposalForm.value
               .comision_bolsa_porcentaje_compra,
               .comision_bolsa_porcentaje_compra,
 
 
-            valor_nominal_venta: this.investmentProposalForm.value
-              .valor_nominal_venta,
-            precio_venta: this.investmentProposalForm.value.precio_venta,
-            precio_vencimiento_venta: this.investmentProposalForm.value
-              .precio_vencimiento_venta,
-            cupon_porcentaje_venta: this.investmentProposalForm.value
-              .cupon_porcentaje_venta,
-            comision_casa_porcentaje_venta: this.investmentProposalForm.value
-              .comision_casa_porcentaje_venta,
-            comision_bolsa_porcentaje_venta: this.investmentProposalForm.value
-              .comision_bolsa_porcentaje_venta,
-
             fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
             fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
               .singleDate.formatted,
               .singleDate.formatted,
             fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
             fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
@@ -599,13 +589,6 @@ export class CINV implements InstrumentComponent {
             fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
             fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
               .singleDate.formatted,
               .singleDate.formatted,
 
 
-            fecha_vencimiento_venta: this.f.fecha_vencimiento_venta.value
-              .singleDate.formatted,
-            fecha_ultima_cupon_venta: this.f.fecha_ultima_cupon_venta.value
-              .singleDate.formatted,
-            fecha_liquidacion_venta: this.f.fecha_liquidacion_venta.value
-              .singleDate.formatted,
-
             // Instrumento de compra
             // Instrumento de compra
 
 
             comision_casa_compra: this.comision_casa_compra,
             comision_casa_compra: this.comision_casa_compra,
@@ -624,26 +607,9 @@ export class CINV implements InstrumentComponent {
             valor_transado_compra: this.valor_transado_compra,
             valor_transado_compra: this.valor_transado_compra,
             monto_pagar: this.monto_pagar,
             monto_pagar: this.monto_pagar,
             fecha_inicio_vigencia: this.fecha_inicio_vigencia,
             fecha_inicio_vigencia: this.fecha_inicio_vigencia,
-            // Instrumento de venta
-
-            comision_casa_venta: this.comision_casa_venta,
-            comision_bolsa_venta: this.comision_bolsa_venta,
-
-            fecha_siguiente_cupon_venta: this.fecha_siguiente_cupon_venta,
-            dias_vencimiento_venta: this.dias_vencimiento_venta,
-            dias_acumulados_venta: this.dias_acumulados_venta,
-            ytm_vencimiento_porcentaje_venta: this
-              .ytm_vencimiento_porcentaje_venta,
-            ytm_vencimiento_comision_porcentaje_venta: this
-              .ytm_vencimiento_comision_porcentaje_venta,
-
-            interes_acumulado_venta: this.interes_acumulado_venta,
-            interes_acumulado_porcentaje_venta: this
-              .interes_acumulado_porcentaje_venta,
-            precio_sucio_porcentaje_venta: this.precio_sucio_porcentaje_venta,
-            valor_transado_venta: this.valor_transado_venta,
-            // Resultado de la operacion
 
 
+            // Resultado de la operacion
+            /*
             monto_recibir: this.monto_recibir,
             monto_recibir: this.monto_recibir,
             dias_tenencia_total: this.dias_tenencia_total,
             dias_tenencia_total: this.dias_tenencia_total,
             ganancia_perdida_capital: this.ganancia_perdida_capital,
             ganancia_perdida_capital: this.ganancia_perdida_capital,
@@ -657,10 +623,68 @@ export class CINV implements InstrumentComponent {
             neto_despues_impuesto_porcentaje: this
             neto_despues_impuesto_porcentaje: this
               .neto_despues_impuesto_porcentaje,
               .neto_despues_impuesto_porcentaje,
             total_ingresos_recibidos: this.total_ingresos_recibidos,
             total_ingresos_recibidos: this.total_ingresos_recibidos,
-
+            */
             // Proyecciones
             // Proyecciones
+
             proyecciones: this.proyecciones
             proyecciones: this.proyecciones
           };
           };
+          if (this.tipoEjecucion == 1) {
+            this.bonosObject[
+              "valor_nominal_venta"
+            ] = this.investmentProposalForm.value.valor_nominal_venta;
+            this.bonosObject[
+              "precio_venta"
+            ] = this.investmentProposalForm.value.precio_venta;
+            this.bonosObject[
+              "precio_vencimiento_venta"
+            ] = this.investmentProposalForm.value.precio_vencimiento_venta;
+            this.bonosObject[
+              "comision_casa_porcentaje_venta"
+            ] = this.investmentProposalForm.value.comision_casa_porcentaje_venta;
+            this.bonosObject[
+              "comision_bolsa_porcentaje_venta"
+            ] = this.investmentProposalForm.value.comision_bolsa_porcentaje_venta;
+            this.bonosObject[
+              "fecha_vencimiento_venta"
+            ] = this.f.fecha_vencimiento_venta.value.singleDate.formatted;
+            this.bonosObject[
+              "fecha_ultima_cupon_venta"
+            ] = this.f.fecha_ultima_cupon_venta.value.singleDate.formatted;
+            this.bonosObject[
+              "fecha_liquidacion_venta"
+            ] = this.f.fecha_liquidacion_venta.value.singleDate.formatted;
+            this.bonosObject["comision_casa_venta"] = this.comision_casa_venta;
+            this.bonosObject[
+              "comision_bolsa_venta"
+            ] = this.comision_bolsa_venta;
+            this.bonosObject[
+              "fecha_siguiente_cupon_venta"
+            ] = this.fecha_siguiente_cupon_venta;
+            this.bonosObject[
+              "dias_vencimiento_venta"
+            ] = this.dias_vencimiento_venta;
+            this.bonosObject[
+              "dias_acumulados_venta"
+            ] = this.dias_acumulados_venta;
+            this.bonosObject[
+              "ytm_vencimiento_porcentaje_venta"
+            ] = this.ytm_vencimiento_porcentaje_venta;
+            this.bonosObject[
+              "ytm_vencimiento_comision_porcentaje_venta"
+            ] = this.ytm_vencimiento_comision_porcentaje_venta;
+            this.bonosObject[
+              "interes_acumulado_venta"
+            ] = this.interes_acumulado_venta;
+            this.bonosObject[
+              "interes_acumulado_porcentaje_venta"
+            ] = this.interes_acumulado_porcentaje_venta;
+            this.bonosObject[
+              "precio_sucio_porcentaje_venta"
+            ] = this.precio_sucio_porcentaje_venta;
+            this.bonosObject[
+              "valor_transado_venta"
+            ] = this.valor_transado_venta;
+          }
 
 
           this.formDataService.setWork(this.bonosObject);
           this.formDataService.setWork(this.bonosObject);
           Swal.close();
           Swal.close();
@@ -699,4 +723,8 @@ export class CINV implements InstrumentComponent {
   goToNext(form: any) {
   goToNext(form: any) {
     this.getCalculations(form, true);
     this.getCalculations(form, true);
   }
   }
+
+  toggle_ejecucion(input: any) {
+    this.tipoEjecucion = +input;
+  }
 }
 }

+ 124 - 28
src/app/components/instruments/eurobonos/eurobonos.component.html

@@ -1,13 +1,35 @@
 <div *ngIf="!summary">
 <div *ngIf="!summary">
   <h4 class="card-title">
   <h4 class="card-title">
-    Eurobonos
+    EuroBonos
   </h4>
   </h4>
   <form
   <form
     class="form-auth-small ng-untouched ng-pristine ng-valid"
     class="form-auth-small ng-untouched ng-pristine ng-valid"
     [formGroup]="investmentProposalForm"
     [formGroup]="investmentProposalForm"
   >
   >
     <div class="row">
     <div class="row">
-      <div class=" col-md-6 col-sm-12 border border-light">
+      <div class="col-6">
+        <div class="form-group">
+          <label>Tipo de ejecución: </label>
+        </div>
+        <select
+          class="custom-select"
+          formControlName="ejecucion"
+          (change)="toggle_ejecucion($event.target.value)"
+        >
+          <option
+            *ngFor="let item of ejecuciones"
+            [value]="item.codigo"
+            [selected]="item.codigo == tipoEjecucion"
+          >
+            {{ item.nombre }}</option
+          >
+        </select>
+      </div>
+      <br />
+    </div>
+    <br />
+    <div class="row">
+      <div class=" col-md-12 col-sm-12 border border-light">
         <div class="row no-gutters">
         <div class="row no-gutters">
           <!-- Valor nominal compra -->
           <!-- Valor nominal compra -->
 
 
@@ -38,7 +60,7 @@
                     Campo requerido
                     Campo requerido
                   </div>
                   </div>
                   <div *ngIf="f.renta_porcentaje.errors.pattern">
                   <div *ngIf="f.renta_porcentaje.errors.pattern">
-                    Debe ingresar una cifra válida
+                    Debe ingresar una cifra válida
                   </div>
                   </div>
                 </div>
                 </div>
               </div>
               </div>
@@ -424,8 +446,13 @@
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
-
-      <div class=" col-md-6 col-sm-12 border border-light">
+    </div>
+    <br />
+    <div class="row">
+      <div
+        class=" col-md-12 col-sm-12 border border-light"
+        *ngIf="tipoEjecucion == 1"
+      >
         <div class="row no-gutters">
         <div class="row no-gutters">
           <div class="col-12">
           <div class="col-12">
             <h5>Venta</h5>
             <h5>Venta</h5>
@@ -853,7 +880,9 @@
             {{ fecha_inicio_vigencia }}
             {{ fecha_inicio_vigencia }}
           </div>
           </div>
         </div>
         </div>
+      </div>
 
 
+      <div class="row" *ngIf="tipoEjecucion == 1">
         <div class="col-12">
         <div class="col-12">
           <h3>
           <h3>
             Instrumento de venta
             Instrumento de venta
@@ -929,71 +958,113 @@
             $USD {{ valor_transado_venta | number: "1.2-4" }}
             $USD {{ valor_transado_venta | number: "1.2-4" }}
           </div>
           </div>
         </div>
         </div>
-
+      </div>
+      <div class="row">
         <div class="row align-container" *ngIf="operation_result">
         <div class="row align-container" *ngIf="operation_result">
           <div class="col-12">
           <div class="col-12">
             <h3>
             <h3>
               Resultado de la operación
               Resultado de la operación
             </h3>
             </h3>
           </div>
           </div>
+
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Monto a recibir:</h4>
-            <div class="field">$USD {{ monto_recibir | number: "1.2-4" }}</div>
+            <h4>Valor nominal compra:</h4>
+            <div class="field">
+              $USD{{ operation_results_work.valor_transado_compra }}
+            </div>
           </div>
           </div>
+
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Días tenencia total:</h4>
             <h4>Días tenencia total:</h4>
             <div class="field">
             <div class="field">
-              {{ dias_tenencia_total }}
+              {{ operation_results_work.dias_tenencia_total }}
             </div>
             </div>
           </div>
           </div>
+
+          <div class="col-sm-4">
+            <h4>Precio compra:</h4>
+            <div class="field">
+              {{ operation_results_work.precio_compra }}
+            </div>
+          </div>
+
+          <div class="col-sm-4">
+            <h4>Precio venta:</h4>
+            <div class="field">
+              {{ operation_results_work.precio_venta }}
+            </div>
+          </div>
+
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Ingresos intereses:</h4>
             <h4>Ingresos intereses:</h4>
             <div class="field">
             <div class="field">
-              $USD {{ ingresos_intereses | number: "1.2-4" }}
+              $USD
+              {{ operation_results_work.ingresos_intereses | number: "1.2-4" }}
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Costos totales:</h4>
             <h4>Costos totales:</h4>
-            <div class="field">$USD {{ costos_totales | number: "1.2-4" }}</div>
+            <div class="field">
+              $USD {{ operation_results_work.costos_totales | number: "1.2-4" }}
+            </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Ganancia / Pérdida total:</h4>
+            <h4>Ganancia o pérdida total:</h4>
             <div class="field">
             <div class="field">
-              $USD {{ ganancia_perdida_total | number: "1.2-4" }}
+              $USD
+              {{
+                operation_results_work.ganancia_perdida_total_neto
+                  | number: "1.2-4"
+              }}
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Ganancia / Pérdida de capital:</h4>
+            <h4>Ganancia o pérdida de capital:</h4>
             <div class="field">
             <div class="field">
-              {{ ganancia_perdida_capital_porcentaje | number: "1.2-4" }}%
+              {{
+                operation_results_work.ganancia_perdida_capital_porcentaje
+                  | number: "1.2-4"
+              }}%
             </div>
             </div>
           </div>
           </div>
 
 
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Interés (%):</h4>
             <h4>Interés (%):</h4>
             <div class="field">
             <div class="field">
-              {{ intereses_porcentaje | number: "1.2-4" }} %
+              {{
+                operation_results_work.intereses_porcentaje | number: "1.2-4"
+              }}
+              %
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Interés neto antes de impuesto (%):</h4>
             <h4>Interés neto antes de impuesto (%):</h4>
             <div class="field">
             <div class="field">
-              {{ neto_antes_impuesto_porcentaje | number: "1.2-4" }}
+              {{
+                operation_results_work.neto_antes_renta_porcentaje
+                  | number: "1.2-4"
+              }}
               %
               %
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
             <h4>Interés neto después de impuesto (%):</h4>
             <h4>Interés neto después de impuesto (%):</h4>
             <div class="field">
             <div class="field">
-              {{ neto_despues_impuesto_porcentaje | number: "1.2-4" }}
+              {{
+                operation_results_work.neto_despues_renta_porcentaje
+                  | number: "1.2-4"
+              }}
               %
               %
             </div>
             </div>
           </div>
           </div>
           <div class="col-sm-4">
           <div class="col-sm-4">
-            <h4>Total de ingresos recibidos:</h4>
+            <h4>Total Ingresos Recibidos:</h4>
             <div class="field">
             <div class="field">
               $USD
               $USD
-              {{ total_ingresos_recibidos | number: "1.2-4" }}
+              {{
+                operation_results_work.total_ingresos_recibidos
+                  | number: "1.2-4"
+              }}
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
@@ -1309,8 +1380,8 @@
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
-    <!--
-    <div class="row">
+
+    <div class="row" *ngIf="tipoEjecucion == 1">
       <div class="col-12">
       <div class="col-12">
         <h3>
         <h3>
           Instrumento de venta
           Instrumento de venta
@@ -1489,7 +1560,7 @@
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
         <h4>Valor nominal compra:</h4>
         <h4>Valor nominal compra:</h4>
         <div class="field">
         <div class="field">
-          $USD{{ operation_results_work.valor_nominal_compra }}
+          $USD{{ operation_results_work.valor_transado_compra }}
         </div>
         </div>
       </div>
       </div>
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
@@ -1498,6 +1569,21 @@
           {{ operation_results_work.dias_tenencia_total }}
           {{ operation_results_work.dias_tenencia_total }}
         </div>
         </div>
       </div>
       </div>
+
+      <div class="col-lg-3 col-md-4 col-sm-6">
+        <h4>Precio compra:</h4>
+        <div class="field">
+          {{ operation_results_work.precio_compra }}
+        </div>
+      </div>
+
+      <div class="col-lg-3 col-md-4 col-sm-6">
+        <h4>Precio venta:</h4>
+        <div class="field">
+          {{ operation_results_work.precio_venta }}
+        </div>
+      </div>
+
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
         <h4>Ingresos intereses:</h4>
         <h4>Ingresos intereses:</h4>
         <div class="field">
         <div class="field">
@@ -1514,7 +1600,9 @@
         <h4>Ganancia o pérdida total:</h4>
         <h4>Ganancia o pérdida total:</h4>
         <div class="field">
         <div class="field">
           $USD
           $USD
-          {{ operation_results_work.ganancia_perdida_total | number: "1.2-4" }}
+          {{
+            operation_results_work.ganancia_perdida_total_neto | number: "1.2-4"
+          }}
         </div>
         </div>
       </div>
       </div>
       <div class="col-lg-3 col-md-4 col-sm-6">
       <div class="col-lg-3 col-md-4 col-sm-6">
@@ -1537,8 +1625,7 @@
         <h4>Interés neto antes de impuesto (%):</h4>
         <h4>Interés neto antes de impuesto (%):</h4>
         <div class="field">
         <div class="field">
           {{
           {{
-            operation_results_work.neto_antes_impuesto_porcentaje
-              | number: "1.2-4"
+            operation_results_work.neto_antes_renta_porcentaje | number: "1.2-4"
           }}
           }}
           %
           %
         </div>
         </div>
@@ -1547,14 +1634,23 @@
         <h4>Interés neto después de impuesto (%):</h4>
         <h4>Interés neto después de impuesto (%):</h4>
         <div class="field">
         <div class="field">
           {{
           {{
-            operation_results_work.neto_despues_impuesto_porcentaje
+            operation_results_work.neto_despues_renta_porcentaje
               | number: "1.2-4"
               | number: "1.2-4"
           }}
           }}
           %
           %
         </div>
         </div>
       </div>
       </div>
+      <div class="col-lg-3 col-md-4 col-sm-6">
+        <h4>Total Ingresos Recibidos:</h4>
+        <div class="field">
+          $USD
+          {{
+            operation_results_work.total_ingresos_recibidos | number: "1.2-4"
+          }}
+        </div>
+      </div>
     </div>
     </div>
-  -->
+
     <br />
     <br />
     <div *ngIf="hasProjections" class="instrument-calcs-summary">
     <div *ngIf="hasProjections" class="instrument-calcs-summary">
       <div class="row">
       <div class="row">

+ 143 - 114
src/app/components/instruments/eurobonos/eurobonos.component.ts

@@ -128,6 +128,11 @@ export class EURB implements InstrumentComponent {
   ytm_vencimiento_porcentaje_venta: any;
   ytm_vencimiento_porcentaje_venta: any;
   comision_bolsa_venta: any;
   comision_bolsa_venta: any;
   consolidado_proyeccion: any;
   consolidado_proyeccion: any;
+  ejecuciones = [
+    { codigo: 1, nombre: "Completa" },
+    { codigo: 0, nombre: "Parcial" }
+  ];
+  tipoEjecucion: number = 0;
 
 
   constructor(
   constructor(
     private formBuilder: FormBuilder,
     private formBuilder: FormBuilder,
@@ -138,7 +143,6 @@ export class EURB implements InstrumentComponent {
     public datepipe: DatePipe
     public datepipe: DatePipe
   ) {
   ) {
     this.instrument_work = this.formDataService.getWork();
     this.instrument_work = this.formDataService.getWork();
-
     this.instrument_exists = this.instrument_work == undefined;
     this.instrument_exists = this.instrument_work == undefined;
     this.general = this.formDataService.getGeneralInfo();
     this.general = this.formDataService.getGeneralInfo();
 
 
@@ -171,7 +175,15 @@ export class EURB implements InstrumentComponent {
       this.operation_result = true;
       this.operation_result = true;
     }
     }
 
 
+    if (+this.instrument_work["valor_nominal_venta"] > 0) {
+      this.tipoEjecucion = 1;
+    }
+    console.log("EJECUCION");
+    console.log(this.tipoEjecucion);
+
     this.investmentProposalForm = this.formBuilder.group({
     this.investmentProposalForm = this.formBuilder.group({
+      ejecucion: [this.instrument_exists ? "" : this.tipoEjecucion],
+
       renta_porcentaje: [
       renta_porcentaje: [
         this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
         this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
         [
         [
@@ -410,6 +422,7 @@ export class EURB implements InstrumentComponent {
           id_periodicidad: +this.general.periodicidad
           id_periodicidad: +this.general.periodicidad
         },
         },
         {
         {
+          completo: this.tipoEjecucion,
           renta_porcentaje: +this.f.renta_porcentaje.value,
           renta_porcentaje: +this.f.renta_porcentaje.value,
           costo_cedeval: +this.f.costo_cedeval.value,
           costo_cedeval: +this.f.costo_cedeval.value,
           costo_transferencia: +this.f.costo_transferencia.value,
           costo_transferencia: +this.f.costo_transferencia.value,
@@ -431,19 +444,31 @@ export class EURB implements InstrumentComponent {
           comision_bolsa_porcentaje_venta: this.f
           comision_bolsa_porcentaje_venta: this.f
             .comision_bolsa_porcentaje_venta.value,
             .comision_bolsa_porcentaje_venta.value,
 
 
-          fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
-            .singleDate.formatted,
-          fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
-            .singleDate.formatted,
-          fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
-            .singleDate.formatted,
-
-          fecha_vencimiento_venta: this.f.fecha_vencimiento_venta.value
-            .singleDate.formatted,
-          fecha_ultima_cupon_venta: this.f.fecha_ultima_cupon_venta.value
-            .singleDate.formatted,
-          fecha_liquidacion_venta: this.f.fecha_liquidacion_venta.value
-            .singleDate.formatted
+          fecha_vencimiento_compra:
+            this.f.fecha_vencimiento_compra.value == ""
+              ? ""
+              : this.f.fecha_vencimiento_compra.value.singleDate.formatted,
+          fecha_ultima_cupon_compra:
+            this.f.fecha_ultima_cupon_compra.value == ""
+              ? ""
+              : this.f.fecha_ultima_cupon_compra.value.singleDate.formatted,
+          fecha_liquidacion_compra:
+            this.f.fecha_liquidacion_compra.value == ""
+              ? ""
+              : this.f.fecha_liquidacion_compra.value.singleDate.formatted,
+
+          fecha_vencimiento_venta:
+            this.f.fecha_vencimiento_venta.value == ""
+              ? ""
+              : this.f.fecha_vencimiento_venta.value.singleDate.formatted,
+          fecha_ultima_cupon_venta:
+            this.f.fecha_ultima_cupon_venta.value == ""
+              ? ""
+              : this.f.fecha_ultima_cupon_venta.value.singleDate.formatted,
+          fecha_liquidacion_venta:
+            this.f.fecha_liquidacion_venta.value == ""
+              ? ""
+              : this.f.fecha_liquidacion_venta.value.singleDate.formatted
         }
         }
       )
       )
       .subscribe(
       .subscribe(
@@ -484,65 +509,43 @@ export class EURB implements InstrumentComponent {
             ans["result"]["instrumento_compra"]["fecha_inicio_vigencia"];
             ans["result"]["instrumento_compra"]["fecha_inicio_vigencia"];
 
 
           // Instrumento de venta
           // Instrumento de venta
-          this.comision_casa_venta =
-            ans["result"]["instrumento_venta"]["comision_casa_venta"];
-
-          this.comision_bolsa_venta =
-            ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
-          this.fecha_siguiente_cupon_venta =
-            ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
-          this.dias_vencimiento_venta =
-            ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
-          this.dias_acumulados_venta =
-            ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
-          this.ytm_vencimiento_comision_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "ytm_vencimiento_comision_porcentaje_venta"
-            ];
-          this.ytm_vencimiento_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "ytm_vencimiento_porcentaje_venta"
-            ];
-          this.interes_acumulado_venta =
-            ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
-          this.interes_acumulado_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "interes_acumulado_porcentaje_venta"
-            ];
-          this.precio_sucio_porcentaje_venta =
-            ans["result"]["instrumento_venta"]["precio_sucio_porcentaje_venta"];
-          this.valor_transado_venta =
-            ans["result"]["instrumento_venta"]["valor_transado_venta"];
-          this.monto_recibir =
-            ans["result"]["instrumento_venta"]["monto_recibir"];
-
-          // Resultado de la operacion
-          this.dias_tenencia_total =
-            ans["result"]["resultado_operacion"]["dias_tenencia_total"];
-          this.ganancia_perdida_capital =
-            ans["result"]["resultado_operacion"]["ganancia_perdida_capital"];
-          this.ingresos_intereses =
-            ans["result"]["resultado_operacion"]["ingresos_intereses"];
-          this.costos_totales =
-            ans["result"]["resultado_operacion"]["costos_totales"];
-          this.ganancia_perdida_total =
-            ans["result"]["resultado_operacion"]["ganancia_perdida_total"];
-          this.ganancia_perdida_capital_porcentaje =
-            ans["result"]["resultado_operacion"][
-              "ganancia_perdida_capital_porcentaje"
-            ];
-          this.intereses_porcentaje =
-            ans["result"]["resultado_operacion"]["intereses_porcentaje"];
-          this.neto_antes_impuesto_porcentaje =
-            ans["result"]["resultado_operacion"][
-              "neto_antes_impuesto_porcentaje"
-            ];
-          this.neto_despues_impuesto_porcentaje =
-            ans["result"]["resultado_operacion"][
-              "neto_despues_impuesto_porcentaje"
-            ];
-          this.total_ingresos_recibidos =
-            ans["result"]["resultado_operacion"]["total_ingresos_recibidos"];
+          if (this.tipoEjecucion == 1) {
+            this.comision_casa_venta =
+              ans["result"]["instrumento_venta"]["comision_casa_venta"];
+            this.comision_bolsa_venta =
+              ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
+            this.fecha_siguiente_cupon_venta =
+              ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
+            this.dias_vencimiento_venta =
+              ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
+            this.dias_acumulados_venta =
+              ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
+            this.ytm_vencimiento_comision_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "ytm_vencimiento_comision_porcentaje_venta"
+              ];
+            this.ytm_vencimiento_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "ytm_vencimiento_porcentaje_venta"
+              ];
+            this.interes_acumulado_venta =
+              ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
+            this.interes_acumulado_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "interes_acumulado_porcentaje_venta"
+              ];
+            this.precio_sucio_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "precio_sucio_porcentaje_venta"
+              ];
+            this.valor_transado_venta =
+              ans["result"]["instrumento_venta"]["valor_transado_venta"];
+            this.monto_recibir =
+              ans["result"]["instrumento_venta"]["monto_recibir"];
+
+            this.operation_results_work = ans["result"]["resultado_operacion"];
+            this.operation_result = true;
+          }
 
 
           // Proyecciones
           // Proyecciones
           this.proyecciones = ans["result"]["proyecciones"];
           this.proyecciones = ans["result"]["proyecciones"];
@@ -554,14 +557,14 @@ export class EURB implements InstrumentComponent {
             this.proyecciones = ans["result"]["proyecciones"];
             this.proyecciones = ans["result"]["proyecciones"];
           }
           }
 
 
-          this.operation_result = true;
           this.dataSource.data = this.proyecciones.slice(0, -1);
           this.dataSource.data = this.proyecciones.slice(0, -1);
           this.dataSource2.data = this.proyecciones.slice(0, -1);
           this.dataSource2.data = this.proyecciones.slice(0, -1);
           this.dataSource.paginator = this.paginator;
           this.dataSource.paginator = this.paginator;
           this.dataSource.sort = this.sort;
           this.dataSource.sort = this.sort;
 
 
-          // Obj
           this.bonosObject = {
           this.bonosObject = {
+            completo: this.tipoEjecucion,
+            cancelado: this.tipoEjecucion,
             renta_porcentaje: this.investmentProposalForm.value
             renta_porcentaje: this.investmentProposalForm.value
               .renta_porcentaje,
               .renta_porcentaje,
             costo_cedeval: this.investmentProposalForm.value.costo_cedeval,
             costo_cedeval: this.investmentProposalForm.value.costo_cedeval,
@@ -579,18 +582,6 @@ export class EURB implements InstrumentComponent {
             comision_bolsa_porcentaje_compra: this.investmentProposalForm.value
             comision_bolsa_porcentaje_compra: this.investmentProposalForm.value
               .comision_bolsa_porcentaje_compra,
               .comision_bolsa_porcentaje_compra,
 
 
-            valor_nominal_venta: this.investmentProposalForm.value
-              .valor_nominal_venta,
-            precio_venta: this.investmentProposalForm.value.precio_venta,
-            precio_vencimiento_venta: this.investmentProposalForm.value
-              .precio_vencimiento_venta,
-            cupon_porcentaje_venta: this.investmentProposalForm.value
-              .cupon_porcentaje_venta,
-            comision_casa_porcentaje_venta: this.investmentProposalForm.value
-              .comision_casa_porcentaje_venta,
-            comision_bolsa_porcentaje_venta: this.investmentProposalForm.value
-              .comision_bolsa_porcentaje_venta,
-
             fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
             fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
               .singleDate.formatted,
               .singleDate.formatted,
             fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
             fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
@@ -598,13 +589,6 @@ export class EURB implements InstrumentComponent {
             fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
             fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
               .singleDate.formatted,
               .singleDate.formatted,
 
 
-            fecha_vencimiento_venta: this.f.fecha_vencimiento_venta.value
-              .singleDate.formatted,
-            fecha_ultima_cupon_venta: this.f.fecha_ultima_cupon_venta.value
-              .singleDate.formatted,
-            fecha_liquidacion_venta: this.f.fecha_liquidacion_venta.value
-              .singleDate.formatted,
-
             // Instrumento de compra
             // Instrumento de compra
 
 
             comision_casa_compra: this.comision_casa_compra,
             comision_casa_compra: this.comision_casa_compra,
@@ -623,26 +607,9 @@ export class EURB implements InstrumentComponent {
             valor_transado_compra: this.valor_transado_compra,
             valor_transado_compra: this.valor_transado_compra,
             monto_pagar: this.monto_pagar,
             monto_pagar: this.monto_pagar,
             fecha_inicio_vigencia: this.fecha_inicio_vigencia,
             fecha_inicio_vigencia: this.fecha_inicio_vigencia,
-            // Instrumento de venta
-
-            comision_casa_venta: this.comision_casa_venta,
-            comision_bolsa_venta: this.comision_bolsa_venta,
-
-            fecha_siguiente_cupon_venta: this.fecha_siguiente_cupon_venta,
-            dias_vencimiento_venta: this.dias_vencimiento_venta,
-            dias_acumulados_venta: this.dias_acumulados_venta,
-            ytm_vencimiento_porcentaje_venta: this
-              .ytm_vencimiento_porcentaje_venta,
-            ytm_vencimiento_comision_porcentaje_venta: this
-              .ytm_vencimiento_comision_porcentaje_venta,
-
-            interes_acumulado_venta: this.interes_acumulado_venta,
-            interes_acumulado_porcentaje_venta: this
-              .interes_acumulado_porcentaje_venta,
-            precio_sucio_porcentaje_venta: this.precio_sucio_porcentaje_venta,
-            valor_transado_venta: this.valor_transado_venta,
-            // Resultado de la operacion
 
 
+            // Resultado de la operacion
+            /*
             monto_recibir: this.monto_recibir,
             monto_recibir: this.monto_recibir,
             dias_tenencia_total: this.dias_tenencia_total,
             dias_tenencia_total: this.dias_tenencia_total,
             ganancia_perdida_capital: this.ganancia_perdida_capital,
             ganancia_perdida_capital: this.ganancia_perdida_capital,
@@ -656,10 +623,68 @@ export class EURB implements InstrumentComponent {
             neto_despues_impuesto_porcentaje: this
             neto_despues_impuesto_porcentaje: this
               .neto_despues_impuesto_porcentaje,
               .neto_despues_impuesto_porcentaje,
             total_ingresos_recibidos: this.total_ingresos_recibidos,
             total_ingresos_recibidos: this.total_ingresos_recibidos,
-
+            */
             // Proyecciones
             // Proyecciones
+
             proyecciones: this.proyecciones
             proyecciones: this.proyecciones
           };
           };
+          if (this.tipoEjecucion == 1) {
+            this.bonosObject[
+              "valor_nominal_venta"
+            ] = this.investmentProposalForm.value.valor_nominal_venta;
+            this.bonosObject[
+              "precio_venta"
+            ] = this.investmentProposalForm.value.precio_venta;
+            this.bonosObject[
+              "precio_vencimiento_venta"
+            ] = this.investmentProposalForm.value.precio_vencimiento_venta;
+            this.bonosObject[
+              "comision_casa_porcentaje_venta"
+            ] = this.investmentProposalForm.value.comision_casa_porcentaje_venta;
+            this.bonosObject[
+              "comision_bolsa_porcentaje_venta"
+            ] = this.investmentProposalForm.value.comision_bolsa_porcentaje_venta;
+            this.bonosObject[
+              "fecha_vencimiento_venta"
+            ] = this.f.fecha_vencimiento_venta.value.singleDate.formatted;
+            this.bonosObject[
+              "fecha_ultima_cupon_venta"
+            ] = this.f.fecha_ultima_cupon_venta.value.singleDate.formatted;
+            this.bonosObject[
+              "fecha_liquidacion_venta"
+            ] = this.f.fecha_liquidacion_venta.value.singleDate.formatted;
+            this.bonosObject["comision_casa_venta"] = this.comision_casa_venta;
+            this.bonosObject[
+              "comision_bolsa_venta"
+            ] = this.comision_bolsa_venta;
+            this.bonosObject[
+              "fecha_siguiente_cupon_venta"
+            ] = this.fecha_siguiente_cupon_venta;
+            this.bonosObject[
+              "dias_vencimiento_venta"
+            ] = this.dias_vencimiento_venta;
+            this.bonosObject[
+              "dias_acumulados_venta"
+            ] = this.dias_acumulados_venta;
+            this.bonosObject[
+              "ytm_vencimiento_porcentaje_venta"
+            ] = this.ytm_vencimiento_porcentaje_venta;
+            this.bonosObject[
+              "ytm_vencimiento_comision_porcentaje_venta"
+            ] = this.ytm_vencimiento_comision_porcentaje_venta;
+            this.bonosObject[
+              "interes_acumulado_venta"
+            ] = this.interes_acumulado_venta;
+            this.bonosObject[
+              "interes_acumulado_porcentaje_venta"
+            ] = this.interes_acumulado_porcentaje_venta;
+            this.bonosObject[
+              "precio_sucio_porcentaje_venta"
+            ] = this.precio_sucio_porcentaje_venta;
+            this.bonosObject[
+              "valor_transado_venta"
+            ] = this.valor_transado_venta;
+          }
 
 
           this.formDataService.setWork(this.bonosObject);
           this.formDataService.setWork(this.bonosObject);
           Swal.close();
           Swal.close();
@@ -698,4 +723,8 @@ export class EURB implements InstrumentComponent {
   goToNext(form: any) {
   goToNext(form: any) {
     this.getCalculations(form, true);
     this.getCalculations(form, true);
   }
   }
+
+  toggle_ejecucion(input: any) {
+    this.tipoEjecucion = +input;
+  }
 }
 }

+ 2 - 2
src/app/components/investment-proposals/approve/approve.component.ts

@@ -103,7 +103,7 @@ export class InvestmentProposalApproveComponent implements OnInit {
 
 
           if (this.userListPrevious.length > 0) {
           if (this.userListPrevious.length > 0) {
             for (let i = 0; i < this.userListPrevious.length; i++) {
             for (let i = 0; i < this.userListPrevious.length; i++) {
-              if (this.userListPrevious[i].checked_email == true) {
+              if (this.userListPrevious[i].default_email == true) {
                 this.generated_inputs_previous += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='previous-${
                 this.generated_inputs_previous += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='previous-${
                   this.userListPrevious[i].name
                   this.userListPrevious[i].name
                 }' name='users' value='${
                 }' name='users' value='${
@@ -122,7 +122,7 @@ export class InvestmentProposalApproveComponent implements OnInit {
           }
           }
           if (this.userListNext.length > 0) {
           if (this.userListNext.length > 0) {
             for (let i = 0; i < this.userListNext.length; i++) {
             for (let i = 0; i < this.userListNext.length; i++) {
-              if (this.userListNext[i].checked_email == true) {
+              if (this.userListNext[i].default_email == true) {
                 this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
                 this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
                   this.userListNext[i].name
                   this.userListNext[i].name
                 }' name='users' value='${this.userListNext[i].name}' checked='${
                 }' name='users' value='${this.userListNext[i].name}' checked='${

+ 18 - 10
src/app/components/investment-proposals/investment-proposals.component.ts

@@ -295,7 +295,7 @@ export class InvestmentProposalsComponent implements OnInit {
 
 
         if (this.userList.length > 0) {
         if (this.userList.length > 0) {
           for (let i = 0; i < this.userList.length; i++) {
           for (let i = 0; i < this.userList.length; i++) {
-            if (this.userList[i].checked_email == true) {
+            if (this.userList[i].default_email == true) {
               this.test += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
               this.test += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
                 this.userList[i].name
                 this.userList[i].name
               }' name='users' value='${this.userList[i].name}' checked='${
               }' name='users' value='${this.userList[i].name}' checked='${
@@ -324,7 +324,7 @@ export class InvestmentProposalsComponent implements OnInit {
           this.reviewProposal = {
           this.reviewProposal = {
             id_inversion: investmentProposalID,
             id_inversion: investmentProposalID,
             step: "next",
             step: "next",
-            comentario: comentario
+            comentario: comentario == null ? "" : comentario
           };
           };
         }
         }
       }).then(result => {
       }).then(result => {
@@ -349,9 +349,13 @@ export class InvestmentProposalsComponent implements OnInit {
               let html_input: HTMLInputElement = document.getElementById(
               let html_input: HTMLInputElement = document.getElementById(
                 this.userList[i].name
                 this.userList[i].name
               ) as HTMLInputElement;
               ) as HTMLInputElement;
-              let html_value: string = html_input.value;
-              if (html_input.checked == true) {
-                array.push(html_value);
+              if (html_input != null) {
+                let html_value: string = html_input.value;
+                if (html_input.checked == true) {
+                  array.push(html_value);
+                }
+              } else {
+                array;
               }
               }
             }
             }
 
 
@@ -422,7 +426,7 @@ export class InvestmentProposalsComponent implements OnInit {
 
 
         if (this.userList.length > 0) {
         if (this.userList.length > 0) {
           for (let i = 0; i < this.userList.length; i++) {
           for (let i = 0; i < this.userList.length; i++) {
-            if (this.userList[i].checked_email == true) {
+            if (this.userList[i].default_email == true) {
               this.test += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
               this.test += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
                 this.userList[i].name
                 this.userList[i].name
               }' name='users' value='${this.userList[i].name}' checked='${
               }' name='users' value='${this.userList[i].name}' checked='${
@@ -455,7 +459,7 @@ export class InvestmentProposalsComponent implements OnInit {
           this.reviewProposal = {
           this.reviewProposal = {
             id_inversion: investmentProposalID,
             id_inversion: investmentProposalID,
             step: "next",
             step: "next",
-            comentario: comentario
+            comentario: comentario == null ? "" : comentario
           };
           };
         },
         },
         allowOutsideClick: () => !Swal.isLoading()
         allowOutsideClick: () => !Swal.isLoading()
@@ -479,9 +483,13 @@ export class InvestmentProposalsComponent implements OnInit {
               let html_input: HTMLInputElement = document.getElementById(
               let html_input: HTMLInputElement = document.getElementById(
                 this.userList[i].name
                 this.userList[i].name
               ) as HTMLInputElement;
               ) as HTMLInputElement;
-              let html_value: string = html_input.value;
-              if (html_input.checked == true) {
-                array.push(html_value);
+              if (html_input != null) {
+                let html_value: string = html_input.value;
+                if (html_input.checked == true) {
+                  array.push(html_value);
+                }
+              } else {
+                array;
               }
               }
             }
             }
 
 

+ 2 - 2
src/app/components/investment-proposals/payment-approval/payment-approval.component.ts

@@ -111,7 +111,7 @@ export class PaymentApprovalComponent implements OnInit {
 
 
           if (this.userListPrevious.length > 0) {
           if (this.userListPrevious.length > 0) {
             for (let i = 0; i < this.userListPrevious.length; i++) {
             for (let i = 0; i < this.userListPrevious.length; i++) {
-              if (this.userListPrevious[i].checked_email == true) {
+              if (this.userListPrevious[i].default_email == true) {
                 this.generated_inputs_previous += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='previous-${
                 this.generated_inputs_previous += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='previous-${
                   this.userListPrevious[i].name
                   this.userListPrevious[i].name
                 }' name='users' value='${
                 }' name='users' value='${
@@ -130,7 +130,7 @@ export class PaymentApprovalComponent implements OnInit {
           }
           }
           if (this.userListNext.length > 0) {
           if (this.userListNext.length > 0) {
             for (let i = 0; i < this.userListNext.length; i++) {
             for (let i = 0; i < this.userListNext.length; i++) {
-              if (this.userListNext[i].checked_email == true) {
+              if (this.userListNext[i].default_email == true) {
                 this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
                 this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
                   this.userListNext[i].name
                   this.userListNext[i].name
                 }' name='users' value='${this.userListNext[i].name}' checked='${
                 }' name='users' value='${this.userListNext[i].name}' checked='${

+ 2 - 3
src/app/components/investment-proposals/payment-info/payment-info.component.html

@@ -116,10 +116,9 @@
                       }"
                       }"
                     >
                     >
                       <option
                       <option
-                        *ngFor="let item of accounts"
+                        *ngFor="let item of accounts_origin"
                         [value]="item.id_cuenta_bancaria"
                         [value]="item.id_cuenta_bancaria"
                       >
                       >
-                        {{ nameBankAccounts(item.id_banco) }} -
                         {{ item.nombre }}</option
                         {{ item.nombre }}</option
                       >
                       >
                     </select>
                     </select>
@@ -165,7 +164,7 @@
                     >
                     >
                       <option
                       <option
                         *ngFor="let item of accounts_destination"
                         *ngFor="let item of accounts_destination"
-                        [value]="item.id_cuenta_bancaria_destino"
+                        [value]="item.id_cuenta_bancaria"
                       >
                       >
                         {{ item.nombre }}</option
                         {{ item.nombre }}</option
                       >
                       >

+ 33 - 17
src/app/components/investment-proposals/payment-info/payment-info.component.ts

@@ -78,6 +78,7 @@ export class PaymentInfoComponent implements OnInit {
   payment_check: boolean;
   payment_check: boolean;
   payment_transfer: boolean;
   payment_transfer: boolean;
   accounts_destination: any;
   accounts_destination: any;
+  accounts_origin: any;
 
 
   constructor(
   constructor(
     private router: Router,
     private router: Router,
@@ -102,17 +103,21 @@ export class PaymentInfoComponent implements OnInit {
         this.generated_inputs_next = "";
         this.generated_inputs_next = "";
         if (this.userListNext.length > 0) {
         if (this.userListNext.length > 0) {
           for (let i = 0; i < this.userListNext.length; i++) {
           for (let i = 0; i < this.userListNext.length; i++) {
-            this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${this.userListNext[i]}' name='users' value='${this.userListNext[i]}'><label class='form-check-label' for='next-${this.userListNext[i]}'>${this.userListNext[i]}</label></div>`;
+            if (this.userListNext[i].default_email == true) {
+              this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
+                this.userListNext[i].name
+              }' name='users' value='${this.userListNext[i].name}' checked='${
+                this.userListNext[i].default_email == "true" ? true : false
+              }'><label class='form-check-label' for='next-${
+                this.userListNext[i].name
+              }'>${this.userListNext[i].name}</label></div>`;
+            } else {
+              this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${this.userListNext[i].name}' name='users' value='${this.userListNext[i].name}'><label class='form-check-label' for='next-${this.userListNext[i].name}'>${this.userListNext[i].name}</label></div>`;
+            }
           }
           }
         }
         }
       });
       });
 
 
-    this.catalogService
-      .getBankAccounts("origen", this.investmentProposalID)
-      .subscribe(res => {
-        console.log(res);
-      });
-
     this.investmentsService
     this.investmentsService
       .getProposalInvestment(this.investmentProposalID)
       .getProposalInvestment(this.investmentProposalID)
       .subscribe(
       .subscribe(
@@ -166,6 +171,18 @@ export class PaymentInfoComponent implements OnInit {
         }
         }
       );
       );
 
 
+    this.catalogService
+      .getBankAccounts("origen", this.investmentProposalID)
+      .subscribe(res => {
+        this.accounts_origin = res["result"];
+      });
+
+    this.catalogService
+      .getBankAccounts("destino", this.investmentProposalID)
+      .subscribe(res => {
+        this.accounts_destination = res["result"];
+      });
+
     this.catalogService.getPaymentTypes().subscribe(res => {
     this.catalogService.getPaymentTypes().subscribe(res => {
       this.payment_types = res;
       this.payment_types = res;
     });
     });
@@ -173,20 +190,20 @@ export class PaymentInfoComponent implements OnInit {
       this.funds = res;
       this.funds = res;
     });
     });
 
 
-    this.catalogService.getCatalogInfo("bancos").subscribe(res => {
+    /*this.catalogService.getCatalogInfo("bancos").subscribe(res => {
       this.banks = res;
       this.banks = res;
       this.catalogService.getCatalogInfo("cuentas-bancarias").subscribe(res => {
       this.catalogService.getCatalogInfo("cuentas-bancarias").subscribe(res => {
         this.accounts = res;
         this.accounts = res;
       });
       });
       //this.payment_types = res;
       //this.payment_types = res;
-    });
+    });*/
 
 
-    this.catalogService
+    /*this.catalogService
       .getCatalogInfo("cuentas-bancaria-destino")
       .getCatalogInfo("cuentas-bancaria-destino")
       .subscribe(res => {
       .subscribe(res => {
         this.accounts_destination = res;
         this.accounts_destination = res;
       });
       });
-
+      */
     this.investmentProposalForm = this.formBuilder.group({
     this.investmentProposalForm = this.formBuilder.group({
       monto: [
       monto: [
         this.inversionAmount,
         this.inversionAmount,
@@ -300,7 +317,7 @@ export class PaymentInfoComponent implements OnInit {
 
 
             for (let i = 0; i < this.userListNext.length; i++) {
             for (let i = 0; i < this.userListNext.length; i++) {
               let html_input: HTMLInputElement = document.getElementById(
               let html_input: HTMLInputElement = document.getElementById(
-                "next-" + this.userListNext[i]
+                "next-" + this.userListNext[i].name
               ) as HTMLInputElement;
               ) as HTMLInputElement;
               let html_value: string = html_input.value;
               let html_value: string = html_input.value;
               if (html_input.checked == true) {
               if (html_input.checked == true) {
@@ -319,16 +336,15 @@ export class PaymentInfoComponent implements OnInit {
               //fecha_pago: this.investmentProposalForm.value.fecha_pago.singleDate.formatted,
               //fecha_pago: this.investmentProposalForm.value.fecha_pago.singleDate.formatted,
               fecha_vencimiento: this.investmentProposalForm.value
               fecha_vencimiento: this.investmentProposalForm.value
                 .fecha_vencimiento.singleDate.formatted,
                 .fecha_vencimiento.singleDate.formatted,
+              emitir_nombre: this.investmentProposalForm.value.emitir_nombre,
               id_inversion: +this.investmentProposalID
               id_inversion: +this.investmentProposalID
             };
             };
 
 
-            if (+this.investmentProposalForm.value.tipo_pago == 2) {
-              this.paymentObject[
-                "emitir_nombre"
-              ] = this.investmentProposalForm.value.emitir_nombre;
-            } else if (+this.investmentProposalForm.value.tipo_pago == 3) {
+            if (+this.investmentProposalForm.value.tipo_pago == 3) {
               this.paymentObject["id_cuenta_bancaria_destino"] = +this
               this.paymentObject["id_cuenta_bancaria_destino"] = +this
                 .investmentProposalForm.value.cuenta_bancaria_destino;
                 .investmentProposalForm.value.cuenta_bancaria_destino;
+            }else{
+              this.paymentObject["id_cuenta_bancaria_destino"] = null;
             }
             }
           }
           }
         }).then(result1 => {
         }).then(result1 => {

+ 2 - 2
src/app/components/investment-proposals/payment-requirement/payment-requirement.component.ts

@@ -114,7 +114,7 @@ export class PaymentRequirementComponent implements OnInit {
 
 
         if (this.userListPrevious.length > 0) {
         if (this.userListPrevious.length > 0) {
           for (let i = 0; i < this.userListPrevious.length; i++) {
           for (let i = 0; i < this.userListPrevious.length; i++) {
-            if (this.userListPrevious[i].checked_email == true) {
+            if (this.userListPrevious[i].default_email == true) {
               this.generated_inputs_previous += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='previous-${
               this.generated_inputs_previous += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='previous-${
                 this.userListPrevious[i].name
                 this.userListPrevious[i].name
               }' name='users' value='${
               }' name='users' value='${
@@ -131,7 +131,7 @@ export class PaymentRequirementComponent implements OnInit {
         }
         }
         if (this.userListNext.length > 0) {
         if (this.userListNext.length > 0) {
           for (let i = 0; i < this.userListNext.length; i++) {
           for (let i = 0; i < this.userListNext.length; i++) {
-            if (this.userListNext[i].checked_email == true) {
+            if (this.userListNext[i].default_email == true) {
               this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
               this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
                 this.userListNext[i].name
                 this.userListNext[i].name
               }' name='users' value='${this.userListNext[i].name}' checked='${
               }' name='users' value='${this.userListNext[i].name}' checked='${

+ 3 - 0
src/app/components/investment-proposals/proposal-detail/proposal-detail.component.ts

@@ -154,6 +154,9 @@ export class InvestmentProposalDetailComponent implements OnInit {
               "id_inversion_instrumento"
               "id_inversion_instrumento"
             ];
             ];
 
 
+          this.gInstrument["resultado_operacion"] =
+            res["result"]["id_inversion_instrumento"]["resultado_operacion"];
+
           this.gComplement = {
           this.gComplement = {
             tipo_mercado:
             tipo_mercado:
               res["result"]["id_tipo_mercado"] == null
               res["result"]["id_tipo_mercado"] == null

+ 2 - 2
src/app/components/investment-proposals/review/review.component.ts

@@ -105,7 +105,7 @@ export class InvestmentProposalReviewComponent implements OnInit {
 
 
           if (this.userListPrevious.length > 0) {
           if (this.userListPrevious.length > 0) {
             for (let i = 0; i < this.userListPrevious.length; i++) {
             for (let i = 0; i < this.userListPrevious.length; i++) {
-              if (this.userListPrevious[i].checked_email == true) {
+              if (this.userListPrevious[i].default_email == true) {
                 this.generated_inputs_previous += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='previous-${
                 this.generated_inputs_previous += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='previous-${
                   this.userListPrevious[i].name
                   this.userListPrevious[i].name
                 }' name='users' value='${
                 }' name='users' value='${
@@ -124,7 +124,7 @@ export class InvestmentProposalReviewComponent implements OnInit {
           }
           }
           if (this.userListNext.length > 0) {
           if (this.userListNext.length > 0) {
             for (let i = 0; i < this.userListNext.length; i++) {
             for (let i = 0; i < this.userListNext.length; i++) {
-              if (this.userListNext[i].checked_email == true) {
+              if (this.userListNext[i].default_email == true) {
                 this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
                 this.generated_inputs_next += `<div class='form-check form-check-inline'><input type='checkbox' class='form-check-input' id='next-${
                   this.userListNext[i].name
                   this.userListNext[i].name
                 }' name='users' value='${this.userListNext[i].name}' checked='${
                 }' name='users' value='${this.userListNext[i].name}' checked='${

+ 360 - 0
src/app/components/investments/costs/pemp/pemp.costs.component.html

@@ -0,0 +1,360 @@
+<h2 class="floating-title">{{ title }}</h2>
+
+<div class="main-content">
+  <div class="container-fluid">
+    <div class="row">
+      <div class="col-12 align-right">
+        <div class="align-container">
+          <nav aria-label="breadcrumb">
+            <ol class="breadcrumb">
+              <li class="breadcrumb-item">
+                <a [routerLink]="['/']">Dashboard</a>
+              </li>
+              <li class="breadcrumb-item">
+                <a [routerLink]="['/investments']">
+                  Inversiones activas
+                </a>
+              </li>
+              <li class="breadcrumb-item">Préstamos empresariales</li>
+            </ol>
+          </nav>
+        </div>
+      </div>
+
+      <div class="col-12">
+        <div class="align-container">
+          <div class="card borderless card-wrapper">
+            <div class="wrapper-costs">
+              <h4 class="card-title">
+                Detalle de proyecciones para el préstamo empresarial
+              </h4>
+              <br />
+
+              <div class="align-container">
+                <div>
+                  <div class="costs-summary" *ngIf="instrument_exists">
+                    <div class="row">
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Valor nominal:</h4>
+                        <div class="field">
+                          $USD
+                          {{ instrument_work.monto_prestamo | number: "1.2-4" }}
+                        </div>
+                      </div>
+
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Monto préstamo:</h4>
+                        <div class="field">
+                          $USD
+                          {{ instrument_work.monto_prestamo | number: "1.2-4" }}
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Tasa (%):</h4>
+                        <div class="field">
+                          {{
+                            instrument_work.tasa_porcentaje | number: "1.2-4"
+                          }}%
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>IVA (%):</h4>
+                        <div class="field">
+                          {{
+                            instrument_work.iva_porcentaje | number: "1.2-4"
+                          }}%
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Renta (%):</h4>
+                        <div class="field">
+                          {{
+                            instrument_work.renta_porcentaje | number: "1.2-4"
+                          }}%
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>IVA ($):</h4>
+                        <div class="field">
+                          $USD {{ instrument_work.iva | number: "1.2-4" }}
+                        </div>
+                      </div>
+
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Comisión desembolso (%):</h4>
+                        <div class="field">
+                          {{
+                            instrument_work.comision_desembolso_porcentaje
+                              | number: "1.2-4"
+                          }}%
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Comisión desembolso ($):</h4>
+                        <div class="field">
+                          $USD
+                          {{
+                            instrument_work.comision_desembolso
+                              | number: "1.2-4"
+                          }}
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Plazo:</h4>
+                        <div class="field">
+                          {{ instrument_work.plazo | number: "1.2-4" }}
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Fecha de operacion:</h4>
+                        <div class="field">
+                          {{ instrument_work.fecha_operacion }}
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Fecha de vencimiento:</h4>
+                        <div class="field">
+                          {{ instrument_work.fecha_vencimiento }}
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+              <br />
+              <br />
+              <div class="align-container">
+                <form *ngIf="dataRetrieved" [formGroup]="form">
+                  <div *ngFor="let group of form.controls; let i = index">
+                    <div class="wrapper-form" [formGroup]="group">
+                      <div class="costs-input-small-container">
+                        <div class="form-group">
+                          <label for="posicion">Posicion: </label>
+
+                          <div class="input-box-container">
+                            <input
+                              type="text"
+                              formControlName="posicion"
+                              class="form-control"
+                              readonly
+                            />
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-small-container">
+                        <div class="form-group">
+                          <label for="plazo">Plazo: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="far fa-clock" aria-hidden="true"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="plazo"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="fecha_pago">Fecha pago: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i
+                                  class="far fa-calendar"
+                                  aria-hidden="true"
+                                ></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="fecha_pago"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="ingreso_bruto">Ingreso bruto: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="ingreso_bruto"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="ingreso_neto">Ingreso neto: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="ingreso_neto"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="tasa_porcentaje">Tasa: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-percent"></i>
+                              </p>
+                              <input
+                                type="number"
+                                formControlName="tasa_porcentaje"
+                                class="form-control"
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="amortizacion_capital"
+                            >Amortización capital:
+                          </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="number"
+                                formControlName="amortizacion_capital"
+                                class="form-control"
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="monto_recibir">Monto a recibir: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="number"
+                                formControlName="monto_recibir"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="iva">IVA: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="iva"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="capital_restante"
+                            >Capital restante:
+                          </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="number"
+                                formControlName="capital_restante"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <input
+                        type="hidden"
+                        formControlName="id_proyeccion_ingreso"
+                      />
+                      <div class="clear"></div>
+                    </div>
+                  </div>
+                  <br />
+                  <div class="form-group text-right space-20">
+                    <button
+                      type="button"
+                      class="btn btn-success center-component float-left"
+                      (click)="saveProjection()"
+                    >
+                      Guardar información de proyecciones
+                    </button>
+
+                    <button
+                      type="button"
+                      class="btn btn-primary center-component float-right"
+                      (click)="recalculateProjectionChanges()"
+                    >
+                      Recalcular proyecciones
+                    </button>
+                  </div>
+                  <br />
+                </form>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <br />
+    </div>
+  </div>
+</div>

+ 225 - 0
src/app/components/investments/costs/pemp/pemp.costs.component.ts

@@ -0,0 +1,225 @@
+import { Component, ViewChild, OnInit } from "@angular/core";
+import { MatPaginator } from "@angular/material/paginator";
+import { MatSort } from "@angular/material/sort";
+import { MatTableDataSource } from "@angular/material/table";
+import Swal from "sweetalert2";
+import { CatalogsService } from "src/app/services/catalogs.service";
+import { InvestmentsService } from "@app/services/investments.service";
+import { InstrumentCalculations } from "@app/services/instrument-calculations.service";
+
+import { AuthService } from "@app/services/auth2.service";
+import { JwtHelperService } from "@auth0/angular-jwt";
+import { InvestmentProposal } from "@app/models/investment-proposal";
+import { from } from "rxjs";
+import { FormInvestmentProposalService } from "@app/services/form-investment-proposal.service";
+import { Router, ActivatedRoute } from "@angular/router";
+import {
+  FormBuilder,
+  FormGroup,
+  FormControl,
+  FormArray,
+  Validators
+} from "@angular/forms";
+
+@Component({
+  selector: "app-pemp-costs",
+  templateUrl: "./pemp.costs.component.html"
+  //styleUrls: ["./dap.costs.component.scss"]
+})
+export class PEMPCostsComponent implements OnInit {
+  helper = new JwtHelperService();
+
+  title: string = "Proyecciones para préstamos empresariales";
+
+  listProposals: InvestmentProposal[];
+  dataSource = new MatTableDataSource(this.listProposals);
+
+  resultsLength = 0;
+  isLoadingResults = true;
+  isRateLimitReached = false;
+  userRole: any;
+
+  @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
+  @ViewChild(MatSort, { static: true }) sort: MatSort;
+  role_number: any;
+  investmentProposalID: string;
+
+  form: FormArray;
+  investmentProposalForm: FormGroup;
+
+  proyecciones: any;
+  proyeccionesProps = [];
+  dataRetrieved: boolean = false;
+
+  array1;
+  array2;
+  array3;
+  investment: any;
+  instrument_work: any;
+  instrument_exists: boolean;
+
+  constructor(
+    private catalogService: CatalogsService,
+    private investmentsService: InvestmentsService,
+    private authService: AuthService,
+    private formInvestmentProposal: FormInvestmentProposalService,
+    private router: Router,
+    private route: ActivatedRoute,
+    private instrumentService: InstrumentCalculations,
+
+    private formBuilder: FormBuilder
+  ) {
+    const decodedToken = this.helper.decodeToken(
+      this.authService.getJwtToken()
+    );
+    this.userRole = decodedToken.groups;
+
+    Swal.fire({
+      allowOutsideClick: false,
+      icon: "info",
+      text: "Espere por favor..."
+    });
+    Swal.showLoading();
+  }
+
+  ngOnInit() {
+    Swal.close();
+    const formDataObj = {};
+
+    this.route.params.subscribe(params => {
+      this.investmentProposalID = params["id"];
+    });
+
+    if (this.investmentProposalID == undefined)
+      this.investmentProposalID = this.route.snapshot.queryParamMap.get("id");
+
+    if (this.investmentProposalID != undefined) {
+      this.investmentsService
+        .getProposalInvestment(this.investmentProposalID)
+        .subscribe(
+          res => {
+            this.investment = res["result"];
+            this.instrument_work =
+              res["result"]["id_inversion_instrumento"]["instrumento"];
+            this.instrument_exists = true;
+          },
+          err => {}
+        );
+
+      this.investmentsService
+        .getProposalInvestment(this.investmentProposalID)
+        .subscribe(
+          res => {
+            this.proyecciones =
+              res["result"]["id_inversion_instrumento"]["instrumento"][
+                "proyecciones"
+              ];
+            this.proyecciones.pop();
+            this.form = new FormArray(this.buildForm(this.proyecciones));
+            this.dataRetrieved = true;
+          },
+          err => {
+            Swal.fire({
+              icon: "error",
+              title: "Error en el servidor",
+              text: err.message
+            });
+          }
+        );
+    }
+
+    setTimeout(() => {
+      Swal.close();
+    }, 1200);
+  }
+
+  recalculateProjectionChanges() {
+    let objProjection = { proyecciones: this.form.value };
+    Swal.fire({
+      allowOutsideClick: false,
+      icon: "info",
+      text: "Espere por favor..."
+    });
+    Swal.showLoading();
+
+    this.instrumentService
+      .projectionCalc(this.investmentProposalID, this.form.value)
+      .subscribe(
+        result => {
+          Swal.fire({
+            allowOutsideClick: false,
+            icon: "success",
+            showCancelButton: false,
+            title: "Exito"
+          });
+          this.proyecciones = result["result"]["proyecciones"];
+          this.proyecciones.pop();
+          this.form.clear();
+          this.form = new FormArray(this.buildForm(this.proyecciones));
+          Swal.close();
+          //window.location.reload();
+        },
+        err => {
+          Swal.fire({
+            icon: "error",
+            title: "Error al guardar",
+            text: err.message
+          });
+        }
+      );
+  }
+
+  saveProjection() {
+    let objProjection = { proyecciones: this.form.value };
+    Swal.fire({
+      allowOutsideClick: false,
+      icon: "info",
+      text: "Espere por favor..."
+    });
+    Swal.showLoading();
+
+    this.instrumentService
+      .projectionModification(this.investmentProposalID, objProjection)
+      .subscribe(
+        resp => {
+          Swal.fire({
+            allowOutsideClick: false,
+            icon: "success",
+            showCancelButton: false,
+            title: "Exito",
+            confirmButtonText: "La información ha sido actualizada"
+          }).then(result => {
+            Swal.close();
+            //window.location.reload();
+          });
+        },
+        err => {
+          Swal.fire({
+            icon: "error",
+            title: "Error al guardar",
+            text: err.message
+          });
+        }
+      );
+  }
+
+  buildForm(items: any[]): FormGroup[] {
+    return items.map(x => this.buildItem(x));
+  }
+  //return a formGroup
+  buildItem(item: any): FormGroup {
+    return new FormGroup({
+      id_proyeccion_ingreso: new FormControl(item.id_proyeccion_ingreso),
+      posicion: new FormControl(item.posicion),
+      plazo: new FormControl(item.plazo),
+      fecha_pago: new FormControl(item.fecha_pago),
+      ingreso_bruto: new FormControl(item.ingreso_bruto),
+      ingreso_neto: new FormControl(item.ingreso_neto),
+      tasa_porcentaje: new FormControl(item.tasa_porcentaje),
+      amortizacion_capital: new FormControl(item.amortizacion_capital),
+      monto_recibir: new FormControl(item.monto_recibir),
+      iva: new FormControl(item.iva),
+      capital_restante: new FormControl(item.capital_restante)
+    });
+  }
+}

+ 487 - 0
src/app/components/investments/costs/pper/pper.costs.component.html

@@ -0,0 +1,487 @@
+<h2 class="floating-title">{{ title }}</h2>
+
+<div class="main-content">
+  <div class="container-fluid">
+    <div class="row">
+      <div class="col-12 align-right">
+        <div class="align-container">
+          <nav aria-label="breadcrumb">
+            <ol class="breadcrumb">
+              <li class="breadcrumb-item">
+                <a [routerLink]="['/']">Dashboard</a>
+              </li>
+              <li class="breadcrumb-item">
+                <a [routerLink]="['/investments']">
+                  Inversiones activas
+                </a>
+              </li>
+              <li class="breadcrumb-item">Préstamos personales</li>
+            </ol>
+          </nav>
+        </div>
+      </div>
+
+      <div class="col-12">
+        <div class="align-container">
+          <div class="card borderless card-wrapper">
+            <div class="wrapper-costs">
+              <h4 class="card-title">
+                Detalle de proyecciones para el préstamo personal
+              </h4>
+              <br />
+
+              <div class="align-container">
+                <div>
+                  <div class="costs-summary" *ngIf="instrument_exists">
+                    <div class="row">
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Valor nominal:</h4>
+                        <div class="field">
+                          $USD
+                          {{ instrument_work.monto_prestamo | number: "1.2-4" }}
+                        </div>
+                      </div>
+
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Monto préstamo:</h4>
+                        <div class="field">
+                          $USD
+                          {{ instrument_work.monto_prestamo | number: "1.2-4" }}
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Tasa (%):</h4>
+                        <div class="field">
+                          {{
+                            instrument_work.tasa_porcentaje | number: "1.2-4"
+                          }}%
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>IVA (%):</h4>
+                        <div class="field">
+                          {{
+                            instrument_work.iva_porcentaje | number: "1.2-4"
+                          }}%
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Renta (%):</h4>
+                        <div class="field">
+                          {{
+                            instrument_work.renta_porcentaje | number: "1.2-4"
+                          }}%
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>IVA ($):</h4>
+                        <div class="field">
+                          $USD {{ instrument_work.iva | number: "1.2-4" }}
+                        </div>
+                      </div>
+
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Comisión desembolso (%):</h4>
+                        <div class="field">
+                          {{
+                            instrument_work.comision_desembolso_porcentaje
+                              | number: "1.2-4"
+                          }}%
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Comisión desembolso ($):</h4>
+                        <div class="field">
+                          $USD
+                          {{
+                            instrument_work.comision_desembolso
+                              | number: "1.2-4"
+                          }}
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Plazo:</h4>
+                        <div class="field">
+                          {{ instrument_work.plazo | number: "1.2-4" }}
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Fecha de operacion:</h4>
+                        <div class="field">
+                          {{ instrument_work.fecha_operacion }}
+                        </div>
+                      </div>
+                      <div class="col-lg-3 col-md-4 col-sm-6">
+                        <h4>Fecha de vencimiento:</h4>
+                        <div class="field">
+                          {{ instrument_work.fecha_vencimiento }}
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+              <br />
+              <br />
+              <div class="align-container">
+                <form *ngIf="dataRetrieved" [formGroup]="form">
+                  <div *ngFor="let group of form.controls; let i = index">
+                    <div class="wrapper-form" [formGroup]="group">
+                      <div class="costs-input-small-container">
+                        <div class="form-group">
+                          <label for="posicion">Posicion: </label>
+
+                          <div class="input-box-container">
+                            <input
+                              type="text"
+                              formControlName="posicion"
+                              class="form-control"
+                              readonly
+                            />
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-small-container">
+                        <div class="form-group">
+                          <label for="plazo">Plazo: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="far fa-clock" aria-hidden="true"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="plazo"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="fecha_pago">Fecha pago: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i
+                                  class="far fa-calendar"
+                                  aria-hidden="true"
+                                ></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="fecha_pago"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="tasa_porcentaje">Tasa: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-percent"></i>
+                              </p>
+                              <input
+                                type="number"
+                                formControlName="tasa_porcentaje"
+                                class="form-control"
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="saldo_inicial">Saldo inicial: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="saldo_inicial"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="pago_cuota">Pago cuota: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="pago_cuota"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="ingreso_bruto">Ingreso bruto: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="ingreso_bruto"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="iva_interes">IVA (%): </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-percent"></i>
+                              </p>
+                              <input
+                                type="number"
+                                formControlName="iva_interes"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="ingreso_neto">Ingreso neto: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="ingreso_neto"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="abono_capital">Abono capital: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="abono_capital"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="capital_restante"
+                            >Capital restante:
+                          </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="capital_restante"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="pago_seguro_dano"
+                            >Pago seguro daño:
+                          </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="pago_seguro_dano"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="pago_seguro_vivienda"
+                            >Pago seguro vivienda:
+                          </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="pago_seguro_vivienda"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="total_cuota">Total cuota: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="text"
+                                formControlName="total_cuota"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="amortizacion_capital"
+                            >Amortización capital:
+                          </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="number"
+                                formControlName="amortizacion_capital"
+                                class="form-control"
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                      <div class="costs-input-normal-container">
+                        <div class="form-group">
+                          <label for="total_recibir">Total a recibir: </label>
+
+                          <div class="input-box-container">
+                            <div>
+                              <p>
+                                <i class="fas fa-dollar-sign"></i>
+                              </p>
+                              <input
+                                type="number"
+                                formControlName="total_recibir"
+                                class="form-control"
+                                readonly
+                              />
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+
+                      <input
+                        type="hidden"
+                        formControlName="id_proyeccion_ingreso"
+                      />
+                      <div class="clear"></div>
+                    </div>
+                  </div>
+                  <br />
+                  <div class="form-group text-right space-20">
+                    <button
+                      type="button"
+                      class="btn btn-success center-component float-left"
+                      (click)="saveProjection()"
+                    >
+                      Guardar información de proyecciones
+                    </button>
+
+                    <button
+                      type="button"
+                      class="btn btn-primary center-component float-right"
+                      (click)="recalculateProjectionChanges()"
+                    >
+                      Recalcular proyecciones
+                    </button>
+                  </div>
+                  <br />
+                </form>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <br />
+    </div>
+  </div>
+</div>

+ 231 - 0
src/app/components/investments/costs/pper/pper.costs.component.ts

@@ -0,0 +1,231 @@
+import { Component, ViewChild, OnInit } from "@angular/core";
+import { MatPaginator } from "@angular/material/paginator";
+import { MatSort } from "@angular/material/sort";
+import { MatTableDataSource } from "@angular/material/table";
+import Swal from "sweetalert2";
+import { CatalogsService } from "src/app/services/catalogs.service";
+import { InvestmentsService } from "@app/services/investments.service";
+import { InstrumentCalculations } from "@app/services/instrument-calculations.service";
+
+import { AuthService } from "@app/services/auth2.service";
+import { JwtHelperService } from "@auth0/angular-jwt";
+import { InvestmentProposal } from "@app/models/investment-proposal";
+import { from } from "rxjs";
+import { FormInvestmentProposalService } from "@app/services/form-investment-proposal.service";
+import { Router, ActivatedRoute } from "@angular/router";
+import {
+  FormBuilder,
+  FormGroup,
+  FormControl,
+  FormArray,
+  Validators
+} from "@angular/forms";
+
+@Component({
+  selector: "app-pper-costs",
+  templateUrl: "./pper.costs.component.html"
+  //styleUrls: ["./dap.costs.component.scss"]
+})
+export class PPERCostsComponent implements OnInit {
+  helper = new JwtHelperService();
+
+  title: string = "Proyecciones para préstamos personales";
+
+  listProposals: InvestmentProposal[];
+  dataSource = new MatTableDataSource(this.listProposals);
+
+  resultsLength = 0;
+  isLoadingResults = true;
+  isRateLimitReached = false;
+  userRole: any;
+
+  @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
+  @ViewChild(MatSort, { static: true }) sort: MatSort;
+  role_number: any;
+  investmentProposalID: string;
+
+  form: FormArray;
+  investmentProposalForm: FormGroup;
+
+  proyecciones: any;
+  proyeccionesProps = [];
+  dataRetrieved: boolean = false;
+
+  array1;
+  array2;
+  array3;
+  investment: any;
+  instrument_work: any;
+  instrument_exists: boolean;
+
+  constructor(
+    private catalogService: CatalogsService,
+    private investmentsService: InvestmentsService,
+    private authService: AuthService,
+    private formInvestmentProposal: FormInvestmentProposalService,
+    private router: Router,
+    private route: ActivatedRoute,
+    private instrumentService: InstrumentCalculations,
+
+    private formBuilder: FormBuilder
+  ) {
+    const decodedToken = this.helper.decodeToken(
+      this.authService.getJwtToken()
+    );
+    this.userRole = decodedToken.groups;
+
+    Swal.fire({
+      allowOutsideClick: false,
+      icon: "info",
+      text: "Espere por favor..."
+    });
+    Swal.showLoading();
+  }
+
+  ngOnInit() {
+    Swal.close();
+    const formDataObj = {};
+
+    this.route.params.subscribe(params => {
+      this.investmentProposalID = params["id"];
+    });
+
+    if (this.investmentProposalID == undefined)
+      this.investmentProposalID = this.route.snapshot.queryParamMap.get("id");
+
+    if (this.investmentProposalID != undefined) {
+      this.investmentsService
+        .getProposalInvestment(this.investmentProposalID)
+        .subscribe(
+          res => {
+            this.investment = res["result"];
+            this.instrument_work =
+              res["result"]["id_inversion_instrumento"]["instrumento"];
+            this.instrument_exists = true;
+          },
+          err => {}
+        );
+
+      this.investmentsService
+        .getProposalInvestment(this.investmentProposalID)
+        .subscribe(
+          res => {
+            this.proyecciones =
+              res["result"]["id_inversion_instrumento"]["instrumento"][
+                "proyecciones"
+              ];
+            this.proyecciones.pop();
+            this.form = new FormArray(this.buildForm(this.proyecciones));
+            this.dataRetrieved = true;
+          },
+          err => {
+            Swal.fire({
+              icon: "error",
+              title: "Error en el servidor",
+              text: err.message
+            });
+          }
+        );
+    }
+
+    setTimeout(() => {
+      Swal.close();
+    }, 1200);
+  }
+
+  recalculateProjectionChanges() {
+    let objProjection = { proyecciones: this.form.value };
+    Swal.fire({
+      allowOutsideClick: false,
+      icon: "info",
+      text: "Espere por favor..."
+    });
+    Swal.showLoading();
+
+    this.instrumentService
+      .projectionCalc(this.investmentProposalID, this.form.value)
+      .subscribe(
+        result => {
+          Swal.fire({
+            allowOutsideClick: false,
+            icon: "success",
+            showCancelButton: false,
+            title: "Exito"
+          });
+          this.proyecciones = result["result"]["proyecciones"];
+          this.proyecciones.pop();
+          this.form.clear();
+          this.form = new FormArray(this.buildForm(this.proyecciones));
+          Swal.close();
+          //window.location.reload();
+        },
+        err => {
+          Swal.fire({
+            icon: "error",
+            title: "Error al guardar",
+            text: err.message
+          });
+        }
+      );
+  }
+
+  saveProjection() {
+    let objProjection = { proyecciones: this.form.value };
+    Swal.fire({
+      allowOutsideClick: false,
+      icon: "info",
+      text: "Espere por favor..."
+    });
+    Swal.showLoading();
+
+    this.instrumentService
+      .projectionModification(this.investmentProposalID, objProjection)
+      .subscribe(
+        resp => {
+          Swal.fire({
+            allowOutsideClick: false,
+            icon: "success",
+            showCancelButton: false,
+            title: "Exito",
+            confirmButtonText: "La información ha sido actualizada"
+          }).then(result => {
+            Swal.close();
+            //window.location.reload();
+          });
+        },
+        err => {
+          Swal.fire({
+            icon: "error",
+            title: "Error al guardar",
+            text: err.message
+          });
+        }
+      );
+  }
+
+  buildForm(items: any[]): FormGroup[] {
+    return items.map(x => this.buildItem(x));
+  }
+  //return a formGroup
+  buildItem(item: any): FormGroup {
+    return new FormGroup({
+      id_proyeccion_ingreso: new FormControl(item.id_proyeccion_ingreso),
+      posicion: new FormControl(item.posicion),
+      plazo: new FormControl(item.plazo),
+      fecha_pago: new FormControl(item.fecha_pago),
+      tasa_porcentaje: new FormControl(item.tasa_porcentaje),
+      saldo_inicial: new FormControl(item.saldo_inicial),
+      pago_cuota: new FormControl(item.pago_cuota),
+      ingreso_bruto: new FormControl(item.ingreso_bruto),
+      iva_interes: new FormControl(item.iva_interes),
+      ingreso_neto: new FormControl(item.ingreso_neto),
+      abono_capital: new FormControl(item.abono_capital),
+      capital_restante: new FormControl(item.capital_restante),
+      pago_seguro_dano: new FormControl(item.pago_seguro_dano),
+      pago_seguro_vivienda: new FormControl(item.pago_seguro_vivienda),
+      total_cuota: new FormControl(item.total_cuota),
+      amortizacion_capital: new FormControl(item.amortizacion_capital),
+      total_recibir: new FormControl(item.total_recibir)
+    });
+  }
+}

+ 2 - 0
src/app/components/investments/investments.component.ts

@@ -141,6 +141,8 @@ export class InvestmentsComponent implements OnInit {
         }
         }
         break;
         break;
       case "FINV":
       case "FINV":
+      case "PEMP":
+      case "PPER":
         return true;
         return true;
       default:
       default:
         return false;
         return false;

+ 4 - 0
src/app/layouts/admin/admin.module.ts

@@ -81,6 +81,8 @@ import { FINVCostsComponent } from "@app/components/investments/costs/fondos/fon
 import { InvestmentPrint } from "@app/components/plugins/investment-print/investment-print";
 import { InvestmentPrint } from "@app/components/plugins/investment-print/investment-print";
 import { PPER } from "@app/components/instruments/pper/pper.component";
 import { PPER } from "@app/components/instruments/pper/pper.component";
 import { PEMP } from "@app/components/instruments/pemp/pemp.component";
 import { PEMP } from "@app/components/instruments/pemp/pemp.component";
+import { PEMPCostsComponent } from "@app/components/investments/costs/pemp/pemp.costs.component";
+import { PPERCostsComponent } from "@app/components/investments/costs/pper/pper.costs.component";
 
 
 // This array defines which "componentId" maps to which lazy-loaded module.
 // This array defines which "componentId" maps to which lazy-loaded module.
 
 
@@ -159,6 +161,8 @@ import { PEMP } from "@app/components/instruments/pemp/pemp.component";
     VCNCostsComponent,
     VCNCostsComponent,
     PBURCostsComponent,
     PBURCostsComponent,
     FINVCostsComponent,
     FINVCostsComponent,
+    PEMPCostsComponent,
+    PPERCostsComponent,
     IncomesComponent,
     IncomesComponent,
     GeneralIncomeFormComponent,
     GeneralIncomeFormComponent,
     PaymentApprovalComponent,
     PaymentApprovalComponent,

+ 10 - 0
src/app/layouts/admin/admin.routing.ts

@@ -33,6 +33,8 @@ import { GeneralIncomeFormComponent } from "@app/components/incomes/general-form
 import { PaymentApprovalComponent } from "@app/components/investment-proposals/payment-approval/payment-approval.component";
 import { PaymentApprovalComponent } from "@app/components/investment-proposals/payment-approval/payment-approval.component";
 import { UploadLiquidationComponent } from "@app/components/investment-proposals/upload-liquidation/upload-liquidation.component";
 import { UploadLiquidationComponent } from "@app/components/investment-proposals/upload-liquidation/upload-liquidation.component";
 import { FINVCostsComponent } from "@app/components/investments/costs/fondos/fondos.costs.component";
 import { FINVCostsComponent } from "@app/components/investments/costs/fondos/fondos.costs.component";
+import { PEMPCostsComponent } from "@app/components/investments/costs/pemp/pemp.costs.component";
+import { PPERCostsComponent } from "@app/components/investments/costs/pper/pper.costs.component";
 
 
 export const AdminLayoutRoutes: Routes = [
 export const AdminLayoutRoutes: Routes = [
   {
   {
@@ -218,6 +220,14 @@ export const AdminLayoutRoutes: Routes = [
     path: "investment-costs/finv/:id",
     path: "investment-costs/finv/:id",
     component: FINVCostsComponent
     component: FINVCostsComponent
   },
   },
+  {
+    path: "investment-costs/pemp/:id",
+    component: PEMPCostsComponent
+  },
+  {
+    path: "investment-costs/pper/:id",
+    component: PPERCostsComponent
+  },
   {
   {
     path: "investment-costs/pbur/:id",
     path: "investment-costs/pbur/:id",
     component: PBURCostsComponent
     component: PBURCostsComponent

+ 2 - 0
src/app/models/investment-proposal-form.ts

@@ -19,6 +19,7 @@ export class InvestmentProposalForm {
   formato_ingreso: string = "";
   formato_ingreso: string = "";
   plazo: string = "";
   plazo: string = "";
   operaciones: string = "";
   operaciones: string = "";
+  resultado_operacion: string = "";
 
 
   clear() {
   clear() {
     this.asunto = "";
     this.asunto = "";
@@ -41,6 +42,7 @@ export class InvestmentProposalForm {
     this.plazo = "";
     this.plazo = "";
     this.operaciones = "";
     this.operaciones = "";
     this.formato_ingreso = "";
     this.formato_ingreso = "";
+    this.resultado_operacion = "";
   }
   }
 }
 }
 
 

+ 1 - 0
src/app/services/instrument-calculations.service.ts

@@ -86,6 +86,7 @@ export class InstrumentCalculations {
       id_formato_ingreso: number;
       id_formato_ingreso: number;
     },
     },
     info_instrumento: {
     info_instrumento: {
+      completo: number;
       renta_porcentaje: number;
       renta_porcentaje: number;
       costo_cedeval: number;
       costo_cedeval: number;
       comision_casa_porcentaje_compra: number;
       comision_casa_porcentaje_compra: number;