|
|
@@ -128,6 +128,11 @@ export class CINV implements InstrumentComponent {
|
|
|
ytm_vencimiento_porcentaje_venta: any;
|
|
|
comision_bolsa_venta: any;
|
|
|
consolidado_proyeccion: any;
|
|
|
+ ejecuciones = [
|
|
|
+ { codigo: 1, nombre: "Completa" },
|
|
|
+ { codigo: 0, nombre: "Parcial" }
|
|
|
+ ];
|
|
|
+ tipoEjecucion: number = 0;
|
|
|
|
|
|
constructor(
|
|
|
private formBuilder: FormBuilder,
|
|
|
@@ -138,7 +143,6 @@ export class CINV implements InstrumentComponent {
|
|
|
public datepipe: DatePipe
|
|
|
) {
|
|
|
this.instrument_work = this.formDataService.getWork();
|
|
|
-
|
|
|
this.instrument_exists = this.instrument_work == undefined;
|
|
|
this.general = this.formDataService.getGeneralInfo();
|
|
|
|
|
|
@@ -171,7 +175,15 @@ export class CINV implements InstrumentComponent {
|
|
|
this.operation_result = true;
|
|
|
}
|
|
|
|
|
|
+ if (+this.instrument_work["valor_nominal_venta"] > 0) {
|
|
|
+ this.tipoEjecucion = 1;
|
|
|
+ }
|
|
|
+ console.log("EJECUCION");
|
|
|
+ console.log(this.tipoEjecucion);
|
|
|
+
|
|
|
this.investmentProposalForm = this.formBuilder.group({
|
|
|
+ ejecucion: [this.instrument_exists ? "" : this.tipoEjecucion],
|
|
|
+
|
|
|
renta_porcentaje: [
|
|
|
this.instrument_exists ? "" : this.instrument_work.renta_porcentaje,
|
|
|
[
|
|
|
@@ -410,6 +422,7 @@ export class CINV implements InstrumentComponent {
|
|
|
id_periodicidad: +this.general.periodicidad
|
|
|
},
|
|
|
{
|
|
|
+ completo: this.tipoEjecucion,
|
|
|
renta_porcentaje: +this.f.renta_porcentaje.value,
|
|
|
costo_cedeval: +this.f.costo_cedeval.value,
|
|
|
costo_transferencia: +this.f.costo_transferencia.value,
|
|
|
@@ -431,19 +444,31 @@ export class CINV implements InstrumentComponent {
|
|
|
comision_bolsa_porcentaje_venta: this.f
|
|
|
.comision_bolsa_porcentaje_venta.value,
|
|
|
|
|
|
- fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
|
|
|
- .singleDate.formatted,
|
|
|
- fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
|
|
|
- .singleDate.formatted,
|
|
|
- fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
|
|
|
- .singleDate.formatted,
|
|
|
-
|
|
|
- fecha_vencimiento_venta: this.f.fecha_vencimiento_venta.value
|
|
|
- .singleDate.formatted,
|
|
|
- fecha_ultima_cupon_venta: this.f.fecha_ultima_cupon_venta.value
|
|
|
- .singleDate.formatted,
|
|
|
- fecha_liquidacion_venta: this.f.fecha_liquidacion_venta.value
|
|
|
- .singleDate.formatted
|
|
|
+ fecha_vencimiento_compra:
|
|
|
+ this.f.fecha_vencimiento_compra.value == ""
|
|
|
+ ? ""
|
|
|
+ : this.f.fecha_vencimiento_compra.value.singleDate.formatted,
|
|
|
+ fecha_ultima_cupon_compra:
|
|
|
+ this.f.fecha_ultima_cupon_compra.value == ""
|
|
|
+ ? ""
|
|
|
+ : this.f.fecha_ultima_cupon_compra.value.singleDate.formatted,
|
|
|
+ fecha_liquidacion_compra:
|
|
|
+ this.f.fecha_liquidacion_compra.value == ""
|
|
|
+ ? ""
|
|
|
+ : this.f.fecha_liquidacion_compra.value.singleDate.formatted,
|
|
|
+
|
|
|
+ fecha_vencimiento_venta:
|
|
|
+ this.f.fecha_vencimiento_venta.value == ""
|
|
|
+ ? ""
|
|
|
+ : this.f.fecha_vencimiento_venta.value.singleDate.formatted,
|
|
|
+ fecha_ultima_cupon_venta:
|
|
|
+ this.f.fecha_ultima_cupon_venta.value == ""
|
|
|
+ ? ""
|
|
|
+ : this.f.fecha_ultima_cupon_venta.value.singleDate.formatted,
|
|
|
+ fecha_liquidacion_venta:
|
|
|
+ this.f.fecha_liquidacion_venta.value == ""
|
|
|
+ ? ""
|
|
|
+ : this.f.fecha_liquidacion_venta.value.singleDate.formatted
|
|
|
}
|
|
|
)
|
|
|
.subscribe(
|
|
|
@@ -484,66 +509,43 @@ export class CINV implements InstrumentComponent {
|
|
|
ans["result"]["instrumento_compra"]["fecha_inicio_vigencia"];
|
|
|
|
|
|
// Instrumento de venta
|
|
|
- this.comision_casa_venta =
|
|
|
- ans["result"]["instrumento_venta"]["comision_casa_venta"];
|
|
|
-
|
|
|
- this.comision_bolsa_venta =
|
|
|
- ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
|
|
|
-
|
|
|
- this.fecha_siguiente_cupon_venta =
|
|
|
- ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
|
|
|
- this.dias_vencimiento_venta =
|
|
|
- ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
|
|
|
- this.dias_acumulados_venta =
|
|
|
- ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
|
|
|
- this.ytm_vencimiento_comision_porcentaje_venta =
|
|
|
- ans["result"]["instrumento_venta"][
|
|
|
- "ytm_vencimiento_comision_porcentaje_venta"
|
|
|
- ];
|
|
|
- this.ytm_vencimiento_porcentaje_venta =
|
|
|
- ans["result"]["instrumento_venta"][
|
|
|
- "ytm_vencimiento_porcentaje_venta"
|
|
|
- ];
|
|
|
- this.interes_acumulado_venta =
|
|
|
- ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
|
|
|
- this.interes_acumulado_porcentaje_venta =
|
|
|
- ans["result"]["instrumento_venta"][
|
|
|
- "interes_acumulado_porcentaje_venta"
|
|
|
- ];
|
|
|
- this.precio_sucio_porcentaje_venta =
|
|
|
- ans["result"]["instrumento_venta"]["precio_sucio_porcentaje_venta"];
|
|
|
- this.valor_transado_venta =
|
|
|
- ans["result"]["instrumento_venta"]["valor_transado_venta"];
|
|
|
- this.monto_recibir =
|
|
|
- ans["result"]["instrumento_venta"]["monto_recibir"];
|
|
|
-
|
|
|
- // Resultado de la operacion
|
|
|
- this.dias_tenencia_total =
|
|
|
- ans["result"]["resultado_operacion"]["dias_tenencia_total"];
|
|
|
- this.ganancia_perdida_capital =
|
|
|
- ans["result"]["resultado_operacion"]["ganancia_perdida_capital"];
|
|
|
- this.ingresos_intereses =
|
|
|
- ans["result"]["resultado_operacion"]["ingresos_intereses"];
|
|
|
- this.costos_totales =
|
|
|
- ans["result"]["resultado_operacion"]["costos_totales"];
|
|
|
- this.ganancia_perdida_total =
|
|
|
- ans["result"]["resultado_operacion"]["ganancia_perdida_total"];
|
|
|
- this.ganancia_perdida_capital_porcentaje =
|
|
|
- ans["result"]["resultado_operacion"][
|
|
|
- "ganancia_perdida_capital_porcentaje"
|
|
|
- ];
|
|
|
- this.intereses_porcentaje =
|
|
|
- ans["result"]["resultado_operacion"]["intereses_porcentaje"];
|
|
|
- this.neto_antes_impuesto_porcentaje =
|
|
|
- ans["result"]["resultado_operacion"][
|
|
|
- "neto_antes_impuesto_porcentaje"
|
|
|
- ];
|
|
|
- this.neto_despues_impuesto_porcentaje =
|
|
|
- ans["result"]["resultado_operacion"][
|
|
|
- "neto_despues_impuesto_porcentaje"
|
|
|
- ];
|
|
|
- this.total_ingresos_recibidos =
|
|
|
- ans["result"]["resultado_operacion"]["total_ingresos_recibidos"];
|
|
|
+ if (this.tipoEjecucion == 1) {
|
|
|
+ this.comision_casa_venta =
|
|
|
+ ans["result"]["instrumento_venta"]["comision_casa_venta"];
|
|
|
+ this.comision_bolsa_venta =
|
|
|
+ ans["result"]["instrumento_venta"]["comision_bolsa_venta"];
|
|
|
+ this.fecha_siguiente_cupon_venta =
|
|
|
+ ans["result"]["instrumento_venta"]["fecha_siguiente_cupon_venta"];
|
|
|
+ this.dias_vencimiento_venta =
|
|
|
+ ans["result"]["instrumento_venta"]["dias_vencimiento_venta"];
|
|
|
+ this.dias_acumulados_venta =
|
|
|
+ ans["result"]["instrumento_venta"]["dias_acumulados_venta"];
|
|
|
+ this.ytm_vencimiento_comision_porcentaje_venta =
|
|
|
+ ans["result"]["instrumento_venta"][
|
|
|
+ "ytm_vencimiento_comision_porcentaje_venta"
|
|
|
+ ];
|
|
|
+ this.ytm_vencimiento_porcentaje_venta =
|
|
|
+ ans["result"]["instrumento_venta"][
|
|
|
+ "ytm_vencimiento_porcentaje_venta"
|
|
|
+ ];
|
|
|
+ this.interes_acumulado_venta =
|
|
|
+ ans["result"]["instrumento_venta"]["interes_acumulado_venta"];
|
|
|
+ this.interes_acumulado_porcentaje_venta =
|
|
|
+ ans["result"]["instrumento_venta"][
|
|
|
+ "interes_acumulado_porcentaje_venta"
|
|
|
+ ];
|
|
|
+ this.precio_sucio_porcentaje_venta =
|
|
|
+ ans["result"]["instrumento_venta"][
|
|
|
+ "precio_sucio_porcentaje_venta"
|
|
|
+ ];
|
|
|
+ this.valor_transado_venta =
|
|
|
+ ans["result"]["instrumento_venta"]["valor_transado_venta"];
|
|
|
+ this.monto_recibir =
|
|
|
+ ans["result"]["instrumento_venta"]["monto_recibir"];
|
|
|
+
|
|
|
+ this.operation_results_work = ans["result"]["resultado_operacion"];
|
|
|
+ this.operation_result = true;
|
|
|
+ }
|
|
|
|
|
|
// Proyecciones
|
|
|
this.proyecciones = ans["result"]["proyecciones"];
|
|
|
@@ -555,14 +557,14 @@ export class CINV implements InstrumentComponent {
|
|
|
this.proyecciones = ans["result"]["proyecciones"];
|
|
|
}
|
|
|
|
|
|
- this.operation_result = true;
|
|
|
this.dataSource.data = this.proyecciones.slice(0, -1);
|
|
|
this.dataSource2.data = this.proyecciones.slice(0, -1);
|
|
|
this.dataSource.paginator = this.paginator;
|
|
|
this.dataSource.sort = this.sort;
|
|
|
|
|
|
- // Obj
|
|
|
this.bonosObject = {
|
|
|
+ completo: this.tipoEjecucion,
|
|
|
+ cancelado: this.tipoEjecucion,
|
|
|
renta_porcentaje: this.investmentProposalForm.value
|
|
|
.renta_porcentaje,
|
|
|
costo_cedeval: this.investmentProposalForm.value.costo_cedeval,
|
|
|
@@ -580,18 +582,6 @@ export class CINV implements InstrumentComponent {
|
|
|
comision_bolsa_porcentaje_compra: this.investmentProposalForm.value
|
|
|
.comision_bolsa_porcentaje_compra,
|
|
|
|
|
|
- valor_nominal_venta: this.investmentProposalForm.value
|
|
|
- .valor_nominal_venta,
|
|
|
- precio_venta: this.investmentProposalForm.value.precio_venta,
|
|
|
- precio_vencimiento_venta: this.investmentProposalForm.value
|
|
|
- .precio_vencimiento_venta,
|
|
|
- cupon_porcentaje_venta: this.investmentProposalForm.value
|
|
|
- .cupon_porcentaje_venta,
|
|
|
- comision_casa_porcentaje_venta: this.investmentProposalForm.value
|
|
|
- .comision_casa_porcentaje_venta,
|
|
|
- comision_bolsa_porcentaje_venta: this.investmentProposalForm.value
|
|
|
- .comision_bolsa_porcentaje_venta,
|
|
|
-
|
|
|
fecha_vencimiento_compra: this.f.fecha_vencimiento_compra.value
|
|
|
.singleDate.formatted,
|
|
|
fecha_ultima_cupon_compra: this.f.fecha_ultima_cupon_compra.value
|
|
|
@@ -599,13 +589,6 @@ export class CINV implements InstrumentComponent {
|
|
|
fecha_liquidacion_compra: this.f.fecha_liquidacion_compra.value
|
|
|
.singleDate.formatted,
|
|
|
|
|
|
- fecha_vencimiento_venta: this.f.fecha_vencimiento_venta.value
|
|
|
- .singleDate.formatted,
|
|
|
- fecha_ultima_cupon_venta: this.f.fecha_ultima_cupon_venta.value
|
|
|
- .singleDate.formatted,
|
|
|
- fecha_liquidacion_venta: this.f.fecha_liquidacion_venta.value
|
|
|
- .singleDate.formatted,
|
|
|
-
|
|
|
// Instrumento de compra
|
|
|
|
|
|
comision_casa_compra: this.comision_casa_compra,
|
|
|
@@ -624,26 +607,9 @@ export class CINV implements InstrumentComponent {
|
|
|
valor_transado_compra: this.valor_transado_compra,
|
|
|
monto_pagar: this.monto_pagar,
|
|
|
fecha_inicio_vigencia: this.fecha_inicio_vigencia,
|
|
|
- // Instrumento de venta
|
|
|
-
|
|
|
- comision_casa_venta: this.comision_casa_venta,
|
|
|
- comision_bolsa_venta: this.comision_bolsa_venta,
|
|
|
-
|
|
|
- fecha_siguiente_cupon_venta: this.fecha_siguiente_cupon_venta,
|
|
|
- dias_vencimiento_venta: this.dias_vencimiento_venta,
|
|
|
- dias_acumulados_venta: this.dias_acumulados_venta,
|
|
|
- ytm_vencimiento_porcentaje_venta: this
|
|
|
- .ytm_vencimiento_porcentaje_venta,
|
|
|
- ytm_vencimiento_comision_porcentaje_venta: this
|
|
|
- .ytm_vencimiento_comision_porcentaje_venta,
|
|
|
-
|
|
|
- interes_acumulado_venta: this.interes_acumulado_venta,
|
|
|
- interes_acumulado_porcentaje_venta: this
|
|
|
- .interes_acumulado_porcentaje_venta,
|
|
|
- precio_sucio_porcentaje_venta: this.precio_sucio_porcentaje_venta,
|
|
|
- valor_transado_venta: this.valor_transado_venta,
|
|
|
- // Resultado de la operacion
|
|
|
|
|
|
+ // Resultado de la operacion
|
|
|
+ /*
|
|
|
monto_recibir: this.monto_recibir,
|
|
|
dias_tenencia_total: this.dias_tenencia_total,
|
|
|
ganancia_perdida_capital: this.ganancia_perdida_capital,
|
|
|
@@ -657,10 +623,68 @@ export class CINV implements InstrumentComponent {
|
|
|
neto_despues_impuesto_porcentaje: this
|
|
|
.neto_despues_impuesto_porcentaje,
|
|
|
total_ingresos_recibidos: this.total_ingresos_recibidos,
|
|
|
-
|
|
|
+ */
|
|
|
// Proyecciones
|
|
|
+
|
|
|
proyecciones: this.proyecciones
|
|
|
};
|
|
|
+ if (this.tipoEjecucion == 1) {
|
|
|
+ this.bonosObject[
|
|
|
+ "valor_nominal_venta"
|
|
|
+ ] = this.investmentProposalForm.value.valor_nominal_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "precio_venta"
|
|
|
+ ] = this.investmentProposalForm.value.precio_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "precio_vencimiento_venta"
|
|
|
+ ] = this.investmentProposalForm.value.precio_vencimiento_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "comision_casa_porcentaje_venta"
|
|
|
+ ] = this.investmentProposalForm.value.comision_casa_porcentaje_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "comision_bolsa_porcentaje_venta"
|
|
|
+ ] = this.investmentProposalForm.value.comision_bolsa_porcentaje_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "fecha_vencimiento_venta"
|
|
|
+ ] = this.f.fecha_vencimiento_venta.value.singleDate.formatted;
|
|
|
+ this.bonosObject[
|
|
|
+ "fecha_ultima_cupon_venta"
|
|
|
+ ] = this.f.fecha_ultima_cupon_venta.value.singleDate.formatted;
|
|
|
+ this.bonosObject[
|
|
|
+ "fecha_liquidacion_venta"
|
|
|
+ ] = this.f.fecha_liquidacion_venta.value.singleDate.formatted;
|
|
|
+ this.bonosObject["comision_casa_venta"] = this.comision_casa_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "comision_bolsa_venta"
|
|
|
+ ] = this.comision_bolsa_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "fecha_siguiente_cupon_venta"
|
|
|
+ ] = this.fecha_siguiente_cupon_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "dias_vencimiento_venta"
|
|
|
+ ] = this.dias_vencimiento_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "dias_acumulados_venta"
|
|
|
+ ] = this.dias_acumulados_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "ytm_vencimiento_porcentaje_venta"
|
|
|
+ ] = this.ytm_vencimiento_porcentaje_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "ytm_vencimiento_comision_porcentaje_venta"
|
|
|
+ ] = this.ytm_vencimiento_comision_porcentaje_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "interes_acumulado_venta"
|
|
|
+ ] = this.interes_acumulado_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "interes_acumulado_porcentaje_venta"
|
|
|
+ ] = this.interes_acumulado_porcentaje_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "precio_sucio_porcentaje_venta"
|
|
|
+ ] = this.precio_sucio_porcentaje_venta;
|
|
|
+ this.bonosObject[
|
|
|
+ "valor_transado_venta"
|
|
|
+ ] = this.valor_transado_venta;
|
|
|
+ }
|
|
|
|
|
|
this.formDataService.setWork(this.bonosObject);
|
|
|
Swal.close();
|
|
|
@@ -699,4 +723,8 @@ export class CINV implements InstrumentComponent {
|
|
|
goToNext(form: any) {
|
|
|
this.getCalculations(form, true);
|
|
|
}
|
|
|
+
|
|
|
+ toggle_ejecucion(input: any) {
|
|
|
+ this.tipoEjecucion = +input;
|
|
|
+ }
|
|
|
}
|