bdpformulas 1.0.69 → 1.0.71
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/strategies/eeff/supuestos.strategy.d.ts +1 -1
- package/build/strategies/eeff/supuestos.strategy.js +13 -8
- package/build/strategies/pecuary/Constantes.js +17 -17
- package/build/strategies/pecuary/desarrollo.detail/desarrolloCalc.d.ts +2 -2
- package/build/strategies/pecuary/desarrollo.detail/desarrolloCalc.js +30 -13
- package/build/strategies/pecuary/desarrollo.detail/hatoDisponibleCalc.js +13 -3
- package/build/strategies/pecuary/desarrollo.detail/mortalidadCalc.js +7 -3
- package/build/strategies/pecuary/desarrollo.detail/proyeccionCalc.js +57 -28
- package/build/strategies/pecuary/desarrollo.detail/requerimientoCalc.js +4 -3
- package/build/strategies/pecuary/desarrollo.detail/ventasAnualesCalc.js +17 -5
- package/build/strategies/pecuary/desarrollo.detail/ventasCantidadCalc.js +9 -4
- package/build/strategies/pecuary/desarrollo.strategy.d.ts +2 -2
- package/build/strategies/pecuary/desarrollo.strategy.js +2 -2
- package/package.json +1 -1
|
@@ -13,12 +13,13 @@ class SupuestosStrategy {
|
|
|
13
13
|
//@ts-ignore
|
|
14
14
|
const origenRow = origen.find((item) => item.RubroId == rubroOrigen);
|
|
15
15
|
//@ts-ignore
|
|
16
|
-
|
|
16
|
+
const destinoRow = this.data.find((item) => item.RubroId == rubroDestino);
|
|
17
17
|
if (!percent)
|
|
18
18
|
destinoRow.Gestion1 = this.cleanNumber(origenRow[`Gestion${this.cantidadGestiones}`]);
|
|
19
19
|
else {
|
|
20
20
|
destinoRow.Gestion1 = this.cleanNumber(origenRow[`Gestion${this.cantidadGestiones}%`] / 100);
|
|
21
|
-
destinoRow.Gestion1 =
|
|
21
|
+
destinoRow.Gestion1 =
|
|
22
|
+
Math.round(destinoRow.Gestion1 * 100) / 100;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -31,17 +32,21 @@ class SupuestosStrategy {
|
|
|
31
32
|
execute(data) {
|
|
32
33
|
this.data = data.Supuestos;
|
|
33
34
|
this.cantidadGestiones = data.CantidadGestiones;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
const rowDeprecCoef = data.Supuestos.find((item) => item.RubroId == 'ACT_SUP_10402');
|
|
36
|
+
const rowDeprecValue = data.Supuestos.find((item) => item.RubroId == 'ACT_SUP_10403');
|
|
37
|
+
const rowDeprecCoefLeasing = data.Supuestos.find((item) => item.RubroId == 'ACT_SUP_10404');
|
|
38
|
+
const rowDeprecValueLeasing = data.Supuestos.find((item) => item.RubroId == 'ACT_SUP_10405');
|
|
38
39
|
for (let i = 1; i <= data.CantidadProyeccion; i++) {
|
|
39
40
|
const activosFijosNetos = data.BalanceProyectado.find((item) => item.Correlativo == i && item.RubroId == 'BP_ACT_EF_12003');
|
|
40
41
|
const activosPorArrendamiento = data.BalanceProyectado.find((item) => item.Correlativo == i && item.RubroId == 'BP_ACT_EF_12004');
|
|
41
42
|
if (rowDeprecValue != null)
|
|
42
|
-
rowDeprecValue[`Gestion${i}`] =
|
|
43
|
+
rowDeprecValue[`Gestion${i}`] =
|
|
44
|
+
this.cleanNumber(rowDeprecCoef[`Gestion${i}`]) *
|
|
45
|
+
this.cleanNumber(activosFijosNetos.Monto);
|
|
43
46
|
if (rowDeprecValueLeasing != null)
|
|
44
|
-
rowDeprecValueLeasing[`Gestion${i}`] =
|
|
47
|
+
rowDeprecValueLeasing[`Gestion${i}`] =
|
|
48
|
+
this.cleanNumber(rowDeprecCoefLeasing[`Gestion${i}`]) *
|
|
49
|
+
this.cleanNumber(activosPorArrendamiento.Monto);
|
|
45
50
|
}
|
|
46
51
|
this.anadirPrecalculo(data.EEFF.eerr, 'ACT_EF_42000', 'ACT_SUP_10101');
|
|
47
52
|
this.anadirPrecalculo(data.EEFF.eerr, 'ACT_EF_44003', 'ACT_SUP_10104');
|
|
@@ -19,25 +19,25 @@ exports.getMap = exports.getOrden = exports.RUBROS = exports.PARAMETROS = void 0
|
|
|
19
19
|
// ACT_PEC_DES07 Preñez precoz de vaquillas de 2-3 años
|
|
20
20
|
// ACT_PEC_DES08 Preñez precoz de vaquillas de 1-2 años
|
|
21
21
|
exports.PARAMETROS = {
|
|
22
|
-
IND_PAR:
|
|
23
|
-
IND_MOR1:
|
|
24
|
-
IND_MOR2:
|
|
25
|
-
REL_HEM_MACH:
|
|
26
|
-
REL_VACA_TORO:
|
|
27
|
-
REL_USO_CAMPO:
|
|
28
|
-
PRE_VAQUILLA_2_3:
|
|
29
|
-
PRE_VAQUILLA_1_2:
|
|
22
|
+
IND_PAR: 'ACT_PEC_DES01',
|
|
23
|
+
IND_MOR1: 'ACT_PEC_DES02',
|
|
24
|
+
IND_MOR2: 'ACT_PEC_DES03',
|
|
25
|
+
REL_HEM_MACH: 'ACT_PEC_DES04',
|
|
26
|
+
REL_VACA_TORO: 'ACT_PEC_DES05',
|
|
27
|
+
REL_USO_CAMPO: 'ACT_PEC_DES06',
|
|
28
|
+
PRE_VAQUILLA_2_3: 'ACT_PEC_DES07',
|
|
29
|
+
PRE_VAQUILLA_1_2: 'ACT_PEC_DES08'
|
|
30
30
|
};
|
|
31
31
|
exports.RUBROS = {
|
|
32
|
-
ACT_PEC_H12:
|
|
33
|
-
ACT_PEC_H1324:
|
|
34
|
-
ACT_PEC_H2536:
|
|
35
|
-
ACT_PEC_H36:
|
|
36
|
-
ACT_PEC_M12:
|
|
37
|
-
ACT_PEC_M1324:
|
|
38
|
-
ACT_PEC_M2536:
|
|
39
|
-
ACT_PEC_M36:
|
|
40
|
-
ACT_PEC_NOV:
|
|
32
|
+
ACT_PEC_H12: 'ACT_PEC_H12',
|
|
33
|
+
ACT_PEC_H1324: 'ACT_PEC_H1324',
|
|
34
|
+
ACT_PEC_H2536: 'ACT_PEC_H2536',
|
|
35
|
+
ACT_PEC_H36: 'ACT_PEC_H36',
|
|
36
|
+
ACT_PEC_M12: 'ACT_PEC_M12',
|
|
37
|
+
ACT_PEC_M1324: 'ACT_PEC_M1324',
|
|
38
|
+
ACT_PEC_M2536: 'ACT_PEC_M2536',
|
|
39
|
+
ACT_PEC_M36: 'ACT_PEC_M36',
|
|
40
|
+
ACT_PEC_NOV: 'ACT_PEC_NOV',
|
|
41
41
|
ACT_PEC_SALDO: 'ACT_PEC_SALDO'
|
|
42
42
|
};
|
|
43
43
|
const getOrden = (rubro) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AvaluoSchemaType } from
|
|
2
|
-
import { PropiedadesGanaderasType } from
|
|
1
|
+
import { AvaluoSchemaType } from '../../../models/pecuary/desarrolloResponse.Schema';
|
|
2
|
+
import { PropiedadesGanaderasType } from '../../../models/pecuary/auxiliar.schema';
|
|
3
3
|
export declare const getAvaluo: (avaluo: AvaluoSchemaType[], propiedades: PropiedadesGanaderasType[]) => {
|
|
4
4
|
RubroId: string;
|
|
5
5
|
Descripcion: string;
|
|
@@ -4,22 +4,31 @@ exports.getRequerimientoInit = exports.getProyectado = exports.getTotalesAvaluo
|
|
|
4
4
|
const Constantes_1 = require("../Constantes");
|
|
5
5
|
const getAvaluo = (avaluo, propiedades) => {
|
|
6
6
|
const cantidad = propiedades.length;
|
|
7
|
-
let sumatoria = Array.from(propiedades
|
|
7
|
+
let sumatoria = Array.from(propiedades
|
|
8
|
+
.reduce((acc, item) => {
|
|
8
9
|
item.Rubros.forEach((rubro) => {
|
|
9
10
|
if (!acc.has(rubro.RubroId)) {
|
|
10
|
-
acc.set(rubro.RubroId, {
|
|
11
|
+
acc.set(rubro.RubroId, {
|
|
12
|
+
RubroId: rubro.RubroId,
|
|
13
|
+
Cantidad: 0,
|
|
14
|
+
Precio: 0
|
|
15
|
+
});
|
|
11
16
|
}
|
|
12
|
-
acc.get(rubro.RubroId).Cantidad =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
acc.get(rubro.RubroId).Cantidad =
|
|
18
|
+
acc.get(rubro.RubroId).Cantidad +
|
|
19
|
+
parseFloat(rubro.CantidadCabezas);
|
|
20
|
+
acc.get(rubro.RubroId).Precio =
|
|
21
|
+
acc.get(rubro.RubroId).Precio +
|
|
22
|
+
parseFloat(rubro.PrecioCabeza);
|
|
16
23
|
});
|
|
17
24
|
return acc;
|
|
18
|
-
}, new Map())
|
|
25
|
+
}, new Map())
|
|
26
|
+
.values());
|
|
19
27
|
sumatoria = sumatoria.map((item) => {
|
|
20
|
-
return {
|
|
28
|
+
return {
|
|
29
|
+
...item,
|
|
21
30
|
Cantidad: Math.round(item.Cantidad * 100) / 100,
|
|
22
|
-
PrecioVenta: Math.round(item.Precio / cantidad * 100) / 100
|
|
31
|
+
PrecioVenta: Math.round((item.Precio / cantidad) * 100) / 100
|
|
23
32
|
};
|
|
24
33
|
});
|
|
25
34
|
avaluo = avaluo.map((item) => {
|
|
@@ -49,7 +58,13 @@ const getAvaluo = (avaluo, propiedades) => {
|
|
|
49
58
|
};
|
|
50
59
|
exports.getAvaluo = getAvaluo;
|
|
51
60
|
const getTotalesAvaluo = (avaluo) => {
|
|
52
|
-
|
|
61
|
+
const total = {
|
|
62
|
+
RubroId: 'TOT01',
|
|
63
|
+
Descripcion: 'Totales en Cabezas',
|
|
64
|
+
Orden: 10,
|
|
65
|
+
HatoInicial: 0,
|
|
66
|
+
PlanInversion: 0
|
|
67
|
+
};
|
|
53
68
|
//@ts-ignore
|
|
54
69
|
for (const [key, value] of avaluo) {
|
|
55
70
|
total.HatoInicial += value.HatoInicial;
|
|
@@ -62,7 +77,7 @@ exports.getTotalesAvaluo = getTotalesAvaluo;
|
|
|
62
77
|
const getProyectado = (avaluo, CantidadProy, init = 1) => {
|
|
63
78
|
let result = {};
|
|
64
79
|
result = avaluo.map((item) => {
|
|
65
|
-
|
|
80
|
+
const data = {};
|
|
66
81
|
for (let i = init; i <= CantidadProy; i++) {
|
|
67
82
|
data[`C-${i}`] = 0;
|
|
68
83
|
}
|
|
@@ -81,9 +96,11 @@ const getProyectado = (avaluo, CantidadProy, init = 1) => {
|
|
|
81
96
|
};
|
|
82
97
|
exports.getProyectado = getProyectado;
|
|
83
98
|
const getRequerimientoInit = () => {
|
|
84
|
-
return [
|
|
99
|
+
return [
|
|
100
|
+
{ RubroId: 'REQ01', Descripcion: '# de Vacas Período' },
|
|
85
101
|
{ RubroId: 'REQ02', Descripcion: 'Toros Actuales (Período Anterior)' },
|
|
86
102
|
{ RubroId: 'REQ03', Descripcion: 'Toros Necesarios' },
|
|
87
|
-
{ RubroId: 'REQ04', Descripcion: 'COMPRA DE TOROS' }
|
|
103
|
+
{ RubroId: 'REQ04', Descripcion: 'COMPRA DE TOROS' }
|
|
104
|
+
];
|
|
88
105
|
};
|
|
89
106
|
exports.getRequerimientoInit = getRequerimientoInit;
|
|
@@ -18,11 +18,21 @@ const calcularTotal = (table, cantidad) => {
|
|
|
18
18
|
tot01 += value[`C-${i}`];
|
|
19
19
|
}
|
|
20
20
|
if (!table.has('TOT01'))
|
|
21
|
-
table.set('TOT01', {
|
|
21
|
+
table.set('TOT01', {
|
|
22
|
+
RubroId: 'TOT01',
|
|
23
|
+
Descripcion: 'Total Cabezas Disponibles',
|
|
24
|
+
Orden: 10
|
|
25
|
+
});
|
|
22
26
|
table.get('TOT01')[`C-${i}`] = tot01;
|
|
23
27
|
}
|
|
24
|
-
table.set('TOT02', {
|
|
25
|
-
|
|
28
|
+
table.set('TOT02', {
|
|
29
|
+
RubroId: 'TOT02',
|
|
30
|
+
Descripcion: `Incremento del hato en ${cantidad}`,
|
|
31
|
+
[`C-${cantidad}`]: 100 -
|
|
32
|
+
(table.get('TOT01')[`C-${1}`] /
|
|
33
|
+
table.get('TOT01')[`C-${cantidad}`]) *
|
|
34
|
+
100
|
|
35
|
+
});
|
|
26
36
|
return table;
|
|
27
37
|
};
|
|
28
38
|
exports.calcularTotal = calcularTotal;
|
|
@@ -7,10 +7,10 @@ const calcularData = (i, proyeccion, mortalidad, parametros) => {
|
|
|
7
7
|
const I13 = parametros.get(Constantes_1.PARAMETROS.IND_MOR2).Porcentaje;
|
|
8
8
|
for (const [key, value] of mortalidad) {
|
|
9
9
|
if (key == Constantes_1.RUBROS.ACT_PEC_H12 || key == Constantes_1.RUBROS.ACT_PEC_M12) {
|
|
10
|
-
value[`C-${i}`] = Math.trunc(proyeccion.get(key)[`C-${i - 1}`] * I12 / 100);
|
|
10
|
+
value[`C-${i}`] = Math.trunc((proyeccion.get(key)[`C-${i - 1}`] * I12) / 100);
|
|
11
11
|
}
|
|
12
12
|
else
|
|
13
|
-
value[`C-${i}`] = Math.trunc(proyeccion.get(key)[`C-${i - 1}`] * I13 / 100);
|
|
13
|
+
value[`C-${i}`] = Math.trunc((proyeccion.get(key)[`C-${i - 1}`] * I13) / 100);
|
|
14
14
|
}
|
|
15
15
|
return mortalidad;
|
|
16
16
|
};
|
|
@@ -25,7 +25,11 @@ const calcularTotal = (table, cantidad) => {
|
|
|
25
25
|
tot01 += value[`C-${i}`];
|
|
26
26
|
}
|
|
27
27
|
if (!table.has('TOT01'))
|
|
28
|
-
table.set('TOT01', {
|
|
28
|
+
table.set('TOT01', {
|
|
29
|
+
RubroId: 'TOT01',
|
|
30
|
+
Descripcion: 'Total Mortalidad',
|
|
31
|
+
Orden: 10
|
|
32
|
+
});
|
|
29
33
|
table.get('TOT01')[`C-${i}`] = tot01;
|
|
30
34
|
}
|
|
31
35
|
return table;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calcularTotal = exports.calcularData = void 0;
|
|
4
|
+
const utils_1 = require("../../eeff/admFinanciera/utils");
|
|
4
5
|
const Constantes_1 = require("../Constantes");
|
|
5
6
|
const formulaInicial = (proyeccion, avaluos) => {
|
|
6
7
|
for (const [key, value] of proyeccion) {
|
|
@@ -30,8 +31,13 @@ const calcularData = (i, proyeccion, avaluos, mortalidad, ventasAnuales, paramet
|
|
|
30
31
|
value[`C-${i}`] = formulaTorillos12(i, proyeccion, mortalidad, ventasAnuales);
|
|
31
32
|
if (key == Constantes_1.RUBROS.ACT_PEC_M2536)
|
|
32
33
|
value[`C-${i}`] = formulaTorillos23(i, proyeccion, mortalidad, ventasAnuales);
|
|
33
|
-
if (key ==
|
|
34
|
-
value[`C-${i}`] = formulaNovillos(
|
|
34
|
+
/* if (key == RUBROS.ACT_PEC_NOV)
|
|
35
|
+
value[`C-${i}`] = formulaNovillos(
|
|
36
|
+
i,
|
|
37
|
+
proyeccion,
|
|
38
|
+
mortalidad,
|
|
39
|
+
ventasAnuales
|
|
40
|
+
) */
|
|
35
41
|
}
|
|
36
42
|
return proyeccion;
|
|
37
43
|
}
|
|
@@ -45,15 +51,29 @@ const calcularTotal = (proyeccion, avaluo, parametros, cantidad) => {
|
|
|
45
51
|
if (key == 'TOT01' || key == 'TOT02' || key == 'TOT03')
|
|
46
52
|
continue;
|
|
47
53
|
tot01 += value[`C-${i}`];
|
|
48
|
-
tot02 +=
|
|
54
|
+
tot02 +=
|
|
55
|
+
(0, utils_1.ourParseFloat)(value[`C-${i}`]) *
|
|
56
|
+
(0, utils_1.ourParseFloat)(avaluo.get(key).Equivalencia);
|
|
49
57
|
}
|
|
50
58
|
tot03 = tot02 * parametros.get(Constantes_1.PARAMETROS.REL_USO_CAMPO).Porcentaje;
|
|
51
59
|
if (!proyeccion.has('TOT01'))
|
|
52
|
-
proyeccion.set('TOT01', {
|
|
60
|
+
proyeccion.set('TOT01', {
|
|
61
|
+
RubroId: 'TOT01',
|
|
62
|
+
Descripcion: 'Totales en Cabezas',
|
|
63
|
+
Orden: 10
|
|
64
|
+
});
|
|
53
65
|
if (!proyeccion.has('TOT02'))
|
|
54
|
-
proyeccion.set('TOT02', {
|
|
66
|
+
proyeccion.set('TOT02', {
|
|
67
|
+
RubroId: 'TOT02',
|
|
68
|
+
Descripcion: 'Totales en U.A.',
|
|
69
|
+
Orden: 11
|
|
70
|
+
});
|
|
55
71
|
if (!proyeccion.has('TOT03'))
|
|
56
|
-
proyeccion.set('TOT03', {
|
|
72
|
+
proyeccion.set('TOT03', {
|
|
73
|
+
RubroId: 'TOT03',
|
|
74
|
+
Descripcion: 'SUP. De Terreno REQ. (Has)',
|
|
75
|
+
Orden: 12
|
|
76
|
+
});
|
|
57
77
|
proyeccion.get('TOT01')[`C-${i}`] = tot01;
|
|
58
78
|
proyeccion.get('TOT02')[`C-${i}`] = tot02;
|
|
59
79
|
proyeccion.get('TOT03')[`C-${i}`] = tot03;
|
|
@@ -62,16 +82,18 @@ const calcularTotal = (proyeccion, avaluo, parametros, cantidad) => {
|
|
|
62
82
|
};
|
|
63
83
|
exports.calcularTotal = calcularTotal;
|
|
64
84
|
const formulaToros = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
65
|
-
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M36)[`C-${i - 1}`]
|
|
66
|
-
proyeccion.get(Constantes_1.RUBROS.ACT_PEC_NOV)[`C-${i - 1}`] -
|
|
85
|
+
return (proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M36)[`C-${i - 1}`] -
|
|
67
86
|
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_M36)[`C-${i}`] -
|
|
68
|
-
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_M36)[`C-${i}`]
|
|
87
|
+
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_M36)[`C-${i}`] +
|
|
88
|
+
(proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M2536)[`C-${i - 1}`] -
|
|
89
|
+
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_M2536)[`C-${i}`] -
|
|
90
|
+
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_M2536)[`C-${i}`]));
|
|
69
91
|
};
|
|
70
92
|
const formulaVacas = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
71
|
-
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i - 1}`] +
|
|
93
|
+
return (proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i - 1}`] +
|
|
72
94
|
proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H2536)[`C-${i - 1}`] -
|
|
73
95
|
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i}`] -
|
|
74
|
-
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i}`];
|
|
96
|
+
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i}`]);
|
|
75
97
|
};
|
|
76
98
|
const formulaTerneras = (i, proyeccion, parametros) => {
|
|
77
99
|
const C25 = proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i - 1}`];
|
|
@@ -80,36 +102,43 @@ const formulaTerneras = (i, proyeccion, parametros) => {
|
|
|
80
102
|
const I14 = parametros.get(Constantes_1.PARAMETROS.REL_HEM_MACH).Porcentaje / 100;
|
|
81
103
|
const I11 = parametros.get(Constantes_1.PARAMETROS.IND_PAR).Porcentaje / 100;
|
|
82
104
|
if (parametros.get(Constantes_1.PARAMETROS.PRE_VAQUILLA_1_2).Bandera == 'SI')
|
|
83
|
-
return (
|
|
105
|
+
return (C25 + C29 + C28) * I14 * I11;
|
|
84
106
|
else {
|
|
85
107
|
if (parametros.get(Constantes_1.PARAMETROS.PRE_VAQUILLA_2_3).Bandera == 'SI')
|
|
86
|
-
return (
|
|
108
|
+
return (C25 + C29) * I14 * I11;
|
|
87
109
|
else
|
|
88
|
-
return
|
|
110
|
+
return C25 * I14 * I11;
|
|
89
111
|
}
|
|
90
112
|
};
|
|
91
113
|
const formulaVaquillas12 = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
92
|
-
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H12)[`C-${i - 1}`] -
|
|
114
|
+
return (proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H12)[`C-${i - 1}`] -
|
|
93
115
|
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_H12)[`C-${i}`] -
|
|
94
|
-
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_H12)[`C-${i}`];
|
|
116
|
+
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_H12)[`C-${i}`]);
|
|
95
117
|
};
|
|
96
118
|
const formulaVaquillas23 = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
97
|
-
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H1324)[`C-${i - 1}`] -
|
|
98
|
-
mortalidad.get(Constantes_1.RUBROS.
|
|
99
|
-
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_H1324)[`C-${i}`];
|
|
119
|
+
return (proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H1324)[`C-${i - 1}`] -
|
|
120
|
+
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_H1324)[`C-${i}`] -
|
|
121
|
+
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_H1324)[`C-${i}`]);
|
|
100
122
|
};
|
|
101
123
|
const formulaTorillos12 = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
102
|
-
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M12)[`C-${i - 1}`] -
|
|
124
|
+
return (proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M12)[`C-${i - 1}`] -
|
|
103
125
|
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_M12)[`C-${i}`] -
|
|
104
|
-
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_M12)[`C-${i}`];
|
|
126
|
+
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_M12)[`C-${i}`]);
|
|
105
127
|
};
|
|
106
128
|
const formulaTorillos23 = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
107
|
-
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M1324)[`C-${i - 1}`] -
|
|
129
|
+
return (proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M1324)[`C-${i - 1}`] -
|
|
108
130
|
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_M1324)[`C-${i}`] -
|
|
109
|
-
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_M1324)[`C-${i}`];
|
|
110
|
-
};
|
|
111
|
-
const formulaNovillos = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
112
|
-
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M2536)[`C-${i - 1}`] -
|
|
113
|
-
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_M2536)[`C-${i}`] -
|
|
114
|
-
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_M2536)[`C-${i}`];
|
|
131
|
+
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_M1324)[`C-${i}`]);
|
|
115
132
|
};
|
|
133
|
+
/* const formulaNovillos = (
|
|
134
|
+
i: number,
|
|
135
|
+
proyeccion: Map<any, any>,
|
|
136
|
+
mortalidad: Map<any, any>,
|
|
137
|
+
ventasAnuales: Map<any, any>
|
|
138
|
+
) => {
|
|
139
|
+
return (
|
|
140
|
+
proyeccion.get(RUBROS.ACT_PEC_M2536)[`C-${i - 1}`] -
|
|
141
|
+
mortalidad.get(RUBROS.ACT_PEC_M2536)[`C-${i}`] -
|
|
142
|
+
ventasAnuales.get(RUBROS.ACT_PEC_M2536)[`C-${i}`]
|
|
143
|
+
)
|
|
144
|
+
} */
|
|
@@ -13,10 +13,11 @@ const calcularData = (i, proyeccion, requerimiento, parametros) => {
|
|
|
13
13
|
}
|
|
14
14
|
for (const [key, value] of requerimiento) {
|
|
15
15
|
if (key == 'REQ03')
|
|
16
|
-
value[`C-${i}`] = Math.trunc(requerimiento.get('REQ01')[`C-${i}`] * I15 / 100);
|
|
16
|
+
value[`C-${i}`] = Math.trunc((requerimiento.get('REQ01')[`C-${i}`] * I15) / 100);
|
|
17
17
|
if (key == 'REQ04')
|
|
18
|
-
value[`C-${i}`] =
|
|
19
|
-
requerimiento.get('
|
|
18
|
+
value[`C-${i}`] =
|
|
19
|
+
requerimiento.get('REQ03')[`C-${i}`] -
|
|
20
|
+
requerimiento.get('REQ02')[`C-${i}`];
|
|
20
21
|
}
|
|
21
22
|
return requerimiento;
|
|
22
23
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calcularTotal = exports.calcularData = void 0;
|
|
4
|
+
const utils_1 = require("../../eeff/admFinanciera/utils");
|
|
4
5
|
const calcularData = (i, ventasAnuales, avaluos, hatoDisponible) => {
|
|
5
6
|
for (const [key, value] of ventasAnuales) {
|
|
6
|
-
value[`C-${i}`] = Math.trunc(hatoDisponible.get(key)[`C-${i}`] * avaluos.get(key).Porcentaje /
|
|
7
|
+
value[`C-${i}`] = Math.trunc((hatoDisponible.get(key)[`C-${i}`] * avaluos.get(key).Porcentaje) /
|
|
8
|
+
100);
|
|
7
9
|
}
|
|
8
10
|
return ventasAnuales;
|
|
9
11
|
};
|
|
@@ -15,13 +17,23 @@ const calcularTotal = (table, avaluo, cantidad) => {
|
|
|
15
17
|
for (const [key, value] of table) {
|
|
16
18
|
if (key == 'TOT01' || key == 'TOT02')
|
|
17
19
|
continue;
|
|
18
|
-
tot01 += value[`C-${i}`];
|
|
19
|
-
tot02 +=
|
|
20
|
+
tot01 += (0, utils_1.ourParseFloat)(value[`C-${i}`]);
|
|
21
|
+
tot02 +=
|
|
22
|
+
(0, utils_1.ourParseFloat)(value[`C-${i}`]) *
|
|
23
|
+
(0, utils_1.ourParseFloat)(avaluo.get(key).Equivalencia);
|
|
20
24
|
}
|
|
21
25
|
if (!table.has('TOT01'))
|
|
22
|
-
table.set('TOT01', {
|
|
26
|
+
table.set('TOT01', {
|
|
27
|
+
RubroId: 'TOT01',
|
|
28
|
+
Descripcion: 'Total Venta Anual',
|
|
29
|
+
Orden: 10
|
|
30
|
+
});
|
|
23
31
|
if (!table.has('TOT02'))
|
|
24
|
-
table.set('TOT02', {
|
|
32
|
+
table.set('TOT02', {
|
|
33
|
+
RubroId: 'TOT02',
|
|
34
|
+
Descripcion: 'Totales en U.A.',
|
|
35
|
+
Orden: 11
|
|
36
|
+
});
|
|
25
37
|
table.get('TOT01')[`C-${i}`] = tot01;
|
|
26
38
|
table.get('TOT02')[`C-${i}`] = tot02;
|
|
27
39
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calcularTotal = exports.calcularData = void 0;
|
|
4
|
+
const utils_1 = require("../../eeff/admFinanciera/utils");
|
|
4
5
|
const calcularData = (i, ventasCantidad, ventasAnuales, avaluosMap) => {
|
|
5
6
|
for (const [key, value] of ventasCantidad) {
|
|
6
|
-
value[`C-${i}`] =
|
|
7
|
-
avaluosMap.get(key).PrecioVenta;
|
|
7
|
+
value[`C-${i}`] =
|
|
8
|
+
ventasAnuales.get(key)[`C-${i}`] * avaluosMap.get(key).PrecioVenta;
|
|
8
9
|
}
|
|
9
10
|
return ventasCantidad;
|
|
10
11
|
};
|
|
@@ -16,10 +17,14 @@ const calcularTotal = (table, cantidad) => {
|
|
|
16
17
|
for (const [key, value] of table) {
|
|
17
18
|
if (key == 'TOT01')
|
|
18
19
|
continue;
|
|
19
|
-
tot01 += value[`C-${i}`];
|
|
20
|
+
tot01 += (0, utils_1.ourParseFloat)(value[`C-${i}`]);
|
|
20
21
|
}
|
|
21
22
|
if (!table.has('TOT01'))
|
|
22
|
-
table.set('TOT01', {
|
|
23
|
+
table.set('TOT01', {
|
|
24
|
+
RubroId: 'TOT01',
|
|
25
|
+
Descripcion: 'Total Venta Anual',
|
|
26
|
+
Orden: 10
|
|
27
|
+
});
|
|
23
28
|
table.get('TOT01')[`C-${i}`] = tot01;
|
|
24
29
|
}
|
|
25
30
|
return table;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Strategy } from
|
|
2
|
-
import { CalcDesarrolloType } from
|
|
1
|
+
import { Strategy } from '../../strategy.interface';
|
|
2
|
+
import { CalcDesarrolloType } from '../../models/pecuary/desarrolloResponse.Schema';
|
|
3
3
|
export default class Desarrollo implements Strategy {
|
|
4
4
|
execute(data: CalcDesarrolloType): any;
|
|
5
5
|
}
|
|
@@ -66,7 +66,7 @@ const getProyDesarrollo = (avaluos, parametros, CantidadProy, CantidadHectareas)
|
|
|
66
66
|
hatoDisponible = hatoDisponibleCalc.calcularTotal(hatoDisponible, CantidadProy);
|
|
67
67
|
ventasAnuales = ventasAnualesCalc.calcularTotal(ventasAnuales, avaluosMap, CantidadProy);
|
|
68
68
|
ventasCantidad = ventasCantidadCalc.calcularTotal(ventasCantidad, CantidadProy);
|
|
69
|
-
|
|
69
|
+
const result = {};
|
|
70
70
|
result.avaluos = Array.from((0, desarrolloCalc_1.getTotalesAvaluo)(avaluosMap).values());
|
|
71
71
|
result.proyeccion = Array.from(proyeccion.values());
|
|
72
72
|
result.requerimiento = Array.from(requerimiento.values());
|
|
@@ -78,7 +78,7 @@ const getProyDesarrollo = (avaluos, parametros, CantidadProy, CantidadHectareas)
|
|
|
78
78
|
};
|
|
79
79
|
class Desarrollo {
|
|
80
80
|
execute(data) {
|
|
81
|
-
|
|
81
|
+
const result = data.Desarrollo;
|
|
82
82
|
const avaluosMap = desarrolloCalc.getAvaluo(data.Desarrollo.Avaluo, data.Auxiliar.PropiedadesGanaderas);
|
|
83
83
|
result.Parametros = data.Desarrollo.Parametros;
|
|
84
84
|
const { proyeccion, mortalidad, hatoDisponible, ventasCantidad, ventasAnuales, requerimiento, avaluos } = getProyDesarrollo(avaluosMap, result.Parametros, result.CantidadProyeccion, result.TamannoHectareas);
|