1
0

9 Коммиты 245508d1c4 ... 910e250c44

Автор SHA1 Сообщение Дата
  Oscar José Nuñez Chávez 910e250c44 Merge branch 'features-o' of onunez/frontend-inversiones into development 5 лет назад
  Oscar José Nuñez Chávez a063849cc8 observaciones de sprint 6 5 лет назад
  Oscar José Nuñez Chávez 2c649b72b3 Merge branch 'features-o' of onunez/frontend-inversiones into development 5 лет назад
  Oscar José Nuñez Chávez e0ce6887f5 Boton para imprimir resumen propuesta en req. pago. Quitar console logs de prueba 5 лет назад
  Oscar José Nuñez Chávez 2520ce0ab3 Merge branch 'features-o' of onunez/frontend-inversiones into development 5 лет назад
  Oscar José Nuñez Chávez 5ec077b241 Boton para imprimir resumen propuesta en req. pago. Quitar console logs de prueba 5 лет назад
  Oscar José Nuñez Chávez f51ab2d309 Correccion en resultado op. en titulo, quitar console log de prueba 5 лет назад
  Oscar José Nuñez Chávez b2592e7a34 Merge branch 'features-o' of onunez/frontend-inversiones into development 5 лет назад
  ahernandez fe018a776c Merge branch 'feature-formato' of onunez/frontend-inversiones into development 5 лет назад

+ 23 - 20
src/app/components/instruments/pemp/pemp.component.html

@@ -316,15 +316,10 @@
                 {{
                   row.tasa_porcentaje == "" || row.tasa_porcentaje == undefined
                     ? "0"
-                    : row.tasa_porcentaje | number: "1.2-4"
-                }}%
-              </td>
-              <td mat-footer-cell *matFooterCellDef>
-                {{
-                  consolidado_proyeccion.total_tasa_porcentaje
-                    | number: "1.2-4"
+                    : (row.tasa_porcentaje | number: "1.2-4")
                 }}%
               </td>
+              <td mat-footer-cell *matFooterCellDef></td>
             </ng-container>
 
             <ng-container matColumnDef="ingreso_bruto">
