bdpformulas 1.0.53 → 1.0.54

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.
@@ -115,6 +115,7 @@ export interface ProyeccionPrestamo {
115
115
  export interface AdministracionFinancieraData {
116
116
  CantidadProyeccion: number;
117
117
  InicioProyeccion: string;
118
+ UltimaGestion: string;
118
119
  PrestamoDirecto: Partial<PrestamoDirecto>[];
119
120
  PrestamoBajoLinea: Partial<PrestamoBajoLinea>[];
120
121
  PrestamoLeasing: Partial<PrestamoLeasing>[];
@@ -22,7 +22,7 @@ class PrestamoBajoLineaHandler {
22
22
  let cantidadAños;
23
23
  if (this.prestamo.TipoExistencia == 'EXISTENTE' &&
24
24
  this.prestamo.VencimientoLinea) {
25
- const fechaInicio = (0, utils_1.getDateTime)(this.data.InicioProyeccion).endOf('month');
25
+ const fechaInicio = (0, utils_1.getDateTime)(this.data.UltimaGestion).endOf('month');
26
26
  const fechaVencimiento = (0, utils_1.getDateTime)(this.prestamo.VencimientoLinea).endOf('month');
27
27
  const diferenciaAños = Math.floor(fechaVencimiento.diff(fechaInicio, 'years').years);
28
28
  if (diferenciaAños > 0) {
@@ -129,14 +129,13 @@ class PrestamoDirectoHandler {
129
129
  porcion = (0, utils_1.ourParseFloat)(pagado.porcionCorrientePagada);
130
130
  cuotas = pagado.cuotasPagadas;
131
131
  if (this.prestamo.TipoFacilidad === 'FIJA') {
132
- const dif = (0, utils_1.ourParseFloat)(this.prestamo.Gracia) -
133
- (0, utils_1.ourParseFloat)(this.prestamo.CuotasPagadas);
132
+ const dif = (0, utils_1.ourParseFloat)(this.prestamo.Gracia) - (0, utils_1.ourParseFloat)(cuotas);
134
133
  const periodoGracia = dif > 0 ? dif : 0;
135
134
  this.simuladorFijo2 = (0, utils_1.simuladorCuotas)({
136
135
  monto: (0, utils_1.ourParseFloat)(this.prestamo.MontoOriginal) -
137
- (0, utils_1.ourParseFloat)(this.prestamo.PorcionPagada),
136
+ (0, utils_1.ourParseFloat)(porcion),
138
137
  plazo: (0, utils_1.ourParseFloat)(this.prestamo.Plazo) * 12 -
139
- (0, utils_1.ourParseFloat)(this.prestamo.CuotasPagadas),
138
+ (0, utils_1.ourParseFloat)(cuotas),
140
139
  frecuencia: this.prestamo.TipoPeriodicidadId ?? 'MENSUAL',
141
140
  tipoCuota: this.prestamo.TipoFacilidad ?? 'VARIABLE',
142
141
  periodoGracia,
@@ -14,8 +14,11 @@ class AdmFinancieraStrategy {
14
14
  this.data = null;
15
15
  }
16
16
  execute(data) {
17
- if (!data || !data?.CantidadProyeccion || !data?.InicioProyeccion) {
18
- throw new Error('La data o Cantidad Proyeccion o Inicio Proyeccion no estan definidos');
17
+ if (!data ||
18
+ !data?.CantidadProyeccion ||
19
+ !data?.InicioProyeccion ||
20
+ !data?.UltimaGestion) {
21
+ throw new Error('La data o Cantidad Proyeccion o Inicio Proyeccion o fecha de Ultima Gestion no estan definidos');
19
22
  }
20
23
  const cloned = (0, lodash_1.cloneDeep)(data);
21
24
  this.data = {
@@ -285,7 +285,8 @@ const data = {
285
285
  };
286
286
  console.log(JSON.stringify(strategy.execute({
287
287
  CantidadProyeccion: 12,
288
- InicioProyeccion: '2024-03-08T00:00:00.000Z',
288
+ InicioProyeccion: '2025-03-08T00:00:00.000Z',
289
+ UltimaGestion: '2024-03-08T00:00:00.000Z',
289
290
  PrestamoDirecto: [
290
291
  {
291
292
  ActividadDeudaId: 65,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bdpformulas",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",