|
@@ -539,26 +539,28 @@ export class OPC implements InstrumentComponent {
|
|
|
.subscribe(
|
|
.subscribe(
|
|
|
ans => {
|
|
ans => {
|
|
|
// Instrumento compra
|
|
// Instrumento compra
|
|
|
- this.fecha_operacion_compra =
|
|
|
|
|
- ans["result"]["instrumento_compra"]["fecha_operacion_compra"];
|
|
|
|
|
- this.fecha_liquidacion_compra =
|
|
|
|
|
- ans["result"]["instrumento_compra"]["fecha_liquidacion_compra"];
|
|
|
|
|
- this.precio_unitario_compra =
|
|
|
|
|
- ans["result"]["instrumento_compra"]["precio_unitario_compra"];
|
|
|
|
|
- this.comision_broker_compra =
|
|
|
|
|
- ans["result"]["instrumento_compra"]["comision_broker_compra"];
|
|
|
|
|
- this.cantidad_contratos_compra =
|
|
|
|
|
- ans["result"]["instrumento_compra"]["cantidad_contratos_compra"];
|
|
|
|
|
- this.unidades_contratos_compra =
|
|
|
|
|
- ans["result"]["instrumento_compra"]["unidades_contratos_compra"];
|
|
|
|
|
- this.valor_transado_compra =
|
|
|
|
|
- ans["result"]["instrumento_compra"]["valor_transado_compra"];
|
|
|
|
|
- this.valor_pagado =
|
|
|
|
|
- ans["result"]["instrumento_compra"]["valor_pagado"];
|
|
|
|
|
- this.ganancia_perdida =
|
|
|
|
|
- ans["result"]["instrumento_compra"]["ganancia_perdida"];
|
|
|
|
|
- this.rendimiento = ans["result"]["instrumento_compra"]["rendimiento"];
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (this.tipoOperacion == 0 || this.tipoEjecucion == 1) {
|
|
|
|
|
+ this.fecha_operacion_compra =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["fecha_operacion_compra"];
|
|
|
|
|
+ this.fecha_liquidacion_compra =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["fecha_liquidacion_compra"];
|
|
|
|
|
+ this.precio_unitario_compra =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["precio_unitario_compra"];
|
|
|
|
|
+ this.comision_broker_compra =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["comision_broker_compra"];
|
|
|
|
|
+ this.cantidad_contratos_compra =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["cantidad_contratos_compra"];
|
|
|
|
|
+ this.unidades_contratos_compra =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["unidades_contratos_compra"];
|
|
|
|
|
+ this.valor_transado_compra =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["valor_transado_compra"];
|
|
|
|
|
+ this.valor_pagado =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["valor_pagado"];
|
|
|
|
|
+ this.ganancia_perdida =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["ganancia_perdida"];
|
|
|
|
|
+ this.rendimiento =
|
|
|
|
|
+ ans["result"]["instrumento_compra"]["rendimiento"];
|
|
|
|
|
+ }
|
|
|
// Si es operacion largo y ejecucion completa
|
|
// Si es operacion largo y ejecucion completa
|
|
|
|
|
|
|
|
if (this.tipoOperacion == 0) {
|
|
if (this.tipoOperacion == 0) {
|
|
@@ -571,23 +573,24 @@ export class OPC implements InstrumentComponent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Instrumento venta
|
|
// Instrumento venta
|
|
|
- this.fecha_operacion_venta =
|
|
|
|
|
- ans["result"]["instrumento_venta"]["fecha_operacion_venta"];
|
|
|
|
|
- this.fecha_liquidacion_venta =
|
|
|
|
|
- ans["result"]["instrumento_venta"]["fecha_liquidacion_venta"];
|
|
|
|
|
- this.precio_unitario_venta =
|
|
|
|
|
- ans["result"]["instrumento_venta"]["precio_unitario_venta"];
|
|
|
|
|
- this.comision_broker_venta =
|
|
|
|
|
- ans["result"]["instrumento_venta"]["comision_broker_venta"];
|
|
|
|
|
- this.cantidad_contratos_venta =
|
|
|
|
|
- ans["result"]["instrumento_venta"]["cantidad_contratos_venta"];
|
|
|
|
|
- this.unidades_contratos_venta =
|
|
|
|
|
- ans["result"]["instrumento_venta"]["unidades_contratos_venta"];
|
|
|
|
|
- this.valor_transado_venta =
|
|
|
|
|
- ans["result"]["instrumento_venta"]["valor_transado_venta"];
|
|
|
|
|
- this.valor_recibido =
|
|
|
|
|
- ans["result"]["instrumento_venta"]["valor_recibido "];
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (this.tipoOperacion == 1 || this.tipoEjecucion == 1) {
|
|
|
|
|
+ this.fecha_operacion_venta =
|
|
|
|
|
+ ans["result"]["instrumento_venta"]["fecha_operacion_venta"];
|
|
|
|
|
+ this.fecha_liquidacion_venta =
|
|
|
|
|
+ ans["result"]["instrumento_venta"]["fecha_liquidacion_venta"];
|
|
|
|
|
+ this.precio_unitario_venta =
|
|
|
|
|
+ ans["result"]["instrumento_venta"]["precio_unitario_venta"];
|
|
|
|
|
+ this.comision_broker_venta =
|
|
|
|
|
+ ans["result"]["instrumento_venta"]["comision_broker_venta"];
|
|
|
|
|
+ this.cantidad_contratos_venta =
|
|
|
|
|
+ ans["result"]["instrumento_venta"]["cantidad_contratos_venta"];
|
|
|
|
|
+ this.unidades_contratos_venta =
|
|
|
|
|
+ ans["result"]["instrumento_venta"]["unidades_contratos_venta"];
|
|
|
|
|
+ this.valor_transado_venta =
|
|
|
|
|
+ ans["result"]["instrumento_venta"]["valor_transado_venta"];
|
|
|
|
|
+ this.valor_recibido =
|
|
|
|
|
+ ans["result"]["instrumento_venta"]["valor_recibido "];
|
|
|
|
|
+ }
|
|
|
// Si es operacion corto
|
|
// Si es operacion corto
|
|
|
if (this.tipoOperacion == 1) {
|
|
if (this.tipoOperacion == 1) {
|
|
|
this.corto = ans["result"]["instrumento_venta"]["corto"];
|
|
this.corto = ans["result"]["instrumento_venta"]["corto"];
|
|
@@ -603,52 +606,70 @@ export class OPC implements InstrumentComponent {
|
|
|
completo: this.tipoEjecucion,
|
|
completo: this.tipoEjecucion,
|
|
|
corto: this.tipoOperacion,
|
|
corto: this.tipoOperacion,
|
|
|
ticket: this.investmentProposalForm.value.ticket,
|
|
ticket: this.investmentProposalForm.value.ticket,
|
|
|
- precio_unitario_compra: this.investmentProposalForm.value
|
|
|
|
|
- .precio_unitario_compra,
|
|
|
|
|
- comision_broker_compra: this.investmentProposalForm.value
|
|
|
|
|
- .comision_broker_compra,
|
|
|
|
|
- cantidad_contratos_compra: this.investmentProposalForm.value
|
|
|
|
|
- .cantidad_contratos_compra,
|
|
|
|
|
- unidades_contratos_compra: this.investmentProposalForm.value
|
|
|
|
|
- .unidades_contratos_compra,
|
|
|
|
|
- fecha_operacion_compra:
|
|
|
|
|
- this.investmentProposalForm.value.fecha_operacion_compra == ""
|
|
|
|
|
- ? ""
|
|
|
|
|
- : this.investmentProposalForm.value.fecha_operacion_compra
|
|
|
|
|
- .singleDate.formatted,
|
|
|
|
|
- fecha_liquidacion_compra:
|
|
|
|
|
- this.investmentProposalForm.value.fecha_liquidacion_compra == ""
|
|
|
|
|
- ? ""
|
|
|
|
|
- : this.investmentProposalForm.value.fecha_liquidacion_compra
|
|
|
|
|
- .singleDate.formatted,
|
|
|
|
|
-
|
|
|
|
|
- precio_unitario_venta: this.investmentProposalForm.value
|
|
|
|
|
- .precio_unitario_venta,
|
|
|
|
|
- comision_broker_venta: this.investmentProposalForm.value
|
|
|
|
|
- .comision_broker_venta,
|
|
|
|
|
- cantidad_contratos_venta: this.investmentProposalForm.value
|
|
|
|
|
- .cantidad_contratos_venta,
|
|
|
|
|
- unidades_contratos_venta: this.investmentProposalForm.value
|
|
|
|
|
- .unidades_contratos_venta,
|
|
|
|
|
- fecha_operacion_venta:
|
|
|
|
|
- this.investmentProposalForm.value.fecha_operacion_venta == ""
|
|
|
|
|
- ? ""
|
|
|
|
|
- : this.investmentProposalForm.value.fecha_operacion_venta
|
|
|
|
|
- .singleDate.formatted,
|
|
|
|
|
- fecha_liquidacion_venta:
|
|
|
|
|
- this.investmentProposalForm.value.fecha_liquidacion_venta == ""
|
|
|
|
|
- ? ""
|
|
|
|
|
- : this.investmentProposalForm.value.fecha_liquidacion_venta
|
|
|
|
|
- .singleDate.formatted,
|
|
|
|
|
-
|
|
|
|
|
- valor_transado_compra: this.valor_transado_compra,
|
|
|
|
|
- valor_pagado: this.valor_pagado,
|
|
|
|
|
- ganancia_perdida: this.ganancia_perdida,
|
|
|
|
|
- rendimiento: this.rendimiento,
|
|
|
|
|
- valor_transado_venta: this.valor_transado_venta,
|
|
|
|
|
- valor_recibido: this.valor_recibido,
|
|
|
|
|
|
|
+
|
|
|
fecha_inicio_vigencia: this.fecha_inicio_vigencia
|
|
fecha_inicio_vigencia: this.fecha_inicio_vigencia
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ if (this.tipoOperacion == 0 || this.tipoEjecucion == 1) {
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "precio_unitario_compra"
|
|
|
|
|
+ ] = this.investmentProposalForm.value.precio_unitario_compra),
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "comision_broker_compra"
|
|
|
|
|
+ ] = this.investmentProposalForm.value.comision_broker_compra),
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "cantidad_contratos_compra"
|
|
|
|
|
+ ] = this.investmentProposalForm.value.cantidad_contratos_compra),
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "unidades_contratos_compra"
|
|
|
|
|
+ ] = this.investmentProposalForm.value.unidades_contratos_compra),
|
|
|
|
|
+ (this.opcionesObject["fecha_operacion_compra"] =
|
|
|
|
|
+ this.investmentProposalForm.value.fecha_operacion_compra == ""
|
|
|
|
|
+ ? ""
|
|
|
|
|
+ : this.investmentProposalForm.value.fecha_operacion_compra
|
|
|
|
|
+ .singleDate.formatted),
|
|
|
|
|
+ (this.opcionesObject["fecha_liquidacion_compra"] =
|
|
|
|
|
+ this.investmentProposalForm.value.fecha_liquidacion_compra == ""
|
|
|
|
|
+ ? ""
|
|
|
|
|
+ : this.investmentProposalForm.value.fecha_liquidacion_compra
|
|
|
|
|
+ .singleDate.formatted),
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "valor_transado_compra"
|
|
|
|
|
+ ] = this.valor_transado_compra),
|
|
|
|
|
+ (this.opcionesObject["valor_pagado"] = this.valor_pagado),
|
|
|
|
|
+ (this.opcionesObject["ganancia_perdida"] = this.ganancia_perdida),
|
|
|
|
|
+ (this.opcionesObject["rendimiento"] = this.rendimiento);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.tipoOperacion == 1 || this.tipoEjecucion == 1) {
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "precio_unitario_venta"
|
|
|
|
|
+ ] = this.investmentProposalForm.value.precio_unitario_venta),
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "comision_broker_venta"
|
|
|
|
|
+ ] = this.investmentProposalForm.value.comision_broker_venta),
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "cantidad_contratos_venta"
|
|
|
|
|
+ ] = this.investmentProposalForm.value.cantidad_contratos_venta),
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "unidades_contratos_venta"
|
|
|
|
|
+ ] = this.investmentProposalForm.value.unidades_contratos_venta),
|
|
|
|
|
+ (this.opcionesObject["fecha_operacion_venta"] =
|
|
|
|
|
+ this.investmentProposalForm.value.fecha_operacion_venta == ""
|
|
|
|
|
+ ? ""
|
|
|
|
|
+ : this.investmentProposalForm.value.fecha_operacion_venta
|
|
|
|
|
+ .singleDate.formatted),
|
|
|
|
|
+ (this.opcionesObject["fecha_liquidacion_venta"] =
|
|
|
|
|
+ this.investmentProposalForm.value.fecha_liquidacion_venta == ""
|
|
|
|
|
+ ? ""
|
|
|
|
|
+ : this.investmentProposalForm.value.fecha_liquidacion_venta
|
|
|
|
|
+ .singleDate.formatted),
|
|
|
|
|
+ (this.opcionesObject[
|
|
|
|
|
+ "valor_transado_venta"
|
|
|
|
|
+ ] = this.valor_transado_venta),
|
|
|
|
|
+ (this.opcionesObject["valor_recibido"] = this.valor_recibido);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (this.tipoOperacion == 0) {
|
|
if (this.tipoOperacion == 0) {
|
|
|
this.opcionesObject[
|
|
this.opcionesObject[
|
|
|
"fecha_vencimiento_compra"
|
|
"fecha_vencimiento_compra"
|
|
@@ -660,6 +681,13 @@ export class OPC implements InstrumentComponent {
|
|
|
] = this.fecha_vencimiento_venta;
|
|
] = this.fecha_vencimiento_venta;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (this.tipoEjecucion == 1) {
|
|
|
|
|
+ this.opcionesObject["fecha_cancelado"] = this.datepipe.transform(
|
|
|
|
|
+ new Date(),
|
|
|
|
|
+ "dd/MM/yyyy"
|
|
|
|
|
+ ); //.toISOString().slice(0, 10);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.formDataService.setWork(this.opcionesObject);
|
|
this.formDataService.setWork(this.opcionesObject);
|
|
|
Swal.close();
|
|
Swal.close();
|
|
|
if (saveForm == true) {
|
|
if (saveForm == true) {
|