bdpformulas 1.0.91 → 1.0.93

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.
Files changed (29) hide show
  1. package/build/strategies/agriculture/costos.detail/costosCalc.js +2 -1
  2. package/build/strategies/agriculture/costos.detail/mesesCalc.js +9 -3
  3. package/build/strategies/agriculture/flujoProyAgr.strategy.js +4 -2
  4. package/build/strategies/common/analisisFinCalculos/apalancamiento.calc.js +21 -14
  5. package/build/strategies/common/analisisFinCalculos/puntoEquilibrio.calc.js +27 -9
  6. package/build/strategies/common/analisisFinCalculos/ratios.calc.js +28 -14
  7. package/build/strategies/common/balanceCalculos/declaracionJurada.calc.js +1 -1
  8. package/build/strategies/common/declaracionJurada.calc.js +1 -2
  9. package/build/strategies/common/flujoCalculos/flujoConstructor.js +22 -14
  10. package/build/strategies/eeff/balanceEEFF.strategy.d.ts +1 -1
  11. package/build/strategies/eeff/balanceEEFF.strategy.js +93 -76
  12. package/build/strategies/eeff/deudas/administracionLinea.js +13 -6
  13. package/build/strategies/eeff/deudas/administracionLineaManuales.js +4 -2
  14. package/build/strategies/eeff/deudas/aplicactionesCuadro.js +10 -7
  15. package/build/strategies/eeff/deudas/deudas.strategy.js +10 -6
  16. package/build/strategies/eeff/deudas/resumenFinanciamiento.js +2 -1
  17. package/build/strategies/eeff/flujoProyEEFF.strategy.d.ts +1 -1
  18. package/build/strategies/eeff/flujoProyEEFF.strategy.js +29 -26
  19. package/build/strategies/general/balanceGeneral.strategy.js +8 -6
  20. package/build/strategies/pecuary/desarrollo.detail/desarrolloCalc.js +4 -2
  21. package/build/strategies/pecuary/flujoProyPec.strategy.js +11 -6
  22. package/build/strategies/production/balancePrd.strategy.js +25 -16
  23. package/build/strategies/production/costos.detail/costosCalc.js +4 -2
  24. package/build/strategies/production/costos.detail/mesesCalc.js +2 -1
  25. package/build/strategies/production/flujoProyPrd.strategy.d.ts +1 -1
  26. package/build/strategies/production/flujoProyPrd.strategy.js +33 -26
  27. package/build/strategies/production/ventas.detail/estacionalidadCalc.js +4 -2
  28. package/build/strategies/production/ventas.detail/ingresosCalc.js +27 -6
  29. package/package.json +1 -1
@@ -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
- Math.round(parseFloat(nuevo[`Monto${i}`]) * 100) / 100;
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
- Math.round(parseFloat(nuevo[`Monto${i}`]) * 100) /
118
- 100;
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
- Math.round(parseFloat(nuevo[`Monto${i}`]) * 100) / 100;
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) * 100) / 100;
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
- Math.round(row3[`Monto${j}`] * 100) / 100;
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
- Math.round(row3[`Monto${j}`] * 100) / 100;
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) {
@@ -1,4 +1,4 @@
1
- import { Strategy } from "../../strategy.interface";
1
+ import { Strategy } from '../../strategy.interface';
2
2
  export default class FlujoProyectadoEEFFStrategy implements Strategy {
3
3
  actividades: any[];
4
4
  constructor();
@@ -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(["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);
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
- "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);
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("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);
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("No existe el rango en la evaluacion");
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}`]) + parseFloat(item[`Gestion${i}`]);
62
- acc[`Gestion${i}`] = Math.round(acc[`Gestion${i}`] * 100) / 100;
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 = "CT";
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
- Math.round(parseFloat(sumado[`Gestion${i}`]) * 100) / 100;
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
- Math.round(parseFloat(rubro[`MontoEmpresa_${i}`]) * 100) /
47
- 100;
48
- copy.MontoFamiliar =
49
- Math.round(parseFloat(rubro[`MontoFamiliar_${i}`]) * 100) /
50
- 100;
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
- Math.round(parseFloat(otrosGastos.GastosOperativos) * 100) / 100;
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
- Math.round(parseFloat(cuentaIngreso.MontoEmpresa) * 100) / 100;
65
- cuentaIngreso.MontoFamiliar =
66
- Math.round(parseFloat(cuentaIngreso.MontoFamiliar) * 100) / 100;
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
- Math.round(parseFloat(subtotal[`C-${i}`]) * 100) / 100;
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
- Math.round(parseFloat(subtotal.Total) * 100) / 100;
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
- Math.round(parseFloat(otrosGastos.GastosOperativos) * 100) / 100;
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
- Math.round(cuentaDestino.MontoEmpresa * 100) / 100;
221
- cuentaDestino.MontoFamiliar =
222
- Math.round(cuentaDestino.MontoFamiliar * 100) / 100;
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) * parseFloat(item.CiclosProduccion) * 100) / 100
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 * 100) / 100;
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] / 100 * item.Total * 100) / 100;
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,4 +1,4 @@
1
- import { Strategy } from "../../strategy.interface";
1
+ import { Strategy } from '../../strategy.interface';
2
2
  export default class FlujoProyectadoPrdStrategy implements Strategy {
3
3
  actividades: any[];
4
4
  constructor();
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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";
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("No se encontro la estacionalidad Calc de la actividad");
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 = "CT";
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
- Math.round(parseFloat(ingresos[`C-${i}`]) * 100) / 100;
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 = "CT";
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
- Math.round(parseFloat(costos[`Monto${i}`]) * 100) / 100;
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("No se encontro los gastos de la actividad");
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 = "CT";
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
- Math.round(parseFloat(otrosGastos.GastosOperativos) * 100) / 100;
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("No se encontro la estacionalidad Calc de la actividad");
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 = "CT";
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
- Math.round(parseFloat(otrosIngresos[`C-${i}`]) * 100) / 100;
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("No se encontro los gastos de la actividad");
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 = "CT";
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
- Math.round(parseFloat(otrosGastos.gastosFamiliares) * 100) / 100;
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 / rango * 100) / 100;
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 = Math.round(item[key] * item.Ingreso * 100) / 100;
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 = { Id: 'CANTIDAD', ProductoId: data.ProductoId, IndicadorABM: 'M' };
6
- let precio = { Id: 'PRECIO', ProductoId: data.ProductoId, IndicadorABM: 'M' };
7
- let subtotal = { Id: 'SUBTOTAL', ProductoId: data.ProductoId, IndicadorABM: 'M' };
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}`] = Math.round(parseFloat(item.Precio) * (parseFloat(item.Cantidad) * parseFloat(data.CampannasAnno)) * (1 - parseFloat(data.Merma) / 100) * 100) / 100;
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}`] = cantidad[`CDesc-${i + 1}`].slice(-4) + ' - ' + cantidad[`CDesc-${i}`].slice(-4);
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}`] = precio[`CDesc-${i + 1}`].slice(-4) + ' - ' + precio[`CDesc-${i}`].slice(-4);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bdpformulas",
3
- "version": "1.0.91",
3
+ "version": "1.0.93",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",