bdpformulas 1.0.100 → 1.0.102
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/index.d.ts +2 -0
- package/build/index.js +3 -1
- package/build/models/eeff/balanceProyectado.d.ts +2 -3
- package/build/models/eeff/balanceProyectado.js +4 -1
- package/build/strategies/common/declaracionJurada.calc.js +1 -2
- package/build/strategies/eeff/balanceProyectado/balanceHandler.js +3 -3
- package/build/strategies/eeff/balanceProyectado/balanceProyectado.strategy.js +0 -14
- package/build/strategies/eeff/balanceProyectado/eerrHandler.d.ts +1 -0
- package/build/strategies/eeff/balanceProyectado/eerrHandler.js +13 -4
- package/build/strategies/eeff/balanceProyectado/flujoCajaHandler.js +2 -4
- package/build/strategies/eeff/deudas/administracionLinea.js +9 -3
- package/build/strategies/eeff/deudas/aplicactionesCuadro.d.ts +6 -7
- package/build/strategies/eeff/deudas/aplicactionesCuadro.js +252 -118
- package/build/strategies/eeff/deudas/deudas.strategy.js +66 -14
- package/build/strategies/eeff/deudas/resumenFinanciamiento.js +2 -2
- package/build/strategies/eeff/index.d.ts +0 -1
- package/build/strategies/eeff/index.js +0 -9240
- package/build/strategies/eeff/mappings/balanceProyectado.js +24 -24
- package/build/strategies/eeff/supuestos.strategy.d.ts +3 -7
- package/build/strategies/eeff/supuestos.strategy.js +51 -20
- package/package.json +1 -1
|
@@ -21,44 +21,12 @@ class AplicacionesCuadroAlternativo {
|
|
|
21
21
|
this.result = [];
|
|
22
22
|
}
|
|
23
23
|
getCalculation() {
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
id: 'ACT_DEU_76002',
|
|
31
|
-
grupo: 'TOTAL',
|
|
32
|
-
descripction: 'KO - Prestamo Directo'
|
|
33
|
-
});
|
|
34
|
-
this.result.push({
|
|
35
|
-
id: 'ACT_DEU_76003',
|
|
36
|
-
grupo: 'TOTAL',
|
|
37
|
-
descripction: 'KI - Prestamo Directo'
|
|
38
|
-
});
|
|
39
|
-
this.result.push({
|
|
40
|
-
id: 'ACT_DEU_76004',
|
|
41
|
-
grupo: 'TOTAL',
|
|
42
|
-
descripction: 'OTROS - Pagares, Bonos, Etc.'
|
|
43
|
-
});
|
|
44
|
-
this.result.push({
|
|
45
|
-
id: 'ACT_DEU_76005',
|
|
46
|
-
grupo: 'TOTAL',
|
|
47
|
-
descripction: 'KI - Leasing Financiero'
|
|
48
|
-
});
|
|
49
|
-
this.result.push({
|
|
50
|
-
id: 'ACT_DEU_76006',
|
|
51
|
-
grupo: 'TOTAL',
|
|
52
|
-
descripction: 'KI - KO - Línea de Crédito Mixta'
|
|
53
|
-
});
|
|
54
|
-
for (const row of this.result.filter((item) => item.grupo == 'TOTAL')) {
|
|
55
|
-
this.caculate001(row);
|
|
56
|
-
this.caculate002(row);
|
|
57
|
-
this.caculate003(row);
|
|
58
|
-
this.caculate004(row);
|
|
59
|
-
this.caculate005(row);
|
|
60
|
-
this.caculate006(row);
|
|
61
|
-
}
|
|
24
|
+
this.generateKOLineaCredito();
|
|
25
|
+
this.generateKOPrestamoDirecto();
|
|
26
|
+
this.generateKIPrestamoDirecto();
|
|
27
|
+
this.generateOtros();
|
|
28
|
+
this.generateKILeasingFinanciero();
|
|
29
|
+
this.generateKIKOLineasMixtas();
|
|
62
30
|
return this.result;
|
|
63
31
|
}
|
|
64
32
|
addMontos(row) {
|
|
@@ -66,128 +34,294 @@ class AplicacionesCuadroAlternativo {
|
|
|
66
34
|
row[`Monto${i}`] = 0;
|
|
67
35
|
}
|
|
68
36
|
}
|
|
69
|
-
|
|
70
|
-
|
|
37
|
+
generateKOLineaCredito() {
|
|
38
|
+
const filaTotales = {
|
|
39
|
+
id: 'ACT_DEU_76001',
|
|
40
|
+
grupo: 'TOTAL',
|
|
41
|
+
descripction: 'KO - Línea de Crédito 100% KO'
|
|
42
|
+
};
|
|
43
|
+
this.addMontos(filaTotales);
|
|
44
|
+
const filasDetalle = [];
|
|
71
45
|
const filterLineas = this.admLineas.filter((item) => item.rubroId === 'ACT_DEU_71003');
|
|
72
46
|
for (let item of filterLineas) {
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
47
|
+
let filaDetalle = {
|
|
48
|
+
id: 'ACT_DEU_76001',
|
|
49
|
+
grupo: item.uuid,
|
|
50
|
+
descripction: item.entidad
|
|
51
|
+
};
|
|
52
|
+
this.addMontos(filaDetalle);
|
|
53
|
+
if (item.estado == 'Existente') {
|
|
54
|
+
filaDetalle.Monto1 = parseFloat(item.saldo);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
filaDetalle.Monto1 = parseFloat(item.monto);
|
|
58
|
+
}
|
|
59
|
+
filaTotales.Monto1 += filaDetalle.Monto1;
|
|
82
60
|
for (let i = 2; i <= this.cantidadProyeccion; i++) {
|
|
83
61
|
const codes = item.uuid.split('_');
|
|
84
62
|
const deudaLinea = this.deudas.find((item) => item.RubroId == 'ACT_DEU_50001' &&
|
|
85
63
|
item.Secuencia == parseInt(codes[3]));
|
|
86
|
-
|
|
87
|
-
deudaLinea[`Monto${i}`]
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
64
|
+
if (deudaLinea) {
|
|
65
|
+
const montoActual = parseFloat(deudaLinea[`Monto${i}`]?.value || 0);
|
|
66
|
+
const montoAnterior = parseFloat(deudaLinea[`Monto${i - 1}`]?.value || 0);
|
|
67
|
+
filaDetalle[`Monto${i}`] = montoActual - montoAnterior;
|
|
68
|
+
filaDetalle[`Monto${i}`] = Math.round(filaDetalle[`Monto${i}`] || 0);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
filaDetalle[`Monto${i}`] = 0;
|
|
72
|
+
}
|
|
73
|
+
filaTotales[`Monto${i}`] += filaDetalle[`Monto${i}`];
|
|
92
74
|
}
|
|
93
|
-
|
|
75
|
+
filasDetalle.push(filaDetalle);
|
|
94
76
|
}
|
|
77
|
+
this.result.push(...filasDetalle, filaTotales);
|
|
95
78
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
generateKOPrestamoDirecto() {
|
|
80
|
+
const filaTotales = {
|
|
81
|
+
id: 'ACT_DEU_76002',
|
|
82
|
+
grupo: 'TOTAL',
|
|
83
|
+
descripction: 'KO - Prestamo Directo'
|
|
84
|
+
};
|
|
85
|
+
this.addMontos(filaTotales);
|
|
86
|
+
const filasDetalle = [];
|
|
87
|
+
const rubros = [
|
|
88
|
+
['ACT_DEU_10001', 'ACT_DEU_10002'],
|
|
89
|
+
['ACT_DEU_40001', 'ACT_DEU_40002']
|
|
90
|
+
];
|
|
91
|
+
let deudasEncontradas = false;
|
|
92
|
+
for (let rubro of rubros) {
|
|
93
|
+
const filtered = this.deudas.filter((item) => item.RubroId == rubro[0] &&
|
|
94
|
+
item.Destino === 'KO' &&
|
|
95
|
+
item.Operacion == 'NUEVA');
|
|
96
|
+
if (filtered.length > 0) {
|
|
97
|
+
deudasEncontradas = true;
|
|
98
|
+
}
|
|
100
99
|
for (const debt of filtered) {
|
|
101
100
|
const companion = this.deudas.find((item) => item.RubroId == rubro[1] &&
|
|
102
|
-
item.Secuencia == debt.Secuencia
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
item.Secuencia == debt.Secuencia);
|
|
102
|
+
let filaDetalle = {
|
|
103
|
+
id: 'ACT_DEU_76002',
|
|
104
|
+
grupo: debt.UUID,
|
|
105
|
+
descripction: debt.Descripcion
|
|
106
|
+
};
|
|
107
|
+
this.addMontos(filaDetalle);
|
|
108
108
|
for (let i = 1; i <= this.cantidadProyeccion; i++) {
|
|
109
109
|
if (i == 1 ||
|
|
110
110
|
(i > 1 &&
|
|
111
|
-
parseFloat(debt[`Monto${i - 1}`]) +
|
|
112
|
-
parseFloat(companion[`Monto${i - 1}`]) ==
|
|
111
|
+
parseFloat(debt[`Monto${i - 1}`]?.value || 0) +
|
|
112
|
+
parseFloat(companion[`Monto${i - 1}`]?.value || 0) ==
|
|
113
113
|
0)) {
|
|
114
|
-
|
|
115
|
-
parseFloat(debt[`Monto${i}`]) +
|
|
116
|
-
parseFloat(companion[`Monto${i}`]);
|
|
117
|
-
|
|
118
|
-
// Math.round(parseFloat(nuevo[`Monto${i}`]) * 100) /
|
|
119
|
-
// 100
|
|
120
|
-
nuevo[`Monto${i}`] = Math.round(parseFloat(nuevo[`Monto${i}`]));
|
|
114
|
+
filaDetalle[`Monto${i}`] =
|
|
115
|
+
parseFloat(debt[`Monto${i}`]?.value || 0) +
|
|
116
|
+
parseFloat(companion[`Monto${i}`]?.value || 0);
|
|
117
|
+
filaDetalle[`Monto${i}`] = Math.round(parseFloat(filaDetalle[`Monto${i}`] || 0));
|
|
121
118
|
}
|
|
122
|
-
|
|
119
|
+
filaTotales[`Monto${i}`] += filaDetalle[`Monto${i}`] || 0;
|
|
123
120
|
}
|
|
121
|
+
filasDetalle.push(filaDetalle);
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
['ACT_DEU_10001', 'ACT_DEU_10002'],
|
|
130
|
-
['ACT_DEU_40001', 'ACT_DEU_40002']
|
|
131
|
-
], 'KO');
|
|
132
|
-
if (this.proyecta)
|
|
133
|
-
row.Monto1 = row.Monto1 - this.calculoAuxiliar1;
|
|
124
|
+
if (this.proyecta) {
|
|
125
|
+
filaTotales.Monto1 = filaTotales.Monto1 - this.calculoAuxiliar1;
|
|
126
|
+
}
|
|
134
127
|
const koPorcionBDP = this.resumenFinanciamiento.find((item) => item.id == 'ACT_DEU_75001');
|
|
135
|
-
const kiPorcionBDP = this.resumenFinanciamiento.find((item) => item.id == '
|
|
128
|
+
const kiPorcionBDP = this.resumenFinanciamiento.find((item) => item.id == 'ACT_DEU_75101');
|
|
136
129
|
for (let i = 2; i <= this.cantidadProyeccion; i++) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
const periodoAnterior = i - 1;
|
|
131
|
+
const porcionesPeriodoAnterior = (koPorcionBDP?.[`Monto${periodoAnterior}`] || 0) +
|
|
132
|
+
(kiPorcionBDP?.[`Monto${periodoAnterior}`] || 0);
|
|
133
|
+
filaTotales[`Monto${i}`] =
|
|
134
|
+
filaTotales[`Monto${i}`] - porcionesPeriodoAnterior;
|
|
140
135
|
}
|
|
136
|
+
this.result.push(...filasDetalle, filaTotales);
|
|
141
137
|
}
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
generateKIPrestamoDirecto() {
|
|
139
|
+
const filaTotales = {
|
|
140
|
+
id: 'ACT_DEU_76003',
|
|
141
|
+
grupo: 'TOTAL',
|
|
142
|
+
descripction: 'KI - Prestamo Directo'
|
|
143
|
+
};
|
|
144
|
+
this.addMontos(filaTotales);
|
|
145
|
+
const filasDetalle = [];
|
|
146
|
+
const rubros = [
|
|
144
147
|
['ACT_DEU_10001', 'ACT_DEU_10002'],
|
|
145
148
|
['ACT_DEU_40001', 'ACT_DEU_40002']
|
|
146
|
-
]
|
|
149
|
+
];
|
|
150
|
+
for (let rubro of rubros) {
|
|
151
|
+
const filtered = this.deudas.filter((item) => item.RubroId == rubro[0] &&
|
|
152
|
+
item.Destino === 'KI' &&
|
|
153
|
+
item.Operacion == 'NUEVA');
|
|
154
|
+
for (const debt of filtered) {
|
|
155
|
+
const companion = this.deudas.find((item) => item.RubroId == rubro[1] &&
|
|
156
|
+
item.Secuencia == debt.Secuencia);
|
|
157
|
+
if (!companion) {
|
|
158
|
+
console.log(`No se encontró companion para: ${debt.UUID}, Rubro: ${rubro[1]}`);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
let filaDetalle = {
|
|
162
|
+
id: 'ACT_DEU_76003',
|
|
163
|
+
grupo: debt.UUID,
|
|
164
|
+
descripction: debt.Descripcion
|
|
165
|
+
};
|
|
166
|
+
this.addMontos(filaDetalle);
|
|
167
|
+
for (let i = 1; i <= this.cantidadProyeccion; i++) {
|
|
168
|
+
if (i == 1 ||
|
|
169
|
+
(i > 1 &&
|
|
170
|
+
parseFloat(debt[`Monto${i - 1}`]?.value || 0) +
|
|
171
|
+
parseFloat(companion[`Monto${i - 1}`]?.value || 0) ==
|
|
172
|
+
0)) {
|
|
173
|
+
filaDetalle[`Monto${i}`] =
|
|
174
|
+
parseFloat(debt[`Monto${i}`]?.value || 0) +
|
|
175
|
+
parseFloat(companion[`Monto${i}`]?.value || 0);
|
|
176
|
+
filaDetalle[`Monto${i}`] = Math.round(parseFloat(filaDetalle[`Monto${i}`] || 0));
|
|
177
|
+
}
|
|
178
|
+
filaTotales[`Monto${i}`] += filaDetalle[`Monto${i}`] || 0;
|
|
179
|
+
}
|
|
180
|
+
filasDetalle.push(filaDetalle);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
this.result.push(...filasDetalle, filaTotales);
|
|
147
184
|
}
|
|
148
|
-
|
|
149
|
-
|
|
185
|
+
generateOtros() {
|
|
186
|
+
const filaTotales = {
|
|
187
|
+
id: 'ACT_DEU_76004',
|
|
188
|
+
grupo: 'TOTAL',
|
|
189
|
+
descripction: 'OTROS - Pagares, Bonos, Etc.'
|
|
190
|
+
};
|
|
191
|
+
this.addMontos(filaTotales);
|
|
192
|
+
const filasDetalle = [];
|
|
193
|
+
const rubros = [['ACT_DEU_10001', 'ACT_DEU_10002']];
|
|
194
|
+
for (let rubro of rubros) {
|
|
195
|
+
const filtered = this.deudas.filter((item) => item.RubroId == rubro[0] &&
|
|
196
|
+
item.Destino == 'OTROS' &&
|
|
197
|
+
item.Operacion == 'NUEVA');
|
|
198
|
+
for (const debt of filtered) {
|
|
199
|
+
const companion = this.deudas.find((item) => item.RubroId == rubro[1] &&
|
|
200
|
+
item.Secuencia == debt.Secuencia);
|
|
201
|
+
if (!companion) {
|
|
202
|
+
console.log(`No se encontró companion para: ${debt.UUID}, Rubro: ${rubro[1]}`);
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
let filaDetalle = {
|
|
206
|
+
id: 'ACT_DEU_76004',
|
|
207
|
+
grupo: debt.UUID,
|
|
208
|
+
descripction: debt.Descripcion
|
|
209
|
+
};
|
|
210
|
+
this.addMontos(filaDetalle);
|
|
211
|
+
for (let i = 1; i <= this.cantidadProyeccion; i++) {
|
|
212
|
+
if (i == 1 ||
|
|
213
|
+
(i > 1 &&
|
|
214
|
+
parseFloat(debt[`Monto${i - 1}`]?.value || 0) +
|
|
215
|
+
parseFloat(companion[`Monto${i - 1}`]?.value || 0) ==
|
|
216
|
+
0)) {
|
|
217
|
+
filaDetalle[`Monto${i}`] =
|
|
218
|
+
parseFloat(debt[`Monto${i}`]?.value || 0) +
|
|
219
|
+
parseFloat(companion[`Monto${i}`]?.value || 0);
|
|
220
|
+
filaDetalle[`Monto${i}`] = Math.round(parseFloat(filaDetalle[`Monto${i}`] || 0));
|
|
221
|
+
}
|
|
222
|
+
filaTotales[`Monto${i}`] += filaDetalle[`Monto${i}`] || 0;
|
|
223
|
+
}
|
|
224
|
+
filasDetalle.push(filaDetalle);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
this.result.push(...filasDetalle, filaTotales);
|
|
150
228
|
}
|
|
151
|
-
|
|
152
|
-
|
|
229
|
+
generateKILeasingFinanciero() {
|
|
230
|
+
const filaTotales = {
|
|
231
|
+
id: 'ACT_DEU_76005',
|
|
232
|
+
grupo: 'TOTAL',
|
|
233
|
+
descripction: 'KI - Leasing Financiero'
|
|
234
|
+
};
|
|
235
|
+
this.addMontos(filaTotales);
|
|
236
|
+
const filasDetalle = [];
|
|
237
|
+
// Procesar leasing financiero (similar a tu método caculate005)
|
|
238
|
+
const rubros = [['ACT_DEU_30001', 'ACT_DEU_30002']];
|
|
239
|
+
for (let rubro of rubros) {
|
|
240
|
+
const filtered = this.deudas.filter((item) => item.RubroId == rubro[0] &&
|
|
241
|
+
item.Destino == 'KI' &&
|
|
242
|
+
item.Operacion == 'NUEVA');
|
|
243
|
+
for (const debt of filtered) {
|
|
244
|
+
const companion = this.deudas.find((item) => item.RubroId == rubro[1] &&
|
|
245
|
+
item.Secuencia == debt.Secuencia);
|
|
246
|
+
if (!companion) {
|
|
247
|
+
console.log(`No se encontró companion para: ${debt.UUID}, Rubro: ${rubro[1]}`);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
let filaDetalle = {
|
|
251
|
+
id: 'ACT_DEU_76005',
|
|
252
|
+
grupo: debt.UUID,
|
|
253
|
+
descripction: debt.Descripcion
|
|
254
|
+
};
|
|
255
|
+
this.addMontos(filaDetalle);
|
|
256
|
+
for (let i = 1; i <= this.cantidadProyeccion; i++) {
|
|
257
|
+
if (i == 1 ||
|
|
258
|
+
(i > 1 &&
|
|
259
|
+
parseFloat(debt[`Monto${i - 1}`]?.value || 0) +
|
|
260
|
+
parseFloat(companion[`Monto${i - 1}`]?.value || 0) ==
|
|
261
|
+
0)) {
|
|
262
|
+
filaDetalle[`Monto${i}`] =
|
|
263
|
+
parseFloat(debt[`Monto${i}`]?.value || 0) +
|
|
264
|
+
parseFloat(companion[`Monto${i}`]?.value || 0);
|
|
265
|
+
filaDetalle[`Monto${i}`] = Math.round(parseFloat(filaDetalle[`Monto${i}`] || 0));
|
|
266
|
+
}
|
|
267
|
+
filaTotales[`Monto${i}`] += filaDetalle[`Monto${i}`] || 0;
|
|
268
|
+
}
|
|
269
|
+
filasDetalle.push(filaDetalle);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
this.result.push(...filasDetalle, filaTotales);
|
|
153
273
|
}
|
|
154
|
-
|
|
155
|
-
|
|
274
|
+
generateKIKOLineasMixtas() {
|
|
275
|
+
const filaTotales = {
|
|
276
|
+
id: 'ACT_DEU_76006',
|
|
277
|
+
grupo: 'TOTAL',
|
|
278
|
+
descripction: 'KI - KO - Línea de Crédito Mixta'
|
|
279
|
+
};
|
|
280
|
+
this.addMontos(filaTotales);
|
|
281
|
+
const filasDetalle = [];
|
|
282
|
+
// Procesar líneas mixtas (similar a tu método caculate006)
|
|
156
283
|
const rubros = [
|
|
157
284
|
['ACT_DEU_41001', 'ACT_DEU_41002'],
|
|
158
285
|
['ACT_DEU_20001', 'ACT_DEU_20002']
|
|
159
286
|
];
|
|
160
|
-
for (let rubro
|
|
161
|
-
const filtered = this.deudas.filter((item) => item.RubroId == rubro[0]);
|
|
287
|
+
for (let rubro of rubros) {
|
|
288
|
+
const filtered = this.deudas.filter((item) => item.RubroId == rubro[0] && item.Operacion == 'NUEVA');
|
|
162
289
|
for (const debt of filtered) {
|
|
163
290
|
const companion = this.deudas.find((item) => item.RubroId == rubro[1] &&
|
|
164
|
-
item.Secuencia == debt.Secuencia
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
291
|
+
item.Secuencia == debt.Secuencia);
|
|
292
|
+
if (!companion) {
|
|
293
|
+
console.log(`No se encontró companion para: ${debt.UUID}, Rubro: ${rubro[1]}`);
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
let filaDetalle = {
|
|
297
|
+
id: 'ACT_DEU_76006',
|
|
298
|
+
grupo: debt.UUID,
|
|
299
|
+
descripction: debt.Descripcion
|
|
300
|
+
};
|
|
301
|
+
this.addMontos(filaDetalle);
|
|
170
302
|
for (let i = 1; i <= this.cantidadProyeccion; i++) {
|
|
171
303
|
if (i == 1) {
|
|
172
|
-
|
|
173
|
-
parseFloat(debt[`Monto${i}`]) +
|
|
174
|
-
parseFloat(companion[`Monto${i}`]);
|
|
304
|
+
filaDetalle[`Monto${i}`] =
|
|
305
|
+
parseFloat(debt[`Monto${i}`]?.value || 0) +
|
|
306
|
+
parseFloat(companion[`Monto${i}`]?.value || 0);
|
|
175
307
|
}
|
|
176
308
|
if (i > 1) {
|
|
177
|
-
|
|
178
|
-
parseFloat(companion[`Monto${i}`]) -
|
|
179
|
-
parseFloat(companion[`Monto${i - 1}`]) +
|
|
180
|
-
parseFloat(debt[`Monto${i}`]);
|
|
309
|
+
filaDetalle[`Monto${i}`] =
|
|
310
|
+
parseFloat(companion[`Monto${i}`]?.value || 0) -
|
|
311
|
+
parseFloat(companion[`Monto${i - 1}`]?.value || 0) +
|
|
312
|
+
parseFloat(debt[`Monto${i}`]?.value || 0);
|
|
181
313
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
nuevo[`Monto${i}`] = Math.round(parseFloat(nuevo[`Monto${i}`]));
|
|
185
|
-
row[`Monto${i}`] += nuevo[`Monto${i}`];
|
|
314
|
+
filaDetalle[`Monto${i}`] = Math.round(parseFloat(filaDetalle[`Monto${i}`] || 0));
|
|
315
|
+
filaTotales[`Monto${i}`] += filaDetalle[`Monto${i}`] || 0;
|
|
186
316
|
}
|
|
317
|
+
filasDetalle.push(filaDetalle);
|
|
187
318
|
}
|
|
188
319
|
}
|
|
189
|
-
|
|
190
|
-
|
|
320
|
+
// Ajuste específico para líneas mixtas
|
|
321
|
+
if (this.proyecta) {
|
|
322
|
+
filaTotales.Monto1 = filaTotales.Monto1 - this.calculoAuxiliar2;
|
|
323
|
+
}
|
|
324
|
+
this.result.push(...filasDetalle, filaTotales);
|
|
191
325
|
}
|
|
192
326
|
}
|
|
193
327
|
exports.default = AplicacionesCuadroAlternativo;
|
|
@@ -64,7 +64,6 @@ class DeudasStrategy {
|
|
|
64
64
|
let rows1 = this.data.Deudas.filter((item) => item.RubroId == params.rubro1);
|
|
65
65
|
let row2 = this.data.Deudas.find((item) => item.RubroId == params.rubro2 && item.Secuencia == 1);
|
|
66
66
|
let row3 = this.data.Deudas.find((item) => item.RubroId == params.rubro3 && item.Secuencia == 1);
|
|
67
|
-
//sumarizando
|
|
68
67
|
let row1 = rows1.reduce((sum, item) => {
|
|
69
68
|
if (!sum)
|
|
70
69
|
sum = { ...item };
|
|
@@ -77,6 +76,15 @@ class DeudasStrategy {
|
|
|
77
76
|
}
|
|
78
77
|
return sum;
|
|
79
78
|
}, null);
|
|
79
|
+
let totalCortoPlazoBLKO = 0;
|
|
80
|
+
if (this.data.CalculosAuxiliares && this.data.CalculosAuxiliares['1']) {
|
|
81
|
+
totalCortoPlazoBLKO = this.cleanNumber(this.data.CalculosAuxiliares['1'].TotalCortoPlazoBLKO);
|
|
82
|
+
}
|
|
83
|
+
if (row3[`Monto1`] == 0) {
|
|
84
|
+
row3[`Monto1`] =
|
|
85
|
+
(totalCortoPlazoBLKO * this.cleanNumber(row2[`Monto1`])) / 100;
|
|
86
|
+
row3[`Monto1`] = Math.round(row3[`Monto1`]);
|
|
87
|
+
}
|
|
80
88
|
for (let j = 2; j <= this.data.CantidadProyeccion; j++) {
|
|
81
89
|
if (row3[`Monto${j}`] == 0) {
|
|
82
90
|
row3[`Monto${j}`] =
|
|
@@ -110,25 +118,69 @@ class DeudasStrategy {
|
|
|
110
118
|
// }, null)
|
|
111
119
|
// return destino
|
|
112
120
|
// }
|
|
121
|
+
// sumarizador(params: any) {
|
|
122
|
+
// let destino = this.data.Deudas.find(
|
|
123
|
+
// (item: any) => item.RubroId == params.rubro2
|
|
124
|
+
// )
|
|
125
|
+
// this.data.Deudas.filter(
|
|
126
|
+
// (item: any) => item.RubroId == params.rubro1
|
|
127
|
+
// ).reduce((sum: any, item: any) => {
|
|
128
|
+
// console.log('SUM', sum)
|
|
129
|
+
// console.log('ITEM', item)
|
|
130
|
+
// if (!sum) {
|
|
131
|
+
// sum = { ...item }
|
|
132
|
+
// for (let i = 1; i <= this.data.CantidadProyeccion; i++) {
|
|
133
|
+
// sum[`Monto${i}`] = this.cleanNumber(
|
|
134
|
+
// sum[`Monto${i}`]?.value ?? sum[`Monto${i}`]
|
|
135
|
+
// )
|
|
136
|
+
// }
|
|
137
|
+
// } else {
|
|
138
|
+
// for (let i = 1; i <= this.data.CantidadProyeccion; i++) {
|
|
139
|
+
// const getVal = (m: any) => this.cleanNumber(m?.value ?? m)
|
|
140
|
+
// sum[`Monto${i}`] =
|
|
141
|
+
// getVal(sum[`Monto${i}`]) + getVal(item[`Monto${i}`])
|
|
142
|
+
// destino[`Monto${i}`] = sum[`Monto${i}`]
|
|
143
|
+
// }
|
|
144
|
+
// }
|
|
145
|
+
// return sum
|
|
146
|
+
// }, null)
|
|
147
|
+
// return destino
|
|
148
|
+
// }
|
|
113
149
|
sumarizador(params) {
|
|
114
150
|
let destino = this.data.Deudas.find((item) => item.RubroId == params.rubro2);
|
|
115
|
-
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
151
|
+
for (let i = 1; i <= this.data.CantidadProyeccion; i++) {
|
|
152
|
+
if (destino[`Monto${i}`] &&
|
|
153
|
+
typeof destino[`Monto${i}`] === 'object') {
|
|
154
|
+
destino[`Monto${i}`].value = 0;
|
|
155
|
+
destino[`Monto${i}`].isCalculated = true;
|
|
121
156
|
}
|
|
122
157
|
else {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
158
|
+
destino[`Monto${i}`] = 0;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const rubrosASumar = this.data.Deudas.filter((item) => item.RubroId == params.rubro1);
|
|
162
|
+
rubrosASumar.forEach((item) => {
|
|
163
|
+
for (let i = 1; i <= this.data.CantidadProyeccion; i++) {
|
|
164
|
+
let valorItem;
|
|
165
|
+
if (item[`Monto${i}`] &&
|
|
166
|
+
typeof item[`Monto${i}`] === 'object') {
|
|
167
|
+
valorItem = this.cleanNumber(item[`Monto${i}`].value ?? 0);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
valorItem = this.cleanNumber(item[`Monto${i}`] ?? 0);
|
|
171
|
+
}
|
|
172
|
+
if (destino[`Monto${i}`] &&
|
|
173
|
+
typeof destino[`Monto${i}`] === 'object') {
|
|
174
|
+
const valorActual = this.cleanNumber(destino[`Monto${i}`].value ?? 0);
|
|
175
|
+
destino[`Monto${i}`].value = valorActual + valorItem;
|
|
176
|
+
destino[`Monto${i}`].isCalculated = true;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
const valorActual = this.cleanNumber(destino[`Monto${i}`] ?? 0);
|
|
180
|
+
destino[`Monto${i}`] = valorActual + valorItem;
|
|
128
181
|
}
|
|
129
182
|
}
|
|
130
|
-
|
|
131
|
-
}, null);
|
|
183
|
+
});
|
|
132
184
|
return destino;
|
|
133
185
|
}
|
|
134
186
|
execute(data) {
|
|
@@ -230,7 +230,7 @@ class ResumenFinanciamiento {
|
|
|
230
230
|
'ACT_DEU_75202',
|
|
231
231
|
'ACT_DEU_75203',
|
|
232
232
|
'ACT_DEU_75204'
|
|
233
|
-
].includes(item.
|
|
233
|
+
].includes(item.id));
|
|
234
234
|
this.generateFilter(row, filter);
|
|
235
235
|
}
|
|
236
236
|
generateLeasingCP(row) {
|
|
@@ -258,7 +258,7 @@ class ResumenFinanciamiento {
|
|
|
258
258
|
'ACT_DEU_75101',
|
|
259
259
|
'ACT_DEU_75102',
|
|
260
260
|
'ACT_DEU_75103',
|
|
261
|
-
'
|
|
261
|
+
'ACT_DEU_75301'
|
|
262
262
|
].includes(item.id));
|
|
263
263
|
this.generateFilter(row, filter);
|
|
264
264
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|