Oscar José Nuñez Chávez 5 år sedan
förälder
incheckning
e03ded9d3d

+ 16 - 8
src/app/components/investment-proposals/investment-proposals.component.ts

@@ -324,7 +324,7 @@ export class InvestmentProposalsComponent implements OnInit {
           this.reviewProposal = {
             id_inversion: investmentProposalID,
             step: "next",
-            comentario: comentario
+            comentario: comentario == null ? "" : comentario
           };
         }
       }).then(result => {
@@ -349,9 +349,13 @@ export class InvestmentProposalsComponent implements OnInit {
               let html_input: HTMLInputElement = document.getElementById(
                 this.userList[i].name
               ) as HTMLInputElement;
-              let html_value: string = html_input.value;
-              if (html_input.checked == true) {
-                array.push(html_value);
+              if (html_input != null) {
+                let html_value: string = html_input.value;
+                if (html_input.checked == true) {
+                  array.push(html_value);
+                }
+              } else {
+                array;
               }
             }
 
@@ -455,7 +459,7 @@ export class InvestmentProposalsComponent implements OnInit {
           this.reviewProposal = {
             id_inversion: investmentProposalID,
             step: "next",
-            comentario: comentario
+            comentario: comentario == null ? "" : comentario
           };
         },
         allowOutsideClick: () => !Swal.isLoading()
@@ -479,9 +483,13 @@ export class InvestmentProposalsComponent implements OnInit {
               let html_input: HTMLInputElement = document.getElementById(
                 this.userList[i].name
               ) as HTMLInputElement;
-              let html_value: string = html_input.value;
-              if (html_input.checked == true) {
-                array.push(html_value);
+              if (html_input != null) {
+                let html_value: string = html_input.value;
+                if (html_input.checked == true) {
+                  array.push(html_value);
+                }
+              } else {
+                array;
               }
             }
 

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

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

+ 21 - 10
src/app/components/investment-proposals/payment-info/payment-info.component.ts

@@ -78,6 +78,7 @@ export class PaymentInfoComponent implements OnInit {
   payment_check: boolean;
   payment_transfer: boolean;
   accounts_destination: any;
+  accounts_origin: any;
 
   constructor(
     private router: Router,
@@ -107,12 +108,6 @@ export class PaymentInfoComponent implements OnInit {
         }
       });
 
-    this.catalogService
-      .getBankAccounts("origen", this.investmentProposalID)
-      .subscribe(res => {
-        console.log(res);
-      });
-
     this.investmentsService
       .getProposalInvestment(this.investmentProposalID)
       .subscribe(
@@ -166,6 +161,22 @@ export class PaymentInfoComponent implements OnInit {
         }
       );
 
+    this.catalogService
+      .getBankAccounts("origen", this.investmentProposalID)
+      .subscribe(res => {
+        this.accounts_origin = res["result"];
+        console.log("origen");
+        console.log(this.accounts_origin);
+      });
+
+    this.catalogService
+      .getBankAccounts("destino", this.investmentProposalID)
+      .subscribe(res => {
+        this.accounts_destination = res["result"];
+        console.log("destino");
+        console.log(this.accounts_destination);
+      });
+
     this.catalogService.getPaymentTypes().subscribe(res => {
       this.payment_types = res;
     });
@@ -173,20 +184,20 @@ export class PaymentInfoComponent implements OnInit {
       this.funds = res;
     });
 
-    this.catalogService.getCatalogInfo("bancos").subscribe(res => {
+    /*this.catalogService.getCatalogInfo("bancos").subscribe(res => {
       this.banks = res;
       this.catalogService.getCatalogInfo("cuentas-bancarias").subscribe(res => {
         this.accounts = res;
       });
       //this.payment_types = res;
-    });
+    });*/
 
-    this.catalogService
+    /*this.catalogService
       .getCatalogInfo("cuentas-bancaria-destino")
       .subscribe(res => {
         this.accounts_destination = res;
       });
-
+      */
     this.investmentProposalForm = this.formBuilder.group({
       monto: [
         this.inversionAmount,