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.
- package/build/models/eeff/admFinanciera/index.d.ts +1 -0
- package/build/strategies/eeff/admFinanciera/prestamoBajoLineaHandler.js +1 -1
- package/build/strategies/eeff/admFinanciera/prestamoDirectoHandler.js +3 -4
- package/build/strategies/eeff/admFinanciera.strategy.js +5 -2
- package/build/strategies/eeff/index.js +2 -1
- package/package.json +1 -1
|
@@ -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.
|
|
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)(
|
|
136
|
+
(0, utils_1.ourParseFloat)(porcion),
|
|
138
137
|
plazo: (0, utils_1.ourParseFloat)(this.prestamo.Plazo) * 12 -
|
|
139
|
-
(0, utils_1.ourParseFloat)(
|
|
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 ||
|
|
18
|
-
|
|
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: '
|
|
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,
|