|
|
@@ -134,22 +134,8 @@ 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],
|
|
|
+ operacion: [this.instrument_exists ? "" : +this.instrument_work.corto],
|
|
|
ejecucion: [this.instrument_exists ? "" : this.ejecucion],
|
|
|
ticker: [this.instrument_exists ? "" : this.instrument_work.ticker],
|
|
|
precio_unitario_compra: [
|
|
|
@@ -296,11 +282,18 @@ export class OPC implements InstrumentComponent {
|
|
|
this.instrument_work_summary.valor_recibido > 0
|
|
|
) {
|
|
|
this.ejecucion = 1;
|
|
|
+ } else if (
|
|
|
+ this.instrument_work_summary.valor_pagado > 0 ||
|
|
|
+ this.instrument_work_summary.valor_recibido > 0
|
|
|
+ ) {
|
|
|
+ this.ejecucion = 0;
|
|
|
}
|
|
|
+ this.investmentProposalForm.patchValue({
|
|
|
+ ejecucion: this.ejecucion
|
|
|
+ });
|
|
|
} else {
|
|
|
this.ejecucion = +this.instrument_work_summary.completo;
|
|
|
}
|
|
|
-
|
|
|
this.toggle_operacion(this.operacion);
|
|
|
this.toggle_ejecucion(this.ejecucion);
|
|
|
}
|
|
|
@@ -322,6 +315,8 @@ export class OPC implements InstrumentComponent {
|
|
|
console.log("tipo de ejecucion");
|
|
|
console.log(this.tipoEjecucion);
|
|
|
|
|
|
+ const ticker = this.investmentProposalForm.get("ticker");
|
|
|
+
|
|
|
const precio_unitario_compra = this.investmentProposalForm.get(
|
|
|
"precio_unitario_compra"
|
|
|
);
|
|
|
@@ -365,6 +360,8 @@ export class OPC implements InstrumentComponent {
|
|
|
"fecha_vencimiento_venta"
|
|
|
);
|
|
|
|
|
|
+ ticker.setValidators([Validators.required]);
|
|
|
+
|
|
|
if (this.tipoEjecucion == 1) {
|
|
|
precio_unitario_compra.setValidators([
|
|
|
Validators.required,
|
|
|
@@ -486,7 +483,6 @@ export class OPC implements InstrumentComponent {
|
|
|
fecha_liquidacion_venta.updateValueAndValidity();
|
|
|
fecha_vencimiento_venta.updateValueAndValidity();
|
|
|
}
|
|
|
-
|
|
|
save(form: any): boolean {
|
|
|
if (!form.valid) {
|
|
|
return false;
|