bdpformulas 1.0.99 → 1.0.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -24,6 +24,7 @@ import SupuestosStrategy from './strategies/eeff/supuestos.strategy';
24
24
  import DeudasStrategy from './strategies/eeff/deudas/deudas.strategy';
25
25
  import ItapStrategy from './strategies/general/itap.stretegy';
26
26
  import CalculosAuxiliaresStrategy from './strategies/eeff/calculosAuxiliares.strategy';
27
+ import BalanceProyectadoStrategy from './strategies/eeff/balanceProyectado/balanceProyectado.strategy';
27
28
  declare const Pecuario: {
28
29
  Auxiliar: typeof Auxiliar;
29
30
  Desarrollo: typeof Desarrollo;
@@ -50,6 +51,7 @@ declare const EEFF: {
50
51
  SupuestosStrategy: typeof SupuestosStrategy;
51
52
  DeudasStrategy: typeof DeudasStrategy;
52
53
  CalculosAuxiliaresStrategy: typeof CalculosAuxiliaresStrategy;
54
+ BalanceProyectadoStrategy: typeof BalanceProyectadoStrategy;
53
55
  };
54
56
  declare const General: {
55
57
  BalanceGeneralStrategy: typeof BalanceGeneralStrategy;
package/build/index.js CHANGED
@@ -31,6 +31,7 @@ const supuestos_strategy_1 = __importDefault(require("./strategies/eeff/supuesto
31
31
  const deudas_strategy_1 = __importDefault(require("./strategies/eeff/deudas/deudas.strategy"));
32
32
  const itap_stretegy_1 = __importDefault(require("./strategies/general/itap.stretegy"));
33
33
  const calculosAuxiliares_strategy_1 = __importDefault(require("./strategies/eeff/calculosAuxiliares.strategy"));
34
+ const balanceProyectado_strategy_1 = __importDefault(require("./strategies/eeff/balanceProyectado/balanceProyectado.strategy"));
34
35
  const Pecuario = {
35
36
  Auxiliar: anexo_strategy_1.default,
36
37
  Desarrollo: desarrollo_strategy_1.default,
@@ -59,7 +60,8 @@ const EEFF = {
59
60
  AdmFinancieraStrategy: admFinanciera_strategy_1.default,
60
61
  SupuestosStrategy: supuestos_strategy_1.default,
61
62
  DeudasStrategy: deudas_strategy_1.default,
62
- CalculosAuxiliaresStrategy: calculosAuxiliares_strategy_1.default
63
+ CalculosAuxiliaresStrategy: calculosAuxiliares_strategy_1.default,
64
+ BalanceProyectadoStrategy: balanceProyectado_strategy_1.default
63
65
  };
64
66
  exports.EEFF = EEFF;
65
67
  const General = {
@@ -23,8 +23,6 @@ export interface BalanceProyectadoStrategyData {
23
23
  Supuestos: Proyeccion[];
24
24
  Balance: BalanceData;
25
25
  Indices: Proyeccion[];
26
- AnhoBase: string;
27
- InicioProyeccion: string;
28
26
  InicioProyeccionGestion: number;
29
27
  CantidadProyeccion: number;
30
28
  CantidadGestiones: number;
@@ -58,12 +56,13 @@ export interface BalanceProyectadoHandlerData {
58
56
  data: BalanceProyectadoStrategyData;
59
57
  }
60
58
  export type SupuestoClasificacion = 'A' | 'D' | 'C' | 'P' | 'CA' | 'PV' | 'NA';
61
- export declare function getValueWithSupuestoByClasificacion({ supuesto, value, valueForCa, valueForPv, valueForD }: {
59
+ export declare function getValueWithSupuestoByClasificacion({ supuesto, value, valueForCa, valueForNone, valueForPv, valueForD }: {
62
60
  supuesto?: SupuestoValue;
63
61
  value: number;
64
62
  valueForPv?: number;
65
63
  valueForCa?: number;
66
64
  valueForD?: number;
65
+ valueForNone?: number;
67
66
  }): number;
68
67
  interface GetSumaParams {
69
68
  map: Map<string, any>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSumaDesdeHastaGestionMap = exports.getValueWithSupuestoByClasificacion = void 0;
4
4
  const utils_1 = require("../../strategies/eeff/admFinanciera/utils");
5
- function getValueWithSupuestoByClasificacion({ supuesto, value, valueForCa, valueForPv = 0, valueForD = 0 }) {
5
+ function getValueWithSupuestoByClasificacion({ supuesto, value, valueForCa, valueForNone, valueForPv = 0, valueForD = 0 }) {
6
6
  let val = 0;
7
7
  const montoSupuesto = (0, utils_1.ourParseFloat)(supuesto?.Monto);
8
8
  if (supuesto?.Clasificacion === 'C') {
@@ -20,6 +20,9 @@ function getValueWithSupuestoByClasificacion({ supuesto, value, valueForCa, valu
20
20
  else if (supuesto?.Clasificacion === 'D') {
21
21
  val = valueForD;
22
22
  }
23
+ else {
24
+ val = valueForNone ?? val;
25
+ }
23
26
  return val;
24
27
  }
25
28
  exports.getValueWithSupuestoByClasificacion = getValueWithSupuestoByClasificacion;
@@ -152,7 +152,7 @@ class BalanceHandler {
152
152
  else if (sup32?.Clasificacion === 'D') {
153
153
  val = montoSup32 * (proy105 / 360) * (0, utils_1.divide)(12, montoSup17);
154
154
  }
155
- this.data.proyectado.set(`X21_${gestion}`, val);
155
+ this.data.proyectado.set(`X23_${gestion}`, val);
156
156
  }
157
157
  set24(gestion) {
158
158
  const sup76 = this.data.supuestosData.get(`X76_${gestion}`);
@@ -331,7 +331,7 @@ class BalanceHandler {
331
331
  const val = (0, balanceProyectado_1.getValueWithSupuestoByClasificacion)({
332
332
  supuesto: sup105,
333
333
  value: anterior,
334
- valueForCa: anterior + (0, utils_2.ourParseFloat)(sup105?.Monto) + admFinanciera722
334
+ valueForNone: admFinanciera722
335
335
  });
336
336
  this.data.proyectado.set(`X40_${gestion}`, val);
337
337
  }
@@ -633,7 +633,7 @@ class BalanceHandler {
633
633
  set74(gestion) {
634
634
  const sup58 = this.data.supuestosData.get(`X58_${gestion}`);
635
635
  const sup59 = this.data.supuestosData.get(`X59_${gestion}`);
636
- const anterior = this.data.proyectado.get(`X73_${gestion - 1}`);
636
+ const anterior = this.data.proyectado.get(`X74_${gestion - 1}`);
637
637
  let val = 0;
638
638
  const montoSup58 = (0, utils_2.ourParseFloat)(sup58?.Monto);
639
639
  const montoSup59 = (0, utils_2.ourParseFloat)(sup59?.Monto);
@@ -46,20 +46,6 @@ class BalanceProyectadoStrategy {
46
46
  eerrHandler.calcular();
47
47
  flujoCajaHandler.calcular();
48
48
  balanceHandler.setTotales();
49
- console.log(JSON.stringify(Array.from(this.supuestosData.entries()).reduce((acc, [key, value]) => {
50
- const splitKey = key.split('_');
51
- const fila = splitKey[0];
52
- const gestion = splitKey[1];
53
- let el = acc.find((el) => el.Fila == fila);
54
- if (!el) {
55
- el = {
56
- Fila: fila
57
- };
58
- acc.push(el);
59
- }
60
- el[`Gestion${gestion}`] = value;
61
- return acc;
62
- }, [])));
63
49
  return this.getCalcData();
64
50
  }
65
51
  generarFilasConfiguracion() {
@@ -6,6 +6,7 @@ export declare class EERRHandler {
6
6
  constructor(data: BalanceProyectadoHandlerData);
7
7
  setBalanceHandler(balanceHandler: BalanceHandler): void;
8
8
  calcular(): void;
9
+ private setTotalesAnhoBase;
9
10
  private set100;
10
11
  private set101;
11
12
  private set102;
@@ -14,6 +14,7 @@ class EERRHandler {
14
14
  this.balanceHandler = balanceHandler;
15
15
  }
16
16
  calcular() {
17
+ this.setTotalesAnhoBase();
17
18
  for (let i = 1; i <= this.data.data.CantidadProyeccion; i++) {
18
19
  this.set101(i);
19
20
  this.set102(i);
@@ -47,6 +48,14 @@ class EERRHandler {
47
48
  this.balanceHandler?.set80(i);
48
49
  }
49
50
  }
51
+ setTotalesAnhoBase() {
52
+ this.set100(0);
53
+ this.set104(0);
54
+ this.set106(0);
55
+ this.set109(0);
56
+ this.set119(0);
57
+ this.set122(0);
58
+ }
50
59
  set100(gestion) {
51
60
  const val = this.data.proyectado.get(`X101_${gestion}`) +
52
61
  this.data.proyectado.get(`X102_${gestion}`);
@@ -113,13 +122,13 @@ class EERRHandler {
113
122
  set108(gestion) {
114
123
  const sup43 = this.data.supuestosData.get(`X43_${gestion}`);
115
124
  const sup45 = this.data.supuestosData.get(`X45_${gestion}`);
116
- this.data.proyectado.set(`X107_${gestion}`, (0, utils_1.ourParseFloat)(sup43?.Monto) + (0, utils_1.ourParseFloat)(sup45?.Monto));
125
+ this.data.proyectado.set(`X108_${gestion}`, (0, utils_1.ourParseFloat)(sup43?.Monto) + (0, utils_1.ourParseFloat)(sup45?.Monto));
117
126
  }
118
127
  set109(gestion) {
119
128
  const proy106 = this.data.proyectado.get(`X106_${gestion}`);
120
129
  const proy107 = this.data.proyectado.get(`X107_${gestion}`);
121
130
  const proy108 = this.data.proyectado.get(`X108_${gestion}`);
122
- this.data.proyectado.set(`X107_${gestion}`, proy106 + proy107 + proy108);
131
+ this.data.proyectado.set(`X109_${gestion}`, proy106 - proy107 - proy108);
123
132
  }
124
133
  set110(gestion) {
125
134
  const sup101 = this.data.supuestosData.get(`X101_${gestion}`);
@@ -141,7 +150,7 @@ class EERRHandler {
141
150
  if (sup106?.Clasificacion === 'A') {
142
151
  val += (0, utils_1.ourParseFloat)(sup106?.Monto);
143
152
  }
144
- this.data.proyectado.set(`X110_${gestion}`, val);
153
+ this.data.proyectado.set(`X111_${gestion}`, val);
145
154
  }
146
155
  set112(gestion) {
147
156
  const sup48 = this.data.supuestosData.get(`X48_${gestion}`);
@@ -243,7 +252,7 @@ class EERRHandler {
243
252
  this.data.proyectado.get(`X116_${gestion}`) +
244
253
  this.data.proyectado.get(`X117_${gestion}`) -
245
254
  this.data.proyectado.get(`X118_${gestion}`);
246
- this.data.proyectado.set(`X118_${gestion}`, val);
255
+ this.data.proyectado.set(`X119_${gestion}`, val);
247
256
  }
248
257
  set120(gestion) {
249
258
  const proy121 = this.data.proyectado.get(`X121_${gestion}`);
@@ -55,9 +55,7 @@ class FlujoCajaHandler {
55
55
  this.set174(i);
56
56
  this.set176(i);
57
57
  this.balanceHandler?.set20(i);
58
- if (i > 1) {
59
- this.set138(i);
60
- }
58
+ this.set138(i + 1);
61
59
  }
62
60
  }
63
61
  set138_1() {
@@ -72,7 +70,7 @@ class FlujoCajaHandler {
72
70
  this.data.proyectado.get(`X111_${gestion}`));
73
71
  }
74
72
  set140(gestion) {
75
- this.data.proyectado.set(`X140_${gestion}`, this.data.proyectado.get(`X110_${gestion}`) -
73
+ this.data.proyectado.set(`X140_${gestion}`, -this.data.proyectado.get(`X110_${gestion}`) -
76
74
  this.data.proyectado.get(`X111_${gestion}`));
77
75
  }
78
76
  set141(gestion) {
@@ -92,7 +92,7 @@ class AdministacionLineas {
92
92
  linea.destino = finded?.destino || null;
93
93
  linea.usado = finded?.usado || 0;
94
94
  linea.fechaVenc = finded?.fechaVenc || null;
95
- linea.montoConVenc = finded.montoConVenc || 0;
95
+ linea.montoConVenc = finded?.montoConVenc || 0;
96
96
  linea.tasa = finded?.tasa || 0;
97
97
  linea.interes = finded?.interes || 0;
98
98
  // linea.montoConVenc =
@@ -68,7 +68,7 @@ class AplicacionesCuadroAlternativo {
68
68
  }
69
69
  caculate001(row) {
70
70
  this.addMontos(row);
71
- const filterLineas = this.admLineas.filter((item) => (item.rubroId = 'ACT_DEU_71003'));
71
+ const filterLineas = this.admLineas.filter((item) => item.rubroId === 'ACT_DEU_71003');
72
72
  for (let item of filterLineas) {
73
73
  let nuevo = {};
74
74
  nuevo.id = row.id;
@@ -127,7 +127,6 @@ class DeudasStrategy {
127
127
  destino[`Monto${i}`] = sum[`Monto${i}`];
128
128
  }
129
129
  }
130
- console.log('RESULTADO SUM', sum);
131
130
  return sum;
132
131
  }, null);
133
132
  return destino;
@@ -192,7 +191,6 @@ class DeudasStrategy {
192
191
  return calculator.getLineasManuales();
193
192
  }
194
193
  getResumenFinanciamiento() {
195
- console.log('DEUDAS FORMULA', this.data.Deudas);
196
194
  const calculator = new resumenFinanciamiento_1.default(this.data.Deudas, this.data.CantidadProyeccion);
197
195
  return calculator.generateResumen();
198
196
  }
@@ -1 +0,0 @@
1
- export {};