Selaa lähdekoodia

Merge branch 'features-o' of onunez/frontend-inversiones into development

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

+ 15 - 21
src/app/components/incomes/general-form/general-form.component.ts

@@ -278,12 +278,9 @@ export class GeneralIncomeFormComponent implements OnInit {
 
   submitIncome(form: any) {
     this.submitted = true;
-    let inversionCapital = this.clearValor(form.value.capital,"decimal")
-    let inversionBruto = this.clearValor(form.value.ingreso_bruto,"decimal")
-    let inversionNeto = this.clearValor(form.value.ingreso_neto,"decimal")
-    console.log(form);
-    console.log(form.value.ingreso_bruto)
-    console.log(inversionBruto)
+    let inversionCapital = this.clearValor(form.value.capital, "decimal");
+    let inversionBruto = this.clearValor(form.value.ingreso_bruto, "decimal");
+    let inversionNeto = this.clearValor(form.value.ingreso_neto, "decimal");
     if (!form.valid) {
       return false;
     }
@@ -344,25 +341,22 @@ export class GeneralIncomeFormComponent implements OnInit {
       }
     );
   }
-  
-clearValor(value,tipoDato){
-    value = parseFloat(value.toString().replace(",",""))        
-return value;
-}
 
-public inputValidator(event: any) {
-  //console.log(event.target.value);
-  const pattern = /^[0-9]*$/;   
-  //let inputChar = String.fromCharCode(event.charCode)
-  
-  if (!pattern.test(event.target.value)) {
+  clearValor(value, tipoDato) {
+    value = parseFloat(value.toString().replace(",", ""));
+    return value;
+  }
 
-    event.target.value = event.target.value.replace(/[^\d,.]+/g, '');
-    // invalid character, prevent input
+  public inputValidator(event: any) {
+    //console.log(event.target.value);
+    const pattern = /^[0-9]*$/;
+    //let inputChar = String.fromCharCode(event.charCode)
 
+    if (!pattern.test(event.target.value)) {
+      event.target.value = event.target.value.replace(/[^\d,.]+/g, "");
+      // invalid character, prevent input
+    }
   }
-  
-}
   conciliateIncome() {
     this.conciliateObject = {
       id_inversion_instrumento: this.projectionRes.id_inversion_instrumento,

+ 0 - 13
src/app/components/instruments/futuros/futuros.component.ts

@@ -130,10 +130,6 @@ export class FUTU implements InstrumentComponent {
     this.instrument_exists = this.instrument_work == undefined;
     this.general = this.formDataService.getGeneralInfo();
 
-    console.log("init");
-    console.log(this.operaciones);
-    console.log(this.instrument_work);
-
     if (
       this.instrument_work != undefined &&
       this.instrument_work.completo == undefined
@@ -292,9 +288,6 @@ export class FUTU implements InstrumentComponent {
       this.instrument_work_summary = this.instrument_work;
       this.operation_result = true;
 
-      console.log("datos");
-      console.log(this.instrument_work_summary);
-
       this.operacion = +this.instrument_work_summary.corto;
       if (this.instrument_work_summary.completo == undefined) {
         if (
@@ -323,11 +316,6 @@ export class FUTU implements InstrumentComponent {
   }
 
   setValidators() {
-    console.log("tipo de operacion");
-    console.log(this.tipoOperacion);
-    console.log("tipo de ejecucion");
-    console.log(this.tipoEjecucion);
-
     const ticker = this.investmentProposalForm.get("ticker");
 
     const precio_unitario_compra = this.investmentProposalForm.get(
@@ -512,7 +500,6 @@ export class FUTU implements InstrumentComponent {
 
   getCalculations(form: any, saveForm: boolean) {
     this.submitted = true;
-    console.log(this.investmentProposalForm);
     if (!form.valid) {
       return false;
     }

+ 0 - 13
src/app/components/instruments/opciones/opciones.component.ts

@@ -130,10 +130,6 @@ export class OPC implements InstrumentComponent {
     this.instrument_exists = this.instrument_work == undefined;
     this.general = this.formDataService.getGeneralInfo();
 
-    console.log("init");
-    console.log(this.operaciones);
-    console.log(this.instrument_work);
-
     this.investmentProposalForm = this.formBuilder.group({
       operacion: [this.instrument_exists ? "" : +this.instrument_work.corto],
       ejecucion: [this.instrument_exists ? "" : this.ejecucion],
@@ -273,9 +269,6 @@ export class OPC implements InstrumentComponent {
       this.instrument_work_summary = this.instrument_work;
       this.operation_result = true;
 
-      console.log("datos");
-      console.log(this.instrument_work_summary);
-
       this.operacion = +this.instrument_work_summary.corto;
       if (this.instrument_work_summary.completo == undefined) {
         if (
@@ -311,11 +304,6 @@ export class OPC implements InstrumentComponent {
   }
 
   setValidators() {
-    console.log("tipo de operacion");
-    console.log(this.tipoOperacion);
-    console.log("tipo de ejecucion");
-    console.log(this.tipoEjecucion);
-
     const ticker = this.investmentProposalForm.get("ticker");
 
     const precio_unitario_compra = this.investmentProposalForm.get(
@@ -499,7 +487,6 @@ export class OPC implements InstrumentComponent {
 
   getCalculations(form: any, saveForm: boolean) {
     this.submitted = true;
-    console.log(this.investmentProposalForm);
     if (!form.valid) {
       return false;
     }

+ 0 - 3
src/app/components/investment-proposals/complement-info/complement-info.component.ts

@@ -91,9 +91,6 @@ export class ComplementInfoComponent implements OnInit {
     this.complementInfoDontExists = this.complementInfo == undefined;
 
     this.instrumentInfo = this.formDataService.getGeneralInfo().instrumentos;
-    console.log(this.instrumentInfo);
-    console.log(this.complementInfo);
-
     this.catalogService.getCatalogInfo("empresas").subscribe(res => {
       this.companies = res;
 

+ 16 - 23
src/app/components/investment-proposals/payment-info/payment-info.component.ts

@@ -238,24 +238,20 @@ export class PaymentInfoComponent implements OnInit {
     return this.investmentProposalForm.controls;
   }
 
-  clearValor(value,tipoDato){
-       value = parseFloat(value.toString().replace(",",""))        
-   return value;
-   }
- 
-   public inputValidator(event: any) {
-     //console.log(event.target.value);
-     const pattern = /^[0-9]*$/;   
-     //let inputChar = String.fromCharCode(event.charCode)
-     
-     if (!pattern.test(event.target.value)) {
- 
-       event.target.value = event.target.value.replace(/[^\d,.]+/g, '');
-       // invalid character, prevent input
- 
-     }
-     
-   }
+  clearValor(value, tipoDato) {
+    value = parseFloat(value.toString().replace(",", ""));
+    return value;
+  }
+
+  public inputValidator(event: any) {
+    const pattern = /^[0-9]*$/;
+    //let inputChar = String.fromCharCode(event.charCode)
+
+    if (!pattern.test(event.target.value)) {
+      event.target.value = event.target.value.replace(/[^\d,.]+/g, "");
+      // invalid character, prevent input
+    }
+  }
 
   nameBankAccounts(id: string) {
     let bank;
@@ -265,10 +261,7 @@ export class PaymentInfoComponent implements OnInit {
 
   sendPaymentInfo(form: any) {
     this.submitted = true;
-
-    console.log(this.inversionAmount)
-    this.inversionAmount = this.clearValor(this.inversionAmount,"decimal")
-    console.log(this.inversionAmount)
+    this.inversionAmount = this.clearValor(this.inversionAmount, "decimal");
     if (!form.valid) {
       return false;
     }
@@ -343,7 +336,7 @@ export class PaymentInfoComponent implements OnInit {
             if (+this.investmentProposalForm.value.tipo_pago == 3) {
               this.paymentObject["id_cuenta_bancaria_destino"] = +this
                 .investmentProposalForm.value.cuenta_bancaria_destino;
-            }else{
+            } else {
               this.paymentObject["id_cuenta_bancaria_destino"] = null;
             }
           }

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

@@ -355,7 +355,6 @@ export class InvestmentProposalDetailComponent implements OnInit {
           res => {
             this.logs = res["result"];
             this.logsExists = true;
-            console.log(this.logs);
           },
           error => {}
         );

+ 36 - 11
src/app/components/investments/costs/pbur/pbur.costs.component.html

@@ -54,6 +54,14 @@
                           {{ 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">
@@ -231,7 +239,10 @@
                               <input
                                 type="text"
                                 formControlName="ingreso_bruto"
-                                [value]="group.get('ingreso_bruto').value | number: '1.2-4'"
+                                [value]="
+                                  group.get('ingreso_bruto').value
+                                    | number: '1.2-4'
+                                "
                                 class="form-control"
                                 readonly
                               />
@@ -249,9 +260,11 @@
                                 <i class="fas fa-dollar-sign"></i>
                               </p>
                               <input
-                                type="text"   
+                                type="text"
                                 formControlName="costo_cedeval"
-                                [value]="group.get('costo_cedeval').value | numberPipe" 
+                                [value]="
+                                  group.get('costo_cedeval').value | numberPipe
+                                "
                                 class="form-control"
                                 (input)="inputValidator($event)"
                               />
@@ -271,9 +284,12 @@
                                 <i class="fas fa-dollar-sign"></i>
                               </p>
                               <input
-                                type="text"   
+                                type="text"
                                 formControlName="costo_transferencia"
-                                [value]="group.get('costo_transferencia').value | numberPipe" 
+                                [value]="
+                                  group.get('costo_transferencia').value
+                                    | numberPipe
+                                "
                                 class="form-control"
                                 (input)="inputValidator($event)"
                               />
@@ -291,9 +307,11 @@
                                 <i class="fas fa-dollar-sign"></i>
                               </p>
                               <input
-                                type="text"   
+                                type="text"
                                 formControlName="costo_banco"
-                                [value]="group.get('costo_banco').value | numberPipe" 
+                                [value]="
+                                  group.get('costo_banco').value | numberPipe
+                                "
                                 class="form-control"
                                 (input)="inputValidator($event)"
                               />
@@ -312,9 +330,11 @@
                                 <i class="fas fa-dollar-sign"></i>
                               </p>
                               <input
-                                type="text"   
+                                type="text"
                                 formControlName="otros_costos"
-                                [value]="group.get('otros_costos').value | numberPipe" 
+                                [value]="
+                                  group.get('otros_costos').value | numberPipe
+                                "
                                 class="form-control"
                                 (input)="inputValidator($event)"
                               />
@@ -335,7 +355,9 @@
                                 type="text"
                                 formControlName="renta"
                                 class="form-control"
-                                [value]="group.get('renta').value | number: '1.2-4'"
+                                [value]="
+                                  group.get('renta').value | number: '1.2-4'
+                                "
                                 readonly
                               />
                             </div>
@@ -354,7 +376,10 @@
                               <input
                                 type="text"
                                 formControlName="ingreso_neto"
-                                [value]="group.get('ingreso_neto').value | number: '1.2-4'"
+                                [value]="
+                                  group.get('ingreso_neto').value
+                                    | number: '1.2-4'
+                                "
                                 class="form-control"
                                 readonly
                               />

+ 39 - 124
src/app/components/investments/costs/pbur/pbur.costs.component.ts

@@ -111,94 +111,6 @@ export class PBURCostsComponent implements OnInit {
             this.instrument_work =
               res["result"]["id_inversion_instrumento"]["instrumento"];
             this.instrument_exists = true;
-
-            this.investmentProposalForm = this.formBuilder.group({
-              valor_par: [
-                !this.instrument_exists ? false : this.instrument_work.valor_par
-              ],
-              valor_nominal: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.valor_nominal,
-                [
-                  Validators.required,
-                  Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-                ]
-              ],
-              otros_costos: [
-                !this.instrument_exists ? 0 : this.instrument_work.otros_costos,
-                [Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)]
-              ],
-              plazo: [
-                !this.instrument_exists ? "" : this.instrument_work.plazo,
-                [Validators.required]
-              ],
-              renta_porcentaje: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.renta_porcentaje,
-                [Validators.required]
-              ],
-              comision_casa_porcentaje: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.comision_casa_porcentaje,
-                [
-                  Validators.required,
-                  Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-                ]
-              ],
-              comision_bolsa_porcentaje: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.comision_bolsa_porcentaje,
-                [
-                  Validators.required,
-                  Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-                ]
-              ],
-              rendimiento_bruto: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.rendimiento_bruto,
-                [
-                  Validators.required,
-                  Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-                ]
-              ],
-              /*formato_ingreso: [
-                !this.instrument_exists ? "" : this.instrument_work.formato_ingreso,
-                [Validators.required]
-              ],*/
-              fecha_liquidacion: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.fecha_liquidacion,
-
-                [Validators.required]
-              ],
-              fecha_vencimiento: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.fecha_vencimiento,
-
-                [Validators.required]
-              ],
-              fecha_operacion: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.fecha_operacion,
-
-                [Validators.required]
-              ],
-              fecha_ultima_cupon: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.fecha_ultima_cupon,
-
-                [Validators.required]
-              ]
-            });
           },
           err => {}
         );
@@ -229,44 +141,47 @@ export class PBURCostsComponent implements OnInit {
       Swal.close();
     }, 1200);
   }
-  clearProyeccion(proyecciones,nombres,tipoDato){
-    let clearPro = []  
- 
-     proyecciones.forEach(createNewProyeccion); 
-   
+  clearProyeccion(proyecciones, nombres, tipoDato) {
+    let clearPro = [];
+
+    proyecciones.forEach(createNewProyeccion);
+
     function createNewProyeccion(arrFila, index) {
-     nombres.forEach(loopNombres);
-    
-     function loopNombres(nombre, index) {
- 
-       arrFila[nombre] = parseFloat(arrFila[nombre].toString().replace(",",""))        
-       } 
-       clearPro.push(arrFila)
-       
-     } 
- 
-   return clearPro;
-   }
- 
-   public inputValidator(event: any) {
-     //console.log(event.target.value);
-     const pattern = /^[0-9]*$/;   
-     //let inputChar = String.fromCharCode(event.charCode)
-     
-     if (!pattern.test(event.target.value)) {
- 
-       event.target.value = event.target.value.replace(/[^\d,.]+/g, '');
-       // invalid character, prevent input
- 
-     }
-     
-   }
+      nombres.forEach(loopNombres);
+
+      function loopNombres(nombre, index) {
+        arrFila[nombre] = parseFloat(
+          arrFila[nombre].toString().replace(",", "")
+        );
+      }
+      clearPro.push(arrFila);
+    }
+
+    return clearPro;
+  }
+
+  public inputValidator(event: any) {
+    //console.log(event.target.value);
+    const pattern = /^[0-9]*$/;
+    //let inputChar = String.fromCharCode(event.charCode)
+
+    if (!pattern.test(event.target.value)) {
+      event.target.value = event.target.value.replace(/[^\d,.]+/g, "");
+      // invalid character, prevent input
+    }
+  }
   recalculateProjectionChanges() {
-    let nombresProyecciones = ["costo_transferencia",
-                                "costo_cedeval",
-                                "costo_banco",
-                                "otros_costos"]
-    let clearPro = this.clearProyeccion(this.form.value,nombresProyecciones,"decimal")
+    let nombresProyecciones = [
+      "costo_transferencia",
+      "costo_cedeval",
+      "costo_banco",
+      "otros_costos"
+    ];
+    let clearPro = this.clearProyeccion(
+      this.form.value,
+      nombresProyecciones,
+      "decimal"
+    );
     let objProjection = { proyecciones: clearPro };
     Swal.fire({
       allowOutsideClick: false,

+ 35 - 15
src/app/components/investments/costs/vcn/vcn.costs.component.html

@@ -48,7 +48,6 @@
                         </div>
                       </div>
 
-                      
                       <div class="col-lg-3 col-md-4 col-sm-6">
                         <h4>Valor transado:</h4>
                         <div class="field">
@@ -56,6 +55,14 @@
                           {{ 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">
@@ -233,10 +240,12 @@
                               <input
                                 type="text"
                                 formControlName="ingreso_bruto"
-                                [value]="group.get('ingreso_bruto').value | number: '1.2-4'"
+                                [value]="
+                                  group.get('ingreso_bruto').value
+                                    | number: '1.2-4'
+                                "
                                 class="form-control"
                                 readonly
-                               
                               />
                             </div>
                           </div>
@@ -252,9 +261,11 @@
                                 <i class="fas fa-dollar-sign"></i>
                               </p>
                               <input
-                                type="text" 
+                                type="text"
                                 formControlName="costo_cedeval"
-                                [value]="group.get('costo_cedeval').value | numberPipe" 
+                                [value]="
+                                  group.get('costo_cedeval').value | numberPipe
+                                "
                                 class="form-control"
                                 (input)="inputValidator($event)"
                               />
@@ -275,14 +286,14 @@
                               </p>
                               <input
                                 type="text"
-                               
                                 formControlName="costo_transferencia"
-                                [value]="group.get('costo_transferencia').value | numberPipe" 
+                                [value]="
+                                  group.get('costo_transferencia').value
+                                    | numberPipe
+                                "
                                 class="form-control"
                                 (input)="inputValidator($event)"
-                               
                               />
-                              
                             </div>
                           </div>
                         </div>
@@ -297,9 +308,11 @@
                                 <i class="fas fa-dollar-sign"></i>
                               </p>
                               <input
-                                type="text" 
+                                type="text"
                                 formControlName="costo_banco"
-                                [value]="group.get('costo_banco').value | numberPipe" 
+                                [value]="
+                                  group.get('costo_banco').value | numberPipe
+                                "
                                 class="form-control"
                                 (input)="inputValidator($event)"
                               />
@@ -318,9 +331,11 @@
                                 <i class="fas fa-dollar-sign"></i>
                               </p>
                               <input
-                                type="text" 
+                                type="text"
                                 formControlName="otros_costos"
-                                [value]="group.get('otros_costos').value | numberPipe" 
+                                [value]="
+                                  group.get('otros_costos').value | numberPipe
+                                "
                                 class="form-control"
                                 (input)="inputValidator($event)"
                               />
@@ -340,7 +355,9 @@
                               <input
                                 type="text"
                                 formControlName="renta"
-                                [value]="group.get('renta').value | number: '1.2-4'"
+                                [value]="
+                                  group.get('renta').value | number: '1.2-4'
+                                "
                                 class="form-control"
                                 readonly
                               />
@@ -360,7 +377,10 @@
                               <input
                                 type="text"
                                 formControlName="ingreso_neto"
-                                 [value]="group.get('ingreso_neto').value | number: '1.2-4'"
+                                [value]="
+                                  group.get('ingreso_neto').value
+                                    | number: '1.2-4'
+                                "
                                 class="form-control"
                                 readonly
                               />

+ 32 - 117
src/app/components/investments/costs/vcn/vcn.costs.component.ts

@@ -28,8 +28,8 @@ import {
 })
 export class VCNCostsComponent implements OnInit {
   helper = new JwtHelperService();
-  price:string;
-  value:any;
+  price: string;
+  value: any;
   title: string = "Costos para valores comerciales";
 
   displayedColumns: string[] = [
@@ -112,94 +112,6 @@ export class VCNCostsComponent implements OnInit {
             this.instrument_work =
               res["result"]["id_inversion_instrumento"]["instrumento"];
             this.instrument_exists = true;
-
-            this.investmentProposalForm = this.formBuilder.group({
-              valor_par: [
-                !this.instrument_exists ? false : this.instrument_work.valor_par
-              ],
-              valor_nominal: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.valor_nominal,
-                [
-                  Validators.required,
-                  Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-                ]
-              ],
-              otros_costos: [
-                !this.instrument_exists ? 0 : this.instrument_work.otros_costos,
-                [Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)]
-              ],
-              plazo: [
-                !this.instrument_exists ? "" : this.instrument_work.plazo,
-                [Validators.required]
-              ],
-              renta_porcentaje: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.renta_porcentaje,
-                [Validators.required]
-              ],
-              comision_casa_porcentaje: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.comision_casa_porcentaje,
-                [
-                  Validators.required,
-                  Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-                ]
-              ],
-              comision_bolsa_porcentaje: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.comision_bolsa_porcentaje,
-                [
-                  Validators.required,
-                  Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-                ]
-              ],
-              rendimiento_bruto: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.rendimiento_bruto,
-                [
-                  Validators.required,
-                  Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-                ]
-              ],
-              /*formato_ingreso: [
-                !this.instrument_exists ? "" : this.instrument_work.formato_ingreso,
-                [Validators.required]
-              ],*/
-              fecha_liquidacion: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.fecha_liquidacion,
-
-                [Validators.required]
-              ],
-              fecha_vencimiento: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.fecha_vencimiento,
-
-                [Validators.required]
-              ],
-              fecha_operacion: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.fecha_operacion,
-
-                [Validators.required]
-              ],
-              fecha_ultima_cupon: [
-                !this.instrument_exists
-                  ? ""
-                  : this.instrument_work.fecha_ultima_cupon,
-
-                [Validators.required]
-              ]
-            });
           },
           err => {}
         );
@@ -230,47 +142,50 @@ export class VCNCostsComponent implements OnInit {
       Swal.close();
     }, 1200);
   }
-  clearProyeccion(proyecciones,nombres,tipoDato){
-   let clearPro = []  
+  clearProyeccion(proyecciones, nombres, tipoDato) {
+    let clearPro = [];
 
-    proyecciones.forEach(createNewProyeccion); 
-  
-   function createNewProyeccion(arrFila, index) {
-    nombres.forEach(loopNombres);
-   
-    function loopNombres(nombre, index) {
+    proyecciones.forEach(createNewProyeccion);
 
-      arrFila[nombre] = parseFloat(arrFila[nombre].toString().replace(",",""))        
-      } 
-      clearPro.push(arrFila)
-      
-    } 
+    function createNewProyeccion(arrFila, index) {
+      nombres.forEach(loopNombres);
 
-  return clearPro;
+      function loopNombres(nombre, index) {
+        arrFila[nombre] = parseFloat(
+          arrFila[nombre].toString().replace(",", "")
+        );
+      }
+      clearPro.push(arrFila);
+    }
+
+    return clearPro;
   }
 
   public inputValidator(event: any) {
     //console.log(event.target.value);
-    const pattern = /^[0-9]*$/;   
+    const pattern = /^[0-9]*$/;
     //let inputChar = String.fromCharCode(event.charCode)
-    
-    if (!pattern.test(event.target.value)) {
 
-      event.target.value = event.target.value.replace(/[^\d,.]+/g, '');
+    if (!pattern.test(event.target.value)) {
+      event.target.value = event.target.value.replace(/[^\d,.]+/g, "");
       // invalid character, prevent input
-
     }
-    
   }
 
   recalculateProjectionChanges() {
-    let nombresProyecciones = ["costo_transferencia",
-                                "costo_cedeval",
-                                "costo_banco",
-                                "otros_costos"]
-    let clearPro = this.clearProyeccion(this.form.value,nombresProyecciones,"decimal")
+    let nombresProyecciones = [
+      "costo_transferencia",
+      "costo_cedeval",
+      "costo_banco",
+      "otros_costos"
+    ];
+    let clearPro = this.clearProyeccion(
+      this.form.value,
+      nombresProyecciones,
+      "decimal"
+    );
     let objProjection = { proyecciones: clearPro };
-    
+
     Swal.fire({
       allowOutsideClick: false,
       icon: "info",
@@ -305,7 +220,7 @@ export class VCNCostsComponent implements OnInit {
         }
       );
   }
- 
+
   saveProjection() {
     let objProjection = { proyecciones: this.form.value };
     Swal.fire({

+ 0 - 15
src/app/components/plugins/investment-print/investment-print.ts

@@ -32,10 +32,8 @@ export class InvestmentPrint implements OnInit {
         .getProposalInvestment(this.investmentID)
         .subscribe(res => {
           this.investmentResult = res["result"];
-          // TO DO, crear una funcion que devuelva los campos necesarios de cada instrumento
           this.instrumentName = this.investmentResult.id_inversion_instrumento.id_tipo_instrumento.codigo;
           this.investmentInstrument = this.investmentResult.id_inversion_instrumento.instrumento;
-          console.log(this.investmentInstrument);
           this.getInstrumentColumns(
             this.instrumentName,
             this.investmentInstrument
@@ -58,10 +56,6 @@ export class InvestmentPrint implements OnInit {
           if (value == null) {
             value = "-";
           }
-          if (key == "renta_porcentaje") {
-            this.columnKey.push("Renta (%)");
-            this.columnValue.push(value.toString() + "%");
-          }
           if (key == "valor_nominal") {
             this.columnKey.push("Valor nominal");
             this.columnValue.push("$" + value.toString());
@@ -138,10 +132,6 @@ export class InvestmentPrint implements OnInit {
           if (value == null) {
             value = "-";
           }
-          if (key == "renta_porcentaje") {
-            this.columnKey.push("Renta (%)");
-            this.columnValue.push(value.toString() + "%");
-          }
           if (key == "valor_nominal") {
             this.columnKey.push("Valor nominal");
             this.columnValue.push("$" + value.toString());
@@ -313,9 +303,6 @@ export class InvestmentPrint implements OnInit {
         });
         break;
       case "DAP":
-        console.log("enter here");
-        console.log(investmentInstrument);
-
         Object.entries(investmentInstrument).forEach(([key, value]) => {
           if (value == null) {
             value = "-";
@@ -369,7 +356,6 @@ export class InvestmentPrint implements OnInit {
             this.columnValue.push(value.toString());
           }
         });
-        console.log(this.columnKey);
         break;
       case "BONO":
       case "EURB":
@@ -863,7 +849,6 @@ export class InvestmentPrint implements OnInit {
   }
 
   generatePdf(action = "open") {
-    console.log(pdfMake);
     var documentDefinition;
 
     switch (action) {