@@ -333,7 +328,7 @@
                 ${{
                   row.ingreso_bruto == "" || row.ingreso_bruto == undefined
                     ? "0"
-                    : row.ingreso_bruto | number: "1.2-4"
+                    : (row.ingreso_bruto | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -349,7 +344,7 @@
                 ${{
                   row.ingreso_neto == "" || row.ingreso_neto == undefined
                     ? "0"
-                    : row.ingreso_neto | number: "1.2-4"
+                    : (row.ingreso_neto | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -362,7 +357,11 @@
             <ng-container matColumnDef="iva">
               <th mat-header-cell *matHeaderCellDef>IVA</th>
               <td mat-cell *matCellDef="let row">
-                ${{ row.iva == "" || row.iva == undefined ? "0" : row.iva | number: "1.2-4"}}
+                ${{
+                  row.iva == "" || row.iva == undefined
+                    ? "0"
+                    : (row.iva | number: "1.2-4")
+                }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
                 ${{ consolidado_proyeccion.total_iva | number: "1.2-4" }}
@@ -393,7 +392,7 @@
                 ${{
                   row.monto_recibir == "" || row.monto_recibir == undefined
                     ? "0"
-                    : row.monto_recibir | number: "1.2-4"
+                    : (row.monto_recibir | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -404,13 +403,13 @@
             </ng-container>
 
             <ng-container matColumnDef="capital_restante">
-              <th mat-header-cell *matHeaderCellDef>Monto a recibir</th>
+              <th mat-header-cell *matHeaderCellDef>Capital restante</th>
               <td mat-cell *matCellDef="let row">
                 ${{
                   row.capital_restante == "" ||
                   row.capital_restante == undefined
                     ? "0"
-                    : row.capital_restante | number: "1.2-4"
+                    : (row.capital_restante | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -557,7 +556,7 @@
                 {{
                   row.tasa_porcentaje == "" || row.tasa_porcentaje == undefined
                     ? "0"
-                    : row.tasa_porcentaje | number: "1.2-4"
+                    : (row.tasa_porcentaje | number: "1.2-4")
                 }}%
               </td>
               <td mat-footer-cell *matFooterCellDef></td>
@@ -569,7 +568,7 @@
                 ${{
                   row.ingreso_bruto == "" || row.ingreso_bruto == undefined
                     ? "0"
-                    : row.ingreso_bruto | number: "1.2-4"
+                    : (row.ingreso_bruto | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -585,7 +584,7 @@
                 ${{
                   row.ingreso_neto == "" || row.ingreso_neto == undefined
                     ? "0"
-                    : row.ingreso_neto | number: "1.2-4"
+                    : (row.ingreso_neto | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -598,7 +597,11 @@
             <ng-container matColumnDef="iva">
               <th mat-header-cell *matHeaderCellDef>IVA</th>
               <td mat-cell *matCellDef="let row">
-                ${{ row.iva == "" || row.iva == undefined ? "0" : row.iva | number: "1.2-4"}}
+                ${{
+                  row.iva == "" || row.iva == undefined
+                    ? "0"
+                    : (row.iva | number: "1.2-4")
+                }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
                 ${{ consolidado_proyeccion.total_iva | number: "1.2-4" }}
@@ -629,7 +632,7 @@
                 ${{
                   row.monto_recibir == "" || row.monto_recibir == undefined
                     ? "0"
-                    : row.monto_recibir | number: "1.2-4"
+                    : (row.monto_recibir | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>
@@ -640,13 +643,13 @@
             </ng-container>
 
             <ng-container matColumnDef="capital_restante">
-              <th mat-header-cell *matHeaderCellDef>Monto a recibir</th>
+              <th mat-header-cell *matHeaderCellDef>Capital restante</th>
               <td mat-cell *matCellDef="let row">
                 ${{
                   row.capital_restante == "" ||
                   row.capital_restante == undefined
                     ? "0"
-                    : row.capital_restante | number: "1.2-4"
+                    : (row.capital_restante | number: "1.2-4")
                 }}
               </td>
               <td mat-footer-cell *matFooterCellDef>

+ 0 - 10
src/app/components/instruments/pper/pper.component.html

@@ -151,9 +151,6 @@
               *ngIf="submitted && f.pago_seguro_dano.errors"
               class="invalid-feedback"
             >
-              <div *ngIf="f.pago_seguro_dano.errors.required">
-                Campo requerido
-              </div>
               <div *ngIf="f.pago_seguro_dano.errors.pattern">
                 Debe ingresar una cifra válida
               </div>
@@ -182,9 +179,6 @@
               *ngIf="submitted && f.pago_seguro_vivienda.errors"
               class="invalid-feedback"
             >
-              <div *ngIf="f.pago_seguro_vivienda.errors.required">
-                Campo requerido
-              </div>
               <div *ngIf="f.pago_seguro_vivienda.errors.pattern">
                 Debe ingresar una cifra válida
               </div>
@@ -193,8 +187,6 @@
         </div>
       </div>
 
-
-
       <!-- Total de cuotas mensuales -->
       <div class="col-lg-6 col-sm-12 pr-xl-3">
         <div class="form-group">
@@ -666,8 +658,6 @@
         </div>
       </div>
 
-
-
       <div class="col-lg-3 col-md-4 col-sm-6">
         <h4>IVA (%):</h4>
         <div class="field">

+ 4 - 12
src/app/components/instruments/pper/pper.component.ts

@@ -144,8 +144,6 @@ export class PPER implements InstrumentComponent {
     }
 
     this.investmentProposalForm = this.formBuilder.group({
-
-
       monto_prestamo: [
         this.instrument_exists ? "" : this.instrument_work.monto_prestamo,
         [
@@ -175,18 +173,12 @@ export class PPER implements InstrumentComponent {
         ]
       ],
       pago_seguro_dano: [
-        this.instrument_exists ? "" : this.instrument_work.pago_seguro_dano,
-        [
-          Validators.required,
-          Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-        ]
+        this.instrument_exists ? 0 : this.instrument_work.pago_seguro_dano,
+        [Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)]
       ],
       pago_seguro_vivienda: [
-        this.instrument_exists ? "" : this.instrument_work.pago_seguro_vivienda,
-        [
-          Validators.required,
-          Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
-        ]
+        this.instrument_exists ? 0 : this.instrument_work.pago_seguro_vivienda,
+        [Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)]
       ],
       total_cuotas_mensuales: [
         this.instrument_exists

+ 37 - 15
src/app/components/instruments/titulos/titulos.component.html

@@ -1030,67 +1030,89 @@
           <div class="col-sm-4">
             <h4>Valor transado compra:</h4>
             <div class="field">
-              $USD {{ valor_transado_compra | number: "1.2-4" }}
+              $USD
+              {{
+                operation_results_work.valor_transado_compra | number: "1.2-4"
+              }}
             </div>
           </div>
           <div class="col-sm-4">
             <h4>Precio compra:</h4>
             <div class="field">
-              {{ precio_compra }}
+              {{ operation_results_work.precio_compra }}
             </div>
           </div>
           <div class="col-sm-4">
             <h4>Precio venta:</h4>
             <div class="field">
-              {{ precio_venta }}
+              {{ operation_results_work.precio_venta }}
             </div>
           </div>
           <div class="col-sm-4">
             <h4>Días tenencia total:</h4>
             <div class="field">
-              {{ dias_tenencia_total }}
+              {{ operation_results_work.dias_tenencia_total }}
             </div>
           </div>
           <div class="col-sm-4">
             <h4>Ingresos intereses:</h4>
             <div class="field">
-              $USD {{ ingresos_intereses | number: "1.2-4" }}
+              $USD
+              {{ operation_results_work.ingresos_intereses | number: "1.2-4" }}
             </div>
           </div>
           <div class="col-sm-4">
             <h4>Costos totales:</h4>
-            <div class="field">$USD {{ costos_totales | number: "1.2-4" }}</div>
+            <div class="field">
+              $USD {{ operation_results_work.costos_totales | number: "1.2-4" }}
+            </div>
           </div>
           <div class="col-sm-4">
             <h4>Ganancia o pérdida total:</h4>
             <div class="field">
-              $USD {{ ganancia_perdida_total | number: "1.2-4" }}
+              $USD
+              {{
+                operation_results_work.ganancia_perdida_total_neto
+                  | number: "1.2-4"
+              }}
             </div>
           </div>
           <div class="col-sm-4">
             <h4>Ganancia o pérdida de capital:</h4>
             <div class="field">
-              {{ ganancia_perdida_capital_porcentaje | number: "1.2-4" }}%
+              {{
+                operation_results_work.ganancia_perdida_capital_porcentaje
+                  | number: "1.2-4"
+              }}%
             </div>
           </div>
 
           <div class="col-sm-4">
             <h4>Interés (%):</h4>
             <div class="field">
-              {{ intereses_porcentaje | number: "1.2-4" }} %
+              {{
+                operation_results_work.intereses_porcentaje | number: "1.2-4"
+              }}
+              %
             </div>
           </div>
           <div class="col-sm-4">
             <h4>Interés neto antes de renta (%):</h4>
             <div class="field">
-              {{ neto_antes_impuesto_porcentaje | number: "1.2-4" }}
+              {{
+                operation_results_work.neto_antes_renta_porcentaje
+                  | number: "1.2-4"
+              }}
               %
             </div>
           </div>
           <div class="col-sm-4">
             <h4>Interés neto después de renta (%):</h4>
             <div class="field">
-              {{ neto_despues_impuesto_porcentaje | number: "1.2-4" }}
+              {{
+                operation_results_work.neto_despues_renta_porcentaje
+                  | number: "1.2-4"
+              }}
               %
             </div>
           </div>
@@ -1098,7 +1120,9 @@
             <h4>Total de intereses recibidos:</h4>
             <div class="field">
               $USD
-              {{ total_ingresos_recibidos | number: "1.2-4" }}
+              {{
+                operation_results_work.total_interes_recibidos | number: "1.2-4"
+              }}
             </div>
           </div>
         </div>
@@ -1755,9 +1779,7 @@
         <h4>Total de intereses recibidos:</h4>
         <div class="field">
           $USD
-          {{
-            operation_results_work.total_intereses_recibidos | number: "1.2-4"
-          }}
+          {{ operation_results_work.total_interes_recibidos | number: "1.2-4" }}
         </div>
       </div>
     </div>

+ 41 - 69
src/app/components/instruments/titulos/titulos.component.ts

@@ -578,71 +578,46 @@ export class TIT implements InstrumentComponent {
           this.fecha_inicio_vigencia =
             ans["result"]["instrumento_compra"]["fecha_inicio_vigencia"];
 
-          // Instrumento de venta
-          this.comision_casa_venta =
-            ans["result"]["instrumento_venta"]["comision_casa_venta"];
-          this.comision_bolsa_venta =
-            ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
-
-          this.fecha_siguiente_cupon_venta =
-            ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
-          this.dias_vencimiento_venta =
-            ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
-          this.dias_acumulados_venta =
-            ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
-          this.ytm_vencimiento_comision_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "ytm_vencimiento_comision_porcentaje_venta"
-            ];
-          this.ytm_vencimiento_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "ytm_vencimiento_porcentaje_venta"
-            ];
-          this.interes_acumulado_venta =
-            ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
-          this.interes_acumulado_porcentaje_venta =
-            ans["result"]["instrumento_venta"][
-              "interes_acumulado_porcentaje_venta"
-            ];
-          this.precio_sucio_porcentaje_venta =
-            ans["result"]["instrumento_venta"]["precio_sucio_porcentaje_venta"];
-          this.valor_transado_venta =
-            ans["result"]["instrumento_venta"]["valor_transado_venta"];
-          this.monto_recibir =
-            ans["result"]["instrumento_venta"]["monto_recibir"];
-
-          // // Resultado de la operacion
-          // this.operation_result = true;
-          // this.valor_transado_compra =
-          //   ans["result"]["resultado_operacion"]["valor_transado_compra"];
-          // this.precio_compra =
-          //   ans["result"]["resultado_operacion"]["precio_compra"];
-          // this.precio_venta =
-          //   ans["result"]["resultado_operacion"]["precio_venta"];
-          // this.dias_tenencia_total =
-          //   ans["result"]["resultado_operacion"]["dias_tenencia_total"];
-          // this.ganancia_perdida_capital =
-          //   ans["result"]["resultado_operacion"]["ganancia_perdida_capital"];
-          // this.ingresos_intereses =
-          //   ans["result"]["resultado_operacion"]["ingresos_intereses"];
-          // this.costos_totales =
-          //   ans["result"]["resultado_operacion"]["costos_totales"];
-          // this.ganancia_perdida_total =
-          //   ans["result"]["resultado_operacion"]["ganancia_perdida_total_neto"];
-          // this.ganancia_perdida_capital_porcentaje =
-          //   ans["result"]["resultado_operacion"][
-          //     "ganancia_perdida_capital_porcentaje"
-          //   ];
-          // this.intereses_porcentaje =
-          //   ans["result"]["resultado_operacion"]["intereses_porcentaje"];
-          // this.neto_antes_impuesto_porcentaje =
-          //   ans["result"]["resultado_operacion"]["neto_antes_renta_porcentaje"];
-          // this.neto_despues_impuesto_porcentaje =
-          //   ans["result"]["resultado_operacion"][
-          //     "neto_despues_renta_porcentaje"
-          //   ];
-          // this.total_ingresos_recibidos =
-          //   ans["result"]["resultado_operacion"]["total_interes_recibidos"];
+          if (this.tipoEjecucion == 1) {
+            // Instrumento de venta
+            this.comision_casa_venta =
+              ans["result"]["instrumento_venta"]["comision_casa_venta"];
+            this.comision_bolsa_venta =
+              ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
+
+            this.fecha_siguiente_cupon_venta =
+              ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
+            this.dias_vencimiento_venta =
+              ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
+            this.dias_acumulados_venta =
+              ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
+            this.ytm_vencimiento_comision_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "ytm_vencimiento_comision_porcentaje_venta"
+              ];
+            this.ytm_vencimiento_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "ytm_vencimiento_porcentaje_venta"
+              ];
+            this.interes_acumulado_venta =
+              ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
+            this.interes_acumulado_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "interes_acumulado_porcentaje_venta"
+              ];
+            this.precio_sucio_porcentaje_venta =
+              ans["result"]["instrumento_venta"][
+                "precio_sucio_porcentaje_venta"
+              ];
+            this.valor_transado_venta =
+              ans["result"]["instrumento_venta"]["valor_transado_venta"];
+            this.monto_recibir =
+              ans["result"]["instrumento_venta"]["monto_recibir"];
+
+            // // Resultado de la operacion
+            this.operation_result = true;
+            this.operation_results_work = ans["result"]["resultado_operacion"];
+          }
 
           // Proyecciones
           this.proyecciones = ans["result"]["proyecciones"];
@@ -796,10 +771,7 @@ export class TIT implements InstrumentComponent {
               "valor_transado_venta"
             ] = this.valor_transado_venta;
 
-            this.titulosObject[
-              "monto_recibir"
-            ] = this.monto_recibir;
-            
+            this.titulosObject["monto_recibir"] = this.monto_recibir;
           }
 
           this.formDataService.setWork(this.titulosObject);

+ 0 - 1
src/app/components/investment-proposals/general-info/general-info.component.ts

@@ -292,7 +292,6 @@ export class InvestmentProposalGeneralInfoComponent
     this.catalogService.getInstrumentTypes().subscribe(res => {
       res;
       this.instrumentTypes = [];
-      console.log(res);
       for (let property in res) {
         this.instrumentTypes.push({
           label: res[property]["nombre"],

+ 4 - 4
src/app/components/investment-proposals/investment-proposals.component.ts

@@ -437,7 +437,7 @@ export class InvestmentProposalsComponent implements OnInit {
     this.reviewProposal = undefined;
     (async () => {
       Swal.fire({
-        title: `<h3>Finalizar propuesta de inversión: ${investmentCode}</h3>`,
+        title: `<h3>Finalizar inversión: ${investmentCode}</h3>`,
         icon: "info",
         input: "textarea",
         html: `<p style="text-align:left;">Comentario:</p>`,
@@ -462,7 +462,7 @@ export class InvestmentProposalsComponent implements OnInit {
           return false;
         }
         Swal.fire({
-          title: `<h3>Finalizar propuesta de inversión ${investmentCode}</h3>`,
+          title: `<h3>Finalizar inversión ${investmentCode}</h3>`,
           icon: "info",
           html: `${this.test}`,
           confirmButtonText: "Finalizar",
@@ -511,7 +511,7 @@ export class InvestmentProposalsComponent implements OnInit {
                     icon: "success",
                     showCancelButton: false,
                     title: "Exito",
-                    confirmButtonText: "La propuesta ha sido finalizada"
+                    confirmButtonText: "La inversión ha sido finalizada"
                   }).then(result => {
                     Swal.close();
                     window.location.reload();
@@ -522,7 +522,7 @@ export class InvestmentProposalsComponent implements OnInit {
                 if (err.code == 405) {
                   Swal.fire({
                     icon: "error",
-                    title: "Operacion no permitida",
+                    title: "Operación no permitida",
                     text: err.message
                   }).then(result => {
                     Swal.close();

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

@@ -30,7 +30,7 @@
           <div class="card borderless">
             <div class="card-header card-header-icon card-header-rose">
               <h4 class="card-title">
-                Resumen de la propuesta
+                Resumen de la inversión
               </h4>
             </div>
             <div class="card-body">
@@ -95,7 +95,7 @@
                       <div class="timeline-body">
                         <div class="row">
                           <div class="col-sm-6">
-                            <h4>Código de la propuesta de inversión:</h4>
+                            <h4>Código de la inversión:</h4>
                             <div class="field">{{ codigo_inversion }}</div>
                           </div>
                           <div class="col-sm-6">

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

@@ -23,7 +23,7 @@ import { InvestmentsService } from "@app/services/investments.service";
   styleUrls: ["./payment-approval.component.scss"]
 })
 export class PaymentApprovalComponent implements OnInit {
-  title = "Aprobación de propuesta";
+  title = "Aprobación de inversión";
   @Input() ads: Instrument[];
   @Input() formData: InvestmentProposalForm;
   @ViewChild(InstrumentDirective, { static: true })

+ 28 - 10
src/app/components/investment-proposals/payment-requirement/payment-requirement.component.html

@@ -80,6 +80,15 @@
                       <h4>Fecha de vencimiento:</h4>
                       <div class="field">{{ fecha_vencimiento }}</div>
                     </div>
+
+                    <div class="col-sm-6">
+                      <h4>Descargar información del instrumento:</h4>
+                      <div class="field">
+                        <app-investment-print
+                          [investmentID]="investmentProposalID"
+                        ></app-investment-print>
+                      </div>
+                    </div>
                   </div>
                 </div>
 
@@ -98,14 +107,24 @@
                           type="file"
                           name="evidencia"
                           (change)="fileProgress($event)"
+                          [ngClass]="{
+                            'is-invalid': submitted && fileData == null
+                          }"
                         />
+                        <div
+                          *ngIf="submitted && fileData == null"
+                          class="invalid-feedback"
+                        >
+                          <div>
+                            Archivo requerido
+                          </div>
+                        </div>
                       </div>
-                      <br />
                       <div *ngIf="fileUploadProgress">
                         Progreso: {{ fileUploadProgress }}
                       </div>
                       <div class="image-preview mb-3" *ngIf="previewUrl">
-                        <img [src]="previewUrl" height="300" />
+                        <img [src]="previewUrl" height="300" width="300" />
                       </div>
 
                       <div class="mb-3" *ngIf="uploadedFilePath">
@@ -132,14 +151,13 @@
                               'is-invalid': submitted && f.fecha_pago.errors
                             }"
                           />
-                        </div>
-
-                        <div
-                          *ngIf="submitted && f.fecha_pago.errors"
-                          class="invalid-feedback"
-                        >
-                          <div *ngIf="f.fecha_pago.errors.required">
-                            Campo requerido
+                          <div
+                            *ngIf="submitted && f.fecha_pago.errors"
+                            class="invalid-feedback"
+                          >
+                            <div>
+                              Campo requerido
+                            </div>
                           </div>
                         </div>
                       </div>

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

@@ -105,7 +105,6 @@ export class PaymentRequirementComponent implements OnInit {
     this.investmentService
       .getAvailableUsers(this.investmentProposalID)
       .subscribe(res => {
-        console.log(res);
         this.userListPrevious = res["usuarios_previous"];
         this.generated_inputs_previous = "";
 
@@ -198,7 +197,8 @@ export class PaymentRequirementComponent implements OnInit {
 
   onSubmit(form: any) {
     this.submitted = true;
-    if (!form.valid) {
+
+    if (!form.valid && this.fileData == null) {
       return false;
     }
 

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

@@ -120,7 +120,6 @@ export class ResultComponent implements OnInit {
     this.general = this.formDataService.getGeneralInfo();
     this.instrument = this.formDataService.getWork();
     this.complement = this.formDataService.getComplementInfo();
-    console.log(this.instrument);
     this.catalogService.getFinancialEntities().subscribe(res => {
       this.financials = res.find(
         e => e.id_entidad_financiera == this.general.casa
@@ -413,7 +412,7 @@ export class ResultComponent implements OnInit {
                 }
               },
               err => {
-                if(err.code==405){
+                if (err.code == 405) {
                   Swal.fire({
                     icon: "error",
                     title: "Operacion no permitida",
@@ -422,13 +421,13 @@ export class ResultComponent implements OnInit {
                     Swal.close();
                     window.location.href = "#/investment-proposals";
                   });
-                }else{
+                } else {
                   Swal.fire({
                     icon: "error",
                     title: "Error al guardar",
                     text: err.message
                   });
-                }      
+                }
               }
             );
         });
@@ -579,7 +578,7 @@ export class ResultComponent implements OnInit {
                 }
               },
               err => {
-                if(err.code==405){
+                if (err.code == 405) {
                   Swal.fire({
                     icon: "error",
                     title: "Operacion no permitida",
@@ -588,13 +587,13 @@ export class ResultComponent implements OnInit {
                     Swal.close();
                     window.location.href = "#/investment-proposals";
                   });
-                }else{
+                } else {
                   Swal.fire({
                     icon: "error",
                     title: "Error al guardar",
                     text: err.message
                   });
-                }              
+                }
               }
             );
         });

+ 105 - 6
src/app/components/plugins/investment-print/investment-print.ts

@@ -18,6 +18,16 @@ export class InvestmentPrint implements OnInit {
   rates: any;
   instrumentName: any;
 
+  allowedStateForPayment = ["PGAPR", "LIQUI", "FINAL"];
+  monto: any;
+  codigo_inversion: any;
+  codigo: any;
+  tipo_pago: any;
+  cuenta_bancaria: any;
+  cuenta_bancaria_destino: any;
+  emitir_nombre: any;
+  fecha_vencimiento: any;
+
   constructor(
     private scriptService: PdfmakeScriptService,
     private investmentService: InvestmentsService,
@@ -34,17 +44,39 @@ export class InvestmentPrint implements OnInit {
           this.investmentResult = res["result"];
           this.instrumentName = this.investmentResult.id_inversion_instrumento.id_tipo_instrumento.codigo;
           this.investmentInstrument = this.investmentResult.id_inversion_instrumento.instrumento;
+
           this.getInstrumentColumns(
             this.instrumentName,
             this.investmentInstrument
           );
 
-          this.catalogService.getRateTypes().subscribe(res => {
-            this.rates = res.find(
-              e => e.id_tipo_tasa == this.investmentResult.id_tipo_tasa
-            );
-            this.rates = this.rates != undefined ? this.rates.nombre : "-";
-          });
+          if (
+            this.allowedStateForPayment.includes(
+              this.investmentResult["id_estado_inversion"]["codigo"]
+            )
+          ) {
+            this.investmentService
+              .getPaymentInfoProposalInvestment(this.investmentID)
+              .subscribe(resp => {
+                this.monto = resp["result"]["monto"];
+                this.codigo_inversion =
+                  resp["result"]["id_inversion"]["codigo_inversion"];
+                this.codigo = resp["result"]["codigo"];
+                this.tipo_pago = resp["result"]["id_tipo_pago"]["nombre"];
+                this.cuenta_bancaria =
+                  resp["result"]["id_cuenta_bancaria"]["nombre"];
+
+                if (resp["result"]["id_cuenta_bancaria_destino"] != undefined) {
+                  this.cuenta_bancaria_destino =
+                    resp["result"]["id_cuenta_bancaria_destino"]["nombre"];
+                }
+                if (resp["result"]["emitir_nombre"] != undefined) {
+                  this.emitir_nombre = resp["result"]["emitir_nombre"];
+                }
+
+                this.fecha_vencimiento = resp["result"]["fecha_vencimiento"];
+              });
+          }
         });
     }
   }
@@ -1043,6 +1075,73 @@ export class InvestmentPrint implements OnInit {
             widths: [150, 200],
             body: [[this.columnKey, this.columnValue]]
           }
+        },
+
+        { text: "Información de pago", style: "subheader", margin: [0, 10] },
+        {
+          style: "tableExample",
+          table: {
+            widths: [100, 200],
+            body: [
+              /*[
+                "Estado de inversión: ",
+                {
+                  text: this.investmentResult.,
+                  italics: true,
+                  color: "gray"
+                }
+              ],*/
+
+              [
+                "Monto: ",
+                {
+                  text: "$" + this.monto.toString(),
+                  italics: true,
+                  color: "gray"
+                }
+              ],
+              [
+                "Tipo pagp: ",
+                {
+                  text: this.tipo_pago,
+                  italics: true,
+                  color: "gray"
+                }
+              ],
+              [
+                "Cuenta bancaria: ",
+                {
+                  text: this.cuenta_bancaria,
+                  italics: true,
+                  color: "gray"
+                }
+              ],
+              [
+                "Cuenta bancaria destino: ",
+                {
+                  text: this.cuenta_bancaria_destino,
+                  italics: true,
+                  color: "gray"
+                }
+              ],
+              [
+                "Emisión a nombre de: ",
+                {
+                  text: this.emitir_nombre,
+                  italics: true,
+                  color: "gray"
+                }
+              ],
+              [
+                "Fecha vencimiento: ",
+                {
+                  text: this.fecha_vencimiento,
+                  italics: true,
+                  color: "gray"
+                }
+              ]
+            ]
+          }
         }
       ],
       info: {

+ 0 - 1
src/app/services/pdfmake-script.service.ts

@@ -48,7 +48,6 @@ export class PdfmakeScriptService {
         script.src = this.scripts[name].src;
         script.onload = () => {
           this.scripts[name].loaded = true;
-          console.log(`${name} Loaded.`);
           resolve({ script: name, loaded: true, status: "Loaded" });
         };
         script.onerror = (error: any) =>