bdpformulas 1.0.90 → 1.0.92
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/strategies/agriculture/costos.detail/costosCalc.js +2 -1
- package/build/strategies/agriculture/costos.detail/mesesCalc.js +9 -3
- package/build/strategies/agriculture/flujoProyAgr.strategy.js +4 -2
- package/build/strategies/common/analisisFinCalculos/apalancamiento.calc.js +21 -14
- package/build/strategies/common/analisisFinCalculos/puntoEquilibrio.calc.js +27 -9
- package/build/strategies/common/analisisFinCalculos/ratios.calc.js +28 -14
- package/build/strategies/common/flujoCalculos/flujoConstructor.js +22 -14
- package/build/strategies/eeff/balanceEEFF.strategy.d.ts +1 -1
- package/build/strategies/eeff/balanceEEFF.strategy.js +93 -76
- package/build/strategies/eeff/deudas/administracionLinea.js +13 -6
- package/build/strategies/eeff/deudas/administracionLineaManuales.js +4 -2
- package/build/strategies/eeff/deudas/aplicactionesCuadro.js +10 -7
- package/build/strategies/eeff/deudas/deudas.strategy.js +10 -6
- package/build/strategies/eeff/deudas/resumenFinanciamiento.js +2 -1
- package/build/strategies/eeff/flujoProyEEFF.strategy.d.ts +1 -1
- package/build/strategies/eeff/flujoProyEEFF.strategy.js +29 -26
- package/build/strategies/general/balanceGeneral.strategy.js +8 -6
- package/build/strategies/pecuary/desarrollo.detail/desarrolloCalc.js +4 -2
- package/build/strategies/pecuary/flujoProyPec.strategy.js +11 -6
- package/build/strategies/production/balancePrd.strategy.js +25 -16
- package/build/strategies/production/costos.detail/costosCalc.js +4 -2
- package/build/strategies/production/costos.detail/mesesCalc.js +2 -1
- package/build/strategies/production/flujoProyPrd.strategy.d.ts +1 -1
- package/build/strategies/production/flujoProyPrd.strategy.js +33 -26
- package/build/strategies/production/ventas.detail/estacionalidadCalc.js +4 -2
- package/build/strategies/production/ventas.detail/ingresosCalc.js +27 -6
- package/package.json +1 -1
|
@@ -6,7 +6,8 @@ const calcular = (Costos) => {
|
|
|
6
6
|
let result = { ...item };
|
|
7
7
|
result.Cantidad = parseFloat(item.Cantidad);
|
|
8
8
|
result.PrecioUnitario = parseFloat(item.PrecioUnitario);
|
|
9
|
-
result.Total = Math.round(result.Cantidad * result.PrecioUnitario * result.Superficie * 100) /
|
|
9
|
+
// result.Total = Math.round(result.Cantidad * result.PrecioUnitario * result.Superficie * 100) /100
|
|
10
|
+
result.Total = Math.round(result.Cantidad * result.PrecioUnitario * result.Superficie);
|
|
10
11
|
result.TotalMonto = 0;
|
|
11
12
|
for (let i in result) {
|
|
12
13
|
if (i.startsWith('Monto')) {
|
|
@@ -11,12 +11,17 @@ const calcularMeses = (data, productos) => {
|
|
|
11
11
|
nuevo.set(item.ProductoId, value);
|
|
12
12
|
}
|
|
13
13
|
nuevo.get(item.ProductoId)[`Monto${item.Correlativo}`] = 0;
|
|
14
|
-
nuevo.get(item.ProductoId)[`CorrelativoDesc${item.Correlativo}`] =
|
|
14
|
+
nuevo.get(item.ProductoId)[`CorrelativoDesc${item.Correlativo}`] =
|
|
15
|
+
item.Descripcion;
|
|
15
16
|
return nuevo;
|
|
16
17
|
}, new Map());
|
|
17
18
|
let result = data.reduce((acc, item) => {
|
|
18
19
|
if (!acc.has(0))
|
|
19
|
-
acc.set(0, {
|
|
20
|
+
acc.set(0, {
|
|
21
|
+
ActividadProductoId: 0,
|
|
22
|
+
Descripcion: 'TOTAL',
|
|
23
|
+
Total: 0
|
|
24
|
+
});
|
|
20
25
|
if (!acc.has(item.ActividadProductoId)) {
|
|
21
26
|
let value = {};
|
|
22
27
|
value.ActividadProductoId = item.ActividadProductoId;
|
|
@@ -30,7 +35,8 @@ const calcularMeses = (data, productos) => {
|
|
|
30
35
|
acc.get(item.ActividadProductoId)[i] = 0;
|
|
31
36
|
if (!(i in acc.get(0)))
|
|
32
37
|
acc.get(0)[i] = 0;
|
|
33
|
-
const monto = Math.round(item[i]
|
|
38
|
+
// const monto = Math.round(item[i]/100 * item.Total * 100)/100
|
|
39
|
+
const monto = Math.round((item[i] / 100) * item.Total);
|
|
34
40
|
acc.get(item.ActividadProductoId)[i] += monto;
|
|
35
41
|
acc.get(item.ActividadProductoId).Total += monto;
|
|
36
42
|
acc.get(0)[i] += monto;
|
|
@@ -46,7 +46,8 @@ const setValues = (data, consolidado, rubroId, i) => {
|
|
|
46
46
|
row[`Monto${i}`] += item[`Monto${i}`];
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
row[`Monto${i}`] = Math.round(parseFloat(row[`Monto${i}`]) * 100) / 100
|
|
49
|
+
// row[`Monto${i}`] = Math.round(parseFloat(row[`Monto${i}`]) * 100) / 100
|
|
50
|
+
row[`Monto${i}`] = Math.round(parseFloat(row[`Monto${i}`]));
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
53
|
//@ts-ignore
|
|
@@ -76,7 +77,8 @@ const getGastos = (actividad, tipo) => {
|
|
|
76
77
|
if (!actividad.OtrosGastos[tipo] || actividad.OtrosGastos[tipo].length == 0)
|
|
77
78
|
return null;
|
|
78
79
|
const total = actividad.OtrosGastos[tipo].reduce((acc, item) => {
|
|
79
|
-
acc += Math.round(parseFloat(item.ImporteMensual) * 100) / 100
|
|
80
|
+
// acc += Math.round(parseFloat(item.ImporteMensual) * 100) / 100
|
|
81
|
+
acc += Math.round(parseFloat(item.ImporteMensual));
|
|
80
82
|
return acc;
|
|
81
83
|
}, 0);
|
|
82
84
|
const result = {
|
|
@@ -10,7 +10,8 @@ const setApalancamiento = (data) => {
|
|
|
10
10
|
}
|
|
11
11
|
return acc;
|
|
12
12
|
}, 0);
|
|
13
|
-
sumaMontos = Math.round(sumaMontos * 100) / 100
|
|
13
|
+
// sumaMontos = Math.round(sumaMontos * 100) / 100
|
|
14
|
+
sumaMontos = Math.round(sumaMontos);
|
|
14
15
|
}
|
|
15
16
|
const rango = data.balanceMap.get('ACT_CN_10000_0').Rango;
|
|
16
17
|
const totalPatrimonio = data.balanceMap.get('ACT_CN_39000_0');
|
|
@@ -53,18 +54,24 @@ const setApalancamiento = (data) => {
|
|
|
53
54
|
? 0
|
|
54
55
|
: (totalPasivo[`MontoTotal_${rango}`] + sumaMontos) /
|
|
55
56
|
totalPatrimonio[`MontoTotal_${rango}`];
|
|
56
|
-
data.Apalancamiento.RelacionPatrimonio.Negocio =
|
|
57
|
-
|
|
58
|
-
data.Apalancamiento.RelacionPatrimonio.FamiEmpresa =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
data.Apalancamiento.PrimerPiso.Negocio =
|
|
62
|
-
|
|
63
|
-
data.Apalancamiento.PrimerPiso.FamiEmpresa =
|
|
64
|
-
|
|
65
|
-
data.Apalancamiento.Firedin.Negocio =
|
|
66
|
-
|
|
67
|
-
data.Apalancamiento.Firedin.FamiEmpresa =
|
|
68
|
-
|
|
57
|
+
// data.Apalancamiento.RelacionPatrimonio.Negocio =
|
|
58
|
+
// Math.round(data.Apalancamiento.RelacionPatrimonio.Negocio * 100) / 100
|
|
59
|
+
// data.Apalancamiento.RelacionPatrimonio.FamiEmpresa =
|
|
60
|
+
// Math.round(data.Apalancamiento.RelacionPatrimonio.FamiEmpresa * 100) /
|
|
61
|
+
// 100
|
|
62
|
+
// data.Apalancamiento.PrimerPiso.Negocio =
|
|
63
|
+
// Math.round(data.Apalancamiento.PrimerPiso.Negocio * 100) / 100
|
|
64
|
+
// data.Apalancamiento.PrimerPiso.FamiEmpresa =
|
|
65
|
+
// Math.round(data.Apalancamiento.PrimerPiso.FamiEmpresa * 100) / 100
|
|
66
|
+
// data.Apalancamiento.Firedin.Negocio =
|
|
67
|
+
// Math.round(data.Apalancamiento.Firedin.Negocio * 100) / 100
|
|
68
|
+
// data.Apalancamiento.Firedin.FamiEmpresa =
|
|
69
|
+
// Math.round(data.Apalancamiento.Firedin.FamiEmpresa * 100) / 100
|
|
70
|
+
data.Apalancamiento.RelacionPatrimonio.Negocio = Math.round(data.Apalancamiento.RelacionPatrimonio.Negocio);
|
|
71
|
+
data.Apalancamiento.RelacionPatrimonio.FamiEmpresa = Math.round(data.Apalancamiento.RelacionPatrimonio.FamiEmpresa);
|
|
72
|
+
data.Apalancamiento.PrimerPiso.Negocio = Math.round(data.Apalancamiento.PrimerPiso.Negocio);
|
|
73
|
+
data.Apalancamiento.PrimerPiso.FamiEmpresa = Math.round(data.Apalancamiento.PrimerPiso.FamiEmpresa);
|
|
74
|
+
data.Apalancamiento.Firedin.Negocio = Math.round(data.Apalancamiento.Firedin.Negocio);
|
|
75
|
+
data.Apalancamiento.Firedin.FamiEmpresa = Math.round(data.Apalancamiento.Firedin.FamiEmpresa);
|
|
69
76
|
};
|
|
70
77
|
exports.setApalancamiento = setApalancamiento;
|
|
@@ -6,13 +6,21 @@ const getPuntoEquilibrio = (data) => {
|
|
|
6
6
|
const fecha = data.balanceMap.get('ACT_CN_10000_0')[`Fecha_${rango}`];
|
|
7
7
|
const totalGastosOperativos = data.eerrMap.get('ACT_CN_43900_0')[`MontoEmpresa_${rango}`];
|
|
8
8
|
const gastosFinancerosFamiliares = data.eerrMap.get('ACT_CN_45002_0')[`MontoEmpresa_${rango}`];
|
|
9
|
-
const gastos =
|
|
10
|
-
|
|
9
|
+
// const gastos =
|
|
10
|
+
// Math.round((totalGastosOperativos + gastosFinancerosFamiliares) * 100) /
|
|
11
|
+
// 100
|
|
12
|
+
const gastos = Math.round(totalGastosOperativos + gastosFinancerosFamiliares);
|
|
11
13
|
const costos = data.eerrMap.get('ACT_CN_41004_0')[`MontoEmpresa_${rango}`];
|
|
12
14
|
const ingresos = data.eerrMap.get('ACT_CN_40003_0')[`MontoEmpresa_${rango}`];
|
|
13
|
-
const margenBruto =
|
|
14
|
-
|
|
15
|
-
const
|
|
15
|
+
// const margenBruto =
|
|
16
|
+
// ingresos == 0 ? 0 : Math.round((1 - costos / ingresos) * 100) / 100
|
|
17
|
+
// const ingresoEquilibrio =
|
|
18
|
+
// margenBruto == 0 ? 0 : Math.round((gastos / margenBruto) * 100) / 100
|
|
19
|
+
// const costoEquilibrio =
|
|
20
|
+
// Math.round(ingresoEquilibrio * (1 - margenBruto) * 100) / 100
|
|
21
|
+
const margenBruto = ingresos == 0 ? 0 : Math.round(1 - costos / ingresos);
|
|
22
|
+
const ingresoEquilibrio = margenBruto == 0 ? 0 : Math.round(gastos / margenBruto);
|
|
23
|
+
const costoEquilibrio = Math.round(ingresoEquilibrio * (1 - margenBruto));
|
|
16
24
|
const gastosEquilibrio = gastos;
|
|
17
25
|
const invi1 = margenBruto * 2;
|
|
18
26
|
const invi2 = invi1 / 10;
|
|
@@ -25,13 +33,23 @@ const getPuntoEquilibrio = (data) => {
|
|
|
25
33
|
GastosCostos: gastos
|
|
26
34
|
});
|
|
27
35
|
for (let i = 1; i <= 10; i++) {
|
|
28
|
-
const itemMargenBruto =
|
|
29
|
-
|
|
36
|
+
// const itemMargenBruto =
|
|
37
|
+
// Math.round((puntoEquilibrio.get(i - 1).MargenBruto + invi2) * 100) /
|
|
38
|
+
// 100
|
|
39
|
+
const itemMargenBruto = Math.round(puntoEquilibrio.get(i - 1).MargenBruto + invi2);
|
|
30
40
|
puntoEquilibrio.set(i, {
|
|
31
41
|
id: i,
|
|
32
42
|
MargenBruto: itemMargenBruto,
|
|
33
|
-
Ingresos:
|
|
34
|
-
|
|
43
|
+
// Ingresos:
|
|
44
|
+
// Math.round(
|
|
45
|
+
// (itemMargenBruto == 0 ? 0 : gastos / itemMargenBruto) * 100
|
|
46
|
+
// ) / 100,
|
|
47
|
+
// GastosCostos:
|
|
48
|
+
// Math.round(
|
|
49
|
+
// (puntoEquilibrio.get(i - 1).GastosCostos + invi3) * 100
|
|
50
|
+
// ) / 100
|
|
51
|
+
Ingresos: Math.round(itemMargenBruto == 0 ? 0 : gastos / itemMargenBruto),
|
|
52
|
+
GastosCostos: Math.round(puntoEquilibrio.get(i - 1).GastosCostos + invi3)
|
|
35
53
|
});
|
|
36
54
|
}
|
|
37
55
|
const result = {};
|
|
@@ -60,10 +60,14 @@ class Ratios {
|
|
|
60
60
|
? 0
|
|
61
61
|
: parseFloat(totalIngresos[`MontoEmpresa_${i}`]) /
|
|
62
62
|
parseFloat(totalActivos[`MontoEmpresa_${i}`]);
|
|
63
|
-
ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`] * 100) / 100
|
|
64
|
-
ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`] * 100) / 100
|
|
65
|
-
ratio3[`Monto${i}`] = Math.round(ratio3[`Monto${i}`] * 100) / 100
|
|
66
|
-
ratio4[`Monto${i}`] = Math.round(ratio4[`Monto${i}`] * 100) / 100
|
|
63
|
+
// ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`] * 100) / 100
|
|
64
|
+
// ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`] * 100) / 100
|
|
65
|
+
// ratio3[`Monto${i}`] = Math.round(ratio3[`Monto${i}`] * 100) / 100
|
|
66
|
+
// ratio4[`Monto${i}`] = Math.round(ratio4[`Monto${i}`] * 100) / 100
|
|
67
|
+
ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`]);
|
|
68
|
+
ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`]);
|
|
69
|
+
ratio3[`Monto${i}`] = Math.round(ratio3[`Monto${i}`]);
|
|
70
|
+
ratio4[`Monto${i}`] = Math.round(ratio4[`Monto${i}`]);
|
|
67
71
|
}
|
|
68
72
|
const array = [];
|
|
69
73
|
array.push(ratio1);
|
|
@@ -104,9 +108,12 @@ class Ratios {
|
|
|
104
108
|
: (totalActivoCorriente[`MontoEmpresa_${i}`] -
|
|
105
109
|
inventarios[`MontoEmpresa_${i}`]) /
|
|
106
110
|
totalPasivoCorriente[`MontoEmpresa_${i}`];
|
|
107
|
-
ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`] * 100) / 100
|
|
108
|
-
ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`] * 100) / 100
|
|
109
|
-
ratio3[`Monto${i}`] = Math.round(ratio3[`Monto${i}`] * 100) / 100
|
|
111
|
+
// ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`] * 100) / 100
|
|
112
|
+
// ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`] * 100) / 100
|
|
113
|
+
// ratio3[`Monto${i}`] = Math.round(ratio3[`Monto${i}`] * 100) / 100
|
|
114
|
+
ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`]);
|
|
115
|
+
ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`]);
|
|
116
|
+
ratio3[`Monto${i}`] = Math.round(ratio3[`Monto${i}`]);
|
|
110
117
|
}
|
|
111
118
|
const array = [];
|
|
112
119
|
array.push(ratio1);
|
|
@@ -140,8 +147,10 @@ class Ratios {
|
|
|
140
147
|
: (parseFloat(totalPasivoCorriente[`MontoEmpresa_${i}`]) /
|
|
141
148
|
parseFloat(totalPasivo[`MontoEmpresa_${i}`])) *
|
|
142
149
|
100;
|
|
143
|
-
ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`] * 100) / 100
|
|
144
|
-
ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`] * 100) / 100
|
|
150
|
+
// ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`] * 100) / 100
|
|
151
|
+
// ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`] * 100) / 100
|
|
152
|
+
ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`]);
|
|
153
|
+
ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`]);
|
|
145
154
|
}
|
|
146
155
|
const array = [];
|
|
147
156
|
array.push(ratio1);
|
|
@@ -207,11 +216,16 @@ class Ratios {
|
|
|
207
216
|
: (parseFloat(utilidadNeta[`MontoTotal_${i}`]) /
|
|
208
217
|
parseFloat(totalIngresos[`MontoTotal_${i}`])) *
|
|
209
218
|
100;
|
|
210
|
-
ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`] * 100) / 100
|
|
211
|
-
ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`] * 100) / 100
|
|
212
|
-
ratio3[`Monto${i}`] = Math.round(ratio3[`Monto${i}`] * 100) / 100
|
|
213
|
-
ratio4[`Monto${i}`] = Math.round(ratio4[`Monto${i}`] * 100) / 100
|
|
214
|
-
ratio5[`Monto${i}`] = Math.round(ratio5[`Monto${i}`] * 100) / 100
|
|
219
|
+
// ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`] * 100) / 100
|
|
220
|
+
// ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`] * 100) / 100
|
|
221
|
+
// ratio3[`Monto${i}`] = Math.round(ratio3[`Monto${i}`] * 100) / 100
|
|
222
|
+
// ratio4[`Monto${i}`] = Math.round(ratio4[`Monto${i}`] * 100) / 100
|
|
223
|
+
// ratio5[`Monto${i}`] = Math.round(ratio5[`Monto${i}`] * 100) / 100
|
|
224
|
+
ratio1[`Monto${i}`] = Math.round(ratio1[`Monto${i}`]);
|
|
225
|
+
ratio2[`Monto${i}`] = Math.round(ratio2[`Monto${i}`]);
|
|
226
|
+
ratio3[`Monto${i}`] = Math.round(ratio3[`Monto${i}`]);
|
|
227
|
+
ratio4[`Monto${i}`] = Math.round(ratio4[`Monto${i}`]);
|
|
228
|
+
ratio5[`Monto${i}`] = Math.round(ratio5[`Monto${i}`]);
|
|
215
229
|
}
|
|
216
230
|
const array = [];
|
|
217
231
|
array.push(ratio1);
|
|
@@ -91,7 +91,8 @@ class FlujoConstructor {
|
|
|
91
91
|
for (let i = 1; i <= this.rango; i++) {
|
|
92
92
|
item.MontoTotal += parseFloat(item[`Monto${i}`]);
|
|
93
93
|
}
|
|
94
|
-
item.MontoTotal = Math.round(item.MontoTotal * 100) / 100
|
|
94
|
+
// item.MontoTotal = Math.round(item.MontoTotal * 100) / 100
|
|
95
|
+
item.MontoTotal = Math.round(item.MontoTotal);
|
|
95
96
|
}
|
|
96
97
|
});
|
|
97
98
|
if (this.tipo == 'MENSUAL') {
|
|
@@ -162,8 +163,9 @@ class FlujoConstructor {
|
|
|
162
163
|
rowAcumulado[`Monto${i}`] =
|
|
163
164
|
rowTotal[`Monto${i}`] + rowAcumulado[`Monto${i - 1}`];
|
|
164
165
|
}
|
|
165
|
-
rowAcumulado[`Monto${i}`] =
|
|
166
|
-
|
|
166
|
+
// rowAcumulado[`Monto${i}`] =
|
|
167
|
+
// Math.round(rowAcumulado[`Monto${i}`] * 100) / 100
|
|
168
|
+
rowAcumulado[`Monto${i}`] = Math.round(rowAcumulado[`Monto${i}`]);
|
|
167
169
|
}
|
|
168
170
|
rowAcumulado.MontoTotal = rowAcumulado[`Monto${this.rango}`];
|
|
169
171
|
};
|
|
@@ -174,8 +176,9 @@ class FlujoConstructor {
|
|
|
174
176
|
rows.map((item) => {
|
|
175
177
|
for (let i = 1; i <= this.rango; i++) {
|
|
176
178
|
destino[`Monto${i}`] += parseFloat(item[`Monto${i}`]);
|
|
177
|
-
destino[`Monto${i}`] =
|
|
178
|
-
|
|
179
|
+
// destino[`Monto${i}`] =
|
|
180
|
+
// Math.round(destino[`Monto${i}`] * 100) / 100
|
|
181
|
+
destino[`Monto${i}`] = Math.round(destino[`Monto${i}`]);
|
|
179
182
|
}
|
|
180
183
|
});
|
|
181
184
|
};
|
|
@@ -185,8 +188,9 @@ class FlujoConstructor {
|
|
|
185
188
|
rows.map((item) => {
|
|
186
189
|
for (let i = 1; i <= this.rango; i++) {
|
|
187
190
|
destino[`Monto${i}`] = parseFloat(item[`Monto${i}`]);
|
|
188
|
-
destino[`Monto${i}`] =
|
|
189
|
-
|
|
191
|
+
// destino[`Monto${i}`] =
|
|
192
|
+
// Math.round(destino[`Monto${i}`] * 100) / 100
|
|
193
|
+
destino[`Monto${i}`] = Math.round(destino[`Monto${i}`]);
|
|
190
194
|
}
|
|
191
195
|
});
|
|
192
196
|
};
|
|
@@ -196,7 +200,8 @@ class FlujoConstructor {
|
|
|
196
200
|
const destino = this.mapObject.get(`${destinoRubro}_0`);
|
|
197
201
|
for (let i = 1; i <= this.rango; i++) {
|
|
198
202
|
destino[`Monto${i}`] = positivo[`Monto${i}`] - negativo[`Monto${i}`];
|
|
199
|
-
destino[`Monto${i}`] = Math.round(destino[`Monto${i}`] * 100) / 100
|
|
203
|
+
// destino[`Monto${i}`] = Math.round(destino[`Monto${i}`] * 100) / 100
|
|
204
|
+
destino[`Monto${i}`] = Math.round(destino[`Monto${i}`]);
|
|
200
205
|
}
|
|
201
206
|
};
|
|
202
207
|
proyectarIngreso = () => {
|
|
@@ -321,8 +326,9 @@ class FlujoConstructor {
|
|
|
321
326
|
rows.map((item) => {
|
|
322
327
|
for (let i = 1; i <= this.rango; i++) {
|
|
323
328
|
destino[`Monto${i}`] += parseFloat(item[`Monto${i}`]);
|
|
324
|
-
destino[`Monto${i}`] =
|
|
325
|
-
|
|
329
|
+
// destino[`Monto${i}`] =
|
|
330
|
+
// Math.round(destino[`Monto${i}`] * 100) / 100
|
|
331
|
+
destino[`Monto${i}`] = Math.round(destino[`Monto${i}`]);
|
|
326
332
|
}
|
|
327
333
|
});
|
|
328
334
|
};
|
|
@@ -364,8 +370,9 @@ class FlujoConstructor {
|
|
|
364
370
|
const rowOtrosIngresosA = this.mapObject.get('ACT_CNFL_70001_0');
|
|
365
371
|
for (let i = 1; i <= this.rango; i++) {
|
|
366
372
|
rowOtrosIngresosA[`Monto${i}`] = rowOtrosIngresosM.MontoTotal;
|
|
367
|
-
rowOtrosIngresosA[`Monto${i}`] =
|
|
368
|
-
|
|
373
|
+
// rowOtrosIngresosA[`Monto${i}`] =
|
|
374
|
+
// Math.round(rowOtrosIngresosA[`Monto${i}`] * 100) / 100
|
|
375
|
+
rowOtrosIngresosA[`Monto${i}`] = Math.round(rowOtrosIngresosA[`Monto${i}`]);
|
|
369
376
|
}
|
|
370
377
|
};
|
|
371
378
|
calcularGastosFamiliares = () => {
|
|
@@ -384,8 +391,9 @@ class FlujoConstructor {
|
|
|
384
391
|
rowGastosFamiliares[`Monto${i - 1}`] *
|
|
385
392
|
(1 + rowGastosFamiliares.MontoCajaPercent / 100);
|
|
386
393
|
}
|
|
387
|
-
rowGastosFamiliares[`Monto${i}`] =
|
|
388
|
-
|
|
394
|
+
// rowGastosFamiliares[`Monto${i}`] =
|
|
395
|
+
// Math.round(rowGastosFamiliares[`Monto${i}`] * 100) / 100
|
|
396
|
+
rowGastosFamiliares[`Monto${i}`] = Math.round(rowGastosFamiliares[`Monto${i}`]);
|
|
389
397
|
}
|
|
390
398
|
};
|
|
391
399
|
calcularFlujoInversiones = () => {
|
|
@@ -11,74 +11,84 @@ class BalanceEEFFStrategy {
|
|
|
11
11
|
if (!this.actividades || this.actividades.length == 0)
|
|
12
12
|
return data;
|
|
13
13
|
//Quitamos estos rubros
|
|
14
|
-
data.errr = data.eerr.filter((item) => item.RubroId !=
|
|
15
|
-
data.errr = data.eerr.filter((item) => item.RubroId !=
|
|
14
|
+
data.errr = data.eerr.filter((item) => item.RubroId != 'ACT_CN_41001');
|
|
15
|
+
data.errr = data.eerr.filter((item) => item.RubroId != 'ACT_CN_43001');
|
|
16
16
|
for (let actividad of this.actividades) {
|
|
17
|
-
anadirGrupoBalance(actividad, [
|
|
18
|
-
anadirGrupoBalance(actividad, [
|
|
19
|
-
anadirGrupoBalance(actividad, [
|
|
17
|
+
anadirGrupoBalance(actividad, ['ACT_EF_11001'], actividad.Balance, 'ACT_CN_11001', data.balance, data.balanceMap);
|
|
18
|
+
anadirGrupoBalance(actividad, ['ACT_EF_11002', 'ACT_EF_11003'], actividad.Balance, 'ACT_CN_11002', data.balance, data.balanceMap);
|
|
19
|
+
anadirGrupoBalance(actividad, ['ACT_EF_11004'], actividad.Balance, 'ACT_CN_11003', data.balance, data.balanceMap);
|
|
20
20
|
anadirGrupoBalance(actividad, [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
], actividad.Balance,
|
|
28
|
-
anadirGrupoBalance(actividad, [
|
|
29
|
-
anadirGrupoBalance(actividad, [
|
|
30
|
-
anadirGrupoBalance(actividad, [
|
|
21
|
+
'ACT_EF_11005',
|
|
22
|
+
'ACT_EF_11006',
|
|
23
|
+
'ACT_EF_11008',
|
|
24
|
+
'ACT_EF_11009',
|
|
25
|
+
'ACT_EF_11010',
|
|
26
|
+
'ACT_EF_11011'
|
|
27
|
+
], actividad.Balance, 'ACT_CN_11004', data.balance, data.balanceMap, true);
|
|
28
|
+
anadirGrupoBalance(actividad, ['ACT_EF_12005', 'ACT_EF_12006'], actividad.Balance, 'ACT_CN_12001', data.balance, data.balanceMap);
|
|
29
|
+
anadirGrupoBalance(actividad, ['ACT_EF_12001', 'ACT_EF_12002', 'ACT_EF_12007'], actividad.Balance, 'ACT_CN_12002', data.balance, data.balanceMap);
|
|
30
|
+
anadirGrupoBalance(actividad, ['ACT_EF_12003', 'ACT_EF_12009'], actividad.Balance, 'ACT_CN_12004', data.balance, data.balanceMap);
|
|
31
31
|
anadirGrupoBalance(actividad, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
], actividad.Balance,
|
|
32
|
+
'ACT_EF_12004',
|
|
33
|
+
'ACT_EF_12008',
|
|
34
|
+
'ACT_EF_12010',
|
|
35
|
+
'ACT_EF_12011',
|
|
36
|
+
'ACT_EF_12012'
|
|
37
|
+
], actividad.Balance, 'ACT_CN_12005', data.balance, data.balanceMap, true);
|
|
38
38
|
anadirGrupoBalance(actividad, [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
], actividad.Balance,
|
|
45
|
-
anadirGrupoBalance(actividad, ["ACT_EF_21005", "ACT_EF_21006", "ACT_EF_21007", "ACT_EF_21009"], actividad.Balance, "ACT_CN_21002", data.balance, data.balanceMap);
|
|
46
|
-
anadirGrupoBalance(actividad, ["ACT_EF_21010", "ACT_EF_21011", "ACT_EF_21012"], actividad.Balance, "ACT_CN_21003", data.balance, data.balanceMap, true);
|
|
47
|
-
anadirGrupoBalance(actividad, ["ACT_EF_22001", "ACT_EF_22002", "ACT_EF_22003"], actividad.Balance, "ACT_CN_22001", data.balance, data.balanceMap);
|
|
48
|
-
anadirGrupoBalance(actividad, ["ACT_EF_22004", "ACT_EF_22005", "ACT_EF_22006", "ACT_EF_22007"], actividad.Balance, "ACT_CN_22002", data.balance, data.balanceMap);
|
|
49
|
-
anadirGrupoBalance(actividad, ["ACT_EF_22008", "ACT_EF_22009", "ACT_EF_22010"], actividad.Balance, "ACT_CN_22003", data.balance, data.balanceMap, true);
|
|
50
|
-
anadirGrupoBalance(actividad, ["ACT_EF_31001", "ACT_EF_31002"], actividad.Balance, "ACT_CN_30001", data.balance, data.balanceMap);
|
|
39
|
+
'ACT_EF_21001',
|
|
40
|
+
'ACT_EF_21002',
|
|
41
|
+
'ACT_EF_21003',
|
|
42
|
+
'ACT_EF_21004',
|
|
43
|
+
'ACT_EF_21008'
|
|
44
|
+
], actividad.Balance, 'ACT_CN_21001', data.balance, data.balanceMap);
|
|
51
45
|
anadirGrupoBalance(actividad, [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
], actividad.Balance,
|
|
58
|
-
anadirGrupoBalance(actividad, [
|
|
59
|
-
anadirGrupoBalance(actividad, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
46
|
+
'ACT_EF_21005',
|
|
47
|
+
'ACT_EF_21006',
|
|
48
|
+
'ACT_EF_21007',
|
|
49
|
+
'ACT_EF_21009'
|
|
50
|
+
], actividad.Balance, 'ACT_CN_21002', data.balance, data.balanceMap);
|
|
51
|
+
anadirGrupoBalance(actividad, ['ACT_EF_21010', 'ACT_EF_21011', 'ACT_EF_21012'], actividad.Balance, 'ACT_CN_21003', data.balance, data.balanceMap, true);
|
|
52
|
+
anadirGrupoBalance(actividad, ['ACT_EF_22001', 'ACT_EF_22002', 'ACT_EF_22003'], actividad.Balance, 'ACT_CN_22001', data.balance, data.balanceMap);
|
|
53
|
+
anadirGrupoBalance(actividad, [
|
|
54
|
+
'ACT_EF_22004',
|
|
55
|
+
'ACT_EF_22005',
|
|
56
|
+
'ACT_EF_22006',
|
|
57
|
+
'ACT_EF_22007'
|
|
58
|
+
], actividad.Balance, 'ACT_CN_22002', data.balance, data.balanceMap);
|
|
59
|
+
anadirGrupoBalance(actividad, ['ACT_EF_22008', 'ACT_EF_22009', 'ACT_EF_22010'], actividad.Balance, 'ACT_CN_22003', data.balance, data.balanceMap, true);
|
|
60
|
+
anadirGrupoBalance(actividad, ['ACT_EF_31001', 'ACT_EF_31002'], actividad.Balance, 'ACT_CN_30001', data.balance, data.balanceMap);
|
|
61
|
+
anadirGrupoBalance(actividad, [
|
|
62
|
+
'ACT_EF_31003',
|
|
63
|
+
'ACT_EF_31004',
|
|
64
|
+
'ACT_EF_31005',
|
|
65
|
+
'ACT_EF_31006',
|
|
66
|
+
'ACT_EF_31007'
|
|
67
|
+
], actividad.Balance, 'ACT_CN_30002', data.balance, data.balanceMap, true);
|
|
68
|
+
anadirGrupoBalance(actividad, ['ACT_EF_41000'], actividad.EERR, 'ACT_CN_40001', data.eerr, data.eerrMap);
|
|
69
|
+
anadirGrupoBalance(actividad, ['ACT_EF_42001'], actividad.EERR, 'ACT_CN_41002', data.eerr, data.eerrMap);
|
|
70
|
+
anadirGrupoBalance(actividad, ['ACT_EF_43001', 'ACT_EF_43002'], actividad.EERR, 'ACT_CN_43002', data.eerr, data.eerrMap);
|
|
71
|
+
anadirGrupoBalance(actividad, ['ACT_EF_44001', 'ACT_EF_44002'], actividad.EERR, 'ACT_CN_43003', data.eerr, data.eerrMap);
|
|
72
|
+
anadirGrupoBalance(actividad, ['ACT_EF_44004', 'ACT_EF_44007'], actividad.EERR, 'ACT_CN_43004', data.eerr, data.eerrMap, true);
|
|
73
|
+
anadirGrupoBalance(actividad, ['ACT_EF_44003', 'ACT_EF_44005', 'ACT_EF_44006'], actividad.EERR, 'ACT_CN_45001', data.eerr, data.eerrMap, true);
|
|
74
|
+
anadirGrupoBalance(actividad, ['ACT_EF_45001'], actividad.EERR, 'ACT_CN_46001', data.eerr, data.eerrMap);
|
|
65
75
|
}
|
|
66
|
-
sumarizarCuentas(
|
|
67
|
-
sumarizarCuentas(
|
|
68
|
-
sumarizarCuentas(
|
|
69
|
-
sumarizarCuentas(
|
|
70
|
-
sumarizarCuentas(
|
|
71
|
-
sumarizarCuentas(
|
|
72
|
-
sumarizarCuentas(
|
|
73
|
-
sumarizarCuentas(
|
|
74
|
-
sumarizarCuentas(
|
|
75
|
-
sumarizarCuentas(
|
|
76
|
-
sumarizarCuentas(
|
|
77
|
-
sumarizarCuentas(
|
|
78
|
-
sumarizarCuentas(
|
|
79
|
-
sumarizarCuentas(
|
|
80
|
-
sumarizarCuentas(
|
|
81
|
-
sumarizarCuentas(
|
|
76
|
+
sumarizarCuentas('ACT_CN_11001', data, data.balanceMap);
|
|
77
|
+
sumarizarCuentas('ACT_CN_11002', data, data.balanceMap);
|
|
78
|
+
sumarizarCuentas('ACT_CN_11003', data, data.balanceMap);
|
|
79
|
+
sumarizarCuentas('ACT_CN_12001', data, data.balanceMap);
|
|
80
|
+
sumarizarCuentas('ACT_CN_12002', data, data.balanceMap);
|
|
81
|
+
sumarizarCuentas('ACT_CN_12004', data, data.balanceMap);
|
|
82
|
+
sumarizarCuentas('ACT_CN_21001', data, data.balanceMap);
|
|
83
|
+
sumarizarCuentas('ACT_CN_21002', data, data.balanceMap);
|
|
84
|
+
sumarizarCuentas('ACT_CN_22001', data, data.balanceMap);
|
|
85
|
+
sumarizarCuentas('ACT_CN_22002', data, data.balanceMap);
|
|
86
|
+
sumarizarCuentas('ACT_CN_30001', data, data.balanceMap);
|
|
87
|
+
sumarizarCuentas('ACT_CN_40001', data, data.eerrMap);
|
|
88
|
+
sumarizarCuentas('ACT_CN_41002', data, data.eerrMap);
|
|
89
|
+
sumarizarCuentas('ACT_CN_43002', data, data.eerrMap);
|
|
90
|
+
sumarizarCuentas('ACT_CN_43003', data, data.eerrMap);
|
|
91
|
+
sumarizarCuentas('ACT_CN_46001', data, data.eerrMap);
|
|
82
92
|
data.camposCalculadosDefinidos = this.camposCalculadosDefinidos;
|
|
83
93
|
return data;
|
|
84
94
|
}
|
|
@@ -96,8 +106,10 @@ const anadirGrupoBalance = (actividad, rubros, grupoActividad, rubroDestino, dat
|
|
|
96
106
|
else {
|
|
97
107
|
for (let i = 1; i <= rango; i++) {
|
|
98
108
|
acc[`Gestion${i}`] +=
|
|
99
|
-
parseFloat(acc[`Gestion${i}`]) +
|
|
100
|
-
|
|
109
|
+
parseFloat(acc[`Gestion${i}`]) +
|
|
110
|
+
parseFloat(item[`Gestion${i}`]);
|
|
111
|
+
// acc[`Gestion${i}`] = Math.round(acc[`Gestion${i}`] * 100) / 100;
|
|
112
|
+
acc[`Gestion${i}`] = Math.round(acc[`Gestion${i}`]);
|
|
101
113
|
}
|
|
102
114
|
}
|
|
103
115
|
return acc;
|
|
@@ -111,9 +123,10 @@ const anadirGrupoBalance = (actividad, rubros, grupoActividad, rubroDestino, dat
|
|
|
111
123
|
copy.MontoEmpresa = 0;
|
|
112
124
|
copy.MontoFamiliar = 0;
|
|
113
125
|
copy.Correlativo = i;
|
|
114
|
-
copy.Clasificador =
|
|
115
|
-
copy.MontoEmpresa =
|
|
116
|
-
|
|
126
|
+
copy.Clasificador = 'CT';
|
|
127
|
+
// copy.MontoEmpresa =
|
|
128
|
+
// Math.round(parseFloat(sumado[`Gestion${i}`]) * 100) / 100;
|
|
129
|
+
copy.MontoEmpresa = Math.round(parseFloat(sumado[`Gestion${i}`]));
|
|
117
130
|
data.push(copy);
|
|
118
131
|
map.set(`${rubroDestino}_${actividad.ActividadEconomicaId}_${i}`, copy);
|
|
119
132
|
}
|
|
@@ -135,24 +148,28 @@ const sumarizarCuentas = (rubro, data, map) => {
|
|
|
135
148
|
cuentaDestino.MontoEmpresa += cuentaOrigen.MontoEmpresa;
|
|
136
149
|
if (original.MontoFamiliar == 0)
|
|
137
150
|
cuentaDestino.MontoFamiliar += cuentaOrigen.MontoFamiliar;
|
|
138
|
-
cuentaDestino.MontoEmpresa =
|
|
139
|
-
|
|
140
|
-
cuentaDestino.MontoFamiliar =
|
|
141
|
-
|
|
151
|
+
// cuentaDestino.MontoEmpresa =
|
|
152
|
+
// Math.round(cuentaDestino.MontoEmpresa * 100) / 100;
|
|
153
|
+
// cuentaDestino.MontoFamiliar =
|
|
154
|
+
// Math.round(cuentaDestino.MontoFamiliar * 100) / 100;
|
|
155
|
+
cuentaDestino.MontoEmpresa = Math.round(cuentaDestino.MontoEmpresa);
|
|
156
|
+
cuentaDestino.MontoFamiliar = Math.round(cuentaDestino.MontoFamiliar);
|
|
142
157
|
}
|
|
143
158
|
}
|
|
144
159
|
};
|
|
145
160
|
const getCuentasCopy = (data, rubroId, map) => {
|
|
146
161
|
if (!data.eerr || data.eerr.length == 0)
|
|
147
|
-
throw new Error(
|
|
162
|
+
throw new Error('Debe ingresar cuentas EERR');
|
|
148
163
|
let originalData = new Map();
|
|
149
164
|
const rango = data.eerr[0].Rango;
|
|
150
165
|
for (let i = 1; i <= rango; i++) {
|
|
151
166
|
let cuentaIngreso = map.get(`${rubroId}_${i}`);
|
|
152
|
-
cuentaIngreso.MontoEmpresa =
|
|
153
|
-
|
|
154
|
-
cuentaIngreso.MontoFamiliar =
|
|
155
|
-
|
|
167
|
+
// cuentaIngreso.MontoEmpresa =
|
|
168
|
+
// Math.round(parseFloat(cuentaIngreso.MontoEmpresa) * 100) / 100;
|
|
169
|
+
// cuentaIngreso.MontoFamiliar =
|
|
170
|
+
// Math.round(parseFloat(cuentaIngreso.MontoFamiliar) * 100) / 100;
|
|
171
|
+
cuentaIngreso.MontoEmpresa = Math.round(parseFloat(cuentaIngreso.MontoEmpresa));
|
|
172
|
+
cuentaIngreso.MontoFamiliar = Math.round(parseFloat(cuentaIngreso.MontoFamiliar));
|
|
156
173
|
originalData.set(`${rubroId}_${i}`, { ...cuentaIngreso });
|
|
157
174
|
}
|
|
158
175
|
return originalData;
|
|
@@ -40,8 +40,11 @@ class AdministacionLineas {
|
|
|
40
40
|
0;
|
|
41
41
|
const monto2 = items.find((item) => item.RubroId === rubroId3)?.Monto1 ||
|
|
42
42
|
0;
|
|
43
|
-
linea.monto =
|
|
44
|
-
|
|
43
|
+
// linea.monto =
|
|
44
|
+
// Math.round(
|
|
45
|
+
// (parseFloat(monto1.value) + parseFloat(monto2.value)) * 100
|
|
46
|
+
// ) / 100
|
|
47
|
+
linea.monto = Math.round(parseFloat(monto1.value) + parseFloat(monto2.value));
|
|
45
48
|
linea = this.mapDataToLineas(linea);
|
|
46
49
|
linea.saldo = linea.monto - linea.usado;
|
|
47
50
|
result.push(linea);
|
|
@@ -69,8 +72,11 @@ class AdministacionLineas {
|
|
|
69
72
|
?.Descripcion || '';
|
|
70
73
|
const monto1 = items.find((item) => item.RubroId === rubroId)?.Monto1 || 0;
|
|
71
74
|
const monto2 = items.find((item) => item.RubroId === rubroId)?.Monto1 || 0;
|
|
72
|
-
linea.monto =
|
|
73
|
-
|
|
75
|
+
// linea.monto =
|
|
76
|
+
// Math.round(
|
|
77
|
+
// parseFloat(monto1.value) + parseFloat(monto2.value) * 100
|
|
78
|
+
// ) / 100
|
|
79
|
+
linea.monto = Math.round(parseFloat(monto1.value) + parseFloat(monto2.value));
|
|
74
80
|
linea = this.mapDataToLineas(linea);
|
|
75
81
|
linea.saldo = linea.monto - linea.usado;
|
|
76
82
|
linea.interes =
|
|
@@ -89,8 +95,9 @@ class AdministacionLineas {
|
|
|
89
95
|
linea.montoConVenc = finded.montoConVenc || 0;
|
|
90
96
|
linea.tasa = finded?.tasa || 0;
|
|
91
97
|
linea.interes = finded?.interes || 0;
|
|
92
|
-
linea.montoConVenc =
|
|
93
|
-
|
|
98
|
+
// linea.montoConVenc =
|
|
99
|
+
// Math.round(parseFloat(linea.montoConVenc) * 100) / 100
|
|
100
|
+
linea.montoConVenc = Math.round(parseFloat(linea.montoConVenc));
|
|
94
101
|
linea.tasa = Math.round(parseFloat(linea.tasa) * 100) / 100;
|
|
95
102
|
linea.interes = Math.round(parseFloat(linea.interes) * 100) / 100;
|
|
96
103
|
return linea;
|
|
@@ -8,8 +8,10 @@ class AdministracionLineasManuales {
|
|
|
8
8
|
getLineasManuales() {
|
|
9
9
|
if (this.lineas && this.lineas.length > 0) {
|
|
10
10
|
for (let linea of this.lineas) {
|
|
11
|
-
linea.monto = Math.round(parseFloat(linea.monto) *
|
|
12
|
-
linea.usado = Math.round(parseFloat(linea.usado) *
|
|
11
|
+
// linea.monto = Math.round( parseFloat( linea.monto ) *100)/100
|
|
12
|
+
// linea.usado = Math.round( parseFloat( linea.usado ) *100)/100
|
|
13
|
+
linea.monto = Math.round(parseFloat(linea.monto));
|
|
14
|
+
linea.usado = Math.round(parseFloat(linea.usado));
|
|
13
15
|
linea.saldo = linea.monto - linea.usado;
|
|
14
16
|
}
|
|
15
17
|
}
|
|
@@ -85,8 +85,9 @@ class AplicacionesCuadroAlternativo {
|
|
|
85
85
|
item.Secuencia == parseInt(codes[3]));
|
|
86
86
|
nuevo[`Monto${i}`] =
|
|
87
87
|
deudaLinea[`Monto${i}`] - deudaLinea[`Monto${i - 1}`];
|
|
88
|
-
nuevo[`Monto${i}`] =
|
|
89
|
-
|
|
88
|
+
// nuevo[`Monto${i}`] =
|
|
89
|
+
// Math.round(parseFloat(nuevo[`Monto${i}`]) * 100) / 100
|
|
90
|
+
nuevo[`Monto${i}`] = Math.round(parseFloat(nuevo[`Monto${i}`]));
|
|
90
91
|
row[`Monto${i}`] += nuevo[`Monto${i}`];
|
|
91
92
|
}
|
|
92
93
|
this.result.push(nuevo);
|
|
@@ -113,9 +114,10 @@ class AplicacionesCuadroAlternativo {
|
|
|
113
114
|
nuevo[`Monto${i}`] =
|
|
114
115
|
parseFloat(debt[`Monto${i}`]) +
|
|
115
116
|
parseFloat(companion[`Monto${i}`]);
|
|
116
|
-
nuevo[`Monto${i}`] =
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
// nuevo[`Monto${i}`] =
|
|
118
|
+
// Math.round(parseFloat(nuevo[`Monto${i}`]) * 100) /
|
|
119
|
+
// 100
|
|
120
|
+
nuevo[`Monto${i}`] = Math.round(parseFloat(nuevo[`Monto${i}`]));
|
|
119
121
|
}
|
|
120
122
|
row[`Monto${i}`] += nuevo[`Monto${i}`];
|
|
121
123
|
}
|
|
@@ -177,8 +179,9 @@ class AplicacionesCuadroAlternativo {
|
|
|
177
179
|
parseFloat(companion[`Monto${i - 1}`]) +
|
|
178
180
|
parseFloat(debt[`Monto${i}`]);
|
|
179
181
|
}
|
|
180
|
-
nuevo[`Monto${i}`] =
|
|
181
|
-
|
|
182
|
+
// nuevo[`Monto${i}`] =
|
|
183
|
+
// Math.round(parseFloat(nuevo[`Monto${i}`]) * 100) / 100
|
|
184
|
+
nuevo[`Monto${i}`] = Math.round(parseFloat(nuevo[`Monto${i}`]));
|
|
182
185
|
row[`Monto${i}`] += nuevo[`Monto${i}`];
|
|
183
186
|
}
|
|
184
187
|
}
|
|
@@ -15,8 +15,9 @@ class DeudasStrategy {
|
|
|
15
15
|
cleanNumber = (data) => {
|
|
16
16
|
if (!data)
|
|
17
17
|
return 0;
|
|
18
|
+
// else return Math.round(parseFloat(data) * 100) / 100
|
|
18
19
|
else
|
|
19
|
-
return Math.round(parseFloat(data)
|
|
20
|
+
return Math.round(parseFloat(data));
|
|
20
21
|
};
|
|
21
22
|
calcularDeuda(params) {
|
|
22
23
|
let i = 1;
|
|
@@ -31,8 +32,9 @@ class DeudasStrategy {
|
|
|
31
32
|
this.cleanNumber(row2[`Monto${j - 1}`])) *
|
|
32
33
|
this.cleanNumber(row3.Variable)) /
|
|
33
34
|
100;
|
|
34
|
-
row3[`Monto${j}`] =
|
|
35
|
-
|
|
35
|
+
// row3[`Monto${j}`] =
|
|
36
|
+
// Math.round(row3[`Monto${j}`] * 100) / 100
|
|
37
|
+
row3[`Monto${j}`] = Math.round(row3[`Monto${j}`]);
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
i++;
|
|
@@ -50,8 +52,9 @@ class DeudasStrategy {
|
|
|
50
52
|
(this.cleanNumber(row1[`Monto${j}`]) *
|
|
51
53
|
this.cleanNumber(row2[`Monto${j}`])) /
|
|
52
54
|
100;
|
|
53
|
-
row3[`Monto${j}`] =
|
|
54
|
-
|
|
55
|
+
// row3[`Monto${j}`] =
|
|
56
|
+
// Math.round(row3[`Monto${j}`] * 100) / 100
|
|
57
|
+
row3[`Monto${j}`] = Math.round(row3[`Monto${j}`]);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
i++;
|
|
@@ -80,7 +83,8 @@ class DeudasStrategy {
|
|
|
80
83
|
(this.cleanNumber(row1[`Monto${j - 1}`]) *
|
|
81
84
|
this.cleanNumber(row2[`Monto${j - 1}`])) /
|
|
82
85
|
100;
|
|
83
|
-
row3[`Monto${j}`] = Math.round(row3[`Monto${j}`] * 100) / 100
|
|
86
|
+
// row3[`Monto${j}`] = Math.round(row3[`Monto${j}`] * 100) / 100
|
|
87
|
+
row3[`Monto${j}`] = Math.round(row3[`Monto${j}`]);
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
}
|
|
@@ -162,7 +162,8 @@ class ResumenFinanciamiento {
|
|
|
162
162
|
acc += parsedValue;
|
|
163
163
|
return acc;
|
|
164
164
|
}, 0);
|
|
165
|
-
row[`Monto${i}`] = Math.round(row[`Monto${i}`] * 100) / 100
|
|
165
|
+
// row[`Monto${i}`] = Math.round(row[`Monto${i}`] * 100) / 100
|
|
166
|
+
row[`Monto${i}`] = Math.round(row[`Monto${i}`]);
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
169
|
generateKOBDP(row) {
|
|
@@ -9,28 +9,28 @@ class FlujoProyectadoEEFFStrategy {
|
|
|
9
9
|
if (!this.actividades || this.actividades.length == 0)
|
|
10
10
|
return data;
|
|
11
11
|
for (let actividad of this.actividades) {
|
|
12
|
-
agregarGrupo([
|
|
13
|
-
agregarGrupo([
|
|
14
|
-
agregarGrupo([
|
|
15
|
-
agregarGrupo([
|
|
16
|
-
agregarGrupo([
|
|
12
|
+
agregarGrupo(['BP_ACT_EF_41000'], actividad, actividad.BalanceProyectado.EERR, 'ACT_CNFL_40001', data);
|
|
13
|
+
agregarGrupo(['BP_ACT_EF_42001'], actividad, actividad.BalanceProyectado.EERR, 'ACT_CNFL_50001', data);
|
|
14
|
+
agregarGrupo(['BP_ACT_EF_43001'], actividad, actividad.BalanceProyectado.EERR, 'ACT_CNFL_60001', data);
|
|
15
|
+
agregarGrupo(['BP_ACT_EF_43002'], actividad, actividad.BalanceProyectado.EERR, 'ACT_CNFL_60002', data);
|
|
16
|
+
agregarGrupo(['BP_ACT_EF_44001', 'BP_ACT_EF_44002'], actividad, actividad.BalanceProyectado.EERR, 'ACT_CNFL_61001', data);
|
|
17
17
|
agregarGrupo([
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
], actividad, actividad.BalanceProyectado.EERR,
|
|
23
|
-
agregarGrupo([
|
|
24
|
-
agregarGrupo([
|
|
25
|
-
agregarGrupo([
|
|
18
|
+
'BP_ACT_EF_44002.1',
|
|
19
|
+
'BP_ACT_EF_44003',
|
|
20
|
+
'BP_ACT_EF_44005',
|
|
21
|
+
'BP_ACT_EF_44006'
|
|
22
|
+
], actividad, actividad.BalanceProyectado.EERR, 'ACT_CNFL_70001', data);
|
|
23
|
+
agregarGrupo(['BP_ACT_EF_44005.1', 'BP_ACT_EF_44004', 'BP_ACT_EF_44007'], actividad, actividad.BalanceProyectado.EERR, 'ACT_CNFL_70002', data);
|
|
24
|
+
agregarGrupo(['BP_ACT_FJ_10501', 'BP_ACT_FJ_10502', 'BP_ACT_FJ_10505'], actividad, actividad.BalanceProyectado.FlujoCaja, 'ACT_CNFL_80001', data);
|
|
25
|
+
agregarGrupo(['BP_ACT_FJ_10504', 'BP_ACT_FJ_10506', 'BP_ACT_FJ_10507'], actividad, actividad.BalanceProyectado.FlujoCaja, 'ACT_CNFL_80002', data);
|
|
26
26
|
}
|
|
27
|
-
sumarizarCuenta(
|
|
28
|
-
sumarizarCuenta(
|
|
29
|
-
sumarizarCuenta(
|
|
30
|
-
sumarizarCuenta(
|
|
31
|
-
sumarizarCuenta(
|
|
32
|
-
sumarizarCuenta(
|
|
33
|
-
sumarizarCuenta(
|
|
27
|
+
sumarizarCuenta('ACT_CNFL_40001', data);
|
|
28
|
+
sumarizarCuenta('ACT_CNFL_50001', data);
|
|
29
|
+
sumarizarCuenta('ACT_CNFL_60001', data);
|
|
30
|
+
sumarizarCuenta('ACT_CNFL_70001', data);
|
|
31
|
+
sumarizarCuenta('ACT_CNFL_70002', data);
|
|
32
|
+
sumarizarCuenta('ACT_CNFL_80001', data);
|
|
33
|
+
sumarizarCuenta('ACT_CNFL_80002', data);
|
|
34
34
|
return data;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -38,7 +38,7 @@ exports.default = FlujoProyectadoEEFFStrategy;
|
|
|
38
38
|
const agregarGrupo = (rubros, actividad, grupoActividad, rubroDestino, data) => {
|
|
39
39
|
const rango = data.DatosEvaluacion.CantidadProyeccion;
|
|
40
40
|
if (!rango)
|
|
41
|
-
throw new Error(
|
|
41
|
+
throw new Error('No existe el rango en la evaluacion');
|
|
42
42
|
const sumado = grupoActividad
|
|
43
43
|
.filter((item) => rubros.includes(item.RubroId))
|
|
44
44
|
.reduce((acc, item) => {
|
|
@@ -58,8 +58,10 @@ const agregarGrupo = (rubros, actividad, grupoActividad, rubroDestino, data) =>
|
|
|
58
58
|
else
|
|
59
59
|
item[`Gestion${i}`] = item[`Gestion${i}`].replace(',', '');
|
|
60
60
|
acc[`Gestion${i}`] +=
|
|
61
|
-
parseFloat(acc[`Gestion${i}`]) +
|
|
62
|
-
|
|
61
|
+
parseFloat(acc[`Gestion${i}`]) +
|
|
62
|
+
parseFloat(item[`Gestion${i}`]);
|
|
63
|
+
// acc[`Gestion${i}`] = Math.round(acc[`Gestion${i}`] * 100) / 100;
|
|
64
|
+
acc[`Gestion${i}`] = Math.round(acc[`Gestion${i}`]);
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
return acc;
|
|
@@ -67,14 +69,15 @@ const agregarGrupo = (rubros, actividad, grupoActividad, rubroDestino, data) =>
|
|
|
67
69
|
const rubro = data.FlujoProyectadoAnual[0];
|
|
68
70
|
let row = { ...rubro };
|
|
69
71
|
row.RubroId = rubroDestino;
|
|
70
|
-
row.Clasificador =
|
|
72
|
+
row.Clasificador = 'CT';
|
|
71
73
|
row.Descripcion = `Actividad: ${actividad.Descripcion}`;
|
|
72
74
|
row.Editable = false;
|
|
73
75
|
row.UUID = `${rubroDestino}_${actividad.ActividadEconomicaId}`;
|
|
74
76
|
row.RubroId = `${rubroDestino}.1`;
|
|
75
77
|
for (let i = 1; i <= rango; i++) {
|
|
76
|
-
row[`Monto${i}`] =
|
|
77
|
-
|
|
78
|
+
// row[`Monto${i}`] =
|
|
79
|
+
// Math.round(parseFloat(sumado[`Gestion${i}`]) * 100) / 100;
|
|
80
|
+
row[`Monto${i}`] = Math.round(parseFloat(sumado[`Gestion${i}`]));
|
|
78
81
|
}
|
|
79
82
|
const existente = data.FlujoProyectadoAnual.findIndex((el) => el.UUID === row.UUID);
|
|
80
83
|
if (existente >= 0) {
|
|
@@ -42,12 +42,14 @@ const procesarConsolidado = (consolidado, data, tipoConsolidado, map) => {
|
|
|
42
42
|
copy.Correlativo = i;
|
|
43
43
|
copy.Clasificador = 'SBCT';
|
|
44
44
|
copy.IndicadorABM = 'N';
|
|
45
|
-
copy.MontoEmpresa =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
copy.MontoFamiliar =
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
// copy.MontoEmpresa =
|
|
46
|
+
// Math.round(parseFloat(rubro[`MontoEmpresa_${i}`]) * 100) /
|
|
47
|
+
// 100
|
|
48
|
+
// copy.MontoFamiliar =
|
|
49
|
+
// Math.round(parseFloat(rubro[`MontoFamiliar_${i}`]) * 100) /
|
|
50
|
+
// 100
|
|
51
|
+
copy.MontoEmpresa = Math.round(parseFloat(rubro[`MontoEmpresa_${i}`]));
|
|
52
|
+
copy.MontoFamiliar = Math.round(parseFloat(rubro[`MontoFamiliar_${i}`]));
|
|
51
53
|
data.push(copy);
|
|
52
54
|
const mapKey = `${copy.RubroId}_${tipoConsolidado}_${i}`;
|
|
53
55
|
if (map.has(mapKey)) {
|
|
@@ -27,8 +27,10 @@ const getAvaluo = (avaluo, propiedades) => {
|
|
|
27
27
|
sumatoria = sumatoria.map((item) => {
|
|
28
28
|
return {
|
|
29
29
|
...item,
|
|
30
|
-
Cantidad: Math.round(item.Cantidad * 100) / 100,
|
|
31
|
-
PrecioVenta: Math.round((item.Precio / cantidad) * 100) / 100
|
|
30
|
+
// Cantidad: Math.round(item.Cantidad * 100) / 100,
|
|
31
|
+
// PrecioVenta: Math.round((item.Precio / cantidad) * 100) / 100
|
|
32
|
+
Cantidad: Math.round(item.Cantidad),
|
|
33
|
+
PrecioVenta: Math.round((item.Precio / cantidad))
|
|
32
34
|
};
|
|
33
35
|
});
|
|
34
36
|
avaluo = avaluo.map((item) => {
|
|
@@ -287,7 +287,8 @@ const addIngresosM = (actividad, data) => {
|
|
|
287
287
|
row.UUID = `${RUBRO_INGRESO}_${actividad.Desarrollo.ActividadEconomicaId}`;
|
|
288
288
|
row.RubroId = `${RUBRO_INGRESO}.1`;
|
|
289
289
|
for (let i = 1; i <= 12; i++) {
|
|
290
|
-
row[`Monto${i}`] = Math.round(parseFloat(ingresos[`C${i}`]) * 100) / 100
|
|
290
|
+
// row[`Monto${i}`] = Math.round(parseFloat(ingresos[`C${i}`]) * 100) / 100
|
|
291
|
+
row[`Monto${i}`] = Math.round(parseFloat(ingresos[`C${i}`]));
|
|
291
292
|
}
|
|
292
293
|
const existente = data.FlujoProyectadoMensual.findIndex((el) => el.UUID === row.UUID);
|
|
293
294
|
if (existente >= 0) {
|
|
@@ -309,7 +310,8 @@ const addCostosM = (actividad, data) => {
|
|
|
309
310
|
row.UUID = `${RUBRO_COSTOS}_${actividad.Desarrollo.ActividadEconomicaId}`;
|
|
310
311
|
row.RubroId = `${RUBRO_COSTOS}.1`;
|
|
311
312
|
for (let i = 1; i <= 12; i++) {
|
|
312
|
-
row[`Monto${i}`] = Math.round(parseFloat(costos[`C-${i}`]) * 100) / 100
|
|
313
|
+
// row[`Monto${i}`] = Math.round(parseFloat(costos[`C-${i}`]) * 100) / 100
|
|
314
|
+
row[`Monto${i}`] = Math.round(parseFloat(costos[`C-${i}`]));
|
|
313
315
|
}
|
|
314
316
|
const existente = data.FlujoProyectadoMensual.findIndex((el) => el.UUID === row.UUID);
|
|
315
317
|
if (existente >= 0) {
|
|
@@ -331,8 +333,9 @@ const addGastosM = (actividad, data) => {
|
|
|
331
333
|
row.UUID = `${RUBRO_GASTOS}_${actividad.Desarrollo.ActividadEconomicaId}`;
|
|
332
334
|
row.RubroId = `${RUBRO_GASTOS}.1`;
|
|
333
335
|
for (let i = 1; i <= 12; i++) {
|
|
334
|
-
row[`Monto${i}`] =
|
|
335
|
-
|
|
336
|
+
// row[`Monto${i}`] =
|
|
337
|
+
// Math.round(parseFloat(otrosGastos.GastosOperativos) * 100) / 100
|
|
338
|
+
row[`Monto${i}`] = Math.round(parseFloat(otrosGastos.GastosOperativos));
|
|
336
339
|
}
|
|
337
340
|
const existente = data.FlujoProyectadoMensual.findIndex((el) => el.UUID === row.UUID);
|
|
338
341
|
if (existente >= 0) {
|
|
@@ -398,7 +401,9 @@ const calcularOtrosGastos = (gastos, tipoImporte = 'Mensual') => {
|
|
|
398
401
|
return acc;
|
|
399
402
|
}, 0);
|
|
400
403
|
return {
|
|
401
|
-
GastosOperativos: Math.round(gastosOperativos * 100) / 100,
|
|
402
|
-
GastosFamiliares: Math.round(gastosFamiliares * 100) / 100
|
|
404
|
+
// GastosOperativos: Math.round(gastosOperativos * 100) / 100,
|
|
405
|
+
// GastosFamiliares: Math.round(gastosFamiliares * 100) / 100
|
|
406
|
+
GastosOperativos: Math.round(gastosOperativos),
|
|
407
|
+
GastosFamiliares: Math.round(gastosFamiliares)
|
|
403
408
|
};
|
|
404
409
|
};
|
|
@@ -60,10 +60,12 @@ const getCuentasCopy = (data, rubroId) => {
|
|
|
60
60
|
const rango = data.eerr[0].Rango;
|
|
61
61
|
for (let i = 1; i <= rango; i++) {
|
|
62
62
|
const cuentaIngreso = data.eerrMap.get(`${rubroId}_${i}`);
|
|
63
|
-
cuentaIngreso.MontoEmpresa =
|
|
64
|
-
|
|
65
|
-
cuentaIngreso.MontoFamiliar =
|
|
66
|
-
|
|
63
|
+
// cuentaIngreso.MontoEmpresa =
|
|
64
|
+
// Math.round(parseFloat(cuentaIngreso.MontoEmpresa) * 100) / 100
|
|
65
|
+
// cuentaIngreso.MontoFamiliar =
|
|
66
|
+
// Math.round(parseFloat(cuentaIngreso.MontoFamiliar) * 100) / 100
|
|
67
|
+
cuentaIngreso.MontoEmpresa = Math.round(parseFloat(cuentaIngreso.MontoEmpresa));
|
|
68
|
+
cuentaIngreso.MontoFamiliar = Math.round(parseFloat(cuentaIngreso.MontoFamiliar));
|
|
67
69
|
originalData.set(`${rubroId}_${i}`, { ...cuentaIngreso });
|
|
68
70
|
}
|
|
69
71
|
return originalData;
|
|
@@ -86,8 +88,9 @@ const anadirIngreso = (actividad, data) => {
|
|
|
86
88
|
copy.Correlativo = i;
|
|
87
89
|
copy.Clasificador = 'CT';
|
|
88
90
|
if (subtotal && subtotal[`C-${i}`]) {
|
|
89
|
-
copy.MontoEmpresa =
|
|
90
|
-
|
|
91
|
+
// copy.MontoEmpresa =
|
|
92
|
+
// Math.round(parseFloat(subtotal[`C-${i}`]) * 100) / 100
|
|
93
|
+
copy.MontoEmpresa = Math.round(parseFloat(subtotal[`C-${i}`]));
|
|
91
94
|
}
|
|
92
95
|
data.eerr.push(copy);
|
|
93
96
|
}
|
|
@@ -111,8 +114,9 @@ const anadirCosto = (actividad, data) => {
|
|
|
111
114
|
copy.Correlativo = i;
|
|
112
115
|
copy.Clasificador = 'CT';
|
|
113
116
|
if (i == rango && subtotal) {
|
|
114
|
-
copy.MontoEmpresa =
|
|
115
|
-
|
|
117
|
+
// copy.MontoEmpresa =
|
|
118
|
+
// Math.round(parseFloat(subtotal.Total) * 100) / 100
|
|
119
|
+
copy.MontoEmpresa = Math.round(parseFloat(subtotal.Total));
|
|
116
120
|
}
|
|
117
121
|
data.eerr.push(copy);
|
|
118
122
|
}
|
|
@@ -133,8 +137,9 @@ const anadirGasto = (actividad, data) => {
|
|
|
133
137
|
copy.Clasificador = 'CT';
|
|
134
138
|
if (rango == i) {
|
|
135
139
|
const otrosGastos = calcularOtrosGastos(actividad.OtrosGastos);
|
|
136
|
-
copy.MontoEmpresa =
|
|
137
|
-
|
|
140
|
+
// copy.MontoEmpresa =
|
|
141
|
+
// Math.round(parseFloat(otrosGastos.GastosOperativos) * 100) / 100
|
|
142
|
+
copy.MontoEmpresa = Math.round(parseFloat(otrosGastos.GastosOperativos));
|
|
138
143
|
}
|
|
139
144
|
data.eerr.push(copy);
|
|
140
145
|
}
|
|
@@ -171,8 +176,10 @@ const calcularOtrosGastos = (gastos) => {
|
|
|
171
176
|
return acc;
|
|
172
177
|
}, 0);
|
|
173
178
|
return {
|
|
174
|
-
GastosOperativos: Math.round(gastosOperativos * 100) / 100,
|
|
175
|
-
GastosFamiliares: Math.round(gastosFamiliares * 100) / 100
|
|
179
|
+
// GastosOperativos: Math.round(gastosOperativos * 100) / 100,
|
|
180
|
+
// GastosFamiliares: Math.round(gastosFamiliares * 100) / 100
|
|
181
|
+
GastosOperativos: Math.round(gastosOperativos),
|
|
182
|
+
GastosFamiliares: Math.round(gastosFamiliares)
|
|
176
183
|
};
|
|
177
184
|
};
|
|
178
185
|
const anadirOtrosIngresos = (actividad, data) => {
|
|
@@ -216,10 +223,12 @@ const sumarizarCuentas = (rubroOrigen, rubroDestino, data, dataOriginal) => {
|
|
|
216
223
|
if (original.MontoFamiliar == 0)
|
|
217
224
|
cuentaDestino.MontoFamiliar +=
|
|
218
225
|
itemCuentaOrigen.MontoFamiliar;
|
|
219
|
-
cuentaDestino.MontoEmpresa =
|
|
220
|
-
|
|
221
|
-
cuentaDestino.MontoFamiliar =
|
|
222
|
-
|
|
226
|
+
// cuentaDestino.MontoEmpresa =
|
|
227
|
+
// Math.round(cuentaDestino.MontoEmpresa * 100) / 100
|
|
228
|
+
// cuentaDestino.MontoFamiliar =
|
|
229
|
+
// Math.round(cuentaDestino.MontoFamiliar * 100) / 100
|
|
230
|
+
cuentaDestino.MontoEmpresa = Math.round(cuentaDestino.MontoEmpresa);
|
|
231
|
+
cuentaDestino.MontoFamiliar = Math.round(cuentaDestino.MontoFamiliar);
|
|
223
232
|
});
|
|
224
233
|
}
|
|
225
234
|
}
|
|
@@ -12,7 +12,8 @@ const getValuePivote = (ventasPrimitivo) => {
|
|
|
12
12
|
}
|
|
13
13
|
acc.set(item.ProductoId, {
|
|
14
14
|
ProductoId: item.ProductoId,
|
|
15
|
-
Cantidad: Math.round(parseFloat(cantidad)
|
|
15
|
+
// Cantidad: Math.round(parseFloat(cantidad)* parseFloat(item.CiclosProduccion) * 100)/100
|
|
16
|
+
Cantidad: Math.round(parseFloat(cantidad) * parseFloat(item.CiclosProduccion))
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
return acc;
|
|
@@ -28,7 +29,8 @@ const calcular = (Costos) => {
|
|
|
28
29
|
result.UnidadActividadId = item.UnidadId;
|
|
29
30
|
result.Cantidad = parseFloat(item.Cantidad);
|
|
30
31
|
result.PrecioUnitario = parseFloat(item.PrecioUnitario);
|
|
31
|
-
result.Total = Math.round(result.Cantidad * result.PrecioUnitario
|
|
32
|
+
// result.Total = Math.round(result.Cantidad * result.PrecioUnitario* 100) /100
|
|
33
|
+
result.Total = Math.round(result.Cantidad * result.PrecioUnitario);
|
|
32
34
|
result.TotalMonto = 0;
|
|
33
35
|
for (let i in result) {
|
|
34
36
|
if (i.startsWith('Monto')) {
|
|
@@ -32,7 +32,8 @@ const calcularMeses = (data, productos) => {
|
|
|
32
32
|
acc.get(item.ProductoId)[i] = 0;
|
|
33
33
|
if (!(i in acc.get(0)))
|
|
34
34
|
acc.get(0)[i] = 0;
|
|
35
|
-
const monto = Math.round(item[i]
|
|
35
|
+
// const monto = Math.round(item[i]/100 * item.Total * 100)/100
|
|
36
|
+
const monto = Math.round(item[i] / 100 * item.Total);
|
|
36
37
|
acc.get(item.ProductoId)[i] += monto;
|
|
37
38
|
acc.get(item.ProductoId).Total += monto;
|
|
38
39
|
acc.get(0)[i] += monto;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const RUBRO_INGRESO =
|
|
4
|
-
const RUBRO_COSTOS =
|
|
5
|
-
const RUBRO_GASTOS =
|
|
6
|
-
const RUBRO_OTROS_INGRESOS =
|
|
7
|
-
const RUBRO_GASTOS_FAMILIARES =
|
|
3
|
+
const RUBRO_INGRESO = 'ACT_CNFL_40001';
|
|
4
|
+
const RUBRO_COSTOS = 'ACT_CNFL_50001';
|
|
5
|
+
const RUBRO_GASTOS = 'ACT_CNFL_60001';
|
|
6
|
+
const RUBRO_OTROS_INGRESOS = 'ACT_CNFL_70001';
|
|
7
|
+
const RUBRO_GASTOS_FAMILIARES = 'ACT_CNFL_70002';
|
|
8
8
|
class FlujoProyectadoPrdStrategy {
|
|
9
9
|
actividades;
|
|
10
10
|
constructor() {
|
|
@@ -55,16 +55,17 @@ const addIngresosM = (actividad, data) => {
|
|
|
55
55
|
for (const producto of productos) {
|
|
56
56
|
const ingresos = actividad.Ventas.EstacionalidadCalc.find((item) => item.ProductoId == producto.ProductoId);
|
|
57
57
|
if (!ingresos)
|
|
58
|
-
throw new Error(
|
|
58
|
+
throw new Error('No se encontro la estacionalidad Calc de la actividad');
|
|
59
59
|
let row = { ...rubro };
|
|
60
60
|
row.Descripcion = `Ingresos Actividad ${actividad.ActividadEconomicaId} - Producto ${ingresos.Descripcion}`;
|
|
61
|
-
row.Clasificador =
|
|
61
|
+
row.Clasificador = 'CT';
|
|
62
62
|
row.Editable = false;
|
|
63
63
|
row.UUID = `${RUBRO_INGRESO}_${actividad.ActividadEconomicaId}_${producto.ProductoId}`;
|
|
64
64
|
row.RubroId = `${RUBRO_INGRESO}.1`;
|
|
65
65
|
for (let i = 1; i <= 12; i++) {
|
|
66
|
-
row[`Monto${i}`] =
|
|
67
|
-
|
|
66
|
+
// row[`Monto${i}`] =
|
|
67
|
+
// Math.round(parseFloat(ingresos[`C-${i}`]) * 100) / 100;
|
|
68
|
+
row[`Monto${i}`] = Math.round(parseFloat(ingresos[`C-${i}`]));
|
|
68
69
|
}
|
|
69
70
|
const existente = data.FlujoProyectadoMensual.findIndex((el) => el.UUID === row.UUID);
|
|
70
71
|
if (existente >= 0) {
|
|
@@ -86,13 +87,14 @@ const addCostosM = (actividad, data) => {
|
|
|
86
87
|
throw new Error(`No se encontro el costo cálculo para el producto ${producto.ProductoId}`);
|
|
87
88
|
let row = { ...rubro };
|
|
88
89
|
row.Descripcion = `(-) Costos de Ventas Actividad: $${actividad.ActividadEconomicaId} Producto ${producto.ProductoId}`;
|
|
89
|
-
row.Clasificador =
|
|
90
|
+
row.Clasificador = 'CT';
|
|
90
91
|
row.Editable = false;
|
|
91
92
|
row.UUID = `${RUBRO_COSTOS}_${actividad.ActividadEconomicaId}_${producto.ProductoId}`;
|
|
92
93
|
row.RubroId = `${RUBRO_COSTOS}.1`;
|
|
93
94
|
for (let i = 1; i <= 12; i++) {
|
|
94
|
-
row[`Monto${i}`] =
|
|
95
|
-
|
|
95
|
+
// row[`Monto${i}`] =
|
|
96
|
+
// Math.round(parseFloat(costos[`Monto${i}`]) * 100) / 100
|
|
97
|
+
row[`Monto${i}`] = Math.round(parseFloat(costos[`Monto${i}`]));
|
|
96
98
|
}
|
|
97
99
|
const existente = data.FlujoProyectadoMensual.findIndex((el) => el.UUID === row.UUID);
|
|
98
100
|
if (existente >= 0) {
|
|
@@ -108,16 +110,17 @@ const addGastosM = (actividad, data) => {
|
|
|
108
110
|
const rubro = data.FlujoProyectadoMensualMap.get(`${RUBRO_GASTOS}_0`);
|
|
109
111
|
const otrosGastos = calcularOtrosGastos(actividad.OtrosGastos);
|
|
110
112
|
if (!otrosGastos)
|
|
111
|
-
throw new Error(
|
|
113
|
+
throw new Error('No se encontro los gastos de la actividad');
|
|
112
114
|
let row = { ...rubro };
|
|
113
115
|
row.Descripcion = `(-) Gastos Operativo ActividadId:${actividad.ActividadEconomicaId}`;
|
|
114
|
-
row.Clasificador =
|
|
116
|
+
row.Clasificador = 'CT';
|
|
115
117
|
row.Editable = false;
|
|
116
118
|
row.UUID = `${RUBRO_GASTOS}_${actividad.ActividadEconomicaId}`;
|
|
117
119
|
row.RubroId = `${RUBRO_GASTOS}.1`;
|
|
118
120
|
for (let i = 1; i <= 12; i++) {
|
|
119
|
-
row[`Monto${i}`] =
|
|
120
|
-
|
|
121
|
+
// row[`Monto${i}`] =
|
|
122
|
+
// Math.round(parseFloat(otrosGastos.GastosOperativos) * 100) / 100
|
|
123
|
+
row[`Monto${i}`] = Math.round(parseFloat(otrosGastos.GastosOperativos));
|
|
121
124
|
}
|
|
122
125
|
const existente = data.FlujoProyectadoMensual.findIndex((el) => el.UUID === row.UUID);
|
|
123
126
|
if (existente >= 0) {
|
|
@@ -131,10 +134,10 @@ const otrosIngresoM = (actividad, data) => {
|
|
|
131
134
|
const rubro = data.FlujoProyectadoMensualMap.get(`${RUBRO_OTROS_INGRESOS}_0`);
|
|
132
135
|
const otrosIngresos = actividad.Ventas.OtrosIngresos;
|
|
133
136
|
if (!otrosIngresos)
|
|
134
|
-
throw new Error(
|
|
137
|
+
throw new Error('No se encontro la estacionalidad Calc de la actividad');
|
|
135
138
|
let row = { ...rubro };
|
|
136
139
|
row.Descripcion = `Otros Ingresos Familiares Actividad: ${actividad.ActividadEconomicaId}`;
|
|
137
|
-
row.Clasificador =
|
|
140
|
+
row.Clasificador = 'CT';
|
|
138
141
|
row.Editable = false;
|
|
139
142
|
row.UUID = `${RUBRO_OTROS_INGRESOS}_${actividad.ActividadEconomicaId}`;
|
|
140
143
|
row.RubroId = `${RUBRO_OTROS_INGRESOS}.1`;
|
|
@@ -149,8 +152,9 @@ const otrosIngresoM = (actividad, data) => {
|
|
|
149
152
|
}
|
|
150
153
|
else {
|
|
151
154
|
for (let i = 1; i <= 12; i++) {
|
|
152
|
-
row[`Monto${i}`] =
|
|
153
|
-
|
|
155
|
+
// row[`Monto${i}`] =
|
|
156
|
+
// Math.round(parseFloat(otrosIngresos[`C-${i}`]) * 100) / 100
|
|
157
|
+
row[`Monto${i}`] = Math.round(parseFloat(otrosIngresos[`C-${i}`]));
|
|
154
158
|
}
|
|
155
159
|
}
|
|
156
160
|
const existente = data.FlujoProyectadoMensual.findIndex((el) => el.UUID === row.UUID);
|
|
@@ -165,16 +169,17 @@ const gastosFamiliaresM = (actividad, data) => {
|
|
|
165
169
|
const rubro = data.FlujoProyectadoMensualMap.get(`$${RUBRO_GASTOS_FAMILIARES}_0`);
|
|
166
170
|
const otrosGastos = calcularOtrosGastos(actividad.OtrosGastos);
|
|
167
171
|
if (!otrosGastos)
|
|
168
|
-
throw new Error(
|
|
172
|
+
throw new Error('No se encontro los gastos de la actividad');
|
|
169
173
|
let row = { ...rubro };
|
|
170
174
|
row.Descripcion = `(-) Gastos Familiares Actividad ${actividad.ActividadEconomicaId}`;
|
|
171
|
-
row.Clasificador =
|
|
175
|
+
row.Clasificador = 'CT';
|
|
172
176
|
row.Editable = false;
|
|
173
177
|
row.UUID = `${RUBRO_GASTOS_FAMILIARES}_${actividad.ActividadEconomicaId}`;
|
|
174
178
|
row.RubroId = `${RUBRO_GASTOS_FAMILIARES}.1`;
|
|
175
179
|
for (let i = 1; i <= 12; i++) {
|
|
176
|
-
row[`Monto${i}`] =
|
|
177
|
-
|
|
180
|
+
// row[`Monto${i}`] =
|
|
181
|
+
// Math.round(parseFloat(otrosGastos.gastosFamiliares) * 100) / 100
|
|
182
|
+
row[`Monto${i}`] = Math.round(parseFloat(otrosGastos.gastosFamiliares));
|
|
178
183
|
}
|
|
179
184
|
const existente = data.FlujoProyectadoMensual.findIndex((el) => el.UUID === row.UUID);
|
|
180
185
|
if (existente >= 0) {
|
|
@@ -194,7 +199,9 @@ const calcularOtrosGastos = (gastos) => {
|
|
|
194
199
|
return acc;
|
|
195
200
|
}, 0);
|
|
196
201
|
return {
|
|
197
|
-
GastosOperativos: Math.round(gastosOperativos * 100) / 100,
|
|
198
|
-
GastosFamiliares: Math.round(gastosFamiliares * 100) / 100
|
|
202
|
+
// GastosOperativos: Math.round(gastosOperativos * 100) / 100,
|
|
203
|
+
// GastosFamiliares: Math.round(gastosFamiliares * 100) / 100
|
|
204
|
+
GastosOperativos: Math.round(gastosOperativos),
|
|
205
|
+
GastosFamiliares: Math.round(gastosFamiliares)
|
|
199
206
|
};
|
|
200
207
|
};
|
|
@@ -21,7 +21,8 @@ const getIngreso = (productoId, ingresosCalc, rango, criterio) => {
|
|
|
21
21
|
for (let i = 1; i <= rango; i++) {
|
|
22
22
|
result += subtotal[`C-${i}`];
|
|
23
23
|
}
|
|
24
|
-
result = Math.round(result
|
|
24
|
+
// result = Math.round(result/rango*100)/100
|
|
25
|
+
result = Math.round(result / rango);
|
|
25
26
|
}
|
|
26
27
|
else if (criterio == 'ULT') {
|
|
27
28
|
result = subtotal[`C-${rango}`];
|
|
@@ -69,7 +70,8 @@ const calcularEstacionalidad = (data) => {
|
|
|
69
70
|
});
|
|
70
71
|
for (const key in item) {
|
|
71
72
|
if (key.startsWith('C-')) {
|
|
72
|
-
const monto
|
|
73
|
+
// const monto= Math.round(item[key] * item.Ingreso * 100)/100
|
|
74
|
+
const monto = Math.round(item[key] * item.Ingreso);
|
|
73
75
|
acc.get(item.ProductoId)[key] = monto;
|
|
74
76
|
acc.get(item.ProductoId).Total += monto;
|
|
75
77
|
acc.get(0)[key] += monto;
|
|
@@ -2,22 +2,43 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calcular = exports.calcularProductos = void 0;
|
|
4
4
|
const calcularProductos = (data) => {
|
|
5
|
-
let cantidad = {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
let cantidad = {
|
|
6
|
+
Id: 'CANTIDAD',
|
|
7
|
+
ProductoId: data.ProductoId,
|
|
8
|
+
IndicadorABM: 'M'
|
|
9
|
+
};
|
|
10
|
+
let precio = {
|
|
11
|
+
Id: 'PRECIO',
|
|
12
|
+
ProductoId: data.ProductoId,
|
|
13
|
+
IndicadorABM: 'M'
|
|
14
|
+
};
|
|
15
|
+
let subtotal = {
|
|
16
|
+
Id: 'SUBTOTAL',
|
|
17
|
+
ProductoId: data.ProductoId,
|
|
18
|
+
IndicadorABM: 'M'
|
|
19
|
+
};
|
|
8
20
|
data.Montos.forEach((item) => {
|
|
9
21
|
cantidad[`C-${item.Correlativo}`] = parseFloat(item.Cantidad);
|
|
10
22
|
cantidad[`CDesc-${item.Correlativo}`] = item.CorrelativoDesc;
|
|
11
23
|
precio[`C-${item.Correlativo}`] = parseFloat(item.Precio);
|
|
12
24
|
precio[`CDesc-${item.Correlativo}`] = item.CorrelativoDesc;
|
|
13
|
-
subtotal[`C-${item.Correlativo}`]
|
|
25
|
+
// subtotal[`C-${item.Correlativo}`]=Math.round(parseFloat(item.Precio)*(parseFloat(item.Cantidad)*parseFloat(data.CampannasAnno))*(1-parseFloat(data.Merma)/100) *100 )/100
|
|
26
|
+
subtotal[`C-${item.Correlativo}`] = Math.round(parseFloat(item.Precio) *
|
|
27
|
+
(parseFloat(item.Cantidad) * parseFloat(data.CampannasAnno)) *
|
|
28
|
+
(1 - parseFloat(data.Merma) / 100));
|
|
14
29
|
subtotal[`CDesc-${item.Correlativo}`] = item.CorrelativoDesc;
|
|
15
30
|
});
|
|
16
31
|
for (let i = 1; i < data.Rango; i++) {
|
|
17
32
|
cantidad[`V-${i}`] = cantidad[`C-${i + 1}`] - cantidad[`C-${i}`];
|
|
18
|
-
cantidad[`VDesc-${i}`] =
|
|
33
|
+
cantidad[`VDesc-${i}`] =
|
|
34
|
+
cantidad[`CDesc-${i + 1}`].slice(-4) +
|
|
35
|
+
' - ' +
|
|
36
|
+
cantidad[`CDesc-${i}`].slice(-4);
|
|
19
37
|
precio[`V-${i}`] = precio[`C-${i + 1}`] - precio[`C-${i}`];
|
|
20
|
-
precio[`VDesc-${i}`] =
|
|
38
|
+
precio[`VDesc-${i}`] =
|
|
39
|
+
precio[`CDesc-${i + 1}`].slice(-4) +
|
|
40
|
+
' - ' +
|
|
41
|
+
precio[`CDesc-${i}`].slice(-4);
|
|
21
42
|
subtotal[`V-${i}`] = subtotal[`C-${i + 1}`] - subtotal[`C-${i}`];
|
|
22
43
|
subtotal[`VDesc-${i}`] = precio[`VDesc-${i}`];
|
|
23
44
|
}
|