Quellcode durchsuchen

Merge branch 'master' of onunez/frontend-inversiones into development

Oscar José Nuñez Chávez vor 5 Jahren
Ursprung
Commit
28d20044b4

+ 25 - 37
src/app/components/instruments/cete/cete.component.html

@@ -256,42 +256,6 @@
         </div>
       </div>
 
-      <!-- Fecha vencimiento -->
-      <div class="col-lg-6 col-sm-12 pr-xl-3">
-        <div class="form-group">
-          <label for="fecha_vencimiento">Fecha vencimiento: </label>
-
-          <div class="input-box-container">
-            <div>
-              <p>
-                <i class="far fa-calendar" aria-hidden="true"></i>
-              </p>
-              <input
-                class="input-box form-control"
-                placeholder="Seleccione una fecha"
-                angular-mydatepicker
-                formControlName="fecha_vencimiento"
-                (click)="dp2.toggleCalendar()"
-                [options]="myDpOptions"
-                #dp2="angular-mydatepicker"
-                [ngClass]="{
-                  'is-invalid': submitted && f.fecha_vencimiento.errors
-                }"
-              />
-            </div>
-          </div>
-
-          <div
-            *ngIf="submitted && f.fecha_vencimiento.errors"
-            class="invalid-feedback"
-          >
-            <div *ngIf="f.fecha_vencimiento.errors.required">
-              Campo requerido
-            </div>
-          </div>
-        </div>
-      </div>
-
       <!-- Ultima fecha cupón -->
       <div class="col-lg-6 col-sm-12 pr-xl-3">
         <div class="form-group">
@@ -386,6 +350,10 @@
           <h4>Comision casa:</h4>
           <div class="field">$USD {{ comision_casa | number: "1.2-4" }}</div>
         </div>
+        <div class="col-sm-6">
+          <h4>Fecha de vencimiento:</h4>
+          <div class="field">{{ fecha_vencimiento }}</div>
+        </div>
       </div>
     </div>
     <br />
@@ -426,7 +394,16 @@
                 }}
               </td>
             </ng-container>
-
+            <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
+                }}
+              </td>
+            </ng-container>
             <!-- Country Column -->
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
@@ -627,6 +604,17 @@
             </ng-container>
 
             <!-- Country Column -->
+            <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
+                }}
+              </td>
+            </ng-container>
+
             <ng-container matColumnDef="ingreso_neto">
               <th mat-header-cell *matHeaderCellDef>Ingreso neto</th>
               <td mat-cell *matCellDef="let row">

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

@@ -28,6 +28,7 @@ export class CETE implements InstrumentComponent {
     "posicion",
     "plazo",
     "fecha_pago",
+    "ingreso_bruto",
     "ingreso_neto"
   ];
 
