bdpformulas 1.0.104 → 1.0.109

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.
@@ -24,7 +24,6 @@ class FlujoConstructor {
24
24
  }
25
25
  }
26
26
  calcularFlujo = () => {
27
- // console.log('DATA CALCULADA', this.data)
28
27
  this.limpiarCamposCalculados();
29
28
  if (this.tipo == 'ANUAL' &&
30
29
  this.data.FlujoProyectadoMensualMap.size > 0) {
@@ -369,12 +368,21 @@ class FlujoConstructor {
369
368
  ...item,
370
369
  UUID
371
370
  };
371
+ // let total = 0
372
+ // for (let i = 1; i <= this.rango; i++) {
373
+ // clone[`Monto${i}`] = 0
374
+ // total += ourParseFloat(item[`Monto${i}`])
375
+ // }
376
+ // clone['Monto1'] = total
372
377
  let total = 0;
373
378
  for (let i = 1; i <= this.rango; i++) {
374
- clone[`Monto${i}`] = 0;
375
379
  total += (0, utils_1.ourParseFloat)(item[`Monto${i}`]);
376
380
  }
377
- clone['Monto1'] = total;
381
+ const montoPorMes = total;
382
+ for (let i = 1; i <= this.rango; i++) {
383
+ clone[`Monto${i}`] = montoPorMes;
384
+ }
385
+ clone.MontoTotal = total;
378
386
  item.MontoTotal = total;
379
387
  if (!this.mapObject.has(key)) {
380
388
  this.array.push(clone);
@@ -150,21 +150,12 @@ const otrosIngresoM = (actividad, data) => {
150
150
  row.Editable = false;
151
151
  row.UUID = `${RUBRO_OTROS_INGRESOS}_${actividad.ActividadEconomicaId}`;
152
152
  row.RubroId = `${RUBRO_OTROS_INGRESOS}.1`;
153
- if (otrosIngresos.length == 0) {
154
- const suma = otrosIngresos.reduce((acc, item) => {
155
- acc += parseFloat(item.Monto);
156
- return acc;
157
- }, 0);
158
- for (let i = 1; i <= 12; i++) {
159
- row[`Monto${i}`] = suma;
160
- }
153
+ for (let i = 1; i <= 12; i++) {
154
+ row[`Monto${i}`] = 0;
161
155
  }
162
- else {
163
- const ingreso = otrosIngresos[0];
156
+ for (const ingreso of otrosIngresos) {
164
157
  for (let i = 1; i <= 12; i++) {
165
- // row[`Monto${i}`] =
166
- // Math.round(parseFloat(otrosIngresos[`C-${i}`]) * 100) / 100
167
- row[`Monto${i}`] = obtenerValorPorMes(ingreso, i);
158
+ row[`Monto${i}`] += obtenerValorPorMes(ingreso, i);
168
159
  }
169
160
  }
170
161
  const existente = data.FlujoProyectadoMensual.findIndex((el) => el.UUID === row.UUID);
@@ -176,7 +167,7 @@ const otrosIngresoM = (actividad, data) => {
176
167
  }
177
168
  };
178
169
  const gastosFamiliaresM = (actividad, data) => {
179
- const rubro = data.FlujoProyectadoMensualMap.get(`$${RUBRO_GASTOS_FAMILIARES}_0`);
170
+ const rubro = data.FlujoProyectadoMensualMap.get(`${RUBRO_GASTOS_FAMILIARES}_0`);
180
171
  const otrosGastos = calcularOtrosGastos(actividad.OtrosGastos);
181
172
  if (!otrosGastos)
182
173
  throw new Error('No se encontro los gastos de la actividad');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bdpformulas",
3
- "version": "1.0.104",
3
+ "version": "1.0.109",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",