|
|
@@ -35,19 +35,12 @@ export class InvestmentPrint implements OnInit {
|
|
|
// TO DO, crear una funcion que devuelva los campos necesarios de cada instrumento
|
|
|
this.instrumentName = this.investmentResult.id_inversion_instrumento.id_tipo_instrumento.codigo;
|
|
|
this.investmentInstrument = this.investmentResult.id_inversion_instrumento.instrumento;
|
|
|
- Object.entries(this.investmentInstrument).forEach(([key, value]) => {
|
|
|
- if (key != "proyecciones") {
|
|
|
- this.columnKey.push(
|
|
|
- key.replace(/([-_][a-z])/g, group =>
|
|
|
- group
|
|
|
- .toUpperCase()
|
|
|
- .replace("-", " ")
|
|
|
- .replace("_", " ")
|
|
|
- )
|
|
|
- );
|
|
|
- this.columnValue.push(value);
|
|
|
- }
|
|
|
- });
|
|
|
+ console.log(this.investmentInstrument);
|
|
|
+ this.getInstrumentColumns(
|
|
|
+ this.instrumentName,
|
|
|
+ this.investmentInstrument
|
|
|
+ );
|
|
|
+
|
|
|
this.catalogService.getRateTypes().subscribe(res => {
|
|
|
this.rates = res.find(
|
|
|
e => e.id_tipo_tasa == this.investmentResult.id_tipo_tasa
|
|
|
@@ -58,6 +51,817 @@ export class InvestmentPrint implements OnInit {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ getInstrumentColumns(instrumentName: string, investmentInstrument: any) {
|
|
|
+ switch (instrumentName) {
|
|
|
+ case "LETE":
|
|
|
+ Object.entries(investmentInstrument).forEach(([key, value]) => {
|
|
|
+ if (value == null) {
|
|
|
+ value = "-";
|
|
|
+ }
|
|
|
+ if (key == "renta_porcentaje") {
|
|
|
+ this.columnKey.push("Renta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "valor_nominal") {
|
|
|
+ this.columnKey.push("Valor nominal");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "plazo") {
|
|
|
+ this.columnKey.push("Plazo");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_casa_porcentaje") {
|
|
|
+ this.columnKey.push("Comisión casa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa_porcentaje") {
|
|
|
+ this.columnKey.push("Comisión bolsa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "rendimiento_bruto") {
|
|
|
+ this.columnKey.push("Rendimiento bruto (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "ingreso_bruto") {
|
|
|
+ this.columnKey.push("Ingreso bruto");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "ingreso_neto") {
|
|
|
+ this.columnKey.push("Ingreso neto");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_transado") {
|
|
|
+ this.columnKey.push("Valor transado");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "precio_porcentaje") {
|
|
|
+ this.columnKey.push("Precio (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "rendimiento_neto") {
|
|
|
+ this.columnKey.push("Rendimiento neto (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "total_pagar") {
|
|
|
+ this.columnKey.push("Total a pagar");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa") {
|
|
|
+ this.columnKey.push("Comisión bolsa ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_casa") {
|
|
|
+ this.columnKey.push("Comisión casa ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento") {
|
|
|
+ this.columnKey.push("Fecha vencimiento");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_operacion") {
|
|
|
+ this.columnKey.push("Fecha operación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_liquidacion") {
|
|
|
+ this.columnKey.push("Fecha liquidación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_redencion") {
|
|
|
+ this.columnKey.push("Fecha redención");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "CETE":
|
|
|
+ Object.entries(investmentInstrument).forEach(([key, value]) => {
|
|
|
+ if (value == null) {
|
|
|
+ value = "-";
|
|
|
+ }
|
|
|
+ if (key == "renta_porcentaje") {
|
|
|
+ this.columnKey.push("Renta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "valor_nominal") {
|
|
|
+ this.columnKey.push("Valor nominal");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "plazo") {
|
|
|
+ this.columnKey.push("Plazo");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_casa_porcentaje") {
|
|
|
+ this.columnKey.push("Comisión casa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa_porcentaje") {
|
|
|
+ this.columnKey.push("Comisión bolsa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "rendimiento_bruto") {
|
|
|
+ this.columnKey.push("RendRendimiento bruto (%)imiento bruto");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "otros_costos") {
|
|
|
+ this.columnKey.push("Otros costos");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_operacion") {
|
|
|
+ this.columnKey.push("Fecha de operación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_liquidacion") {
|
|
|
+ this.columnKey.push("Fecha de liquidación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_ultima_cupon") {
|
|
|
+ this.columnKey.push("Fecha última cupón");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento") {
|
|
|
+ this.columnKey.push("Fecha de vencimiento");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "ingreso_bruto") {
|
|
|
+ this.columnKey.push("Ingreso bruto");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "ingreso_neto") {
|
|
|
+ this.columnKey.push("Ingreso neto");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_transado") {
|
|
|
+ this.columnKey.push("Valor transado");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "precio_porcentaje") {
|
|
|
+ this.columnKey.push("Precio (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "rendimiento_neto") {
|
|
|
+ this.columnKey.push("Rendimiento neto (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "total_pagar") {
|
|
|
+ this.columnKey.push("Total a pagar");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa") {
|
|
|
+ this.columnKey.push("Comisión bolsa ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_casa") {
|
|
|
+ this.columnKey.push("Comisión casa ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case "VCN":
|
|
|
+ case "PBUR":
|
|
|
+ Object.entries(investmentInstrument).forEach(([key, value]) => {
|
|
|
+ if (value == null) {
|
|
|
+ value = "-";
|
|
|
+ }
|
|
|
+ if (key == "valor_par") {
|
|
|
+ this.columnKey.push("Valor par");
|
|
|
+ this.columnValue.push(value.toString() == "true" ? "Si" : "No");
|
|
|
+ }
|
|
|
+ if (key == "valor_nominal") {
|
|
|
+ this.columnKey.push("Valor nominal");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "renta_porcentaje") {
|
|
|
+ this.columnKey.push("Renta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_casa_porcentaje") {
|
|
|
+ this.columnKey.push("Comisión casa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa_porcentaje") {
|
|
|
+ this.columnKey.push("Comisión bolsa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_casa") {
|
|
|
+ this.columnKey.push("Comisión casa ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa") {
|
|
|
+ this.columnKey.push("Comisión bolsa ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "rendimiento_bruto") {
|
|
|
+ this.columnKey.push("Rendimiento bruto (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "otros_costos") {
|
|
|
+ this.columnKey.push("Otros costos");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "ingreso_bruto") {
|
|
|
+ this.columnKey.push("Ingreso bruto");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "ingreso_neto") {
|
|
|
+ this.columnKey.push("Ingreso neto");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_transado") {
|
|
|
+ this.columnKey.push("Valor transado");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "precio_porcentaje") {
|
|
|
+ this.columnKey.push("Precio (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "rendimiento_neto") {
|
|
|
+ this.columnKey.push("Rendimiento neto (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "total_pagar") {
|
|
|
+ this.columnKey.push("Total a pagar");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "interes_acumulado") {
|
|
|
+ this.columnKey.push("Interés acumulado");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_inicio_vigencia") {
|
|
|
+ this.columnKey.push("Fecha inicio de vigencia");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "plazo") {
|
|
|
+ this.columnKey.push("Plazo");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_operacion") {
|
|
|
+ this.columnKey.push("Fecha de operación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_liquidacion") {
|
|
|
+ this.columnKey.push("Fecha de liquidación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_ultima_cupon") {
|
|
|
+ this.columnKey.push("Fecha última cupón");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento") {
|
|
|
+ this.columnKey.push("Fecha de vencimiento");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case "DAP":
|
|
|
+ console.log("enter here");
|
|
|
+ console.log(investmentInstrument);
|
|
|
+
|
|
|
+ Object.entries(investmentInstrument).forEach(([key, value]) => {
|
|
|
+ if (value == null) {
|
|
|
+ value = "-";
|
|
|
+ }
|
|
|
+ if (key == "monto_inversion") {
|
|
|
+ this.columnKey.push("Monto inversión");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "renta_porcentaje") {
|
|
|
+ this.columnKey.push("Renta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "tasa_porcentaje") {
|
|
|
+ this.columnKey.push("Tasa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "ingreso_bruto") {
|
|
|
+ this.columnKey.push("Ingreso bruto");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "ingreso_neto") {
|
|
|
+ this.columnKey.push("Ingreso neto");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "rendimiento_bruto") {
|
|
|
+ this.columnKey.push("Rendimiento bruto (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "rendimiento_neto") {
|
|
|
+ this.columnKey.push("Rendimiento neto (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "fecha_inicio_vigencia") {
|
|
|
+ this.columnKey.push("Fecha inicio de vigencia");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "renta") {
|
|
|
+ this.columnKey.push("Renta");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "numero_certificado") {
|
|
|
+ this.columnKey.push("Número de certificado");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_operacion") {
|
|
|
+ this.columnKey.push("Fecha de operación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento") {
|
|
|
+ this.columnKey.push("Fecha de vencimiento");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(this.columnKey);
|
|
|
+ break;
|
|
|
+ case "BONO":
|
|
|
+ case "EURB":
|
|
|
+ case "CINV":
|
|
|
+ Object.entries(investmentInstrument).forEach(([key, value]) => {
|
|
|
+ if (value == null) {
|
|
|
+ value = "-";
|
|
|
+ }
|
|
|
+ if (key == "renta_porcentaje") {
|
|
|
+ this.columnKey.push("Renta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "costo_cedeval") {
|
|
|
+ this.columnKey.push("Costo cedeval");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "costo_transferencia") {
|
|
|
+ this.columnKey.push("Costo transferencia");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_nominal_compra") {
|
|
|
+ this.columnKey.push("Valor nominal compra");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "precio_compra") {
|
|
|
+ this.columnKey.push("Precio compra");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "precio_vencimiento_compra") {
|
|
|
+ this.columnKey.push("Precio vencimiento compra");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "cupon_porcentaje_compra") {
|
|
|
+ this.columnKey.push("Cupón compra");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_casa_porcentaje_compra") {
|
|
|
+ this.columnKey.push("Comisión casa compra");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa_porcentaje_compra") {
|
|
|
+ this.columnKey.push("Comisión bolsa compra");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "valor_nominal_venta") {
|
|
|
+ this.columnKey.push("Valor nominal venta");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "precio_venta") {
|
|
|
+ this.columnKey.push("Precio venta");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "precio_vencimiento_venta") {
|
|
|
+ this.columnKey.push("Precio vencimiento venta");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "cupon_porcentaje_venta") {
|
|
|
+ this.columnKey.push("Cupón venta");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_casa_porcentaje_venta") {
|
|
|
+ this.columnKey.push("Comisión casa venta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa_porcentaje_venta") {
|
|
|
+ this.columnKey.push("Comisión bolsa venta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento_compra") {
|
|
|
+ this.columnKey.push("Fecha vencimiento compra");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_ultima_cupon_compra") {
|
|
|
+ this.columnKey.push("Fecha última cupón");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_liquidacion_compra") {
|
|
|
+ this.columnKey.push("Fecha liquidación compra");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento_venta") {
|
|
|
+ this.columnKey.push("Fecha vencimiento venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_ultima_cupon_venta") {
|
|
|
+ this.columnKey.push("Fecha última cupón venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_liquidacion_venta") {
|
|
|
+ this.columnKey.push("Fecha liquidación venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_casa_compra") {
|
|
|
+ this.columnKey.push("Comisión casa compra ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa_compra") {
|
|
|
+ this.columnKey.push("Comisión bolsa compra ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_siguiente_cupon_compra") {
|
|
|
+ this.columnKey.push("Fecha siguiente cupón compra");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "dias_vencimiento_compra") {
|
|
|
+ this.columnKey.push("Días vencimiento compra");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "dias_acumulados_compra") {
|
|
|
+ this.columnKey.push("Días acumulados");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "ytm_vencimiento_porcentaje_compra") {
|
|
|
+ this.columnKey.push("YTM vencimiento compra");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "ytm_vencimiento_comision_porcentaje_compra") {
|
|
|
+ this.columnKey.push("YTM vencimiento comisión compra");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "interes_acumulado_compra") {
|
|
|
+ this.columnKey.push("Interés acumulado compra ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "interes_acumulado_porcentaje_compra") {
|
|
|
+ this.columnKey.push(" Interés acumulado compra (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "precio_sucio_porcentaje_compra") {
|
|
|
+ this.columnKey.push("Precio sucio compra");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "valor_transado_compra") {
|
|
|
+ this.columnKey.push("Valor transado compra");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "monto_pagar") {
|
|
|
+ this.columnKey.push("Monto a pagar");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_inicio_vigencia") {
|
|
|
+ this.columnKey.push("Fecha inicio vigencia");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_casa_venta") {
|
|
|
+ this.columnKey.push("Comisión venta");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa_venta") {
|
|
|
+ this.columnKey.push("Comisión venta");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_siguiente_cupon_venta") {
|
|
|
+ this.columnKey.push("Fecha siguiente cupón venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "dias_vencimiento_venta") {
|
|
|
+ this.columnKey.push("Días vencimiento venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "dias_acumulados_venta") {
|
|
|
+ this.columnKey.push("Días acumulados venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "ytm_vencimiento_porcentaje_venta") {
|
|
|
+ this.columnKey.push("YTM vencimiento venta");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "ytm_vencimiento_comision_porcentaje_venta") {
|
|
|
+ this.columnKey.push("YTM vencimiento comisión venta");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "interes_acumulado_venta") {
|
|
|
+ this.columnKey.push("Interés acumulado venta");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "interes_acumulado_porcentaje_venta") {
|
|
|
+ this.columnKey.push("Interés acumulado venta");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "precio_sucio_porcentaje_venta") {
|
|
|
+ this.columnKey.push("Precio sucio venta");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "valor_transado_venta") {
|
|
|
+ this.columnKey.push("Valor transado venta");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "TIT":
|
|
|
+ break;
|
|
|
+ case "FINV":
|
|
|
+ Object.entries(investmentInstrument).forEach(([key, value]) => {
|
|
|
+ if (value == null) {
|
|
|
+ value = "-";
|
|
|
+ }
|
|
|
+ if (key == "renta_porcentaje") {
|
|
|
+ this.columnKey.push("Renta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "cuota_participacion") {
|
|
|
+ this.columnKey.push("Cuota participación");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_participacion") {
|
|
|
+ this.columnKey.push("Valor participación");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa_porcentaje") {
|
|
|
+ this.columnKey.push("Comisión bolsa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_casa_porcentaje") {
|
|
|
+ this.columnKey.push("Comisión casa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "dividendo_porcentaje") {
|
|
|
+ this.columnKey.push("Dividendo (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "rendimiento_porcentaje") {
|
|
|
+ this.columnKey.push("Rendimiento (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "dias_liquidacion") {
|
|
|
+ this.columnKey.push("Días liquidación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "dias_vencimiento") {
|
|
|
+ this.columnKey.push("Días vencimiento");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_operacion") {
|
|
|
+ this.columnKey.push("Fecha de operación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_nominal") {
|
|
|
+ this.columnKey.push("Valor nominal");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_transado") {
|
|
|
+ this.columnKey.push("Valor transado");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "monto_pagar") {
|
|
|
+ this.columnKey.push("Monto a pagar");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_casa") {
|
|
|
+ this.columnKey.push("Comisión casa ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_bolsa") {
|
|
|
+ this.columnKey.push("Comisión bolsa ($)");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_liquidacion") {
|
|
|
+ this.columnKey.push("Fecha de liquidación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento") {
|
|
|
+ this.columnKey.push("Fecha de vencimiento");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "OPC":
|
|
|
+ case "FUTU":
|
|
|
+ Object.entries(investmentInstrument).forEach(([key, value]) => {
|
|
|
+ if (value == null) {
|
|
|
+ value = "-";
|
|
|
+ }
|
|
|
+ if (key == "ticker") {
|
|
|
+ this.columnKey.push("Ticker");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "corto") {
|
|
|
+ this.columnKey.push("Tipo de operación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "precio_unitario_compra") {
|
|
|
+ this.columnKey.push("Precio unitario compra");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_broker_compra") {
|
|
|
+ this.columnKey.push("Comisión broker compra");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "cantidad_contratos_compra") {
|
|
|
+ this.columnKey.push("Cantidad contratos compra");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "unidades_contratos_compra") {
|
|
|
+ this.columnKey.push("Unidades contratos compra");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_transado_compra") {
|
|
|
+ this.columnKey.push("Valor transado compra");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_pagado") {
|
|
|
+ this.columnKey.push("Valor pagado");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "ganancia_perdida") {
|
|
|
+ this.columnKey.push("Ganancia/Pérdida");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "rendimiento") {
|
|
|
+ this.columnKey.push("Rendimiento");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "precio_unitario_venta") {
|
|
|
+ this.columnKey.push("Precio unitario venta");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "comision_broker_venta") {
|
|
|
+ this.columnKey.push("Comisión broker venta");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "cantidad_contratos_venta") {
|
|
|
+ this.columnKey.push("Cantidad contratos venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "unidades_contratos_venta") {
|
|
|
+ this.columnKey.push("Unidades contratos venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_transado_venta") {
|
|
|
+ this.columnKey.push("Valor transado venta");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "valor_recibido") {
|
|
|
+ this.columnKey.push("Valor recibido");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_cancelado") {
|
|
|
+ this.columnKey.push("Fecha cancelado");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_liquidacion_compra") {
|
|
|
+ this.columnKey.push("Fecha liquidación compra");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento_compra") {
|
|
|
+ this.columnKey.push("Fecha vencimiento compra");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_operacion_compra") {
|
|
|
+ this.columnKey.push("Fecha de operación compra");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_liquidacion_venta") {
|
|
|
+ this.columnKey.push("Fecha liquidación venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento_venta") {
|
|
|
+ this.columnKey.push("Fecha vencimientoz venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_operacion_venta") {
|
|
|
+ this.columnKey.push("Fecha de operación venta");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_inicio_vigencia") {
|
|
|
+ this.columnKey.push("Fecha inicio de vigencia");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "PPER":
|
|
|
+ Object.entries(investmentInstrument).forEach(([key, value]) => {
|
|
|
+ if (value == null) {
|
|
|
+ value = "-";
|
|
|
+ }
|
|
|
+ if (key == "renta_porcentaje") {
|
|
|
+ this.columnKey.push("Renta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "monto_prestamo") {
|
|
|
+ this.columnKey.push("Monto préstamo");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "plazo_gracia") {
|
|
|
+ this.columnKey.push("Plazo gracia");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "tasa_porcentaje") {
|
|
|
+ this.columnKey.push("Tasa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "iva_porcentaje") {
|
|
|
+ this.columnKey.push("IVA (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "pago_seguro_dano") {
|
|
|
+ this.columnKey.push("Pago seguro por daño");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "pago_seguro_vivienda") {
|
|
|
+ this.columnKey.push("Pago seguro vivienda");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "total_cuotas_mensuales") {
|
|
|
+ this.columnKey.push("Total cuotas mensuales");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "numero_deudor") {
|
|
|
+ this.columnKey.push("Número deudor");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "nombre_deudor") {
|
|
|
+ this.columnKey.push("Nombre deudor");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_otorgamiento") {
|
|
|
+ this.columnKey.push("Fecha de otorgamiento");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_fin_otorgamiento") {
|
|
|
+ this.columnKey.push("Fecha fin de otorgamiento");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_gracia") {
|
|
|
+ this.columnKey.push("Fecha gracia");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "cuota_sin_seguros") {
|
|
|
+ this.columnKey.push("Cuota sin seguros");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "PEMP":
|
|
|
+ Object.entries(investmentInstrument).forEach(([key, value]) => {
|
|
|
+ if (value == null) {
|
|
|
+ value = "-";
|
|
|
+ }
|
|
|
+ if (key == "renta_porcentaje") {
|
|
|
+ this.columnKey.push("Renta (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "monto_prestamo") {
|
|
|
+ this.columnKey.push("Monto préstamo");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ if (key == "tasa_porcentaje") {
|
|
|
+ this.columnKey.push("Tasa (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "iva_porcentaje") {
|
|
|
+ this.columnKey.push("IVA (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_desembolso_porcentaje") {
|
|
|
+ this.columnKey.push("Comisión desembolso (%)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "comision_desembolso") {
|
|
|
+ this.columnKey.push("Comisión desembolso ($)");
|
|
|
+ this.columnValue.push(value.toString() + "%");
|
|
|
+ }
|
|
|
+ if (key == "fecha_operacion") {
|
|
|
+ this.columnKey.push("Fecha de operación");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "fecha_vencimiento") {
|
|
|
+ this.columnKey.push("Fecha de vencimiento");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "plazo") {
|
|
|
+ this.columnKey.push("Plazo");
|
|
|
+ this.columnValue.push(value.toString());
|
|
|
+ }
|
|
|
+ if (key == "iva") {
|
|
|
+ this.columnKey.push("IVA");
|
|
|
+ this.columnValue.push("$" + value.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
generatePdf(action = "open") {
|
|
|
console.log(pdfMake);
|
|
|
var documentDefinition;
|
|
|
@@ -288,16 +1092,4 @@ export class InvestmentPrint implements OnInit {
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
- /*
|
|
|
- getProfilePicObject() {
|
|
|
- if (this.resume.profilePic){
|
|
|
- return {
|
|
|
- image: this.resume.profilePic,
|
|
|
- width: 75,
|
|
|
- alignment: 'right'
|
|
|
- };
|
|
|
- }
|
|
|
- return null;
|
|
|
- }*/
|
|
|
}
|