bdpformulas 1.0.83 → 1.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/models/eeff/admFinanciera/index.d.ts +3 -0
- package/build/models/eeff/calculosAuxiliares.d.ts +1 -0
- package/build/strategies/eeff/admFinanciera/aplicacionesHandler.js +21 -6
- package/build/strategies/eeff/admFinanciera/index.d.ts +0 -0
- package/build/strategies/eeff/admFinanciera/index.js +1 -0
- package/build/strategies/eeff/admFinanciera/prestamoDirectoHandler.js +14 -7
- package/build/strategies/eeff/admFinanciera/prestamoLeasingHandler.d.ts +1 -1
- package/build/strategies/eeff/admFinanciera/prestamoLeasingHandler.js +34 -14
- package/build/strategies/eeff/admFinanciera/proyeccionPrestamosDirectosHandler.js +7 -7
- package/build/strategies/eeff/admFinanciera/utils.d.ts +2 -1
- package/build/strategies/eeff/admFinanciera/utils.js +4 -2
- package/build/strategies/eeff/calculosAuxiliares.strategy.js +46 -43
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Frecuencia, TipoCuota } from '../../../strategies/eeff/admFinanciera/utils';
|
|
2
|
+
import { CalculoAuxiliarCalc } from '../calculosAuxiliares';
|
|
2
3
|
export type TipoOperacionLeasing = 'LEASING' | 'LEASEBACK';
|
|
3
4
|
export declare enum TipoDestinoEnum {
|
|
4
5
|
CapitalInversion = "KI",
|
|
@@ -123,6 +124,8 @@ export interface AdministracionFinancieraData {
|
|
|
123
124
|
LineasMixtasBDP: Partial<LineaCreditoMixta>[];
|
|
124
125
|
LineasMixtasOtros: Partial<LineaCreditoMixta>[];
|
|
125
126
|
ProyeccionPrestamosDirectos: Partial<ProyeccionPrestamo>[];
|
|
127
|
+
CalculosAuxiliaresData: CalculoAuxiliarCalc;
|
|
128
|
+
CorrelativoCalculoAuxiliar: number | null;
|
|
126
129
|
}
|
|
127
130
|
export interface AdministracionFinancieraCalcData extends AdministracionFinancieraData {
|
|
128
131
|
ProyeccionPrestamosBajoLineas: Partial<ProyeccionPrestamo>[];
|
|
@@ -44,8 +44,9 @@ class AplicacionesHandler {
|
|
|
44
44
|
pr.TipoExistencia === 'NUEVA' &&
|
|
45
45
|
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.CapitalOperacion).map((pr) => {
|
|
46
46
|
const proyeccion = {};
|
|
47
|
-
if (pr.AnnoProyectadoInicio) {
|
|
48
|
-
const value = (0, utils_1.ourParseFloat)(pr.MontoOriginal)
|
|
47
|
+
if (pr.AnnoProyectadoInicio && pr.AnnoProyectadoInicio <= 3) {
|
|
48
|
+
const value = (0, utils_1.ourParseFloat)(pr.MontoOriginal) -
|
|
49
|
+
(0, utils_1.ourParseFloat)(pr.PorcionPagada);
|
|
49
50
|
proyeccion[`Gestion${pr.AnnoProyectadoInicio}`] = value;
|
|
50
51
|
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
51
52
|
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${pr.AnnoProyectadoInicio}`]) + value;
|
|
@@ -61,6 +62,12 @@ class AplicacionesHandler {
|
|
|
61
62
|
filaTotales[`Gestion${i}`] =
|
|
62
63
|
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${i}`]) - (KOBDP + KOOtros);
|
|
63
64
|
}
|
|
65
|
+
if (this.data.CorrelativoCalculoAuxiliar) {
|
|
66
|
+
const totalPorcionCPKO = this.data.CalculosAuxiliaresData[this.data.CorrelativoCalculoAuxiliar]?.TotalPorcionCPKO;
|
|
67
|
+
filaTotales[`Gestion1`] =
|
|
68
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion1`]) -
|
|
69
|
+
(0, utils_1.ourParseFloat)(totalPorcionCPKO);
|
|
70
|
+
}
|
|
64
71
|
this.data.ProyeccionAplicaciones.push(...filas, filaTotales);
|
|
65
72
|
}
|
|
66
73
|
setKIPrestamoDirecto() {
|
|
@@ -72,8 +79,9 @@ class AplicacionesHandler {
|
|
|
72
79
|
pr.TipoExistencia === 'NUEVA' &&
|
|
73
80
|
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.CapitalInversion).map((pr) => {
|
|
74
81
|
const proyeccion = {};
|
|
75
|
-
if (pr.AnnoProyectadoInicio) {
|
|
76
|
-
const value = (0, utils_1.ourParseFloat)(pr.MontoOriginal)
|
|
82
|
+
if (pr.AnnoProyectadoInicio && pr.AnnoProyectadoInicio <= 3) {
|
|
83
|
+
const value = (0, utils_1.ourParseFloat)(pr.MontoOriginal) -
|
|
84
|
+
(0, utils_1.ourParseFloat)(pr.PorcionPagada);
|
|
77
85
|
proyeccion[`Gestion${pr.AnnoProyectadoInicio}`] = value;
|
|
78
86
|
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
79
87
|
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${pr.AnnoProyectadoInicio}`]) + value;
|
|
@@ -94,8 +102,9 @@ class AplicacionesHandler {
|
|
|
94
102
|
pr.TipoExistencia === 'NUEVA' &&
|
|
95
103
|
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.Otros).map((pr) => {
|
|
96
104
|
const proyeccion = {};
|
|
97
|
-
if (pr.AnnoProyectadoInicio) {
|
|
98
|
-
const value = (0, utils_1.ourParseFloat)(pr.MontoOriginal)
|
|
105
|
+
if (pr.AnnoProyectadoInicio && pr.AnnoProyectadoInicio <= 3) {
|
|
106
|
+
const value = (0, utils_1.ourParseFloat)(pr.MontoOriginal) -
|
|
107
|
+
(0, utils_1.ourParseFloat)(pr.PorcionPagada);
|
|
99
108
|
proyeccion[`Gestion${pr.AnnoProyectadoInicio}`] = value;
|
|
100
109
|
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
101
110
|
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${pr.AnnoProyectadoInicio}`]) + value;
|
|
@@ -196,6 +205,12 @@ class AplicacionesHandler {
|
|
|
196
205
|
}
|
|
197
206
|
i += 4;
|
|
198
207
|
}
|
|
208
|
+
if (this.data.CorrelativoCalculoAuxiliar) {
|
|
209
|
+
const totalBLMixta = this.data.CalculosAuxiliaresData[this.data.CorrelativoCalculoAuxiliar]?.TotalBLMixta;
|
|
210
|
+
filaTotales[`Gestion1`] =
|
|
211
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion1`]) -
|
|
212
|
+
(0, utils_1.ourParseFloat)(totalBLMixta);
|
|
213
|
+
}
|
|
199
214
|
this.data.ProyeccionAplicaciones.push(...filas, filaTotales);
|
|
200
215
|
}
|
|
201
216
|
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -112,30 +112,37 @@ class PrestamoDirectoHandler {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
setPorcionNoCorriente(gestion) {
|
|
115
|
+
const porcionCorriente = this.prestamo.TipoFacilidad == 'VARIABLE'
|
|
116
|
+
? (0, utils_1.ourParseFloat)(this.prestamo.AmortizacionesCapitalCuotaFinal?.[`Gestion${gestion}`])
|
|
117
|
+
: (0, utils_1.ourParseFloat)(this.prestamo.AmortizacionesCapital?.[`Gestion${gestion}`]);
|
|
115
118
|
this.prestamo.PorcionesNoCorrientes[`Gestion${gestion}`] =
|
|
116
119
|
(0, utils_1.ourParseFloat)(this.prestamo.CuadroEfectoLinea?.[`Gestion${gestion}`]) +
|
|
117
120
|
(0, utils_1.ourParseFloat)(this.prestamo.CuadroEfectoExposicion?.[`Gestion${gestion}`]) -
|
|
118
|
-
|
|
121
|
+
porcionCorriente;
|
|
119
122
|
}
|
|
120
123
|
setPorcionCuotasPagadas() {
|
|
121
124
|
let porcion, cuotas;
|
|
122
|
-
if (this.prestamo.FechaDesembolso
|
|
125
|
+
if (this.prestamo.FechaDesembolso &&
|
|
126
|
+
this.prestamo.AnnoProyectadoInicio) {
|
|
123
127
|
const pagado = (0, utils_1.calcularPorcionCorrientePagada)({
|
|
124
128
|
fechaInicial: this.data.InicioProyeccion,
|
|
125
129
|
fechaDesembolso: this.prestamo.FechaDesembolso,
|
|
126
130
|
frecuencia: this.prestamo.TipoPeriodicidadId ?? 'MENSUAL',
|
|
127
|
-
simulador: this.simulador.simulador
|
|
131
|
+
simulador: this.simulador.simulador,
|
|
132
|
+
annoProyectadoInicio: this.prestamo.AnnoProyectadoInicio
|
|
128
133
|
});
|
|
129
134
|
porcion = (0, utils_1.ourParseFloat)(pagado.porcionCorrientePagada);
|
|
130
135
|
cuotas = pagado.cuotasPagadas;
|
|
131
136
|
if (this.prestamo.TipoFacilidad === 'FIJA') {
|
|
132
137
|
const dif = (0, utils_1.ourParseFloat)(this.prestamo.Gracia) - (0, utils_1.ourParseFloat)(cuotas);
|
|
133
138
|
const periodoGracia = dif > 0 ? dif : 0;
|
|
139
|
+
const monto = (0, utils_1.ourParseFloat)(this.prestamo.MontoOriginal) -
|
|
140
|
+
(0, utils_1.ourParseFloat)(porcion);
|
|
141
|
+
const plazo = (0, utils_1.ourParseFloat)(this.prestamo.Plazo) * 12 -
|
|
142
|
+
(0, utils_1.ourParseFloat)(cuotas);
|
|
134
143
|
this.simuladorFijo2 = (0, utils_1.simuladorCuotas)({
|
|
135
|
-
monto
|
|
136
|
-
|
|
137
|
-
plazo: (0, utils_1.ourParseFloat)(this.prestamo.Plazo) * 12 -
|
|
138
|
-
(0, utils_1.ourParseFloat)(cuotas),
|
|
144
|
+
monto,
|
|
145
|
+
plazo,
|
|
139
146
|
frecuencia: this.prestamo.TipoPeriodicidadId ?? 'MENSUAL',
|
|
140
147
|
tipoCuota: this.prestamo.TipoFacilidad ?? 'VARIABLE',
|
|
141
148
|
periodoGracia,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdministracionFinancieraData, PrestamoLeasing } from
|
|
1
|
+
import { AdministracionFinancieraData, PrestamoLeasing } from '../../../models/eeff/admFinanciera';
|
|
2
2
|
interface HandlerData {
|
|
3
3
|
data: AdministracionFinancieraData;
|
|
4
4
|
prestamo: Partial<PrestamoLeasing>;
|
|
@@ -9,7 +9,7 @@ const frecuencias = {
|
|
|
9
9
|
TRIMESTRAL: 4,
|
|
10
10
|
CUATRIMESTRAL: 3,
|
|
11
11
|
SEMESTRAL: 2,
|
|
12
|
-
ANUAL: 1
|
|
12
|
+
ANUAL: 1
|
|
13
13
|
};
|
|
14
14
|
class PrestamoLeasingHandler {
|
|
15
15
|
data;
|
|
@@ -56,12 +56,14 @@ class PrestamoLeasingHandler {
|
|
|
56
56
|
if (this.prestamo.AnnoProyectadoInicio && this.prestamo.Plazo) {
|
|
57
57
|
if (gestion >= this.prestamo.AnnoProyectadoInicio) {
|
|
58
58
|
if (gestion == this.prestamo.AnnoProyectadoInicio) {
|
|
59
|
-
this.prestamo.Plazos[`Gestion${gestion}`] =
|
|
59
|
+
this.prestamo.Plazos[`Gestion${gestion}`] =
|
|
60
|
+
this.prestamo.Plazo;
|
|
60
61
|
}
|
|
61
62
|
else {
|
|
62
63
|
const anterior = (0, utils_1.ourParseFloat)(this.prestamo.Plazos?.[`Gestion${gestion - 1}`]);
|
|
63
64
|
if (anterior > 1) {
|
|
64
|
-
this.prestamo.Plazos[`Gestion${gestion}`] =
|
|
65
|
+
this.prestamo.Plazos[`Gestion${gestion}`] =
|
|
66
|
+
anterior - 1;
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
}
|
|
@@ -75,7 +77,8 @@ class PrestamoLeasingHandler {
|
|
|
75
77
|
value = frecuencia;
|
|
76
78
|
}
|
|
77
79
|
else if (this.prestamo.AnnoProyectadoInicio <= gestion) {
|
|
78
|
-
value =
|
|
80
|
+
value =
|
|
81
|
+
(0, utils_1.ourParseFloat)(this.prestamo.PlazosMultiplicados?.[`Gestion${gestion - 1}`]) + frecuencia;
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
this.prestamo.PlazosMultiplicados[`Gestion${gestion}`] = value;
|
|
@@ -98,7 +101,8 @@ class PrestamoLeasingHandler {
|
|
|
98
101
|
}
|
|
99
102
|
else {
|
|
100
103
|
if (añoProyectadoInicio < gestion) {
|
|
101
|
-
periodoInicial =
|
|
104
|
+
periodoInicial =
|
|
105
|
+
(0, utils_1.ourParseFloat)(this.prestamo.PlazosMultiplicados?.[`Gestion${gestion - 1}`]) + 1;
|
|
102
106
|
}
|
|
103
107
|
value = (0, utils_1.calcularPagoPrincipalEntre)({
|
|
104
108
|
tasaPeriodica,
|
|
@@ -115,10 +119,14 @@ class PrestamoLeasingHandler {
|
|
|
115
119
|
periodoFinal
|
|
116
120
|
});
|
|
117
121
|
}
|
|
118
|
-
this.prestamo.AmortizacionesCapital[`Gestion${gestion}`] =
|
|
119
|
-
|
|
122
|
+
this.prestamo.AmortizacionesCapital[`Gestion${gestion}`] =
|
|
123
|
+
(0, utils_1.ourParseFloat)(value);
|
|
124
|
+
this.prestamo.AmortizacionesInteres[`Gestion${gestion}`] =
|
|
125
|
+
(0, utils_1.ourParseFloat)(valueInteres);
|
|
120
126
|
}
|
|
121
|
-
this.prestamo.AmortizacionesCapitalFinal[`Gestion${gestion}`] =
|
|
127
|
+
this.prestamo.AmortizacionesCapitalFinal[`Gestion${gestion}`] =
|
|
128
|
+
(0, utils_1.ourParseFloat)(value) +
|
|
129
|
+
(0, utils_1.ourParseFloat)(this.getGeneracionValorResidual(gestion));
|
|
122
130
|
}
|
|
123
131
|
getGeneracionValorResidual(gestion) {
|
|
124
132
|
if ((0, utils_1.ourParseFloat)(this.prestamo.Plazos[`Gestion${gestion}`]) == 1) {
|
|
@@ -133,7 +141,8 @@ class PrestamoLeasingHandler {
|
|
|
133
141
|
if (this.prestamo.TipoOperacion2 === admFinanciera_1.TipoOperacionExistencia.Antigua) {
|
|
134
142
|
index++;
|
|
135
143
|
}
|
|
136
|
-
const porcionCorriente = (0, utils_1.ourParseFloat)(this.prestamo.AmortizacionesCapitalFinal?.[`Gestion${index}`]) +
|
|
144
|
+
const porcionCorriente = (0, utils_1.ourParseFloat)(this.prestamo.AmortizacionesCapitalFinal?.[`Gestion${index}`]) +
|
|
145
|
+
(0, utils_1.ourParseFloat)(this.prestamo.AmortizacionesInteres?.[`Gestion${index}`]);
|
|
137
146
|
this.prestamo.PorcionesCorrientes[`Gestion${i}`] = porcionCorriente;
|
|
138
147
|
const plazo = (0, utils_1.ourParseFloat)(this.prestamo.Plazos?.[`Gestion${i}`]);
|
|
139
148
|
if (plazo && this.prestamo.TipoAmortizacion) {
|
|
@@ -141,21 +150,32 @@ class PrestamoLeasingHandler {
|
|
|
141
150
|
const frecuencia = frecuencias[this.prestamo.TipoAmortizacion];
|
|
142
151
|
const cuotaPeriodo = (0, utils_1.ourParseFloat)(this.prestamo.MontoCuotaPeriodo);
|
|
143
152
|
const valorResidual = (0, utils_1.ourParseFloat)(this.prestamo.MontoValorResidual);
|
|
144
|
-
if (this.prestamo.TipoOperacion2 ===
|
|
153
|
+
if (this.prestamo.TipoOperacion2 ===
|
|
154
|
+
admFinanciera_1.TipoOperacionExistencia.Antigua) {
|
|
145
155
|
if (plazo > 1) {
|
|
146
|
-
value =
|
|
156
|
+
value =
|
|
157
|
+
(plazo - 1) * cuotaPeriodo * frecuencia +
|
|
158
|
+
valorResidual -
|
|
159
|
+
porcionCorriente;
|
|
147
160
|
}
|
|
148
161
|
}
|
|
149
162
|
else {
|
|
150
|
-
value =
|
|
163
|
+
value =
|
|
164
|
+
plazo * cuotaPeriodo * frecuencia +
|
|
165
|
+
valorResidual -
|
|
166
|
+
porcionCorriente;
|
|
151
167
|
}
|
|
152
|
-
this.prestamo.PorcionesNoCorrientes[`Gestion${i}`] =
|
|
168
|
+
this.prestamo.PorcionesNoCorrientes[`Gestion${i}`] =
|
|
169
|
+
(0, utils_1.ourParseFloat)(value);
|
|
153
170
|
}
|
|
154
171
|
}
|
|
155
172
|
}
|
|
156
173
|
setActivacionOperacion() {
|
|
157
174
|
if (this.prestamo.TipoOperacion2 === admFinanciera_1.TipoOperacionExistencia.Nueva) {
|
|
158
|
-
this.prestamo.ActivacionOperacion =
|
|
175
|
+
this.prestamo.ActivacionOperacion =
|
|
176
|
+
(0, utils_1.ourParseFloat)(this.prestamo.MontoOriginal) +
|
|
177
|
+
(0, utils_1.ourParseFloat)(this.prestamo.MontoAporteInicial) +
|
|
178
|
+
(0, utils_1.ourParseFloat)(this.prestamo.MontoValorResidual);
|
|
159
179
|
}
|
|
160
180
|
}
|
|
161
181
|
}
|
|
@@ -111,7 +111,7 @@ class ProyeccionPrestamosDirectosHandler {
|
|
|
111
111
|
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.CapitalOperacion &&
|
|
112
112
|
pr.EsNuestroBanco);
|
|
113
113
|
const sumaGestion = (0, utils_1.ourParseFloat)(prestamosFiltrados.reduce((acc, curr) => acc +
|
|
114
|
-
(0, utils_1.ourParseFloat)(curr.
|
|
114
|
+
(0, utils_1.ourParseFloat)(curr.AmortizacionesCapitalCuotaFinal?.[`Gestion${gestion}`]), 0));
|
|
115
115
|
fila[`Gestion${gestion}`] = sumaGestion;
|
|
116
116
|
filaTotalesCPBDP[`Gestion${gestion}`] =
|
|
117
117
|
(0, utils_1.ourParseFloat)(filaTotalesCPBDP[`Gestion${gestion}`]) + sumaGestion;
|
|
@@ -123,7 +123,7 @@ class ProyeccionPrestamosDirectosHandler {
|
|
|
123
123
|
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.CapitalInversion &&
|
|
124
124
|
pr.EsNuestroBanco);
|
|
125
125
|
const sumaGestion = (0, utils_1.ourParseFloat)(prestamosFiltrados.reduce((acc, curr) => acc +
|
|
126
|
-
(0, utils_1.ourParseFloat)(curr.
|
|
126
|
+
(0, utils_1.ourParseFloat)(curr.AmortizacionesCapitalCuotaFinal?.[`Gestion${gestion}`]), 0));
|
|
127
127
|
fila[`Gestion${gestion}`] = sumaGestion;
|
|
128
128
|
filaTotalesCPBDP[`Gestion${gestion}`] =
|
|
129
129
|
(0, utils_1.ourParseFloat)(filaTotalesCPBDP[`Gestion${gestion}`]) + sumaGestion;
|
|
@@ -135,7 +135,7 @@ class ProyeccionPrestamosDirectosHandler {
|
|
|
135
135
|
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.CapitalOperacion &&
|
|
136
136
|
!pr.EsNuestroBanco);
|
|
137
137
|
const sumaGestion = (0, utils_1.ourParseFloat)(prestamosFiltrados.reduce((acc, curr) => acc +
|
|
138
|
-
(0, utils_1.ourParseFloat)(curr.
|
|
138
|
+
(0, utils_1.ourParseFloat)(curr.AmortizacionesCapitalCuotaFinal?.[`Gestion${gestion}`]), 0));
|
|
139
139
|
fila[`Gestion${gestion}`] = sumaGestion;
|
|
140
140
|
filaTotalesCPOtras[`Gestion${gestion}`] =
|
|
141
141
|
(0, utils_1.ourParseFloat)(filaTotalesCPOtras[`Gestion${gestion}`]) + sumaGestion;
|
|
@@ -147,7 +147,7 @@ class ProyeccionPrestamosDirectosHandler {
|
|
|
147
147
|
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.CapitalInversion &&
|
|
148
148
|
!pr.EsNuestroBanco);
|
|
149
149
|
const sumaGestion = (0, utils_1.ourParseFloat)(prestamosFiltrados.reduce((acc, curr) => acc +
|
|
150
|
-
(0, utils_1.ourParseFloat)(curr.
|
|
150
|
+
(0, utils_1.ourParseFloat)(curr.AmortizacionesCapitalCuotaFinal?.[`Gestion${gestion}`]), 0));
|
|
151
151
|
fila[`Gestion${gestion}`] = sumaGestion;
|
|
152
152
|
filaTotalesCPOtras[`Gestion${gestion}`] =
|
|
153
153
|
(0, utils_1.ourParseFloat)(filaTotalesCPOtras[`Gestion${gestion}`]) + sumaGestion;
|
|
@@ -159,7 +159,7 @@ class ProyeccionPrestamosDirectosHandler {
|
|
|
159
159
|
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.Otros &&
|
|
160
160
|
!pr.EsNuestroBanco);
|
|
161
161
|
const sumaGestion = (0, utils_1.ourParseFloat)(prestamosFiltrados.reduce((acc, curr) => acc +
|
|
162
|
-
(0, utils_1.ourParseFloat)(curr.
|
|
162
|
+
(0, utils_1.ourParseFloat)(curr.AmortizacionesCapitalCuotaFinal?.[`Gestion${gestion}`]), 0));
|
|
163
163
|
fila[`Gestion${gestion}`] = sumaGestion;
|
|
164
164
|
filaTotalesCPOtras[`Gestion${gestion}`] =
|
|
165
165
|
(0, utils_1.ourParseFloat)(filaTotalesCPOtras[`Gestion${gestion}`]) + sumaGestion;
|
|
@@ -264,9 +264,9 @@ class ProyeccionPrestamosDirectosHandler {
|
|
|
264
264
|
(0, utils_1.ourParseFloat)(curr.AmortizacionesInteres?.[`Gestion${gestion}`]), 0));
|
|
265
265
|
const totalPagoCostosFinancieros = this.data.ProyeccionPrestamosBajoLineas.find((p) => p.Clasificador == 'T')?.[`Gestion${gestion}`];
|
|
266
266
|
const totalGastosFinancieroBDP = this.data.LineasMixtasBDP.find((p) => p.Clasificador == 'T' &&
|
|
267
|
-
p.RubroId == admFinanciera_1.rubros.lineasMixtas.gastosFinancierosYComisiones)?.[`Gestion${gestion
|
|
267
|
+
p.RubroId == admFinanciera_1.rubros.lineasMixtas.gastosFinancierosYComisiones)?.[`Gestion${gestion}`];
|
|
268
268
|
const totalGastosFinancieroOtros = this.data.LineasMixtasOtros.find((p) => p.Clasificador == 'T' &&
|
|
269
|
-
p.RubroId == admFinanciera_1.rubros.lineasMixtas.gastosFinancierosYComisiones)?.[`Gestion${gestion
|
|
269
|
+
p.RubroId == admFinanciera_1.rubros.lineasMixtas.gastosFinancierosYComisiones)?.[`Gestion${gestion}`];
|
|
270
270
|
const costosMasGastos = (0, utils_1.ourParseFloat)(totalPagoCostosFinancieros) +
|
|
271
271
|
(0, utils_1.ourParseFloat)(totalGastosFinancieroBDP) +
|
|
272
272
|
(0, utils_1.ourParseFloat)(totalGastosFinancieroOtros);
|
|
@@ -42,8 +42,9 @@ interface CalcularPorcionCorrienteParams {
|
|
|
42
42
|
fechaDesembolso: string;
|
|
43
43
|
fechaInicial: string;
|
|
44
44
|
frecuencia: Frecuencia;
|
|
45
|
+
annoProyectadoInicio: number;
|
|
45
46
|
}
|
|
46
|
-
export declare function calcularPorcionCorrientePagada({ fechaDesembolso, fechaInicial, frecuencia, simulador }: CalcularPorcionCorrienteParams): ResultadoPorcionPagada;
|
|
47
|
+
export declare function calcularPorcionCorrientePagada({ fechaDesembolso, fechaInicial, frecuencia, simulador, annoProyectadoInicio }: CalcularPorcionCorrienteParams): ResultadoPorcionPagada;
|
|
47
48
|
export declare function ourParseFloat(num: any, round?: boolean): number;
|
|
48
49
|
/**
|
|
49
50
|
* Calcula la tasa de interés periódica (similar a la función TASA de Excel).
|
|
@@ -88,8 +88,10 @@ function simuladorCuotas({ monto, plazo, frecuencia, tipoCuota, periodoGracia =
|
|
|
88
88
|
return { simulador: cuotas, pagosAnuales };
|
|
89
89
|
}
|
|
90
90
|
exports.simuladorCuotas = simuladorCuotas;
|
|
91
|
-
function calcularPorcionCorrientePagada({ fechaDesembolso, fechaInicial, frecuencia, simulador }) {
|
|
92
|
-
|
|
91
|
+
function calcularPorcionCorrientePagada({ fechaDesembolso, fechaInicial, frecuencia, simulador, annoProyectadoInicio }) {
|
|
92
|
+
let inicial = getDateTime(fechaInicial).endOf('month');
|
|
93
|
+
if (annoProyectadoInicio)
|
|
94
|
+
inicial = inicial.plus({ years: annoProyectadoInicio - 1 });
|
|
93
95
|
const desembolso = getDateTime(fechaDesembolso).endOf('month');
|
|
94
96
|
const mesesPorFrecuencia = exports.frecuenciaMeses[frecuencia];
|
|
95
97
|
const mesesTranscurridos = inicial.diff(desembolso, 'months').months;
|
|
@@ -13,49 +13,52 @@ class CalculosAuxiliaresStrategy {
|
|
|
13
13
|
calculate(data) {
|
|
14
14
|
const copy = (0, lodash_1.cloneDeep)(data);
|
|
15
15
|
Object.values(copy).forEach((data) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.
|
|
57
|
-
|
|
58
|
-
|
|
16
|
+
if (data.IndicadorABM !== 'B') {
|
|
17
|
+
const active = data.Pasivos.filter((el) => el.IndicadorABM !== 'B');
|
|
18
|
+
data.TotalCortoPlazoBLKO = active
|
|
19
|
+
.filter((el) => el.DestinoOperacionId === calculosAuxiliares_1.ValoresDestino['B/L KO'])
|
|
20
|
+
.reduce((acc, curr) => {
|
|
21
|
+
return acc + this.getValue(curr.CortoPlazo);
|
|
22
|
+
}, 0);
|
|
23
|
+
data.TotalPorcionCPKO = active
|
|
24
|
+
.filter((el) => el.DestinoOperacionId === calculosAuxiliares_1.ValoresDestino.KO)
|
|
25
|
+
.reduce((acc, curr) => {
|
|
26
|
+
return acc + this.getValue(curr.PorcionCP);
|
|
27
|
+
}, 0);
|
|
28
|
+
data.TotalBLMixta = active
|
|
29
|
+
.filter((el) => el.DestinoOperacionId ===
|
|
30
|
+
calculosAuxiliares_1.ValoresDestino['B/L Mixta'])
|
|
31
|
+
.reduce((acc, curr) => {
|
|
32
|
+
return (acc +
|
|
33
|
+
this.getValue(curr.PorcionLP) +
|
|
34
|
+
this.getValue(curr.CortoPlazo));
|
|
35
|
+
}, 0);
|
|
36
|
+
data.TotalDeudasDirectasKIyKO = active
|
|
37
|
+
.filter((el) => [calculosAuxiliares_1.ValoresDestino.KI, calculosAuxiliares_1.ValoresDestino.KO].includes(el.DestinoOperacionId))
|
|
38
|
+
.reduce((acc, curr) => {
|
|
39
|
+
return acc + this.getValue(curr.MontoOriginal);
|
|
40
|
+
}, 0);
|
|
41
|
+
data.TotalPorcionCPBDP = active
|
|
42
|
+
.filter((el) => el.EsNuestroBanco)
|
|
43
|
+
.reduce((acc, curr) => {
|
|
44
|
+
return acc + this.getValue(curr.PorcionCP);
|
|
45
|
+
}, 0);
|
|
46
|
+
data.TotalPorcionCPOtros = active
|
|
47
|
+
.filter((el) => !el.EsNuestroBanco)
|
|
48
|
+
.reduce((acc, curr) => {
|
|
49
|
+
return acc + this.getValue(curr.PorcionCP);
|
|
50
|
+
}, 0);
|
|
51
|
+
data.TotalPorcionLPBDP = active
|
|
52
|
+
.filter((el) => el.EsNuestroBanco)
|
|
53
|
+
.reduce((acc, curr) => {
|
|
54
|
+
return acc + this.getValue(curr.PorcionLP);
|
|
55
|
+
}, 0);
|
|
56
|
+
data.TotalPorcionLPOtros = active
|
|
57
|
+
.filter((el) => !el.EsNuestroBanco)
|
|
58
|
+
.reduce((acc, curr) => {
|
|
59
|
+
return acc + this.getValue(curr.PorcionLP);
|
|
60
|
+
}, 0);
|
|
61
|
+
}
|
|
59
62
|
});
|
|
60
63
|
return copy;
|
|
61
64
|
}
|