@@ -93,6 +94,7 @@ export class CETE implements InstrumentComponent {
   dataSource = new MatTableDataSource(this.proyecciones);
   dataSource2 = new MatTableDataSource(this.proyecciones);
   hasProjections: boolean;
+  fecha_vencimiento: any;
 
   constructor(
     private formBuilder: FormBuilder,
@@ -176,7 +178,7 @@ export class CETE implements InstrumentComponent {
               }
             },
         Validators.required
-      ],
+      ] /*
       fecha_vencimiento: [
         this.instrument_exists
           ? ""
@@ -192,7 +194,7 @@ export class CETE implements InstrumentComponent {
               }
             },
         Validators.required
-      ],
+      ],*/,
       fecha_operacion: [
         this.instrument_exists
           ? ""
@@ -255,9 +257,9 @@ export class CETE implements InstrumentComponent {
       .ceteCalc(
         "CETE", // Codigo del instrumento
         {
-          id_tipo_base: this.general.base_anual,
-          id_formato_ingreso: this.general.formato_ingreso,
-          id_periodicidad: this.general.periodicidad
+          id_tipo_base: +this.general.base_anual,
+          id_formato_ingreso: +this.general.formato_ingreso,
+          id_periodicidad: +this.general.periodicidad
         },
         {
           valor_nominal: +this.f.valor_nominal.value,
@@ -270,13 +272,12 @@ export class CETE implements InstrumentComponent {
           fecha_liquidacion: this.f.fecha_liquidacion.value.singleDate
             .formatted,
           fecha_ultima_cupon: this.f.fecha_ultima_cupon.value.singleDate
-            .formatted,
-          fecha_vencimiento: this.f.fecha_vencimiento.value.singleDate.formatted
+            .formatted
+          //fecha_vencimiento: this.f.fecha_vencimiento.value.singleDate.formatted
         }
       )
       .subscribe(
         ans => {
-          console.log(ans);
           this.ingreso_bruto = ans["result"]["ingreso_bruto"];
           this.ingreso_neto = ans["result"]["ingreso_neto"];
           this.valor_transado = ans["result"]["valor_transado"];
@@ -286,6 +287,7 @@ export class CETE implements InstrumentComponent {
           this.comision_bolsa = ans["result"]["comision_bolsa"];
           this.comision_casa = ans["result"]["comision_casa"];
           this.proyecciones = ans["result"]["proyecciones"];
+          this.fecha_vencimiento = ans["result"]["fecha_vencimiento"];
 
           this.dataSource.data = this.proyecciones;
           this.dataSource.paginator = this.paginator;
@@ -308,8 +310,7 @@ export class CETE implements InstrumentComponent {
               .formatted,
             fecha_ultima_cupon: this.f.fecha_ultima_cupon.value.singleDate
               .formatted,
-            fecha_vencimiento: this.f.fecha_vencimiento.value.singleDate
-              .formatted,
+            fecha_vencimiento: this.fecha_vencimiento,
             ingreso_bruto: this.ingreso_bruto,
             ingreso_neto: this.ingreso_neto,
             valor_transado: this.valor_transado,

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

@@ -321,11 +321,12 @@
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
+                $USD
                 {{
                   row.renta == "" || row.renta == undefined
                     ? "-"
                     : (row.renta | number: "1.2-4")
-                }}%
+                }}
               </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">
@@ -515,11 +516,12 @@
             <ng-container matColumnDef="renta">
               <th mat-header-cell *matHeaderCellDef>Renta</th>
               <td mat-cell *matCellDef="let row">
+                $USD
                 {{
                   row.renta == "" || row.renta == undefined
                     ? "-"
                     : (row.renta | number: "1.2-4")
-                }}%
+                }}
               </td>
             </ng-container>
             <ng-container matColumnDef="ingreso_neto">

+ 4 - 4
src/app/components/instruments/dap/dap.component.ts

@@ -128,7 +128,7 @@ export class DAP implements InstrumentComponent {
       ],
 
       renta_porcentaje: [
-        this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
+        this.instrument_exists ? 10 : this.instrument_work.renta_porcentaje,
         [Validators.required]
       ],
       tasa_porcentaje: [
@@ -211,9 +211,9 @@ export class DAP implements InstrumentComponent {
       .dapCalc(
         "DAP", // Codigo del instrumento
         {
-          id_tipo_base: this.general.base_anual,
-          id_periodicidad: this.general.periodicidad,
-          id_formato_ingreso: this.general.formato_ingreso
+          id_tipo_base: +this.general.base_anual,
+          id_periodicidad: +this.general.periodicidad,
+          id_formato_ingreso: +this.general.formato_ingreso
         },
         {
           monto_inversion: +this.f.monto_inversion.value,

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

@@ -91,10 +91,6 @@ export class LETE implements InstrumentComponent {
 
     this.general = this.formDataService.getGeneralInfo();
 
-    console.log("intrument cargado:");
-    console.log(this.instrument_work);
-    console.log(this.general);
-
     this.investmentProposalForm = this.formBuilder.group({
       valor_nominal: [
         this.instrument_exists ? "" : this.instrument_work.valor_nominal,

+ 3 - 3
src/app/components/instruments/pbur/pbur.component.ts

@@ -270,9 +270,9 @@ export class PBUR implements InstrumentComponent {
       .vcnCalc(
         "PBUR", // Codigo del instrumento
         {
-          id_tipo_base: this.general.base_anual,
-          id_periodicidad: this.general.periodicidad,
-          id_formato_ingreso: this.general.formato_ingreso
+          id_tipo_base: +this.general.base_anual,
+          id_periodicidad: +this.general.periodicidad,
+          id_formato_ingreso: +this.general.formato_ingreso
         },
         {
           valor_par: this.f.valor_par.value,

+ 3 - 3
src/app/components/instruments/vcn/vcn.component.ts

@@ -272,9 +272,9 @@ export class VCN implements InstrumentComponent {
       .vcnCalc(
         "VCN", // Codigo del instrumento
         {
-          id_tipo_base: this.general.base_anual,
-          id_periodicidad: this.general.periodicidad,
-          id_formato_ingreso: this.general.formato_ingreso
+          id_tipo_base: +this.general.base_anual,
+          id_periodicidad: +this.general.periodicidad,
+          id_formato_ingreso: +this.general.formato_ingreso
         },
         {
           valor_par: this.f.valor_par.value,

+ 0 - 1
src/app/components/investment-proposals/change-history/change-history.component.ts

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

+ 4 - 5
src/app/components/investment-proposals/investment-proposals.component.html

@@ -56,14 +56,13 @@
                 </ng-container>
 
                 <!-- Country Column -->
-                <ng-container matColumnDef="id_tipo_mercado">
-                  <th mat-header-cell *matHeaderCellDef>Tipo de mercado</th>
+                <ng-container matColumnDef="id_empresa">
+                  <th mat-header-cell *matHeaderCellDef>Empresa</th>
                   <td mat-cell *matCellDef="let row">
                     {{
-                      row.id_tipo_mercado == "" ||
-                      row.id_tipo_mercado == undefined
+                      row.id_empresa == "" || row.id_empresa == undefined
                         ? "-"
-                        : row.id_tipo_mercado.nombre
+                        : row.id_empresa.nombre
                     }}
                   </td>
                 </ng-container>

+ 9 - 3
src/app/components/investment-proposals/investment-proposals.component.ts

@@ -25,7 +25,7 @@ export class InvestmentProposalsComponent implements OnInit {
   displayedColumns: string[] = [
     "codigo_inversion",
     "asunto",
-    "id_tipo_mercado",
+    "id_empresa",
     "id_inversion_instrumento",
     "id_estado_inversion",
     "id"
@@ -62,6 +62,7 @@ export class InvestmentProposalsComponent implements OnInit {
         data.codigo_inversion.toLowerCase() +
         data.nombre_inversion.toLowerCase() +
         data.asunto.toLowerCase() +
+        data.id_empresa.nombre.toLowerCase() +
         data.comentario.toLowerCase() +
         data.justificacion.toLowerCase();
       return dataStr.indexOf(filter) != -1;
@@ -117,7 +118,7 @@ export class InvestmentProposalsComponent implements OnInit {
 
     setTimeout(() => {
       Swal.close();
-    }, 1200);
+    }, 2000);
   }
 
   applyFilter(event: Event) {
@@ -245,6 +246,7 @@ export class InvestmentProposalsComponent implements OnInit {
         showCancelButton: true,
         confirmButtonText: "Enviar propuesta",
         cancelButtonText: "Cancelar",
+        showLoaderOnConfirm: true,
         // inputValidator: value => {
         //   if (!value) {
         //     return "Debe ingresar un comentario";
@@ -283,7 +285,8 @@ export class InvestmentProposalsComponent implements OnInit {
                 });
               }
             );
-        }
+        },
+        allowOutsideClick: () => !Swal.isLoading()
       });
     })();
   }
@@ -299,6 +302,9 @@ export class InvestmentProposalsComponent implements OnInit {
         showCancelButton: true,
         confirmButtonText: "Finalizar",
         cancelButtonText: "Cancelar",
+        onOpen: () => {
+          Swal.showLoading();
+        },
         preConfirm: comentario => {
           let reviewProposal = {
             id_inversion: investmentProposalID,

+ 1 - 1
src/app/components/investment-proposals/result/result.component.ts

@@ -133,7 +133,7 @@ export class ResultComponent implements OnInit {
       );
       this.base_types =
         this.base_types != undefined
-          ? ` ${this.base_types.tipo_base} / ${this.base_types.tipo_base_dias}`
+          ? `${this.base_types.tipo_base_dias}  / ${this.base_types.tipo_base}`
           : "-";
     });
 

+ 4 - 4
src/app/components/plugins/navbar-inv-proposals/navbar-inv-proposals.html

@@ -6,8 +6,8 @@
     <li>
       <a
         (click)="goToStep('general')"
-        title="general"
         [ngClass]="activeLink == 'general' ? 'active' : ''"
+        title="Información general"
       >
         <span class="round-tabs one">
           <i class="material-icons">post_add</i>
@@ -19,7 +19,7 @@
     <li>
       <a
         (click)="goToStep('instrument')"
-        title="instrument"
+        title="Instrumento"
         [ngClass]="activeLink == 'instrument' ? 'active' : ''"
       >
         <span class="round-tabs two">
@@ -33,7 +33,7 @@
       <a
         (click)="goToStep('other_info')"
         [ngClass]="activeLink == 'other_info' ? 'active' : ''"
-        title="address"
+        title="Información complementaria"
       >
         <span class="round-tabs three">
           <i class="material-icons">library_books</i>
@@ -46,7 +46,7 @@
       <a
         (click)="goToStep('result')"
         [ngClass]="activeLink == 'result' ? 'active' : ''"
-        title="completed"
+        title="Resumen de la propuesta"
       >
         <span class="round-tabs four">
           <i class="material-icons">check_box</i>

+ 10 - 10
src/app/services/instrument-calculations.service.ts

@@ -44,9 +44,9 @@ export class InstrumentCalculations {
   ceteCalc(
     codigo_instrumento: string,
     info_inversion: {
-      id_tipo_base: string;
-      id_periodicidad: string;
-      id_formato_ingreso: string;
+      id_tipo_base: number;
+      id_periodicidad: number;
+      id_formato_ingreso: number;
     },
     info_instrumento: {
       valor_nominal: number;
@@ -58,7 +58,7 @@ export class InstrumentCalculations {
       fecha_operacion: string;
       fecha_liquidacion: string;
       fecha_ultima_cupon: string;
-      fecha_vencimiento: string;
+      //fecha_vencimiento: string;
     }
   ): Observable<boolean> {
     return this.http
@@ -78,9 +78,9 @@ export class InstrumentCalculations {
   vcnCalc(
     codigo_instrumento: string,
     info_inversion: {
-      id_tipo_base: string;
-      id_periodicidad: string;
-      id_formato_ingreso: string;
+      id_tipo_base: number;
+      id_periodicidad: number;
+      id_formato_ingreso: number;
     },
     info_instrumento: {
       valor_par: boolean;
@@ -114,9 +114,9 @@ export class InstrumentCalculations {
   dapCalc(
     codigo_instrumento: string,
     info_inversion: {
-      id_tipo_base: string;
-      id_periodicidad: string;
-      id_formato_ingreso: string;
+      id_tipo_base: number;
+      id_periodicidad: number;
+      id_formato_ingreso: number;
     },
     info_instrumento: {
       monto_inversion: number;