bdpformulas 1.0.50 → 1.0.51
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 +14 -15
- package/build/models/eeff/admFinanciera/index.js +2 -2
- package/build/strategies/eeff/admFinanciera/aplicacionesHandler.d.ts +1 -1
- package/build/strategies/eeff/admFinanciera/aplicacionesHandler.js +56 -29
- package/build/strategies/eeff/admFinanciera/lineasMixtasHandler.d.ts +1 -1
- package/build/strategies/eeff/admFinanciera/lineasMixtasHandler.js +42 -19
- package/build/strategies/eeff/admFinanciera/prestamoBajoLineaHandler.d.ts +1 -1
- package/build/strategies/eeff/admFinanciera/prestamoBajoLineaHandler.js +13 -8
- package/build/strategies/eeff/admFinanciera/prestamoDirectoHandler.d.ts +1 -1
- package/build/strategies/eeff/admFinanciera/prestamoDirectoHandler.js +75 -32
- package/build/strategies/eeff/admFinanciera/proyeccionPrestamosDirectosHandler.d.ts +26 -2
- package/build/strategies/eeff/admFinanciera/proyeccionPrestamosDirectosHandler.js +156 -84
- package/build/strategies/eeff/admFinanciera/utils.d.ts +8 -6
- package/build/strategies/eeff/admFinanciera/utils.js +28 -19
- package/build/strategies/eeff/admFinanciera.strategy.d.ts +2 -2
- package/build/strategies/eeff/admFinanciera.strategy.js +49 -35
- package/build/strategies/eeff/index.d.ts +1 -0
- package/build/strategies/eeff/index.js +1509 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Frecuencia, TipoCuota } from
|
|
1
|
+
import { Frecuencia, TipoCuota } from '../../../strategies/eeff/admFinanciera/utils';
|
|
2
2
|
export type TipoOperacionLeasing = 'LEASING' | 'LEASEBACK';
|
|
3
3
|
export declare enum TipoDestinoEnum {
|
|
4
4
|
CapitalInversion = "KI",
|
|
@@ -9,11 +9,15 @@ export declare enum TipoOperacionExistencia {
|
|
|
9
9
|
Nueva = "NUEVA",
|
|
10
10
|
Antigua = "ANTIGUA"
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
type Clasificador = 'T';
|
|
13
|
+
interface Deuda {
|
|
14
|
+
IndicadorABM: 'A' | 'B' | 'M' | 'N';
|
|
15
|
+
Clasificador: Clasificador;
|
|
16
|
+
}
|
|
17
|
+
export interface PrestamoDirecto extends Deuda {
|
|
13
18
|
ActividadDeudaId: number;
|
|
14
19
|
ActividadEconomicaId: number;
|
|
15
20
|
UUID: string;
|
|
16
|
-
IndicadorABM: string;
|
|
17
21
|
TipoDeuda: string;
|
|
18
22
|
Descripcion: string;
|
|
19
23
|
MontoOriginal: number;
|
|
@@ -31,7 +35,6 @@ export interface PrestamoDirecto {
|
|
|
31
35
|
EsBajoLinea: boolean;
|
|
32
36
|
PorcionPagada: number;
|
|
33
37
|
CuotasPagadas: number;
|
|
34
|
-
Clasificador: string;
|
|
35
38
|
AmortizacionesCapital: Partial<ProyeccionPrestamo>;
|
|
36
39
|
AmortizacionesCapitalCuotaFinal: Partial<ProyeccionPrestamo>;
|
|
37
40
|
AmortizacionesCapitalEfectoCorriente: Partial<ProyeccionPrestamo>;
|
|
@@ -43,11 +46,10 @@ export interface PrestamoDirecto {
|
|
|
43
46
|
PlazoRemanenteAños: number;
|
|
44
47
|
MesesPorcionPagada: number;
|
|
45
48
|
}
|
|
46
|
-
export interface PrestamoBajoLinea {
|
|
49
|
+
export interface PrestamoBajoLinea extends Deuda {
|
|
47
50
|
ActividadDeudaId: number;
|
|
48
51
|
ActividadEconomicaId: number;
|
|
49
52
|
UUID: string;
|
|
50
|
-
IndicadorABM: string;
|
|
51
53
|
TipoDeuda: string;
|
|
52
54
|
Descripcion: string;
|
|
53
55
|
MontoOriginal: number;
|
|
@@ -61,16 +63,14 @@ export interface PrestamoBajoLinea {
|
|
|
61
63
|
VencimientoLinea: string | null;
|
|
62
64
|
CantidadAnnos: number;
|
|
63
65
|
TasaPonderada: number;
|
|
64
|
-
Clasificador: string;
|
|
65
66
|
SaldoLineaAplicar: number;
|
|
66
67
|
Proyecciones: Partial<ProyeccionPrestamo>;
|
|
67
68
|
Aplicaciones: Partial<ProyeccionPrestamo>;
|
|
68
69
|
}
|
|
69
|
-
export interface PrestamoLeasing {
|
|
70
|
+
export interface PrestamoLeasing extends Deuda {
|
|
70
71
|
ActividadDeudaId: number;
|
|
71
72
|
ActividadEconomicaId: number;
|
|
72
73
|
UUID: string;
|
|
73
|
-
IndicadorABM: string;
|
|
74
74
|
TipoDeuda: string;
|
|
75
75
|
Descripcion: string;
|
|
76
76
|
MontoOriginal: number;
|
|
@@ -85,7 +85,6 @@ export interface PrestamoLeasing {
|
|
|
85
85
|
MontoAporteInicial: number;
|
|
86
86
|
MontoValorResidual: number;
|
|
87
87
|
MontoValorBien: number;
|
|
88
|
-
Clasificador: string;
|
|
89
88
|
Plazos: Partial<ProyeccionPrestamo>;
|
|
90
89
|
PlazosMultiplicados: Partial<ProyeccionPrestamo>;
|
|
91
90
|
AmortizacionesCapital: Partial<ProyeccionPrestamo>;
|
|
@@ -100,21 +99,20 @@ export interface LineaCreditoMixta {
|
|
|
100
99
|
Descripcion: string;
|
|
101
100
|
TipoExistencia: TipoExistencia;
|
|
102
101
|
Tasa: number;
|
|
103
|
-
Clasificador:
|
|
102
|
+
Clasificador: Clasificador;
|
|
104
103
|
RubroId?: string;
|
|
104
|
+
IndicadorABM: string;
|
|
105
105
|
[key: `Gestion${number}`]: number | undefined;
|
|
106
106
|
}
|
|
107
107
|
export interface ProyeccionPrestamo {
|
|
108
108
|
id: number;
|
|
109
109
|
Descripcion: string;
|
|
110
|
-
Clasificador?:
|
|
110
|
+
Clasificador?: Clasificador;
|
|
111
111
|
Editable?: boolean;
|
|
112
112
|
RubroId?: string;
|
|
113
113
|
[key: `Gestion${number}`]: number | undefined;
|
|
114
114
|
}
|
|
115
115
|
export interface AdministracionFinancieraData {
|
|
116
|
-
ActividadEconomicaId: number;
|
|
117
|
-
EvaluacionId: number;
|
|
118
116
|
CantidadProyeccion: number;
|
|
119
117
|
InicioProyeccion: string;
|
|
120
118
|
PrestamoDirecto: Partial<PrestamoDirecto>[];
|
|
@@ -129,7 +127,7 @@ export interface AdministracionFinancieraCalcData extends AdministracionFinancie
|
|
|
129
127
|
ProyeccionPrestamosDirectos: Partial<ProyeccionPrestamo>[];
|
|
130
128
|
ProyeccionAplicaciones: Partial<ProyeccionPrestamo>[];
|
|
131
129
|
}
|
|
132
|
-
export type TipoExistencia =
|
|
130
|
+
export type TipoExistencia = 'EXISTENTE' | 'NUEVA';
|
|
133
131
|
export declare const rubros: {
|
|
134
132
|
lineasMixtas: {
|
|
135
133
|
descripcion: string;
|
|
@@ -142,3 +140,4 @@ export declare const rubros: {
|
|
|
142
140
|
interesLeasingManual: string;
|
|
143
141
|
};
|
|
144
142
|
};
|
|
143
|
+
export {};
|
|
@@ -17,10 +17,10 @@ exports.rubros = {
|
|
|
17
17
|
descripcion: 'DESCP',
|
|
18
18
|
vencimientoCorrienteLargoPlazo: 'VCLP',
|
|
19
19
|
deudaFinancieraLargoPlazo: 'DFLP',
|
|
20
|
-
gastosFinancierosYComisiones: 'GFC'
|
|
20
|
+
gastosFinancierosYComisiones: 'GFC'
|
|
21
21
|
},
|
|
22
22
|
proyeccionPrestamosDirectos: {
|
|
23
23
|
interesManual: 'INTM',
|
|
24
|
-
interesLeasingManual: 'INTLM'
|
|
24
|
+
interesLeasingManual: 'INTLM'
|
|
25
25
|
}
|
|
26
26
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AplicacionesHandler = void 0;
|
|
4
4
|
const admFinanciera_1 = require("../../../models/eeff/admFinanciera");
|
|
5
|
+
const proyeccionPrestamosDirectosHandler_1 = require("./proyeccionPrestamosDirectosHandler");
|
|
5
6
|
const utils_1 = require("./utils");
|
|
6
7
|
class AplicacionesHandler {
|
|
7
8
|
data;
|
|
@@ -21,10 +22,11 @@ class AplicacionesHandler {
|
|
|
21
22
|
Descripcion: 'KO - Línea de Crédito 100% KO',
|
|
22
23
|
Clasificador: 'T'
|
|
23
24
|
};
|
|
24
|
-
const filas = this.data.PrestamoBajoLinea.filter(pr => pr.Clasificador !== 'T')
|
|
25
|
-
.map(pr => {
|
|
25
|
+
const filas = this.data.PrestamoBajoLinea.filter((pr) => pr.IndicadorABM !== 'B' && pr.Clasificador !== 'T').map((pr) => {
|
|
26
26
|
for (let i = 1; i <= this.data.CantidadProyeccion; i++) {
|
|
27
|
-
filaTotales[`Gestion${i}`] =
|
|
27
|
+
filaTotales[`Gestion${i}`] =
|
|
28
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${i}`]) +
|
|
29
|
+
(0, utils_1.ourParseFloat)(pr.Aplicaciones?.[`Gestion${i}`]);
|
|
28
30
|
}
|
|
29
31
|
return {
|
|
30
32
|
Descripcion: pr.Descripcion,
|
|
@@ -38,19 +40,27 @@ class AplicacionesHandler {
|
|
|
38
40
|
Descripcion: 'KO - Prestamo Directo',
|
|
39
41
|
Clasificador: 'T'
|
|
40
42
|
};
|
|
41
|
-
const filas = this.data.PrestamoDirecto.filter(pr => pr.
|
|
42
|
-
.
|
|
43
|
+
const filas = this.data.PrestamoDirecto.filter((pr) => pr.IndicadorABM !== 'B' &&
|
|
44
|
+
pr.TipoExistencia === 'NUEVA' &&
|
|
45
|
+
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.CapitalOperacion).map((pr) => {
|
|
43
46
|
const proyeccion = {};
|
|
44
47
|
if (pr.AnnoProyectadoInicio) {
|
|
45
|
-
|
|
48
|
+
const value = (0, utils_1.ourParseFloat)(pr.MontoOriginal);
|
|
46
49
|
proyeccion[`Gestion${pr.AnnoProyectadoInicio}`] = value;
|
|
47
|
-
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
50
|
+
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
51
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${pr.AnnoProyectadoInicio}`]) + value;
|
|
48
52
|
}
|
|
49
53
|
return {
|
|
50
54
|
Descripcion: pr.Descripcion,
|
|
51
55
|
...proyeccion
|
|
52
56
|
};
|
|
53
57
|
});
|
|
58
|
+
for (let i = 2; i <= this.data.CantidadProyeccion; i++) {
|
|
59
|
+
const KOBDP = (0, utils_1.ourParseFloat)(this.data.ProyeccionPrestamosDirectos[proyeccionPrestamosDirectosHandler_1.FILAS_PROYECCION_PRESTAMOS_DIRECTOS['KO - Porción CP - BDP SAM']][`Gestion${i - 1}`]);
|
|
60
|
+
const KOOtros = (0, utils_1.ourParseFloat)(this.data.ProyeccionPrestamosDirectos[proyeccionPrestamosDirectosHandler_1.FILAS_PROYECCION_PRESTAMOS_DIRECTOS['KO - Porción CP - Otras EIFs']][`Gestion${i - 1}`]);
|
|
61
|
+
filaTotales[`Gestion${i}`] =
|
|
62
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${i}`]) - (KOBDP + KOOtros);
|
|
63
|
+
}
|
|
54
64
|
this.data.ProyeccionAplicaciones.push(...filas, filaTotales);
|
|
55
65
|
}
|
|
56
66
|
setKIPrestamoDirecto() {
|
|
@@ -58,13 +68,15 @@ class AplicacionesHandler {
|
|
|
58
68
|
Descripcion: 'KI - Prestamo Directo',
|
|
59
69
|
Clasificador: 'T'
|
|
60
70
|
};
|
|
61
|
-
const filas = this.data.PrestamoDirecto.filter(pr => pr.
|
|
62
|
-
.
|
|
71
|
+
const filas = this.data.PrestamoDirecto.filter((pr) => pr.IndicadorABM !== 'B' &&
|
|
72
|
+
pr.TipoExistencia === 'NUEVA' &&
|
|
73
|
+
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.CapitalInversion).map((pr) => {
|
|
63
74
|
const proyeccion = {};
|
|
64
75
|
if (pr.AnnoProyectadoInicio) {
|
|
65
|
-
|
|
76
|
+
const value = (0, utils_1.ourParseFloat)(pr.MontoOriginal);
|
|
66
77
|
proyeccion[`Gestion${pr.AnnoProyectadoInicio}`] = value;
|
|
67
|
-
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
78
|
+
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
79
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${pr.AnnoProyectadoInicio}`]) + value;
|
|
68
80
|
}
|
|
69
81
|
return {
|
|
70
82
|
Descripcion: pr.Descripcion,
|
|
@@ -78,13 +90,15 @@ class AplicacionesHandler {
|
|
|
78
90
|
Descripcion: 'MIXTO - Pagares, Bonos, Etc.',
|
|
79
91
|
Clasificador: 'T'
|
|
80
92
|
};
|
|
81
|
-
const filas = this.data.PrestamoDirecto.filter(pr => pr.
|
|
82
|
-
.
|
|
93
|
+
const filas = this.data.PrestamoDirecto.filter((pr) => pr.IndicadorABM !== 'B' &&
|
|
94
|
+
pr.TipoExistencia === 'NUEVA' &&
|
|
95
|
+
pr.DestinoOperacionId === admFinanciera_1.TipoDestinoEnum.Otros).map((pr) => {
|
|
83
96
|
const proyeccion = {};
|
|
84
97
|
if (pr.AnnoProyectadoInicio) {
|
|
85
|
-
|
|
98
|
+
const value = (0, utils_1.ourParseFloat)(pr.MontoOriginal);
|
|
86
99
|
proyeccion[`Gestion${pr.AnnoProyectadoInicio}`] = value;
|
|
87
|
-
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
100
|
+
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
101
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${pr.AnnoProyectadoInicio}`]) + value;
|
|
88
102
|
}
|
|
89
103
|
return {
|
|
90
104
|
Descripcion: pr.Descripcion,
|
|
@@ -98,13 +112,14 @@ class AplicacionesHandler {
|
|
|
98
112
|
Descripcion: 'KI - Leasing Financiero',
|
|
99
113
|
Clasificador: 'T'
|
|
100
114
|
};
|
|
101
|
-
const filas = this.data.PrestamoLeasing.filter(pr => pr.
|
|
102
|
-
.map(pr => {
|
|
115
|
+
const filas = this.data.PrestamoLeasing.filter((pr) => pr.IndicadorABM !== 'B' &&
|
|
116
|
+
pr.TipoOperacion2 === admFinanciera_1.TipoOperacionExistencia.Nueva).map((pr) => {
|
|
103
117
|
const proyeccion = {};
|
|
104
118
|
if (pr.AnnoProyectadoInicio) {
|
|
105
|
-
|
|
119
|
+
const value = (0, utils_1.ourParseFloat)(pr.ActivacionOperacion);
|
|
106
120
|
proyeccion[`Gestion${pr.AnnoProyectadoInicio}`] = value;
|
|
107
|
-
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
121
|
+
filaTotales[`Gestion${pr.AnnoProyectadoInicio}`] =
|
|
122
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${pr.AnnoProyectadoInicio}`]) + value;
|
|
108
123
|
}
|
|
109
124
|
return {
|
|
110
125
|
Descripcion: pr.Descripcion,
|
|
@@ -120,50 +135,62 @@ class AplicacionesHandler {
|
|
|
120
135
|
};
|
|
121
136
|
const filas = [];
|
|
122
137
|
let i = 0;
|
|
123
|
-
let lineas = this.data.LineasMixtasBDP;
|
|
138
|
+
let lineas = this.data.LineasMixtasBDP.filter((lin) => lin.IndicadorABM !== 'B');
|
|
124
139
|
while (i < lineas.length) {
|
|
125
140
|
const filaVencimiento = lineas.at(i + 1);
|
|
126
141
|
if (filaVencimiento?.Clasificador !== 'T') {
|
|
127
142
|
const filaDescripcion = lineas.at(i);
|
|
128
143
|
const filaDeuda = lineas.at(i + 2);
|
|
129
144
|
const fila = {
|
|
130
|
-
Descripcion: filaDescripcion?.Descripcion
|
|
145
|
+
Descripcion: filaDescripcion?.Descripcion
|
|
131
146
|
};
|
|
132
147
|
for (let i = 1; i <= this.data.CantidadProyeccion; i++) {
|
|
133
148
|
let value;
|
|
134
149
|
if (i == 1) {
|
|
135
|
-
value =
|
|
150
|
+
value =
|
|
151
|
+
(0, utils_1.ourParseFloat)(filaVencimiento?.[`Gestion${i}`]) +
|
|
152
|
+
(0, utils_1.ourParseFloat)(filaDeuda?.[`Gestion${i}`]);
|
|
136
153
|
}
|
|
137
154
|
else {
|
|
138
|
-
value =
|
|
155
|
+
value =
|
|
156
|
+
(0, utils_1.ourParseFloat)(filaDeuda?.[`Gestion${i}`]) -
|
|
157
|
+
(0, utils_1.ourParseFloat)(filaDeuda?.[`Gestion${i - 1}`]) +
|
|
158
|
+
(0, utils_1.ourParseFloat)(filaVencimiento?.[`Gestion${i}`]);
|
|
139
159
|
}
|
|
140
160
|
fila[`Gestion${i}`] = value;
|
|
141
|
-
filaTotales[`Gestion${i}`] =
|
|
161
|
+
filaTotales[`Gestion${i}`] =
|
|
162
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${i}`]) + value;
|
|
142
163
|
}
|
|
143
164
|
filas.push(fila);
|
|
144
165
|
}
|
|
145
166
|
i += 4;
|
|
146
167
|
}
|
|
147
168
|
i = 0;
|
|
148
|
-
lineas = this.data.LineasMixtasOtros;
|
|
169
|
+
lineas = this.data.LineasMixtasOtros.filter((lin) => lin.IndicadorABM !== 'B');
|
|
149
170
|
while (i < lineas.length) {
|
|
150
171
|
const filaVencimiento = lineas.at(i + 1);
|
|
151
172
|
if (filaVencimiento?.Clasificador !== 'T') {
|
|
152
173
|
const filaDescripcion = lineas.at(i);
|
|
153
174
|
const filaDeuda = lineas.at(i + 2);
|
|
154
175
|
const fila = {
|
|
155
|
-
Descripcion: filaDescripcion?.Descripcion
|
|
176
|
+
Descripcion: filaDescripcion?.Descripcion
|
|
156
177
|
};
|
|
157
178
|
for (let i = 1; i <= this.data.CantidadProyeccion; i++) {
|
|
158
179
|
let value;
|
|
159
180
|
if (i == 1) {
|
|
160
|
-
value =
|
|
181
|
+
value =
|
|
182
|
+
(0, utils_1.ourParseFloat)(filaVencimiento?.[`Gestion${i}`]) +
|
|
183
|
+
(0, utils_1.ourParseFloat)(filaDeuda?.[`Gestion${i}`]);
|
|
161
184
|
}
|
|
162
185
|
else {
|
|
163
|
-
value =
|
|
186
|
+
value =
|
|
187
|
+
(0, utils_1.ourParseFloat)(filaDeuda?.[`Gestion${i}`]) -
|
|
188
|
+
(0, utils_1.ourParseFloat)(filaDeuda?.[`Gestion${i - 1}`]) +
|
|
189
|
+
(0, utils_1.ourParseFloat)(filaVencimiento?.[`Gestion${i}`]);
|
|
164
190
|
}
|
|
165
191
|
fila[`Gestion${i}`] = value;
|
|
166
|
-
filaTotales[`Gestion${i}`] =
|
|
192
|
+
filaTotales[`Gestion${i}`] =
|
|
193
|
+
(0, utils_1.ourParseFloat)(filaTotales[`Gestion${i}`]) + value;
|
|
167
194
|
}
|
|
168
195
|
filas.push(fila);
|
|
169
196
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdministracionFinancieraCalcData } from
|
|
1
|
+
import { AdministracionFinancieraCalcData } from '../../../models/eeff/admFinanciera';
|
|
2
2
|
export declare class LineasMixtasHandler {
|
|
3
3
|
private data;
|
|
4
4
|
constructor(data: AdministracionFinancieraCalcData);
|
|
@@ -13,28 +13,51 @@ class LineasMixtasHandler {
|
|
|
13
13
|
this.formatLineasMixtas(this.data.LineasMixtasOtros);
|
|
14
14
|
}
|
|
15
15
|
formatLineasMixtas(lineas) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
const lineasActivas = lineas.filter((lin) => lin.IndicadorABM !== 'B');
|
|
17
|
+
if (lineasActivas.length) {
|
|
18
|
+
const filasTotales = [
|
|
19
|
+
{
|
|
20
|
+
Descripcion: 'Total Vencimiento Corriente de Deuda de Largo Plazo',
|
|
21
|
+
Clasificador: 'T',
|
|
22
|
+
RubroId: admFinanciera_1.rubros.lineasMixtas.vencimientoCorrienteLargoPlazo
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
Descripcion: 'Total Deuda Financiera de largo plazo',
|
|
26
|
+
Clasificador: 'T',
|
|
27
|
+
RubroId: admFinanciera_1.rubros.lineasMixtas.deudaFinancieraLargoPlazo
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
Descripcion: 'Total Gastos Financieros y Comisiones',
|
|
31
|
+
Clasificador: 'T',
|
|
32
|
+
RubroId: admFinanciera_1.rubros.lineasMixtas.gastosFinancierosYComisiones
|
|
30
33
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
];
|
|
35
|
+
let i = 0;
|
|
36
|
+
while (i < lineasActivas.length) {
|
|
37
|
+
const filaVencimiento = lineasActivas.at(i + 1);
|
|
38
|
+
const filaDeuda = lineasActivas.at(i + 2);
|
|
39
|
+
const filaGastos = lineasActivas.at(i + 3);
|
|
40
|
+
const tasa = (0, utils_1.ourParseFloat)(filaGastos?.Tasa) / 100;
|
|
41
|
+
for (let j = 1; j <= this.data.CantidadProyeccion; j++) {
|
|
42
|
+
if (j > 1 && filaGastos) {
|
|
43
|
+
filaGastos[`Gestion${j}`] = (0, utils_1.ourParseFloat)(((0, utils_1.ourParseFloat)(filaVencimiento?.[`Gestion${j - 1}`]) +
|
|
44
|
+
(0, utils_1.ourParseFloat)(filaDeuda?.[`Gestion${j - 1}`])) *
|
|
45
|
+
tasa);
|
|
46
|
+
}
|
|
47
|
+
filasTotales[0][`Gestion${j}`] =
|
|
48
|
+
(0, utils_1.ourParseFloat)(filasTotales[0][`Gestion${j}`]) +
|
|
49
|
+
(0, utils_1.ourParseFloat)(filaVencimiento?.[`Gestion${j}`]);
|
|
50
|
+
filasTotales[1][`Gestion${j}`] =
|
|
51
|
+
(0, utils_1.ourParseFloat)(filasTotales[1][`Gestion${j}`]) +
|
|
52
|
+
(0, utils_1.ourParseFloat)(filaDeuda?.[`Gestion${j}`]);
|
|
53
|
+
filasTotales[2][`Gestion${j}`] =
|
|
54
|
+
(0, utils_1.ourParseFloat)(filasTotales[2][`Gestion${j}`]) +
|
|
55
|
+
(0, utils_1.ourParseFloat)(filaGastos?.[`Gestion${j}`]);
|
|
56
|
+
}
|
|
57
|
+
i += 4;
|
|
34
58
|
}
|
|
35
|
-
|
|
59
|
+
lineas.push(...filasTotales);
|
|
36
60
|
}
|
|
37
|
-
lineas.push(...filasTotales);
|
|
38
61
|
}
|
|
39
62
|
}
|
|
40
63
|
exports.LineasMixtasHandler = LineasMixtasHandler;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdministracionFinancieraData, PrestamoBajoLinea } from
|
|
1
|
+
import { AdministracionFinancieraData, PrestamoBajoLinea } from '../../../models/eeff/admFinanciera';
|
|
2
2
|
export declare class PrestamoBajoLineaHandler {
|
|
3
3
|
private data;
|
|
4
4
|
private prestamo;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PrestamoBajoLineaHandler = void 0;
|
|
4
|
-
const luxon_1 = require("luxon");
|
|
5
4
|
const utils_1 = require("./utils");
|
|
6
5
|
class PrestamoBajoLineaHandler {
|
|
7
6
|
data;
|
|
@@ -21,9 +20,10 @@ class PrestamoBajoLineaHandler {
|
|
|
21
20
|
}
|
|
22
21
|
setCantidadAños() {
|
|
23
22
|
let cantidadAños;
|
|
24
|
-
if (this.prestamo.TipoExistencia == 'EXISTENTE' &&
|
|
25
|
-
|
|
26
|
-
const
|
|
23
|
+
if (this.prestamo.TipoExistencia == 'EXISTENTE' &&
|
|
24
|
+
this.prestamo.VencimientoLinea) {
|
|
25
|
+
const fechaInicio = (0, utils_1.getDateTime)(this.data.InicioProyeccion).endOf('month');
|
|
26
|
+
const fechaVencimiento = (0, utils_1.getDateTime)(this.prestamo.VencimientoLinea).endOf('month');
|
|
27
27
|
const diferenciaAños = Math.ceil(Math.abs(fechaInicio.diff(fechaVencimiento, 'years').years));
|
|
28
28
|
if (diferenciaAños > 0) {
|
|
29
29
|
cantidadAños = diferenciaAños;
|
|
@@ -35,15 +35,18 @@ class PrestamoBajoLineaHandler {
|
|
|
35
35
|
this.prestamo.CantidadAnnos = cantidadAños;
|
|
36
36
|
}
|
|
37
37
|
setSaldoLineaAplicar() {
|
|
38
|
-
this.prestamo.SaldoLineaAplicar =
|
|
38
|
+
this.prestamo.SaldoLineaAplicar =
|
|
39
|
+
(0, utils_1.ourParseFloat)(this.prestamo.MontoOriginal) -
|
|
40
|
+
(0, utils_1.ourParseFloat)(this.prestamo.MontoUtilizado);
|
|
39
41
|
}
|
|
40
42
|
setTasaPonderada() {
|
|
41
|
-
|
|
43
|
+
const totalMonto = this.data.PrestamoBajoLinea.filter((pr) => pr.IndicadorABM !== 'B').reduce((acc, curr) => acc + (0, utils_1.ourParseFloat)(curr.MontoOriginal), 0);
|
|
42
44
|
let promedio = 0;
|
|
43
45
|
if (totalMonto) {
|
|
44
46
|
promedio = (0, utils_1.ourParseFloat)(this.prestamo.MontoOriginal) / totalMonto;
|
|
45
47
|
}
|
|
46
|
-
this.prestamo.TasaPonderada =
|
|
48
|
+
this.prestamo.TasaPonderada =
|
|
49
|
+
promedio * (0, utils_1.ourParseFloat)(this.prestamo.Tasa);
|
|
47
50
|
}
|
|
48
51
|
setProyecciones() {
|
|
49
52
|
for (let i = 1; i <= this.data.CantidadProyeccion; i++) {
|
|
@@ -62,7 +65,9 @@ class PrestamoBajoLineaHandler {
|
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
else {
|
|
65
|
-
value =
|
|
68
|
+
value =
|
|
69
|
+
(0, utils_1.ourParseFloat)(this.prestamo.Proyecciones?.[`Gestion${gestion}`]) -
|
|
70
|
+
(0, utils_1.ourParseFloat)(this.prestamo.Proyecciones?.[`Gestion${gestion - 1}`]);
|
|
66
71
|
}
|
|
67
72
|
this.prestamo.Aplicaciones[`Gestion${gestion}`] = (0, utils_1.ourParseFloat)(value);
|
|
68
73
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdministracionFinancieraData, PrestamoDirecto } from
|
|
1
|
+
import { AdministracionFinancieraData, PrestamoDirecto } from '../../../models/eeff/admFinanciera';
|
|
2
2
|
interface HandlerData {
|
|
3
3
|
data: AdministracionFinancieraData;
|
|
4
4
|
prestamo: Partial<PrestamoDirecto>;
|