浏览代码

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

Oscar José Nuñez Chávez 5 年之前
父节点
当前提交
1ea1330fac

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

@@ -244,8 +244,7 @@ export class CETE implements InstrumentComponent {
 
   getCalculations(form: any, saveForm: boolean) {
     this.submitted = true;
-    console.log("formulario");
-    console.log(form);
+
     if (!form.valid) {
       return false;
     }

+ 13 - 11
src/app/components/instruments/dap/dap.component.ts

@@ -63,7 +63,7 @@ export class DAP implements InstrumentComponent {
     11: "Nov",
     12: "Dic"
   };
-  instrument_exists: boolean;
+  instrument_null: boolean;
   instrument_work: any = [];
   investmentProposalForm: FormGroup;
   myDpOptions: IAngularMyDpOptions = {
@@ -103,7 +103,7 @@ export class DAP implements InstrumentComponent {
     public datepipe: DatePipe
   ) {
     this.instrument_work = this.formDataService.getWork();
-    this.instrument_exists = this.instrument_work == undefined;
+    this.instrument_null = this.instrument_work == undefined;
     this.general = this.formDataService.getGeneralInfo();
 
     if (
@@ -121,7 +121,7 @@ export class DAP implements InstrumentComponent {
 
     this.investmentProposalForm = this.formBuilder.group({
       monto_inversion: [
-        this.instrument_exists ? "" : this.instrument_work.monto_inversion,
+        this.instrument_null ? "" : this.instrument_work.monto_inversion,
         [
           Validators.required,
           Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
@@ -129,28 +129,30 @@ export class DAP implements InstrumentComponent {
       ],
 
       renta_porcentaje: [
-        this.instrument_exists ? 10 : this.instrument_work.renta_porcentaje,
+        this.instrument_null || this.instrument_work.renta_porcentaje == null
+          ? 10
+          : this.instrument_work.renta_porcentaje,
         [Validators.required]
       ],
       tasa_porcentaje: [
-        this.instrument_exists ? "" : this.instrument_work.tasa_porcentaje,
+        this.instrument_null ? "" : this.instrument_work.tasa_porcentaje,
         [
           Validators.required,
           Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
         ]
       ],
       plazo: [
-        this.instrument_exists ? "" : this.instrument_work.plazo,
+        this.instrument_null ? "" : this.instrument_work.plazo,
         [Validators.required]
       ],
 
       numero_certificado: [
-        this.instrument_exists ? "" : this.instrument_work.numero_certificado,
+        this.instrument_null ? "" : this.instrument_work.numero_certificado,
         []
       ],
 
       fecha_operacion: [
-        this.instrument_exists
+        this.instrument_null
           ? ""
           : {
               isRange: false,
@@ -182,8 +184,7 @@ export class DAP implements InstrumentComponent {
 
   getCalculations(form: any, saveForm: boolean) {
     this.submitted = true;
-    console.log("formulario");
-    console.log(form);
+
     if (!form.valid) {
       return false;
     }
@@ -246,7 +247,8 @@ export class DAP implements InstrumentComponent {
             proyecciones: this.proyecciones,
 
             fecha_operacion: this.investmentProposalForm.value.fecha_operacion
-              .singleDate.formatted
+              .singleDate.formatted,
+            fecha_vencimiento: this.fecha_vencimiento
           };
           this.formDataService.setWork(this.dapObject);
           Swal.close();

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

@@ -248,8 +248,6 @@ export class PBUR implements InstrumentComponent {
 
   getCalculations(form: any, saveForm: boolean) {
     this.submitted = true;
-    console.log("formulario");
-    console.log(form);
 
     if (!form.valid) {
       return false;
@@ -347,7 +345,8 @@ export class PBUR implements InstrumentComponent {
               this.investmentProposalForm.value.fecha_ultima_cupon != undefined
                 ? this.investmentProposalForm.value.fecha_ultima_cupon
                     .singleDate.formatted
-                : ""
+                : "",
+            fecha_vencimiento: this.fecha_vencimiento
           };
           this.formDataService.setWork(this.pburObject);
           Swal.close();

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

@@ -165,7 +165,6 @@ export class PaymentInfoComponent implements OnInit {
 
   sendPaymentInfo(form: any) {
     this.submitted = true;
-    console.log(form);
     if (!form.valid) {
       return false;
     }

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

@@ -138,7 +138,6 @@ export class PaymentRequirementComponent implements OnInit {
 
   onSubmit(form: any) {
     this.submitted = true;
-    console.log(form);
     if (!form.valid) {
       return false;
     }

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

@@ -188,7 +188,6 @@ export class InvestmentProposalReviewComponent implements OnInit {
           if (this.general != undefined) {
             this.subject = this.general.asunto;
             this.investmentName = this.general.name;
-            console.log(this.complement);
             this.comment = this.complement.comentarios;
             this.justification = this.complement.justificacion;