Selaa lähdekoodia

Correcciones en instrumentos

Oscar José Nuñez Chávez 5 vuotta sitten
vanhempi
commit
366898ca74

+ 3 - 6
src/app/components/instruments/bonos/bonos.component.ts

@@ -150,6 +150,9 @@ export class BONO implements InstrumentComponent {
       this.instrument_work != undefined &&
       this.instrument_work.proyecciones != ""
     ) {
+      if (+this.instrument_work["valor_nominal_venta"] > 0) {
+        this.tipoEjecucion = 1;
+      }
       this.hasProjections = true;
       this.consolidado_proyeccion = this.instrument_work.proyecciones[
         this.instrument_work.proyecciones.length - 1
@@ -175,12 +178,6 @@ export class BONO implements InstrumentComponent {
       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({
       ejecucion: [this.instrument_exists ? "" : this.tipoEjecucion],
 

+ 3 - 6
src/app/components/instruments/certificados/certificados.component.ts

@@ -150,6 +150,9 @@ export class CINV implements InstrumentComponent {
       this.instrument_work != undefined &&
       this.instrument_work.proyecciones != ""
     ) {
+      if (+this.instrument_work["valor_nominal_venta"] > 0) {
+        this.tipoEjecucion = 1;
+      }
       this.hasProjections = true;
       this.consolidado_proyeccion = this.instrument_work.proyecciones[
         this.instrument_work.proyecciones.length - 1
@@ -175,12 +178,6 @@ export class CINV implements InstrumentComponent {
       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({
       ejecucion: [this.instrument_exists ? "" : this.tipoEjecucion],
 

+ 4 - 48
src/app/components/instruments/cete/cete.component.html

@@ -156,36 +156,6 @@
         </div>
       </div>
 
-      <div class="col-lg-6 col-sm-12 pr-xl-3">
-        <div class="form-group">
-          <label for="renta_porcentaje">Renta: </label>
-          <div class="input-box-container">
-            <p>
-              <i class="fas fa-percent" aria-hidden="true"></i>
-            </p>
-            <input
-              type="text"
-              formControlName="renta_porcentaje"
-              class="form-control"
-              [ngClass]="{
-                'is-invalid': submitted && f.renta_porcentaje.errors
-              }"
-            />
-            <div
-              *ngIf="submitted && f.renta_porcentaje.errors"
-              class="invalid-feedback"
-            >
-              <div *ngIf="f.renta_porcentaje.errors.required">
-                Campo requerido
-              </div>
-              <div *ngIf="f.renta_porcentaje.errors.pattern">
-                Debe ingresar una cifra válida
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-
       <!-- Otros Costos -->
       <div class="col-lg-6 col-sm-12 pr-xl-3">
         <div class="form-group">
@@ -428,15 +398,13 @@
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_bruto == "" || row.ingreso_bruto == undefined
                     ? "-"
-                    : row.ingreso_bruto | number: "1.2-4"
+                    : (row.ingreso_bruto | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
                 }}
@@ -446,15 +414,13 @@
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_neto == "" || row.ingreso_neto == undefined
                     ? "-"
-                    : row.ingreso_neto | number: "1.2-4"
+                    : (row.ingreso_neto | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
                 }}
@@ -567,12 +533,6 @@
         </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>Rendimiento bruto:</h4>
         <div class="field">
@@ -663,15 +623,13 @@
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_bruto == "" || row.ingreso_bruto == undefined
                     ? "-"
-                    : row.ingreso_bruto | number: "1.2-4"
+                    : (row.ingreso_bruto | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
                 }}
@@ -681,15 +639,13 @@
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_neto == "" || row.ingreso_neto == undefined
                     ? "-"
-                    : row.ingreso_neto | number: "1.2-4"
+                    : (row.ingreso_neto | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
                 }}

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

@@ -129,14 +129,6 @@ export class CETE implements InstrumentComponent {
     }
 
     this.investmentProposalForm = this.formBuilder.group({
-      renta_porcentaje: [
-        this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
-        [
-          Validators.required,
-          Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-        ]
-      ],
-
       valor_nominal: [
         this.instrument_exists ? "" : this.instrument_work.valor_nominal,
         [
@@ -278,7 +270,6 @@ export class CETE implements InstrumentComponent {
           id_periodicidad: +this.general.periodicidad
         },
         {
-          renta_porcentaje: +this.f.renta_porcentaje.value,
           valor_nominal: +this.f.valor_nominal.value,
           comision_casa_porcentaje: this.f.comision_casa_porcentaje.value,
           comision_bolsa_porcentaje: this.f.comision_bolsa_porcentaje.value,
@@ -318,8 +309,6 @@ export class CETE implements InstrumentComponent {
           this.dataSource.sort = this.sort;
 
           this.ceteObject = {
-            renta_porcentaje: this.investmentProposalForm.value
-              .renta_porcentaje,
             valor_nominal: this.investmentProposalForm.value.valor_nominal,
             plazo: this.investmentProposalForm.value.plazo,
             comision_casa_porcentaje: this.investmentProposalForm.value

+ 3 - 6
src/app/components/instruments/eurobonos/eurobonos.component.ts

@@ -150,6 +150,9 @@ export class EURB implements InstrumentComponent {
       this.instrument_work != undefined &&
       this.instrument_work.proyecciones != ""
     ) {
+      if (+this.instrument_work["valor_nominal_venta"] > 0) {
+        this.tipoEjecucion = 1;
+      }
       this.hasProjections = true;
       this.consolidado_proyeccion = this.instrument_work.proyecciones[
         this.instrument_work.proyecciones.length - 1
@@ -175,12 +178,6 @@ export class EURB implements InstrumentComponent {
       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({
       ejecucion: [this.instrument_exists ? "" : this.tipoEjecucion],
 

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

@@ -253,35 +253,6 @@
         </div>
       </div>
 
-      <div class="col-lg-6 col-sm-12 pr-xl-3">
-        <div class="form-group">
-          <label for="renta_porcentaje">Renta: </label>
-          <div class="input-box-container">
-            <p>
-              <i class="fas fa-percent" aria-hidden="true"></i>
-            </p>
-            <input
-              type="text"
-              formControlName="renta_porcentaje"
-              class="form-control"
-              [ngClass]="{
-                'is-invalid': submitted && f.renta_porcentaje.errors
-              }"
-            />
-            <div
-              *ngIf="submitted && f.renta_porcentaje.errors"
-              class="invalid-feedback"
-            >
-              <div *ngIf="f.renta_porcentaje.errors.required">
-                Campo requerido
-              </div>
-              <div *ngIf="f.renta_porcentaje.errors.pattern">
-                Debe ingresar una cifra válida
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
 
       <!-- Fecha de operación -->
       <div class="col-lg-6 col-sm-12 pr-xl-3">
@@ -683,12 +654,7 @@
           $USD {{ instrument_work_summary.comision_bolsa | 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_summary.renta_porcentaje | number: "1.2-4" }}%
-        </div>
-      </div>
+      
       <div class="col-lg-3 col-md-4 col-sm-6">
         <h4>Rendimiento (%):</h4>
         <div class="field">

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

@@ -155,13 +155,6 @@ export class FINV implements InstrumentComponent {
     }
 
     this.investmentProposalForm = this.formBuilder.group({
-      renta_porcentaje: [
-        this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
-        [
-          Validators.required,
-          Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-        ]
-      ],
       cuota_participacion: [
         this.instrument_exists ? "" : this.instrument_work.cuota_participacion,
         [
@@ -342,8 +335,6 @@ export class FINV implements InstrumentComponent {
           this.dataSource.sort = this.sort;
 
           this.fondosObject = {
-            renta_porcentaje: this.investmentProposalForm.value
-              .renta_porcentaje,
             cuota_participacion: this.investmentProposalForm.value
               .cuota_participacion,
             valor_participacion: this.investmentProposalForm.value

+ 0 - 36
src/app/components/instruments/futuros/futuros.component.html

@@ -75,36 +75,6 @@
           </div>
         </div>
       </div>
-
-      <div class="col-lg-6 col-sm-12 pr-xl-3">
-        <div class="form-group">
-          <label for="renta_porcentaje">Renta: </label>
-          <div class="input-box-container">
-            <p>
-              <i class="fas fa-percent" aria-hidden="true"></i>
-            </p>
-            <input
-              type="text"
-              formControlName="renta_porcentaje"
-              class="form-control"
-              [ngClass]="{
-                'is-invalid': submitted && f.renta_porcentaje.errors
-              }"
-            />
-            <div
-              *ngIf="submitted && f.renta_porcentaje.errors"
-              class="invalid-feedback"
-            >
-              <div *ngIf="f.renta_porcentaje.errors.required">
-                Campo requerido
-              </div>
-              <div *ngIf="f.renta_porcentaje.errors.pattern">
-                Debe ingresar una cifra válida
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
     </div>
 
     <br />
@@ -905,12 +875,6 @@
           {{ instrument_work_summary.ticker }}
         </div>
       </div>
-      <div class="col-6">
-        <h4>Renta (%):</h4>
-        <div class="field">
-          {{ instrument_work_summary.renta_porcentaje | number: "1.2-4" }}%
-        </div>
-      </div>
 
       <!-- COMPRA -->
       <div class="col-12">

+ 2 - 10
src/app/components/instruments/futuros/futuros.component.ts

@@ -157,13 +157,7 @@ export class FUTU implements InstrumentComponent {
       operacion: [this.instrument_exists ? "" : this.instrument_work.corto],
       ejecucion: [this.instrument_exists ? "" : this.ejecucion],
       ticker: [this.instrument_exists ? "" : this.instrument_work.ticker],
-      renta_porcentaje: [
-        this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
-        [
-          Validators.required,
-          Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-        ]
-      ],
+
       precio_unitario_compra: [
         this.instrument_exists
           ? ""
@@ -543,7 +537,6 @@ export class FUTU implements InstrumentComponent {
           cancelado: this.tipoEjecucion,
 
           corto: this.tipoOperacion,
-          renta_porcentaje: +this.f.renta_porcentaje.value,
           precio_unitario_compra: this.f.precio_unitario_compra.value,
           comision_broker_compra: this.f.comision_broker_compra.value,
           cantidad_contratos_compra: this.f.cantidad_contratos_compra.value,
@@ -650,8 +643,7 @@ export class FUTU implements InstrumentComponent {
 
             corto: this.tipoOperacion,
             ticker: this.investmentProposalForm.value.ticker,
-            renta_porcentaje: this.investmentProposalForm.value
-              .renta_porcentaje,
+
             fecha_inicio_vigencia: this.fecha_inicio_vigencia
           };
 

+ 0 - 36
src/app/components/instruments/lete/lete.component.html

@@ -152,36 +152,6 @@
         </div>
       </div>
 
-      <div class="col-lg-6 col-sm-12 pr-xl-3">
-        <div class="form-group">
-          <label for="renta_porcentaje">Renta: </label>
-          <div class="input-box-container">
-            <p>
-              <i class="fas fa-percent" aria-hidden="true"></i>
-            </p>
-            <input
-              type="text"
-              formControlName="renta_porcentaje"
-              class="form-control"
-              [ngClass]="{
-                'is-invalid': submitted && f.renta_porcentaje.errors
-              }"
-            />
-            <div
-              *ngIf="submitted && f.renta_porcentaje.errors"
-              class="invalid-feedback"
-            >
-              <div *ngIf="f.renta_porcentaje.errors.required">
-                Campo requerido
-              </div>
-              <div *ngIf="f.renta_porcentaje.errors.pattern">
-                Debe ingresar una cifra válida
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-
       <div class="col-lg-6 col-sm-12 pr-xl-3">
         <div class="form-group">
           <label for="fecha_operacion">Fecha operación: </label>
@@ -392,12 +362,6 @@
           $USD {{ instrument_work.valor_transado | 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>Total a pagar:</h4>

+ 0 - 11
src/app/components/instruments/lete/lete.component.ts

@@ -92,14 +92,6 @@ export class LETE implements InstrumentComponent {
     this.general = this.formDataService.getGeneralInfo();
 
     this.investmentProposalForm = this.formBuilder.group({
-      renta_porcentaje: [
-        this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
-        [
-          Validators.required,
-          Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-        ]
-      ],
-
       valor_nominal: [
         this.instrument_exists ? "" : this.instrument_work.valor_nominal,
         [
@@ -220,7 +212,6 @@ export class LETE implements InstrumentComponent {
         {
           valor_nominal: +this.f.valor_nominal.value,
           plazo: +this.f.plazo.value,
-          renta_porcentaje: +this.f.renta_porcentaje.value,
           comision_casa_porcentaje: +this.f.comision_casa_porcentaje.value,
           comision_bolsa_porcentaje: +this.f.comision_bolsa_porcentaje.value,
           rendimiento_bruto: +this.f.rendimiento_bruto.value,
@@ -242,8 +233,6 @@ export class LETE implements InstrumentComponent {
           Swal.close();
 
           this.leteObject = {
-            renta_porcentaje: this.investmentProposalForm.value
-              .renta_porcentaje,
             valor_nominal: this.investmentProposalForm.value.valor_nominal,
             plazo: this.investmentProposalForm.value.plazo,
             comision_casa_porcentaje: this.investmentProposalForm.value

+ 0 - 36
src/app/components/instruments/opciones/opciones.component.html

@@ -70,36 +70,6 @@
           </div>
         </div>
       </div>
-
-      <div class="col-lg-6 col-sm-12 pr-xl-3">
-        <div class="form-group">
-          <label for="renta_porcentaje">Renta: </label>
-          <div class="input-box-container">
-            <p>
-              <i class="fas fa-percent" aria-hidden="true"></i>
-            </p>
-            <input
-              type="text"
-              formControlName="renta_porcentaje"
-              class="form-control"
-              [ngClass]="{
-                'is-invalid': submitted && f.renta_porcentaje.errors
-              }"
-            />
-            <div
-              *ngIf="submitted && f.renta_porcentaje.errors"
-              class="invalid-feedback"
-            >
-              <div *ngIf="f.renta_porcentaje.errors.required">
-                Campo requerido
-              </div>
-              <div *ngIf="f.renta_porcentaje.errors.pattern">
-                Debe ingresar una cifra válida
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
     </div>
 
     <br />
@@ -900,12 +870,6 @@
           {{ instrument_work_summary.ticker }}
         </div>
       </div>
-      <div class="col-6">
-        <h4>Renta (%):</h4>
-        <div class="field">
-          {{ instrument_work_summary.renta_porcentaje | number: "1.2-4" }}%
-        </div>
-      </div>
 
       <!-- COMPRA -->
       <div class="col-12">

+ 2 - 10
src/app/components/instruments/opciones/opciones.component.ts

@@ -137,13 +137,7 @@ export class OPC implements InstrumentComponent {
     this.investmentProposalForm = this.formBuilder.group({
       operacion: [this.instrument_exists ? "" : +this.instrument_work.corto],
       ejecucion: [this.instrument_exists ? "" : this.ejecucion],
-      renta_porcentaje: [
-        this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
-        [
-          Validators.required,
-          Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-        ]
-      ],
+
       ticker: [this.instrument_exists ? "" : this.instrument_work.ticker],
       precio_unitario_compra: [
         this.instrument_exists
@@ -530,7 +524,6 @@ export class OPC implements InstrumentComponent {
           cancelado: this.tipoEjecucion,
 
           corto: this.tipoOperacion,
-          renta_porcentaje: +this.f.renta_porcentaje.value,
           precio_unitario_compra: this.f.precio_unitario_compra.value,
           comision_broker_compra: this.f.comision_broker_compra.value,
           cantidad_contratos_compra: this.f.cantidad_contratos_compra.value,
@@ -637,8 +630,7 @@ export class OPC implements InstrumentComponent {
 
             corto: this.tipoOperacion,
             ticker: this.investmentProposalForm.value.ticker,
-            renta_porcentaje: this.investmentProposalForm.value
-              .renta_porcentaje,
+
             fecha_inicio_vigencia: this.fecha_inicio_vigencia
           };
 

+ 16 - 30
src/app/components/instruments/pbur/pbur.component.html

@@ -351,7 +351,10 @@
             >Cálculos del instrumento</span
           >
         </div>
-
+        <div class="col-sm-6">
+          <h4>Renta (%):</h4>
+          <div class="field">{{ renta_porcentaje | number: "1.2-4" }}%</div>
+        </div>
         <div class="col-sm-6">
           <h4>Ingreso bruto:</h4>
           <div class="field">$USD {{ ingreso_bruto | number: "1.2-4" }}</div>
@@ -444,7 +447,6 @@
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_bruto == "" || row.ingreso_bruto == undefined
                     ? "-"
@@ -452,7 +454,6 @@
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
                 }}
@@ -461,7 +462,6 @@
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_neto == "" || row.ingreso_neto == undefined
                     ? "-"
@@ -469,7 +469,6 @@
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
                 }}
@@ -478,11 +477,9 @@
             <ng-container matColumnDef="costo_cedeval">
               <th mat-header-cell *matHeaderCellDef>Costo CEDEVAL</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_cedeval | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_costo_cedeval | number: "1.2-4"
                 }}
@@ -491,7 +488,6 @@
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.renta | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -501,11 +497,9 @@
             <ng-container matColumnDef="costo_transferencia">
               <th mat-header-cell *matHeaderCellDef>Costo transferencia</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_transferencia | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_costo_transferencia
                     | number: "1.2-4"
@@ -515,22 +509,20 @@
             <ng-container matColumnDef="costo_banco">
               <th mat-header-cell *matHeaderCellDef>Costo banco</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_banco | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
-                ${{ consolidado_proyeccion.total_costo_banco | number: "1.2-4" }}
+                ${{
+                  consolidado_proyeccion.total_costo_banco | number: "1.2-4"
+                }}
               </td>
             </ng-container>
             <ng-container matColumnDef="otros_costos">
               <th mat-header-cell *matHeaderCellDef>Otros costos</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.otros_costos | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_otros_costos | number: "1.2-4"
                 }}
@@ -595,7 +587,12 @@
           $USD {{ instrument_work.valor_transado | 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>Precio porcentaje:</h4>
         <div class="field">
@@ -744,7 +741,6 @@
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_bruto == "" || row.ingreso_bruto == undefined
                     ? "-"
@@ -752,7 +748,6 @@
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
                 }}
@@ -761,7 +756,6 @@
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_neto == "" || row.ingreso_neto == undefined
                     ? "-"
@@ -769,7 +763,6 @@
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
                 }}
@@ -778,11 +771,9 @@
             <ng-container matColumnDef="costo_cedeval">
               <th mat-header-cell *matHeaderCellDef>Costo CEDEVAL</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_cedeval | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_costo_cedeval | number: "1.2-4"
                 }}
@@ -791,7 +782,6 @@
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.renta | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -801,11 +791,9 @@
             <ng-container matColumnDef="costo_transferencia">
               <th mat-header-cell *matHeaderCellDef>Costo transferencia</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_transferencia | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_costo_transferencia
                     | number: "1.2-4"
@@ -815,22 +803,20 @@
             <ng-container matColumnDef="costo_banco">
               <th mat-header-cell *matHeaderCellDef>Costo banco</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_banco | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
-                ${{ consolidado_proyeccion.total_costo_banco | number: "1.2-4" }}
+                ${{
+                  consolidado_proyeccion.total_costo_banco | number: "1.2-4"
+                }}
               </td>
             </ng-container>
             <ng-container matColumnDef="otros_costos">
               <th mat-header-cell *matHeaderCellDef>Otros costos</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.otros_costos | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_otros_costos | number: "1.2-4"
                 }}

+ 2 - 0
src/app/components/instruments/pbur/pbur.component.ts

@@ -105,6 +105,7 @@ export class PBUR implements InstrumentComponent {
   @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
   @ViewChild(MatSort, { static: true }) sort: MatSort;
   fecha_vencimiento: any;
+  renta_porcentaje: any;
   constructor(
     private formBuilder: FormBuilder,
     private router: Router,
@@ -313,6 +314,7 @@ export class PBUR implements InstrumentComponent {
           this.fecha_inicio_vigencia = ans["result"]["fecha_inicio_vigencia"];
           this.fecha_vencimiento = ans["result"]["fecha_vencimiento"];
           this.proyecciones = ans["result"]["proyecciones"];
+          this.renta_porcentaje = ans["result"]["renta_porcentaje"];
 
           if (this.proyecciones != undefined && this.proyecciones.length > 0) {
             this.consolidado_proyeccion = this.proyecciones.slice(0, -1);

+ 1 - 36
src/app/components/instruments/pemp/pemp.component.html

@@ -100,36 +100,6 @@
         </div>
       </div>
 
-      <div class="col-lg-6 col-sm-12 pr-xl-3">
-        <div class="form-group">
-          <label for="renta_porcentaje">Renta: </label>
-          <div class="input-box-container">
-            <p>
-              <i class="fas fa-percent" aria-hidden="true"></i>
-            </p>
-            <input
-              type="text"
-              formControlName="renta_porcentaje"
-              class="form-control"
-              [ngClass]="{
-                'is-invalid': submitted && f.renta_porcentaje.errors
-              }"
-            />
-            <div
-              *ngIf="submitted && f.renta_porcentaje.errors"
-              class="invalid-feedback"
-            >
-              <div *ngIf="f.renta_porcentaje.errors.required">
-                Campo requerido
-              </div>
-              <div *ngIf="f.renta_porcentaje.errors.pattern">
-                Debe ingresar una cifra válida
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-
       <!-- Comisián desembolso -->
       <div class="col-lg-6 col-sm-12 pr-xl-3">
         <div class="form-group">
@@ -507,12 +477,7 @@
           {{ 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">

+ 0 - 11
src/app/components/instruments/pemp/pemp.component.ts

@@ -134,14 +134,6 @@ export class PEMP implements InstrumentComponent {
     }
 
     this.investmentProposalForm = this.formBuilder.group({
-      renta_porcentaje: [
-        this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
-        [
-          Validators.required,
-          Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-        ]
-      ],
-
       monto_prestamo: [
         this.instrument_exists ? "" : this.instrument_work.monto_prestamo,
         [
@@ -242,7 +234,6 @@ export class PEMP implements InstrumentComponent {
         },
         {
           monto_prestamo: +this.f.monto_prestamo.value,
-          renta_porcentaje: +this.f.renta_porcentaje.value,
           tasa_porcentaje: +this.f.tasa_porcentaje.value,
           iva_porcentaje: +this.f.iva_porcentaje.value,
           comision_desembolso_porcentaje: +this.f.comision_desembolso_porcentaje
@@ -282,8 +273,6 @@ export class PEMP implements InstrumentComponent {
           this.dataSource.sort = this.sort;
 
           this.pempObject = {
-            renta_porcentaje: this.investmentProposalForm.value
-              .renta_porcentaje,
             monto_prestamo: this.investmentProposalForm.value.monto_prestamo,
             tasa_porcentaje: this.investmentProposalForm.value.tasa_porcentaje,
             iva_porcentaje: this.investmentProposalForm.value.iva_porcentaje,

+ 16 - 29
src/app/components/instruments/vcn/vcn.component.html

@@ -362,7 +362,10 @@
             >Cálculos del instrumento</span
           >
         </div>
-
+        <div class="col-sm-6">
+          <h4>Renta (%):</h4>
+          <div class="field">{{ renta_porcentaje | number: "1.2-4" }}%</div>
+        </div>
         <div class="col-sm-6">
           <h4>Ingreso bruto:</h4>
           <div class="field">$USD {{ ingreso_bruto | number: "1.2-4" }}</div>
@@ -456,7 +459,6 @@
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_bruto == "" || row.ingreso_bruto == undefined
                     ? "-"
@@ -464,7 +466,6 @@
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
                 }}
@@ -473,7 +474,6 @@
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_neto == "" || row.ingreso_neto == undefined
                     ? "-"
@@ -481,7 +481,6 @@
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
                 }}
@@ -490,11 +489,9 @@
             <ng-container matColumnDef="costo_cedeval">
               <th mat-header-cell *matHeaderCellDef>Costo CEDEVAL</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_cedeval | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_costo_cedeval | number: "1.2-4"
                 }}
@@ -503,7 +500,6 @@
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.renta | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -513,11 +509,9 @@
             <ng-container matColumnDef="costo_transferencia">
               <th mat-header-cell *matHeaderCellDef>Costo transferencia</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_transferencia | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_costo_transferencia
                     | number: "1.2-4"
@@ -527,22 +521,20 @@
             <ng-container matColumnDef="costo_banco">
               <th mat-header-cell *matHeaderCellDef>Costo banco</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_banco | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
-                ${{ consolidado_proyeccion.total_costo_banco | number: "1.2-4" }}
+                ${{
+                  consolidado_proyeccion.total_costo_banco | number: "1.2-4"
+                }}
               </td>
             </ng-container>
             <ng-container matColumnDef="otros_costos">
               <th mat-header-cell *matHeaderCellDef>Otros costos</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.otros_costos | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_otros_costos | number: "1.2-4"
                 }}
@@ -608,6 +600,12 @@
           $USD {{ instrument_work.valor_transado | 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>Precio porcentaje:</h4>
         <div class="field">
@@ -755,7 +753,6 @@
             <ng-container matColumnDef="ingreso_bruto">
               <th mat-header-cell *matHeaderCellDef>Ingreso bruto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_bruto == "" || row.ingreso_bruto == undefined
                     ? "-"
@@ -763,7 +760,6 @@
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_bruto | number: "1.2-4"
                 }}
@@ -772,7 +768,6 @@
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{
                   row.ingreso_neto == "" || row.ingreso_neto == undefined
                     ? "-"
@@ -780,7 +775,6 @@
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_ingreso_neto | number: "1.2-4"
                 }}
@@ -789,11 +783,9 @@
             <ng-container matColumnDef="costo_cedeval">
               <th mat-header-cell *matHeaderCellDef>Costo CEDEVAL</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_cedeval | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_costo_cedeval | number: "1.2-4"
                 }}
@@ -802,7 +794,6 @@
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.renta | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -812,11 +803,9 @@
             <ng-container matColumnDef="costo_transferencia">
               <th mat-header-cell *matHeaderCellDef>Costo transferencia</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_transferencia | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_costo_transferencia
                     | number: "1.2-4"
@@ -826,22 +815,20 @@
             <ng-container matColumnDef="costo_banco">
               <th mat-header-cell *matHeaderCellDef>Costo banco</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.costo_banco | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
-                ${{ consolidado_proyeccion.total_costo_banco | number: "1.2-4" }}
+                ${{
+                  consolidado_proyeccion.total_costo_banco | number: "1.2-4"
+                }}
               </td>
             </ng-container>
             <ng-container matColumnDef="otros_costos">
               <th mat-header-cell *matHeaderCellDef>Otros costos</th>
               <td mat-cell *matCellDef="let row">
-                
                 ${{ row.otros_costos | number: "1.2-4" }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
-                
                 ${{
                   consolidado_proyeccion.total_otros_costos | number: "1.2-4"
                 }}

+ 2 - 1
src/app/components/instruments/vcn/vcn.component.ts

@@ -103,6 +103,7 @@ export class VCN implements InstrumentComponent {
     total_costo_banco: 0,
     total_otros_costos: 0
   };
+  renta_porcentaje: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -322,6 +323,7 @@ export class VCN implements InstrumentComponent {
           this.interes_acumulado = ans["result"]["interes_acumulado"];
           this.fecha_inicio_vigencia = ans["result"]["fecha_inicio_vigencia"];
           this.proyecciones = ans["result"]["proyecciones"];
+          this.renta_porcentaje = ans["result"]["renta_porcentaje"];
 
           if (this.proyecciones != undefined && this.proyecciones.length > 0) {
             this.consolidado_proyeccion = this.proyecciones.slice(0, -1);
@@ -363,7 +365,6 @@ export class VCN implements InstrumentComponent {
             fecha_inicio_vigencia: this.fecha_inicio_vigencia,
             proyecciones: this.proyecciones,
             plazo: this.plazo,
-            //id_formato_ingreso: this.investmentProposalForm.value.id_formato_ingreso,
 
             fecha_operacion: this.investmentProposalForm.value.fecha_operacion
               .singleDate.formatted,

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

@@ -23,7 +23,6 @@ export class InstrumentCalculations {
       comision_casa_porcentaje: number;
       comision_bolsa_porcentaje: number;
       rendimiento_bruto: number;
-      renta_porcentaje: number;
       fecha_operacion: string;
       fecha_liquidacion?: string;
     }
@@ -51,7 +50,6 @@ export class InstrumentCalculations {
     },
     info_instrumento: {
       valor_nominal: number;
-      renta_porcentaje: number;
       comision_casa_porcentaje: number;
       comision_bolsa_porcentaje: number;
       plazo: number;
@@ -343,7 +341,6 @@ export class InstrumentCalculations {
       monto_prestamo: number;
       tasa_porcentaje: number;
       iva_porcentaje: number;
-      renta_porcentaje: number;
       comision_desembolso_porcentaje: number;
       fecha_operacion: string;
       fecha_vencimiento: string;