Jelajahi Sumber

Edicion de instrumentos de opciones y futuros

Oscar José Nuñez Chávez 5 tahun lalu
induk
melakukan
cd0833d37a

+ 26 - 3
src/app/components/instruments/futuros/futuros.component.ts

@@ -134,9 +134,23 @@ export class FUTU implements InstrumentComponent {
     console.log(this.operaciones);
     console.log(this.instrument_work);
 
+    if (
+      this.instrument_work != undefined &&
+      this.instrument_work.completo == undefined
+    ) {
+      if (
+        this.instrument_work.valor_pagado > 0 &&
+        this.instrument_work.valor_recibido > 0
+      ) {
+        this.ejecucion = 1;
+      } else {
+        this.ejecucion = +this.instrument_work_summary.completo;
+      }
+    }
+
     this.investmentProposalForm = this.formBuilder.group({
       operacion: [this.instrument_exists ? "" : this.instrument_work.corto],
-      ejecucion: [this.instrument_exists ? "" : this.instrument_work.completa],
+      ejecucion: [this.instrument_exists ? "" : this.ejecucion],
       ticket: [this.instrument_exists ? "" : this.instrument_work.ticket],
       precio_unitario_compra: [
         this.instrument_exists
@@ -275,8 +289,17 @@ export class FUTU implements InstrumentComponent {
       console.log("datos");
       console.log(this.instrument_work_summary);
 
-      this.operacion = this.instrument_work_summary.corto;
-      this.ejecucion = this.instrument_work_summary.completo;
+      this.operacion = +this.instrument_work_summary.corto;
+      if (this.instrument_work_summary.completo == undefined) {
+        if (
+          this.instrument_work_summary.valor_pagado > 0 &&
+          this.instrument_work_summary.valor_recibido > 0
+        ) {
+          this.ejecucion = 1;
+        }
+      } else {
+        this.ejecucion = +this.instrument_work_summary.completo;
+      }
 
       this.toggle_operacion(this.operacion);
       this.toggle_ejecucion(this.ejecucion);

+ 26 - 3
src/app/components/instruments/opciones/opciones.component.ts

@@ -134,9 +134,23 @@ export class OPC implements InstrumentComponent {
     console.log(this.operaciones);
     console.log(this.instrument_work);
 
+    if (
+      this.instrument_work != undefined &&
+      this.instrument_work.completo == undefined
+    ) {
+      if (
+        this.instrument_work.valor_pagado > 0 &&
+        this.instrument_work.valor_recibido > 0
+      ) {
+        this.ejecucion = 1;
+      } else {
+        this.ejecucion = +this.instrument_work_summary.completo;
+      }
+    }
+
     this.investmentProposalForm = this.formBuilder.group({
       operacion: [this.instrument_exists ? "" : this.instrument_work.corto],
-      ejecucion: [this.instrument_exists ? "" : this.instrument_work.completa],
+      ejecucion: [this.instrument_exists ? "" : this.ejecucion],
       ticket: [this.instrument_exists ? "" : this.instrument_work.ticket],
       precio_unitario_compra: [
         this.instrument_exists
@@ -275,8 +289,17 @@ export class OPC implements InstrumentComponent {
       console.log("datos");
       console.log(this.instrument_work_summary);
 
-      this.operacion = this.instrument_work_summary.corto;
-      this.ejecucion = this.instrument_work_summary.completo;
+      this.operacion = +this.instrument_work_summary.corto;
+      if (this.instrument_work_summary.completo == undefined) {
+        if (
+          this.instrument_work_summary.valor_pagado > 0 &&
+          this.instrument_work_summary.valor_recibido > 0
+        ) {
+          this.ejecucion = 1;
+        }
+      } else {
+        this.ejecucion = +this.instrument_work_summary.completo;
+      }
 
       this.toggle_operacion(this.operacion);
       this.toggle_ejecucion(this.ejecucion);

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

@@ -191,6 +191,7 @@ export class InvestmentProposalsComponent implements OnInit {
       status == "NUEVA" ||
       status == "RECHA" ||
       status == "APROB" ||
+      status == "PGNPR" ||
       status == "LIQUI"
     ) {
       return true;
@@ -205,6 +206,7 @@ export class InvestmentProposalsComponent implements OnInit {
         status == "LIQUI" ||
         status == "COMPR" ||
         status == "PGAPR" ||
+        status == "PGNPR" ||
         status == "LIQUI") &&
       file == null
     ) {
@@ -241,7 +243,7 @@ export class InvestmentProposalsComponent implements OnInit {
   }
 
   can_write_payment_info(status: string) {
-    if (status == "APROB") {
+    if (status == "APROB" || status == "PGNPR") {
       return true;
     } else {
       return false;