bdpformulas 1.0.7 → 1.0.9
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/pecuary/desarrolloResponse.Schema.d.ts +53 -53
- package/build/models/pecuary/desarrolloResponse.Schema.js +4 -4
- package/build/strategies/pecuary/Constantes.d.ts +1 -0
- package/build/strategies/pecuary/Constantes.js +24 -3
- package/build/strategies/pecuary/anexo.strategy.js +1 -1
- package/build/strategies/pecuary/desarrollo.detail/desarrolloCalc.d.ts +4 -15
- package/build/strategies/pecuary/desarrollo.detail/desarrolloCalc.js +28 -26
- package/build/strategies/pecuary/desarrollo.detail/hatoDisponibleCalc.d.ts +1 -0
- package/build/strategies/pecuary/desarrollo.detail/hatoDisponibleCalc.js +20 -2
- package/build/strategies/pecuary/desarrollo.detail/mortalidadCalc.d.ts +1 -0
- package/build/strategies/pecuary/desarrollo.detail/mortalidadCalc.js +21 -4
- package/build/strategies/pecuary/desarrollo.detail/proyeccionCalc.d.ts +1 -0
- package/build/strategies/pecuary/desarrollo.detail/proyeccionCalc.js +37 -12
- package/build/strategies/pecuary/desarrollo.detail/requerimientoCalc.js +1 -4
- package/build/strategies/pecuary/desarrollo.detail/ventasAnualesCalc.d.ts +1 -0
- package/build/strategies/pecuary/desarrollo.detail/ventasAnualesCalc.js +22 -2
- package/build/strategies/pecuary/desarrollo.detail/ventasCantidadCalc.d.ts +1 -0
- package/build/strategies/pecuary/desarrollo.detail/ventasCantidadCalc.js +18 -2
- package/build/strategies/pecuary/desarrollo.strategy.js +26 -20
- package/package.json +1 -1
|
@@ -2,27 +2,27 @@ import { z } from 'zod';
|
|
|
2
2
|
declare const AvaluoSchema: z.ZodObject<{
|
|
3
3
|
RubroId: z.ZodString;
|
|
4
4
|
Descripcion: z.ZodString;
|
|
5
|
-
PlanInversion: z.ZodNullable<z.
|
|
6
|
-
Equivalencia: z.ZodNullable<z.
|
|
7
|
-
Porcentaje: z.ZodNullable<z.
|
|
5
|
+
PlanInversion: z.ZodNullable<z.ZodNumber>;
|
|
6
|
+
Equivalencia: z.ZodNullable<z.ZodNumber>;
|
|
7
|
+
Porcentaje: z.ZodNullable<z.ZodNumber>;
|
|
8
8
|
Justificaciones: z.ZodNullable<z.ZodString>;
|
|
9
9
|
HatoInicial: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
10
10
|
PrecioVenta: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
RubroId: string;
|
|
13
13
|
Descripcion: string;
|
|
14
|
-
PlanInversion:
|
|
15
|
-
Equivalencia:
|
|
16
|
-
Porcentaje:
|
|
14
|
+
PlanInversion: number | null;
|
|
15
|
+
Equivalencia: number | null;
|
|
16
|
+
Porcentaje: number | null;
|
|
17
17
|
Justificaciones: string | null;
|
|
18
18
|
HatoInicial?: number | null | undefined;
|
|
19
19
|
PrecioVenta?: number | null | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
RubroId: string;
|
|
22
22
|
Descripcion: string;
|
|
23
|
-
PlanInversion:
|
|
24
|
-
Equivalencia:
|
|
25
|
-
Porcentaje:
|
|
23
|
+
PlanInversion: number | null;
|
|
24
|
+
Equivalencia: number | null;
|
|
25
|
+
Porcentaje: number | null;
|
|
26
26
|
Justificaciones: string | null;
|
|
27
27
|
HatoInicial?: number | null | undefined;
|
|
28
28
|
PrecioVenta?: number | null | undefined;
|
|
@@ -58,7 +58,7 @@ export declare const DesarrolloSchema: z.ZodObject<{
|
|
|
58
58
|
NombreCompleto: z.ZodString;
|
|
59
59
|
Municipio: z.ZodString;
|
|
60
60
|
NombrePropiedad: z.ZodString;
|
|
61
|
-
TamannoHectareas: z.
|
|
61
|
+
TamannoHectareas: z.ZodNumber;
|
|
62
62
|
ActividadGanadera: z.ZodString;
|
|
63
63
|
CantidadProyeccion: z.ZodNumber;
|
|
64
64
|
Solicitudes: z.ZodArray<z.ZodObject<{
|
|
@@ -92,27 +92,27 @@ export declare const DesarrolloSchema: z.ZodObject<{
|
|
|
92
92
|
Avaluo: z.ZodArray<z.ZodObject<{
|
|
93
93
|
RubroId: z.ZodString;
|
|
94
94
|
Descripcion: z.ZodString;
|
|
95
|
-
PlanInversion: z.ZodNullable<z.
|
|
96
|
-
Equivalencia: z.ZodNullable<z.
|
|
97
|
-
Porcentaje: z.ZodNullable<z.
|
|
95
|
+
PlanInversion: z.ZodNullable<z.ZodNumber>;
|
|
96
|
+
Equivalencia: z.ZodNullable<z.ZodNumber>;
|
|
97
|
+
Porcentaje: z.ZodNullable<z.ZodNumber>;
|
|
98
98
|
Justificaciones: z.ZodNullable<z.ZodString>;
|
|
99
99
|
HatoInicial: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
100
100
|
PrecioVenta: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
101
101
|
}, "strip", z.ZodTypeAny, {
|
|
102
102
|
RubroId: string;
|
|
103
103
|
Descripcion: string;
|
|
104
|
-
PlanInversion:
|
|
105
|
-
Equivalencia:
|
|
106
|
-
Porcentaje:
|
|
104
|
+
PlanInversion: number | null;
|
|
105
|
+
Equivalencia: number | null;
|
|
106
|
+
Porcentaje: number | null;
|
|
107
107
|
Justificaciones: string | null;
|
|
108
108
|
HatoInicial?: number | null | undefined;
|
|
109
109
|
PrecioVenta?: number | null | undefined;
|
|
110
110
|
}, {
|
|
111
111
|
RubroId: string;
|
|
112
112
|
Descripcion: string;
|
|
113
|
-
PlanInversion:
|
|
114
|
-
Equivalencia:
|
|
115
|
-
Porcentaje:
|
|
113
|
+
PlanInversion: number | null;
|
|
114
|
+
Equivalencia: number | null;
|
|
115
|
+
Porcentaje: number | null;
|
|
116
116
|
Justificaciones: string | null;
|
|
117
117
|
HatoInicial?: number | null | undefined;
|
|
118
118
|
PrecioVenta?: number | null | undefined;
|
|
@@ -148,7 +148,7 @@ export declare const DesarrolloSchema: z.ZodObject<{
|
|
|
148
148
|
NombreCompleto: string;
|
|
149
149
|
Municipio: string;
|
|
150
150
|
NombrePropiedad: string;
|
|
151
|
-
TamannoHectareas:
|
|
151
|
+
TamannoHectareas: number;
|
|
152
152
|
ActividadGanadera: string;
|
|
153
153
|
CantidadProyeccion: number;
|
|
154
154
|
Solicitudes: {
|
|
@@ -164,9 +164,9 @@ export declare const DesarrolloSchema: z.ZodObject<{
|
|
|
164
164
|
Avaluo: {
|
|
165
165
|
RubroId: string;
|
|
166
166
|
Descripcion: string;
|
|
167
|
-
PlanInversion:
|
|
168
|
-
Equivalencia:
|
|
169
|
-
Porcentaje:
|
|
167
|
+
PlanInversion: number | null;
|
|
168
|
+
Equivalencia: number | null;
|
|
169
|
+
Porcentaje: number | null;
|
|
170
170
|
Justificaciones: string | null;
|
|
171
171
|
HatoInicial?: number | null | undefined;
|
|
172
172
|
PrecioVenta?: number | null | undefined;
|
|
@@ -188,7 +188,7 @@ export declare const DesarrolloSchema: z.ZodObject<{
|
|
|
188
188
|
NombreCompleto: string;
|
|
189
189
|
Municipio: string;
|
|
190
190
|
NombrePropiedad: string;
|
|
191
|
-
TamannoHectareas:
|
|
191
|
+
TamannoHectareas: number;
|
|
192
192
|
ActividadGanadera: string;
|
|
193
193
|
CantidadProyeccion: number;
|
|
194
194
|
Solicitudes: {
|
|
@@ -204,9 +204,9 @@ export declare const DesarrolloSchema: z.ZodObject<{
|
|
|
204
204
|
Avaluo: {
|
|
205
205
|
RubroId: string;
|
|
206
206
|
Descripcion: string;
|
|
207
|
-
PlanInversion:
|
|
208
|
-
Equivalencia:
|
|
209
|
-
Porcentaje:
|
|
207
|
+
PlanInversion: number | null;
|
|
208
|
+
Equivalencia: number | null;
|
|
209
|
+
Porcentaje: number | null;
|
|
210
210
|
Justificaciones: string | null;
|
|
211
211
|
HatoInicial?: number | null | undefined;
|
|
212
212
|
PrecioVenta?: number | null | undefined;
|
|
@@ -230,7 +230,7 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
230
230
|
NombreCompleto: z.ZodString;
|
|
231
231
|
Municipio: z.ZodString;
|
|
232
232
|
NombrePropiedad: z.ZodString;
|
|
233
|
-
TamannoHectareas: z.
|
|
233
|
+
TamannoHectareas: z.ZodNumber;
|
|
234
234
|
ActividadGanadera: z.ZodString;
|
|
235
235
|
CantidadProyeccion: z.ZodNumber;
|
|
236
236
|
Solicitudes: z.ZodArray<z.ZodObject<{
|
|
@@ -264,27 +264,27 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
264
264
|
Avaluo: z.ZodArray<z.ZodObject<{
|
|
265
265
|
RubroId: z.ZodString;
|
|
266
266
|
Descripcion: z.ZodString;
|
|
267
|
-
PlanInversion: z.ZodNullable<z.
|
|
268
|
-
Equivalencia: z.ZodNullable<z.
|
|
269
|
-
Porcentaje: z.ZodNullable<z.
|
|
267
|
+
PlanInversion: z.ZodNullable<z.ZodNumber>;
|
|
268
|
+
Equivalencia: z.ZodNullable<z.ZodNumber>;
|
|
269
|
+
Porcentaje: z.ZodNullable<z.ZodNumber>;
|
|
270
270
|
Justificaciones: z.ZodNullable<z.ZodString>;
|
|
271
271
|
HatoInicial: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
272
272
|
PrecioVenta: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
273
273
|
}, "strip", z.ZodTypeAny, {
|
|
274
274
|
RubroId: string;
|
|
275
275
|
Descripcion: string;
|
|
276
|
-
PlanInversion:
|
|
277
|
-
Equivalencia:
|
|
278
|
-
Porcentaje:
|
|
276
|
+
PlanInversion: number | null;
|
|
277
|
+
Equivalencia: number | null;
|
|
278
|
+
Porcentaje: number | null;
|
|
279
279
|
Justificaciones: string | null;
|
|
280
280
|
HatoInicial?: number | null | undefined;
|
|
281
281
|
PrecioVenta?: number | null | undefined;
|
|
282
282
|
}, {
|
|
283
283
|
RubroId: string;
|
|
284
284
|
Descripcion: string;
|
|
285
|
-
PlanInversion:
|
|
286
|
-
Equivalencia:
|
|
287
|
-
Porcentaje:
|
|
285
|
+
PlanInversion: number | null;
|
|
286
|
+
Equivalencia: number | null;
|
|
287
|
+
Porcentaje: number | null;
|
|
288
288
|
Justificaciones: string | null;
|
|
289
289
|
HatoInicial?: number | null | undefined;
|
|
290
290
|
PrecioVenta?: number | null | undefined;
|
|
@@ -320,7 +320,7 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
320
320
|
NombreCompleto: string;
|
|
321
321
|
Municipio: string;
|
|
322
322
|
NombrePropiedad: string;
|
|
323
|
-
TamannoHectareas:
|
|
323
|
+
TamannoHectareas: number;
|
|
324
324
|
ActividadGanadera: string;
|
|
325
325
|
CantidadProyeccion: number;
|
|
326
326
|
Solicitudes: {
|
|
@@ -336,9 +336,9 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
336
336
|
Avaluo: {
|
|
337
337
|
RubroId: string;
|
|
338
338
|
Descripcion: string;
|
|
339
|
-
PlanInversion:
|
|
340
|
-
Equivalencia:
|
|
341
|
-
Porcentaje:
|
|
339
|
+
PlanInversion: number | null;
|
|
340
|
+
Equivalencia: number | null;
|
|
341
|
+
Porcentaje: number | null;
|
|
342
342
|
Justificaciones: string | null;
|
|
343
343
|
HatoInicial?: number | null | undefined;
|
|
344
344
|
PrecioVenta?: number | null | undefined;
|
|
@@ -360,7 +360,7 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
360
360
|
NombreCompleto: string;
|
|
361
361
|
Municipio: string;
|
|
362
362
|
NombrePropiedad: string;
|
|
363
|
-
TamannoHectareas:
|
|
363
|
+
TamannoHectareas: number;
|
|
364
364
|
ActividadGanadera: string;
|
|
365
365
|
CantidadProyeccion: number;
|
|
366
366
|
Solicitudes: {
|
|
@@ -376,9 +376,9 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
376
376
|
Avaluo: {
|
|
377
377
|
RubroId: string;
|
|
378
378
|
Descripcion: string;
|
|
379
|
-
PlanInversion:
|
|
380
|
-
Equivalencia:
|
|
381
|
-
Porcentaje:
|
|
379
|
+
PlanInversion: number | null;
|
|
380
|
+
Equivalencia: number | null;
|
|
381
|
+
Porcentaje: number | null;
|
|
382
382
|
Justificaciones: string | null;
|
|
383
383
|
HatoInicial?: number | null | undefined;
|
|
384
384
|
PrecioVenta?: number | null | undefined;
|
|
@@ -603,7 +603,7 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
603
603
|
NombreCompleto: string;
|
|
604
604
|
Municipio: string;
|
|
605
605
|
NombrePropiedad: string;
|
|
606
|
-
TamannoHectareas:
|
|
606
|
+
TamannoHectareas: number;
|
|
607
607
|
ActividadGanadera: string;
|
|
608
608
|
CantidadProyeccion: number;
|
|
609
609
|
Solicitudes: {
|
|
@@ -619,9 +619,9 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
619
619
|
Avaluo: {
|
|
620
620
|
RubroId: string;
|
|
621
621
|
Descripcion: string;
|
|
622
|
-
PlanInversion:
|
|
623
|
-
Equivalencia:
|
|
624
|
-
Porcentaje:
|
|
622
|
+
PlanInversion: number | null;
|
|
623
|
+
Equivalencia: number | null;
|
|
624
|
+
Porcentaje: number | null;
|
|
625
625
|
Justificaciones: string | null;
|
|
626
626
|
HatoInicial?: number | null | undefined;
|
|
627
627
|
PrecioVenta?: number | null | undefined;
|
|
@@ -686,7 +686,7 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
686
686
|
NombreCompleto: string;
|
|
687
687
|
Municipio: string;
|
|
688
688
|
NombrePropiedad: string;
|
|
689
|
-
TamannoHectareas:
|
|
689
|
+
TamannoHectareas: number;
|
|
690
690
|
ActividadGanadera: string;
|
|
691
691
|
CantidadProyeccion: number;
|
|
692
692
|
Solicitudes: {
|
|
@@ -702,9 +702,9 @@ export declare const CalcDesarrolloSchema: z.ZodObject<{
|
|
|
702
702
|
Avaluo: {
|
|
703
703
|
RubroId: string;
|
|
704
704
|
Descripcion: string;
|
|
705
|
-
PlanInversion:
|
|
706
|
-
Equivalencia:
|
|
707
|
-
Porcentaje:
|
|
705
|
+
PlanInversion: number | null;
|
|
706
|
+
Equivalencia: number | null;
|
|
707
|
+
Porcentaje: number | null;
|
|
708
708
|
Justificaciones: string | null;
|
|
709
709
|
HatoInicial?: number | null | undefined;
|
|
710
710
|
PrecioVenta?: number | null | undefined;
|
|
@@ -16,9 +16,9 @@ const SolicitudSchema = zod_1.z.object({
|
|
|
16
16
|
const AvaluoSchema = zod_1.z.object({
|
|
17
17
|
RubroId: zod_1.z.string(),
|
|
18
18
|
Descripcion: zod_1.z.string(),
|
|
19
|
-
PlanInversion: zod_1.z.
|
|
20
|
-
Equivalencia: zod_1.z.
|
|
21
|
-
Porcentaje: zod_1.z.
|
|
19
|
+
PlanInversion: zod_1.z.number().nullable(),
|
|
20
|
+
Equivalencia: zod_1.z.number().nullable(),
|
|
21
|
+
Porcentaje: zod_1.z.number().nullable(),
|
|
22
22
|
Justificaciones: zod_1.z.string().nullable(),
|
|
23
23
|
HatoInicial: zod_1.z.number().nullable().optional(),
|
|
24
24
|
PrecioVenta: zod_1.z.number().nullable().optional(),
|
|
@@ -40,7 +40,7 @@ exports.DesarrolloSchema = zod_1.z.object({
|
|
|
40
40
|
NombreCompleto: zod_1.z.string(),
|
|
41
41
|
Municipio: zod_1.z.string(),
|
|
42
42
|
NombrePropiedad: zod_1.z.string(),
|
|
43
|
-
TamannoHectareas: zod_1.z.
|
|
43
|
+
TamannoHectareas: zod_1.z.number(),
|
|
44
44
|
ActividadGanadera: zod_1.z.string(),
|
|
45
45
|
CantidadProyeccion: zod_1.z.number(),
|
|
46
46
|
Solicitudes: zod_1.z.array(SolicitudSchema),
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// ACT_PEC_M36 TOROS
|
|
10
10
|
// ACT_PEC_NOV NOVILLOS > 3 AÑOS
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RUBROS = exports.PARAMETROS = void 0;
|
|
12
|
+
exports.getOrden = exports.RUBROS = exports.PARAMETROS = void 0;
|
|
13
13
|
// ACT_PEC_DES01 Índice de parición
|
|
14
14
|
// ACT_PEC_DES02 Índice de mortalidad < 1 año
|
|
15
15
|
// ACT_PEC_DES03 Índice de mortalidad > 1 año
|
|
@@ -30,8 +30,8 @@ exports.PARAMETROS = {
|
|
|
30
30
|
};
|
|
31
31
|
exports.RUBROS = {
|
|
32
32
|
ACT_PEC_H12: "ACT_PEC_H12",
|
|
33
|
-
ACT_PEC_H1324: "
|
|
34
|
-
ACT_PEC_H2536: "
|
|
33
|
+
ACT_PEC_H1324: "ACT_PEC_H1324",
|
|
34
|
+
ACT_PEC_H2536: "ACT_PEC_H2536",
|
|
35
35
|
ACT_PEC_H36: "ACT_PEC_H36",
|
|
36
36
|
ACT_PEC_M12: "ACT_PEC_M12",
|
|
37
37
|
ACT_PEC_M1324: "ACT_PEC_M1324",
|
|
@@ -39,3 +39,24 @@ exports.RUBROS = {
|
|
|
39
39
|
ACT_PEC_M36: "ACT_PEC_M36",
|
|
40
40
|
ACT_PEC_NOV: "ACT_PEC_NOV"
|
|
41
41
|
};
|
|
42
|
+
const getOrden = (rubro) => {
|
|
43
|
+
if (rubro == exports.RUBROS.ACT_PEC_M36)
|
|
44
|
+
return 1;
|
|
45
|
+
if (rubro == exports.RUBROS.ACT_PEC_H36)
|
|
46
|
+
return 2;
|
|
47
|
+
if (rubro == exports.RUBROS.ACT_PEC_M12)
|
|
48
|
+
return 3;
|
|
49
|
+
if (rubro == exports.RUBROS.ACT_PEC_H12)
|
|
50
|
+
return 4;
|
|
51
|
+
if (rubro == exports.RUBROS.ACT_PEC_H1324)
|
|
52
|
+
return 5;
|
|
53
|
+
if (rubro == exports.RUBROS.ACT_PEC_H2536)
|
|
54
|
+
return 6;
|
|
55
|
+
if (rubro == exports.RUBROS.ACT_PEC_M1324)
|
|
56
|
+
return 7;
|
|
57
|
+
if (rubro == exports.RUBROS.ACT_PEC_M2536)
|
|
58
|
+
return 8;
|
|
59
|
+
if (rubro == exports.RUBROS.ACT_PEC_NOV)
|
|
60
|
+
return 9;
|
|
61
|
+
};
|
|
62
|
+
exports.getOrden = getOrden;
|
|
@@ -3,26 +3,15 @@ import { PropiedadesGanaderasType } from "../../../models/pecuary/auxiliar.schem
|
|
|
3
3
|
export declare const getAvaluo: (avaluo: AvaluoSchemaType[], propiedades: PropiedadesGanaderasType[]) => {
|
|
4
4
|
RubroId: string;
|
|
5
5
|
Descripcion: string;
|
|
6
|
-
PlanInversion:
|
|
7
|
-
Equivalencia:
|
|
8
|
-
Porcentaje:
|
|
6
|
+
PlanInversion: number | null;
|
|
7
|
+
Equivalencia: number | null;
|
|
8
|
+
Porcentaje: number | null;
|
|
9
9
|
Justificaciones: string | null;
|
|
10
10
|
HatoInicial?: number | null | undefined;
|
|
11
11
|
PrecioVenta?: number | null | undefined;
|
|
12
12
|
}[];
|
|
13
|
+
export declare const getTotalesAvaluo: (avaluo: Map<any, any>) => Map<any, any>;
|
|
13
14
|
export declare const getProyectado: (avaluo: any[], CantidadProy: number, init?: number) => any;
|
|
14
|
-
export declare const getEquivalencias: (avaluo: AvaluoSchemaType[]) => {
|
|
15
|
-
RubroId: string;
|
|
16
|
-
Descripcion: string;
|
|
17
|
-
Equivalencia: string | null;
|
|
18
|
-
PrecioVenta: number | null | undefined;
|
|
19
|
-
}[];
|
|
20
|
-
export declare const getDescartes: (avaluo: AvaluoSchemaType[]) => {
|
|
21
|
-
RubroId: string;
|
|
22
|
-
Descripcion: string;
|
|
23
|
-
Porcentaje: string | null;
|
|
24
|
-
Justificaciones: string | null;
|
|
25
|
-
}[];
|
|
26
15
|
export declare const getRequerimientoInit: () => {
|
|
27
16
|
RubroId: string;
|
|
28
17
|
Descripcion: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRequerimientoInit = exports.
|
|
3
|
+
exports.getRequerimientoInit = exports.getProyectado = exports.getTotalesAvaluo = exports.getAvaluo = void 0;
|
|
4
|
+
const Constantes_1 = require("../Constantes");
|
|
4
5
|
const getAvaluo = (avaluo, propiedades) => {
|
|
5
6
|
const cantidad = propiedades.length;
|
|
6
7
|
let sumatoria = Array.from(propiedades.reduce((acc, item) => {
|
|
@@ -22,16 +23,39 @@ const getAvaluo = (avaluo, propiedades) => {
|
|
|
22
23
|
item.HatoInicial = 0;
|
|
23
24
|
if (cantidad > 0) {
|
|
24
25
|
const findx = sumatoria.find((rubro) => rubro.RubroId === item.RubroId);
|
|
25
|
-
if (findx)
|
|
26
|
+
if (findx) {
|
|
26
27
|
item.HatoInicial = findx.Cantidad;
|
|
27
|
-
|
|
28
|
+
item.PrecioVenta = findx.PrecioVenta;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
28
31
|
item.HatoInicial = 0;
|
|
32
|
+
item.PrecioVenta = 0;
|
|
33
|
+
}
|
|
29
34
|
}
|
|
35
|
+
//@ts-ignore
|
|
36
|
+
item.Porcentaje = parseFloat(item.Porcentaje);
|
|
37
|
+
//@ts-ignore
|
|
38
|
+
item.Equivalencia = parseFloat(item.Equivalencia);
|
|
39
|
+
//@ts-ignore
|
|
40
|
+
item.PlanInversion = parseFloat(item.PlanInversion);
|
|
41
|
+
//@ts-ignore
|
|
42
|
+
item.Orden = (0, Constantes_1.getOrden)(item.RubroId);
|
|
30
43
|
return item;
|
|
31
44
|
});
|
|
32
45
|
return avaluo;
|
|
33
46
|
};
|
|
34
47
|
exports.getAvaluo = getAvaluo;
|
|
48
|
+
const getTotalesAvaluo = (avaluo) => {
|
|
49
|
+
let total = { RubroId: 'TOT01', Descripcion: 'Totales en Cabezas', Orden: 10, HatoInicial: 0, PlanInversion: 0 };
|
|
50
|
+
//@ts-ignore
|
|
51
|
+
for (const [key, value] of avaluo) {
|
|
52
|
+
total.HatoInicial += value.HatoInicial;
|
|
53
|
+
total.PlanInversion += value.PlanInversion;
|
|
54
|
+
}
|
|
55
|
+
avaluo.set('TOT01', total);
|
|
56
|
+
return avaluo;
|
|
57
|
+
};
|
|
58
|
+
exports.getTotalesAvaluo = getTotalesAvaluo;
|
|
35
59
|
const getProyectado = (avaluo, CantidadProy, init = 1) => {
|
|
36
60
|
let result = {};
|
|
37
61
|
result = avaluo.map((item) => {
|
|
@@ -39,7 +63,7 @@ const getProyectado = (avaluo, CantidadProy, init = 1) => {
|
|
|
39
63
|
for (let i = init; i <= CantidadProy; i++) {
|
|
40
64
|
data[`C-${i}`] = 0;
|
|
41
65
|
}
|
|
42
|
-
return Object.assign({ RubroId: item.RubroId, Descripcion: item.Descripcion }, data);
|
|
66
|
+
return Object.assign({ RubroId: item.RubroId, Descripcion: item.Descripcion, Orden: (0, Constantes_1.getOrden)(item.RubroId) }, data);
|
|
43
67
|
});
|
|
44
68
|
result = result.reduce((acc, item) => {
|
|
45
69
|
acc.set(item.RubroId, Object.assign({}, item));
|
|
@@ -48,28 +72,6 @@ const getProyectado = (avaluo, CantidadProy, init = 1) => {
|
|
|
48
72
|
return result;
|
|
49
73
|
};
|
|
50
74
|
exports.getProyectado = getProyectado;
|
|
51
|
-
const getEquivalencias = (avaluo) => {
|
|
52
|
-
return avaluo.map((item) => {
|
|
53
|
-
return {
|
|
54
|
-
RubroId: item.RubroId,
|
|
55
|
-
Descripcion: item.Descripcion,
|
|
56
|
-
Equivalencia: item.Equivalencia,
|
|
57
|
-
PrecioVenta: item.PrecioVenta
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
exports.getEquivalencias = getEquivalencias;
|
|
62
|
-
const getDescartes = (avaluo) => {
|
|
63
|
-
return avaluo.map((item) => {
|
|
64
|
-
return {
|
|
65
|
-
RubroId: item.RubroId,
|
|
66
|
-
Descripcion: item.Descripcion,
|
|
67
|
-
Porcentaje: item.Porcentaje,
|
|
68
|
-
Justificaciones: item.Justificaciones,
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
exports.getDescartes = getDescartes;
|
|
73
75
|
const getRequerimientoInit = () => {
|
|
74
76
|
return [{ RubroId: 'REQ01', Descripcion: '# de Vacas Período' },
|
|
75
77
|
{ RubroId: 'REQ02', Descripcion: 'Toros Actuales (Período Anterior)' },
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calcularData = void 0;
|
|
3
|
+
exports.calcularTotal = exports.calcularData = void 0;
|
|
4
4
|
const calcularData = (i, proyeccion, hatoDisponible, mortalidad) => {
|
|
5
5
|
for (const [key, value] of hatoDisponible) {
|
|
6
|
-
value[`C-${i}`] = Math.
|
|
6
|
+
value[`C-${i}`] = Math.trunc(proyeccion.get(key)[`C-${i - 1}`] - mortalidad.get(key)[`C-${i}`]);
|
|
7
7
|
}
|
|
8
8
|
return hatoDisponible;
|
|
9
9
|
};
|
|
10
10
|
exports.calcularData = calcularData;
|
|
11
|
+
const calcularTotal = (table, cantidad) => {
|
|
12
|
+
let tot01;
|
|
13
|
+
for (let i = 1; i <= cantidad; i++) {
|
|
14
|
+
tot01 = 0;
|
|
15
|
+
for (const [key, value] of table) {
|
|
16
|
+
if (key == 'TOT01')
|
|
17
|
+
continue;
|
|
18
|
+
tot01 += value[`C-${i}`];
|
|
19
|
+
}
|
|
20
|
+
if (!table.has('TOT01'))
|
|
21
|
+
table.set('TOT01', { RubroId: 'TOT01', Descripcion: 'Total Cabezas Disponibles', Orden: 10 });
|
|
22
|
+
table.get('TOT01')[`C-${i}`] = tot01;
|
|
23
|
+
}
|
|
24
|
+
table.set('TOT02', { RubroId: 'TOT02', Descripcion: `Incremento del hato en ${cantidad}`,
|
|
25
|
+
[`C-${cantidad}`]: table.get('TOT01')[`C-${1}`] / table.get('TOT01')[`C-${cantidad}`] * 100 });
|
|
26
|
+
return table;
|
|
27
|
+
};
|
|
28
|
+
exports.calcularTotal = calcularTotal;
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calcularData = void 0;
|
|
3
|
+
exports.calcularTotal = exports.calcularData = void 0;
|
|
4
4
|
const Constantes_1 = require("../Constantes");
|
|
5
5
|
const calcularData = (i, proyeccion, mortalidad, parametros) => {
|
|
6
6
|
const I12 = parametros.get(Constantes_1.PARAMETROS.IND_MOR1).Porcentaje;
|
|
7
7
|
const I13 = parametros.get(Constantes_1.PARAMETROS.IND_MOR2).Porcentaje;
|
|
8
8
|
for (const [key, value] of mortalidad) {
|
|
9
|
-
if (key == Constantes_1.RUBROS.ACT_PEC_H12 || key == Constantes_1.RUBROS.ACT_PEC_M12)
|
|
10
|
-
value[`C-${i}`] = Math.
|
|
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);
|
|
11
|
+
}
|
|
11
12
|
else
|
|
12
|
-
value[`C-${i}`] = Math.
|
|
13
|
+
value[`C-${i}`] = Math.trunc(proyeccion.get(key)[`C-${i - 1}`] * I13 / 100);
|
|
13
14
|
}
|
|
14
15
|
return mortalidad;
|
|
15
16
|
};
|
|
16
17
|
exports.calcularData = calcularData;
|
|
18
|
+
const calcularTotal = (table, cantidad) => {
|
|
19
|
+
let tot01;
|
|
20
|
+
for (let i = 1; i <= cantidad; i++) {
|
|
21
|
+
tot01 = 0;
|
|
22
|
+
for (const [key, value] of table) {
|
|
23
|
+
if (key == 'TOT01')
|
|
24
|
+
continue;
|
|
25
|
+
tot01 += value[`C-${i}`];
|
|
26
|
+
}
|
|
27
|
+
if (!table.has('TOT01'))
|
|
28
|
+
table.set('TOT01', { RubroId: 'TOT01', Descripcion: 'Total Mortalidad', Orden: 10 });
|
|
29
|
+
table.get('TOT01')[`C-${i}`] = tot01;
|
|
30
|
+
}
|
|
31
|
+
return table;
|
|
32
|
+
};
|
|
33
|
+
exports.calcularTotal = calcularTotal;
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export declare const calcularData: (i: number, proyeccion: Map<any, any>, avaluos: Map<any, any>, mortalidad: Map<any, any>, ventasAnuales: Map<any, any>, parametros: Map<any, any>) => any;
|
|
2
|
+
export declare const calcularTotal: (proyeccion: Map<any, any>, avaluo: Map<any, any>, parametros: Map<any, any>, cantidad: number) => Map<any, any>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calcularData = void 0;
|
|
3
|
+
exports.calcularTotal = exports.calcularData = void 0;
|
|
4
4
|
const Constantes_1 = require("../Constantes");
|
|
5
5
|
const formulaInicial = (proyeccion, avaluos) => {
|
|
6
6
|
for (const [key, value] of proyeccion) {
|
|
7
7
|
const avaluo = avaluos.get(key);
|
|
8
|
-
value[`C-0`] = avaluo.HatoInicial
|
|
8
|
+
value[`C-0`] = avaluo.HatoInicial + avaluo.PlanInversion;
|
|
9
9
|
}
|
|
10
10
|
return proyeccion;
|
|
11
11
|
};
|
|
@@ -33,9 +33,34 @@ const calcularData = (i, proyeccion, avaluos, mortalidad, ventasAnuales, paramet
|
|
|
33
33
|
if (key == Constantes_1.RUBROS.ACT_PEC_NOV)
|
|
34
34
|
value[`C-${i}`] = formulaNovillos(i, proyeccion, mortalidad, ventasAnuales);
|
|
35
35
|
}
|
|
36
|
+
return proyeccion;
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
39
|
exports.calcularData = calcularData;
|
|
40
|
+
const calcularTotal = (proyeccion, avaluo, parametros, cantidad) => {
|
|
41
|
+
let tot01, tot02, tot03;
|
|
42
|
+
for (let i = 0; i <= cantidad; i++) {
|
|
43
|
+
tot01 = tot02 = tot03 = 0;
|
|
44
|
+
for (const [key, value] of proyeccion) {
|
|
45
|
+
if (key == 'TOT01' || key == 'TOT02' || key == 'TOT03')
|
|
46
|
+
continue;
|
|
47
|
+
tot01 += value[`C-${i}`];
|
|
48
|
+
tot02 += value[`C-${i}`] * avaluo.get(key).Equivalencia;
|
|
49
|
+
}
|
|
50
|
+
tot03 = tot02 * parametros.get(Constantes_1.PARAMETROS.REL_USO_CAMPO).Porcentaje;
|
|
51
|
+
if (!proyeccion.has('TOT01'))
|
|
52
|
+
proyeccion.set('TOT01', { RubroId: 'TOT01', Descripcion: 'Totales en Cabezas', Orden: 10 });
|
|
53
|
+
if (!proyeccion.has('TOT02'))
|
|
54
|
+
proyeccion.set('TOT02', { RubroId: 'TOT02', Descripcion: 'Totales en U.A.', Orden: 11 });
|
|
55
|
+
if (!proyeccion.has('TOT03'))
|
|
56
|
+
proyeccion.set('TOT03', { RubroId: 'TOT03', Descripcion: 'SUP. De Terreno REQ. (Has)', Orden: 12 });
|
|
57
|
+
proyeccion.get('TOT01')[`C-${i}`] = tot01;
|
|
58
|
+
proyeccion.get('TOT02')[`C-${i}`] = tot02;
|
|
59
|
+
proyeccion.get('TOT03')[`C-${i}`] = tot03;
|
|
60
|
+
}
|
|
61
|
+
return proyeccion;
|
|
62
|
+
};
|
|
63
|
+
exports.calcularTotal = calcularTotal;
|
|
39
64
|
const formulaToros = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
40
65
|
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M36)[`C-${i - 1}`] +
|
|
41
66
|
proyeccion.get(Constantes_1.RUBROS.ACT_PEC_NOV)[`C-${i - 1}`] -
|
|
@@ -45,19 +70,19 @@ const formulaToros = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
|
45
70
|
const formulaVacas = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
46
71
|
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i - 1}`] +
|
|
47
72
|
proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H2536)[`C-${i - 1}`] -
|
|
48
|
-
mortalidad.get(Constantes_1.RUBROS.
|
|
49
|
-
ventasAnuales.get(Constantes_1.RUBROS.
|
|
73
|
+
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i}`] -
|
|
74
|
+
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i}`];
|
|
50
75
|
};
|
|
51
76
|
const formulaTerneras = (i, proyeccion, parametros) => {
|
|
52
77
|
const C25 = proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i - 1}`];
|
|
53
|
-
const C29 = proyeccion.get(Constantes_1.RUBROS.
|
|
54
|
-
const C28 = proyeccion.get(Constantes_1.RUBROS.
|
|
55
|
-
const I14 = parametros.get(Constantes_1.PARAMETROS.REL_HEM_MACH).Porcentaje;
|
|
56
|
-
const I11 = parametros.get(Constantes_1.PARAMETROS.IND_PAR).Porcentaje;
|
|
57
|
-
if (parametros.get(Constantes_1.PARAMETROS.PRE_VAQUILLA_1_2).Bandera)
|
|
78
|
+
const C29 = proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H2536)[`C-${i - 1}`];
|
|
79
|
+
const C28 = proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H1324)[`C-${i - 1}`];
|
|
80
|
+
const I14 = parametros.get(Constantes_1.PARAMETROS.REL_HEM_MACH).Porcentaje / 100;
|
|
81
|
+
const I11 = parametros.get(Constantes_1.PARAMETROS.IND_PAR).Porcentaje / 100;
|
|
82
|
+
if (parametros.get(Constantes_1.PARAMETROS.PRE_VAQUILLA_1_2).Bandera == 'SI')
|
|
58
83
|
return ((C25 + C29 + C28) * I14 * I11);
|
|
59
84
|
else {
|
|
60
|
-
if (parametros.get(Constantes_1.PARAMETROS.PRE_VAQUILLA_2_3).Bandera)
|
|
85
|
+
if (parametros.get(Constantes_1.PARAMETROS.PRE_VAQUILLA_2_3).Bandera == 'SI')
|
|
61
86
|
return ((C25 + C29) * I14 * I11);
|
|
62
87
|
else
|
|
63
88
|
return (C25 * I14 * I11);
|
|
@@ -85,6 +110,6 @@ const formulaTorillos23 = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
|
85
110
|
};
|
|
86
111
|
const formulaNovillos = (i, proyeccion, mortalidad, ventasAnuales) => {
|
|
87
112
|
return proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M2536)[`C-${i - 1}`] -
|
|
88
|
-
mortalidad.get(Constantes_1.RUBROS.
|
|
89
|
-
ventasAnuales.get(Constantes_1.RUBROS.
|
|
113
|
+
mortalidad.get(Constantes_1.RUBROS.ACT_PEC_M2536)[`C-${i}`] -
|
|
114
|
+
ventasAnuales.get(Constantes_1.RUBROS.ACT_PEC_M2536)[`C-${i}`];
|
|
90
115
|
};
|
|
@@ -3,9 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.calcularData = void 0;
|
|
4
4
|
const Constantes_1 = require("../Constantes");
|
|
5
5
|
const calcularData = (i, proyeccion, requerimiento, parametros) => {
|
|
6
|
-
console.log('REQ01');
|
|
7
6
|
const I15 = parametros.get(Constantes_1.PARAMETROS.REL_VACA_TORO).Porcentaje;
|
|
8
|
-
console.log('REQ02');
|
|
9
7
|
for (const [key, value] of requerimiento) {
|
|
10
8
|
if (key == 'REQ01') {
|
|
11
9
|
value[`C-${i}`] = proyeccion.get(Constantes_1.RUBROS.ACT_PEC_H36)[`C-${i - 1}`];
|
|
@@ -13,10 +11,9 @@ const calcularData = (i, proyeccion, requerimiento, parametros) => {
|
|
|
13
11
|
if (key == 'REQ02')
|
|
14
12
|
value[`C-${i}`] = proyeccion.get(Constantes_1.RUBROS.ACT_PEC_M36)[`C-${i - 1}`];
|
|
15
13
|
}
|
|
16
|
-
console.log('REQ03');
|
|
17
14
|
for (const [key, value] of requerimiento) {
|
|
18
15
|
if (key == 'REQ03')
|
|
19
|
-
value[`C-${i}`] = Math.
|
|
16
|
+
value[`C-${i}`] = Math.trunc(requerimiento.get('REQ01')[`C-${i}`] * I15 / 100);
|
|
20
17
|
if (key == 'REQ04')
|
|
21
18
|
value[`C-${i}`] = requerimiento.get('REQ03')[`C-${i}`] -
|
|
22
19
|
requerimiento.get('REQ02')[`C-${i}`];
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calcularData = void 0;
|
|
3
|
+
exports.calcularTotal = exports.calcularData = void 0;
|
|
4
4
|
const calcularData = (i, ventasAnuales, avaluos, hatoDisponible) => {
|
|
5
5
|
for (const [key, value] of ventasAnuales) {
|
|
6
|
-
value[`C-${i}`] = Math.
|
|
6
|
+
value[`C-${i}`] = Math.trunc(hatoDisponible.get(key)[`C-${i}`] * avaluos.get(key).Porcentaje / 100);
|
|
7
7
|
}
|
|
8
8
|
return ventasAnuales;
|
|
9
9
|
};
|
|
10
10
|
exports.calcularData = calcularData;
|
|
11
|
+
const calcularTotal = (table, avaluo, cantidad) => {
|
|
12
|
+
let tot01, tot02;
|
|
13
|
+
for (let i = 1; i <= cantidad; i++) {
|
|
14
|
+
tot01 = tot02 = 0;
|
|
15
|
+
for (const [key, value] of table) {
|
|
16
|
+
if (key == 'TOT01' || key == 'TOT02')
|
|
17
|
+
continue;
|
|
18
|
+
tot01 += value[`C-${i}`];
|
|
19
|
+
tot02 += value[`C-${i}`] * avaluo.get(key).Equivalencia;
|
|
20
|
+
}
|
|
21
|
+
if (!table.has('TOT01'))
|
|
22
|
+
table.set('TOT01', { RubroId: 'TOT01', Descripcion: 'Total Venta Anual', Orden: 10 });
|
|
23
|
+
if (!table.has('TOT02'))
|
|
24
|
+
table.set('TOT02', { RubroId: 'TOT02', Descripcion: 'Totales en U.A.', Orden: 11 });
|
|
25
|
+
table.get('TOT01')[`C-${i}`] = tot01;
|
|
26
|
+
table.get('TOT02')[`C-${i}`] = tot02;
|
|
27
|
+
}
|
|
28
|
+
return table;
|
|
29
|
+
};
|
|
30
|
+
exports.calcularTotal = calcularTotal;
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calcularData = void 0;
|
|
3
|
+
exports.calcularTotal = exports.calcularData = void 0;
|
|
4
4
|
const calcularData = (i, ventasCantidad, ventasAnuales, avaluosMap) => {
|
|
5
5
|
for (const [key, value] of ventasCantidad) {
|
|
6
6
|
value[`C-${i}`] = ventasAnuales.get(key)[`C-${i}`] *
|
|
7
|
-
avaluosMap.get(key).
|
|
7
|
+
avaluosMap.get(key).PrecioVenta;
|
|
8
8
|
}
|
|
9
9
|
return ventasCantidad;
|
|
10
10
|
};
|
|
11
11
|
exports.calcularData = calcularData;
|
|
12
|
+
const calcularTotal = (table, cantidad) => {
|
|
13
|
+
let tot01;
|
|
14
|
+
for (let i = 1; i <= cantidad; i++) {
|
|
15
|
+
tot01 = 0;
|
|
16
|
+
for (const [key, value] of table) {
|
|
17
|
+
if (key == 'TOT01')
|
|
18
|
+
continue;
|
|
19
|
+
tot01 += value[`C-${i}`];
|
|
20
|
+
}
|
|
21
|
+
if (!table.has('TOT01'))
|
|
22
|
+
table.set('TOT01', { RubroId: 'TOT01', Descripcion: 'Total Venta Anual', Orden: 10 });
|
|
23
|
+
table.get('TOT01')[`C-${i}`] = tot01;
|
|
24
|
+
}
|
|
25
|
+
return table;
|
|
26
|
+
};
|
|
27
|
+
exports.calcularTotal = calcularTotal;
|
|
@@ -24,21 +24,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const proyeccionCalc = __importStar(require("./desarrollo.detail/proyeccionCalc"));
|
|
27
|
+
//@ts-ignore
|
|
27
28
|
const requerimientoCal = __importStar(require("./desarrollo.detail/requerimientoCalc"));
|
|
28
29
|
const mortalidadCalc = __importStar(require("./desarrollo.detail/mortalidadCalc"));
|
|
29
30
|
const hatoDisponibleCalc = __importStar(require("./desarrollo.detail/hatoDisponibleCalc"));
|
|
31
|
+
//@ts-ignore
|
|
30
32
|
const ventasCantidadCalc = __importStar(require("./desarrollo.detail/ventasCantidadCalc"));
|
|
31
33
|
const ventasAnualesCalc = __importStar(require("./desarrollo.detail/ventasAnualesCalc"));
|
|
32
34
|
const desarrolloCalc = __importStar(require("./desarrollo.detail/desarrolloCalc"));
|
|
35
|
+
const desarrolloCalc_1 = require("./desarrollo.detail/desarrolloCalc");
|
|
33
36
|
const getProyDesarrollo = (avaluos, parametros, CantidadProy, CantidadHectareas) => {
|
|
34
|
-
console.log('proy0001');
|
|
35
37
|
let proyeccion = desarrolloCalc.getProyectado(avaluos, CantidadProy, 0);
|
|
36
38
|
let requerimiento = desarrolloCalc.getProyectado(desarrolloCalc.getRequerimientoInit(), CantidadProy);
|
|
37
39
|
let mortalidad = desarrolloCalc.getProyectado(avaluos, CantidadProy);
|
|
38
40
|
let hatoDisponible = desarrolloCalc.getProyectado(avaluos, CantidadProy);
|
|
39
41
|
let ventasCantidad = desarrolloCalc.getProyectado(avaluos, CantidadProy);
|
|
40
42
|
let ventasAnuales = desarrolloCalc.getProyectado(avaluos, CantidadProy);
|
|
41
|
-
console.log('proy0002');
|
|
42
43
|
const paramsMap = parametros.reduce((acc, item) => {
|
|
43
44
|
acc.set(item.RubroId, Object.assign({}, item));
|
|
44
45
|
return acc;
|
|
@@ -47,42 +48,47 @@ const getProyDesarrollo = (avaluos, parametros, CantidadProy, CantidadHectareas)
|
|
|
47
48
|
acc.set(item.RubroId, Object.assign({}, item));
|
|
48
49
|
return acc;
|
|
49
50
|
}, new Map());
|
|
50
|
-
console.log('proy0003');
|
|
51
51
|
for (let i = 0; i <= CantidadProy; i++) {
|
|
52
52
|
if (i == 0) {
|
|
53
|
-
console.log('proy0003.1');
|
|
54
53
|
proyeccion = proyeccionCalc.calcularData(i, proyeccion, avaluosMap, new Map(), new Map(), new Map());
|
|
55
54
|
}
|
|
56
55
|
else {
|
|
57
|
-
console.log('proy0003.2');
|
|
58
56
|
mortalidad = mortalidadCalc.calcularData(i, proyeccion, mortalidad, paramsMap);
|
|
59
|
-
console.log('proy0003.3');
|
|
60
57
|
hatoDisponible = hatoDisponibleCalc.calcularData(i, proyeccion, hatoDisponible, mortalidad);
|
|
61
|
-
console.log('proy0003.4');
|
|
62
58
|
ventasAnuales = ventasAnualesCalc.calcularData(i, ventasAnuales, avaluosMap, hatoDisponible);
|
|
63
|
-
console.log('proy0003.5');
|
|
64
59
|
proyeccion = proyeccionCalc.calcularData(i, proyeccion, avaluosMap, mortalidad, ventasAnuales, paramsMap);
|
|
65
|
-
console.log('proy0003.6');
|
|
66
60
|
requerimiento = requerimientoCal.calcularData(i, proyeccion, requerimiento, paramsMap);
|
|
67
|
-
console.log('proy0003.7');
|
|
68
61
|
ventasCantidad = ventasCantidadCalc.calcularData(i, ventasCantidad, ventasAnuales, avaluosMap);
|
|
69
62
|
}
|
|
70
63
|
}
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
proyeccion = proyeccionCalc.calcularTotal(proyeccion, avaluosMap, paramsMap, CantidadProy);
|
|
65
|
+
mortalidad = mortalidadCalc.calcularTotal(mortalidad, CantidadProy);
|
|
66
|
+
hatoDisponible = hatoDisponibleCalc.calcularTotal(hatoDisponible, CantidadProy);
|
|
67
|
+
ventasAnuales = ventasAnualesCalc.calcularTotal(ventasAnuales, avaluosMap, CantidadProy);
|
|
68
|
+
ventasCantidad = ventasCantidadCalc.calcularTotal(ventasCantidad, CantidadProy);
|
|
69
|
+
let result = {};
|
|
70
|
+
result.avaluos = Array.from((0, desarrolloCalc_1.getTotalesAvaluo)(avaluosMap).values());
|
|
71
|
+
result.proyeccion = Array.from(proyeccion.values());
|
|
72
|
+
result.requerimiento = Array.from(requerimiento.values());
|
|
73
|
+
result.mortalidad = Array.from(mortalidad.values());
|
|
74
|
+
result.hatoDisponible = Array.from(hatoDisponible.values());
|
|
75
|
+
result.ventasCantidad = Array.from(ventasCantidad.values());
|
|
76
|
+
result.ventasAnuales = Array.from(ventasAnuales.values());
|
|
77
|
+
return result;
|
|
73
78
|
};
|
|
74
79
|
class Desarrollo {
|
|
75
80
|
execute(data) {
|
|
76
81
|
let result = data.Desarrollo;
|
|
77
|
-
|
|
78
|
-
result.Avaluo = desarrolloCalc.getAvaluo(data.Desarrollo.Avaluo, data.Auxiliar.PropiedadesGanaderas);
|
|
82
|
+
const avaluosMap = desarrolloCalc.getAvaluo(data.Desarrollo.Avaluo, data.Auxiliar.PropiedadesGanaderas);
|
|
79
83
|
result.Parametros = data.Desarrollo.Parametros;
|
|
80
|
-
|
|
81
|
-
result.
|
|
82
|
-
|
|
83
|
-
result.
|
|
84
|
-
|
|
85
|
-
result.
|
|
84
|
+
const { proyeccion, mortalidad, hatoDisponible, ventasCantidad, ventasAnuales, requerimiento, avaluos } = getProyDesarrollo(avaluosMap, result.Parametros, result.CantidadProyeccion, result.TamannoHectareas);
|
|
85
|
+
result.Avaluo = avaluos;
|
|
86
|
+
result.Proyeccion = proyeccion;
|
|
87
|
+
result.Requerimiento = requerimiento;
|
|
88
|
+
result.Mortalidad = mortalidad;
|
|
89
|
+
result.HatoDisponible = hatoDisponible;
|
|
90
|
+
result.VentasAnuales = ventasAnuales;
|
|
91
|
+
result.VentasCantidad = ventasCantidad;
|
|
86
92
|
return result;
|
|
87
93
|
}
|
|
88
94
|
}
|