flit-modulo-exportacoes 2.0.46 → 2.0.47
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.
|
@@ -15,7 +15,7 @@ class UnificacaoEventosRepetidos {
|
|
|
15
15
|
agruparArray({ campo, array }) {
|
|
16
16
|
return array.reduce((acc, item) => ({
|
|
17
17
|
...acc,
|
|
18
|
-
[item[campo]]: [...(acc[item[campo]] ?? []), item]
|
|
18
|
+
[item[campo]]: [...(acc[item[campo]] ?? []), item]
|
|
19
19
|
}), {});
|
|
20
20
|
}
|
|
21
21
|
processarValoresCodigosRepetidos({ valoresEventos, eventosAgrupados }) {
|
|
@@ -23,6 +23,14 @@ class UnificacaoEventosRepetidos {
|
|
|
23
23
|
let somatorioMinutos = 0;
|
|
24
24
|
for (let index = 0; index < eventosAgrupados.length; index++) {
|
|
25
25
|
switch (eventosAgrupados[index].tipo) {
|
|
26
|
+
case models_1.TipoEventoExportacao.FALTA:
|
|
27
|
+
somatorioHoras += valoresEventos.ValorFaltas.Horas ?? 0;
|
|
28
|
+
somatorioMinutos += valoresEventos.ValorFaltas.Minutos ?? 0;
|
|
29
|
+
if (index > 0) {
|
|
30
|
+
valoresEventos.ValorAtraso.Horas = 0;
|
|
31
|
+
valoresEventos.ValorAtraso.Minutos = 0;
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
26
34
|
case models_1.TipoEventoExportacao.ATRASO:
|
|
27
35
|
somatorioHoras += valoresEventos.ValorAtraso.Horas ?? 0;
|
|
28
36
|
somatorioMinutos += valoresEventos.ValorAtraso.Minutos ?? 0;
|
|
@@ -204,6 +212,10 @@ class UnificacaoEventosRepetidos {
|
|
|
204
212
|
}
|
|
205
213
|
}
|
|
206
214
|
switch (eventosAgrupados[0].tipo) {
|
|
215
|
+
case models_1.TipoEventoExportacao.FALTA:
|
|
216
|
+
valoresEventos.ValorFaltas.Horas = somatorioHoras;
|
|
217
|
+
valoresEventos.ValorFaltas.Minutos = somatorioMinutos;
|
|
218
|
+
break;
|
|
207
219
|
case models_1.TipoEventoExportacao.ATRASO:
|
|
208
220
|
valoresEventos.ValorAtraso.Horas = somatorioHoras;
|
|
209
221
|
valoresEventos.ValorAtraso.Minutos = somatorioMinutos;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flit-modulo-exportacoes",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.47",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"directories": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"moment": "^2.30.1"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@elastic/elasticsearch": "^8.
|
|
18
|
+
"@elastic/elasticsearch": "^8.13.0",
|
|
19
19
|
"@types/luxon": "^3.4.2",
|
|
20
20
|
"flit-calcular-jornada": "^2.1.22",
|
|
21
21
|
"prettier": "^3.2.5",
|