flit-modulo-exportacoes 2.0.12 → 2.0.14
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/dist/index.d.ts +2 -1
- package/dist/index.js +38 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,12 @@ import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
|
|
|
3
3
|
import { EnumFormaEnvioFaltasEventosExportacoes } from './eventos-exportacoes-model';
|
|
4
4
|
import { PayloadExportacaoPadrao, TipoEventoExportacao, TiposEventosExportacaoArquivo, TiposEventosExportar, ValoresEventosExportacao } from './models';
|
|
5
5
|
export declare function validarDadosPayload(data: PayloadExportacaoPadrao, fn: () => Array<string>): boolean;
|
|
6
|
-
export declare function calcularValoresExportacao({ contaId, dataFinal, dataInicial, elasticClient, parametrosIntegracao, empresas, jornadas, formaEnvioFaltas }: {
|
|
6
|
+
export declare function calcularValoresExportacao({ contaId, dataFinal, dataInicial, elasticClient, fatorConversao, parametrosIntegracao, empresas, jornadas, formaEnvioFaltas }: {
|
|
7
7
|
contaId: string;
|
|
8
8
|
dataFinal: Date;
|
|
9
9
|
dataInicial: Date;
|
|
10
10
|
elasticClient: Client;
|
|
11
|
+
fatorConversao?: number;
|
|
11
12
|
parametrosIntegracao: any;
|
|
12
13
|
empresas: Array<SearchHit<any>>;
|
|
13
14
|
jornadas: Array<SearchHit<any>>;
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,39 @@ function validarDadosPayload(data, fn) {
|
|
|
23
23
|
return fn().length === 0;
|
|
24
24
|
}
|
|
25
25
|
exports.validarDadosPayload = validarDadosPayload;
|
|
26
|
-
|
|
26
|
+
function aplicarFatorConversaoValoresEventos({ fatorConversao, valoresEventos, formaEnvioFaltas }) {
|
|
27
|
+
return {
|
|
28
|
+
datas_faltas: valoresEventos.datas_faltas,
|
|
29
|
+
ValorNormal: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorNormal * fatorConversao, 1),
|
|
30
|
+
ValorAtraso: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorAtraso * fatorConversao, 1),
|
|
31
|
+
ValorNoturno: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorNoturno * fatorConversao, 1),
|
|
32
|
+
ValorHorasFaltas: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorHorasFaltas * fatorConversao, 1),
|
|
33
|
+
ValorExtraSegSex: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraSegSex * fatorConversao, 1),
|
|
34
|
+
ValorExtraSabado: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraSabado * fatorConversao, 1),
|
|
35
|
+
ValorExtraDomingo: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraDomingo * fatorConversao, 1),
|
|
36
|
+
ValorExtraFeriado: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraFeriado * fatorConversao, 1),
|
|
37
|
+
ValorNoturnoTotal: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorNoturnoTotal * fatorConversao, 1),
|
|
38
|
+
FaixaSemanal: {
|
|
39
|
+
ValorFaixa1: (0, utils_2.arredondarTempoDecimal)(valoresEventos.FaixaSemanal.ValorFaixa1 * fatorConversao, 1),
|
|
40
|
+
ValorFaixa2: (0, utils_2.arredondarTempoDecimal)(valoresEventos.FaixaSemanal.ValorFaixa2 * fatorConversao, 1),
|
|
41
|
+
ValorFaixa3: (0, utils_2.arredondarTempoDecimal)(valoresEventos.FaixaSemanal.ValorFaixa3 * fatorConversao, 1)
|
|
42
|
+
},
|
|
43
|
+
FaixaDiferenciada: {
|
|
44
|
+
ValorFaixa1: (0, utils_2.arredondarTempoDecimal)(valoresEventos.FaixaDiferenciada.ValorFaixa1 * fatorConversao, 1),
|
|
45
|
+
ValorFaixa2: (0, utils_2.arredondarTempoDecimal)(valoresEventos.FaixaDiferenciada.ValorFaixa2 * fatorConversao, 1),
|
|
46
|
+
ValorFaixa3: (0, utils_2.arredondarTempoDecimal)(valoresEventos.FaixaDiferenciada.ValorFaixa3 * fatorConversao, 1)
|
|
47
|
+
},
|
|
48
|
+
ValorHorasTrabalhadas: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorHorasTrabalhadas * fatorConversao, 1),
|
|
49
|
+
ValorExtraIntrajornada: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraIntrajornada * fatorConversao, 1),
|
|
50
|
+
ValorExtraNoturnoSegSex: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraNoturnoSegSex * fatorConversao, 1),
|
|
51
|
+
ValorExtraNoturnoSabado: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraNoturnoSabado * fatorConversao, 1),
|
|
52
|
+
ValorExtraNoturnoDomingo: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraNoturnoDomingo * fatorConversao, 1),
|
|
53
|
+
ValorExtraNoturnoFeriado: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraNoturnoFeriado * fatorConversao, 1),
|
|
54
|
+
ValorExtraIntrajornadaComReducao: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorExtraIntrajornadaComReducao * fatorConversao, 1),
|
|
55
|
+
ValorFaltas: (0, utils_2.arredondarTempoDecimal)(valoresEventos.ValorFaltas * (formaEnvioFaltas === eventos_exportacoes_model_1.EnumFormaEnvioFaltasEventosExportacoes.Dias ? 1 : fatorConversao), 1)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async function calcularValoresExportacao({ contaId, dataFinal, dataInicial, elasticClient, fatorConversao, parametrosIntegracao, empresas, jornadas, formaEnvioFaltas }) {
|
|
27
59
|
const feriados = await new feriados_elastic_1.FeriadosElastic(elasticClient).getFeriadosElastic({
|
|
28
60
|
contaId: contaId,
|
|
29
61
|
dataFinal: dataFinal,
|
|
@@ -132,7 +164,11 @@ async function calcularValoresExportacao({ contaId, dataFinal, dataInicial, elas
|
|
|
132
164
|
valoresEventos: valoresEventos,
|
|
133
165
|
parametrosIntegracao: parametrosIntegracao ?? {}
|
|
134
166
|
});
|
|
135
|
-
return
|
|
167
|
+
return aplicarFatorConversaoValoresEventos({
|
|
168
|
+
valoresEventos: valoresEventos,
|
|
169
|
+
formaEnvioFaltas: formaEnvioFaltas,
|
|
170
|
+
fatorConversao: fatorConversao ?? 1
|
|
171
|
+
});
|
|
136
172
|
}
|
|
137
173
|
exports.calcularValoresExportacao = calcularValoresExportacao;
|
|
138
174
|
function retornaValorEvento(tipoEvento, valoresEventos) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flit-modulo-exportacoes",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/lib/index.js",
|
|
6
6
|
"directories": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"flit-calcular-jornada": "^2.1.4",
|
|
21
21
|
"prettier": "^2.8.8",
|
|
22
22
|
"tsc-alias": "^1.8.6",
|
|
23
|
-
"typescript": "^5.1.
|
|
23
|
+
"typescript": "^5.1.5"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json",
|