teodoro 0.0.8 → 0.0.13
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.
- checksums.yaml +4 -4
- data/lib/teodoro.rb +3 -9
- data/lib/teodoro/arquivo_de_evento.rb +17 -24
- data/lib/teodoro/arquivo_de_evento_de_tabela.rb +2 -12
- data/lib/teodoro/arquivo_de_evento_exceto_de_exclusao.rb +25 -0
- data/lib/teodoro/arquivo_de_evento_nao_periodico.rb +6 -15
- data/lib/teodoro/arquivo_de_origem.rb +1 -1
- data/lib/teodoro/arquivo_xml.rb +71 -57
- data/lib/teodoro/console.rb +2 -6
- data/lib/teodoro/empresa.rb +42 -13
- data/lib/teodoro/leiaute.rb +24 -0
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1000.rb +3 -3
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1005.rb +1 -1
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1010.rb +2 -2
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1020.rb +1 -1
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1030.rb +1 -1
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1040.rb +1 -1
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1050.rb +1 -1
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1070.rb +1 -1
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2190.rb +2 -2
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2200.rb +129 -22
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2205.rb +2 -2
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2206.rb +15 -4
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2230.rb +1 -1
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2250.rb +25 -9
- data/lib/teodoro/leiaute/arquivo_s2299.rb +310 -0
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2300.rb +21 -2
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2306.rb +27 -7
- data/lib/teodoro/leiaute/arquivo_s2399.rb +304 -0
- data/lib/teodoro/leiaute/arquivo_s3000.rb +41 -0
- data/lib/teodoro/obj.rb +5 -0
- metadata +24 -19
- data/lib/teodoro/leiaute_2_4_1.rb +0 -21
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative 'leiaute/arquivo_s1000'
|
2
|
+
require_relative 'leiaute/arquivo_s1005'
|
3
|
+
require_relative 'leiaute/arquivo_s1010'
|
4
|
+
require_relative 'leiaute/arquivo_s1020'
|
5
|
+
require_relative 'leiaute/arquivo_s1030'
|
6
|
+
require_relative 'leiaute/arquivo_s1040'
|
7
|
+
require_relative 'leiaute/arquivo_s1050'
|
8
|
+
require_relative 'leiaute/arquivo_s1070'
|
9
|
+
require_relative 'leiaute/arquivo_s2190'
|
10
|
+
require_relative 'leiaute/arquivo_s2200'
|
11
|
+
require_relative 'leiaute/arquivo_s2205'
|
12
|
+
require_relative 'leiaute/arquivo_s2206'
|
13
|
+
require_relative 'leiaute/arquivo_s2230'
|
14
|
+
require_relative 'leiaute/arquivo_s2250'
|
15
|
+
require_relative 'leiaute/arquivo_s2299'
|
16
|
+
require_relative 'leiaute/arquivo_s2300'
|
17
|
+
require_relative 'leiaute/arquivo_s2306'
|
18
|
+
require_relative 'leiaute/arquivo_s2399'
|
19
|
+
require_relative 'leiaute/arquivo_s3000'
|
20
|
+
|
21
|
+
module Teodoro
|
22
|
+
module Leiaute
|
23
|
+
end
|
24
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
# rubocop:disable Metrics/ClassLength
|
4
4
|
class ArquivoS1000
|
5
5
|
include ArquivoDeEventoDeTabela
|
@@ -84,8 +84,8 @@ module Teodoro
|
|
84
84
|
['ExibeModoCompleto'],
|
85
85
|
['InicioValidade', inicio_da_validade],
|
86
86
|
['FimValidade', fim_da_validade],
|
87
|
-
['NovaValidade_InicioValidade'],
|
88
|
-
['NovaValidade_FimValidade'],
|
87
|
+
['NovaValidade_InicioValidade'],
|
88
|
+
['NovaValidade_FimValidade'],
|
89
89
|
['NomeRazaoSocial', evento['evtInfoEmpregador/infoEmpregador/*/infoCadastro/nmRazao']],
|
90
90
|
['ClassificacaoTributaria', evento['evtInfoEmpregador/infoEmpregador/*/infoCadastro/classTrib']],
|
91
91
|
['NaturezaJuridica', evento['evtInfoEmpregador/infoEmpregador/*/infoCadastro/natJurid']],
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS1010
|
4
4
|
include ArquivoDeEventoDeTabela
|
5
5
|
|
@@ -18,7 +18,7 @@ module Teodoro
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def identificacao_do_arquivo_data
|
21
|
-
['RUB', "#{identificador_da_tabela_de_rubricas}
|
21
|
+
['RUB', "#{identificador_da_tabela_de_rubricas}#{codigo}"]
|
22
22
|
end
|
23
23
|
|
24
24
|
def identificador_da_tabela_de_rubricas
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS2190
|
4
4
|
include ArquivoDeEventoNaoPeriodico
|
5
5
|
|
@@ -8,7 +8,7 @@ module Teodoro
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def nome_do_arquivo_data
|
11
|
-
"PRE[#{cpf_do_trabalhador}]"
|
11
|
+
@nome_do_arquivo_data ||= "PRE[#{cpf_do_trabalhador}]"
|
12
12
|
end
|
13
13
|
|
14
14
|
def cpf_do_trabalhador
|
@@ -1,10 +1,35 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS2200 # rubocop:disable Metrics/ClassLength
|
4
4
|
include ArquivoDeEventoNaoPeriodico
|
5
5
|
|
6
|
+
def processar
|
7
|
+
super
|
8
|
+
|
9
|
+
registrar_admissao
|
10
|
+
end
|
11
|
+
|
6
12
|
private
|
7
13
|
|
14
|
+
def registrar_admissao
|
15
|
+
admissoes_por_matricula[matricula_do_trabalhador] = Obj.new(
|
16
|
+
data: data_de_admissao,
|
17
|
+
categoria_do_trabalhador: categoria_do_trabalhador
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
def admissoes_por_matricula
|
22
|
+
empresa.admissoes_por_matricula
|
23
|
+
end
|
24
|
+
|
25
|
+
def data_de_admissao
|
26
|
+
@data_de_admissao ||= evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/dtAdm']
|
27
|
+
end
|
28
|
+
|
29
|
+
def categoria_do_trabalhador
|
30
|
+
@categoria_do_trabalhador ||= evento['evtAdmissao/vinculo/infoContrato/codCateg']
|
31
|
+
end
|
32
|
+
|
8
33
|
def noh_principal_do_evento
|
9
34
|
'evtAdmissao'
|
10
35
|
end
|
@@ -22,13 +47,9 @@ module Teodoro
|
|
22
47
|
@matricula_do_trabalhador ||= evento['evtAdmissao/vinculo/matricula']
|
23
48
|
end
|
24
49
|
|
25
|
-
def
|
26
|
-
@data_de_admissao ||= evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/dtAdm']
|
27
|
-
end
|
28
|
-
|
29
|
-
# rubocop:disable Metrics/MethodLength, Layout/LineLength, Metrics/AbcSize
|
30
|
-
def itens_do_conteudo_do_arquivo_data
|
50
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
31
51
|
[
|
52
|
+
# rubocop:disable Layout/LineLength
|
32
53
|
['ESX_CPF', cpf_do_trabalhador],
|
33
54
|
['ESX_MATRICULA', matricula_do_trabalhador],
|
34
55
|
['ESX_CATEGORIA', categoria_do_trabalhador],
|
@@ -39,7 +60,7 @@ module Teodoro
|
|
39
60
|
['NrReciboEventoOriginal'],
|
40
61
|
['EventoAdmissao_TipoEventoEnviado'],
|
41
62
|
['TipoInscricaoEmpregador', tipo_de_inscricao_do_empregador],
|
42
|
-
['EventoAdmissao_NrRecibo',
|
63
|
+
['EventoAdmissao_NrRecibo', numero_do_recibo],
|
43
64
|
['EventoAdmissao_DataAlteracaoCadastral'],
|
44
65
|
['EventoAdmissao_InformacoesInicio_IndicativoCadastramentoInicial', evento['evtAdmissao/vinculo/cadIni']],
|
45
66
|
['EventoAdmissao_InformacoesInicio_DataInicio'],
|
@@ -137,7 +158,7 @@ module Teodoro
|
|
137
158
|
['EventoAdmissao_EnderecoResidencialEX_PaisResidencia_TEXT'],
|
138
159
|
['SemNumeroLogradouroEnderecoEX'],
|
139
160
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_CasadoComBrasileiro', evento['evtAdmissao/trabalhador/trabEstrangeiro/casadoBr']],
|
140
|
-
|
161
|
+
item_do_conteudo_do_arquivo_data('EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_ClassificacaoCondicao'),
|
141
162
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_ClassificacaoCondicao_TEXT'],
|
142
163
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_DataChegada', evento['evtAdmissao/trabalhador/trabEstrangeiro/dtChegada']],
|
143
164
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_FilhosBrasileiros', evento['evtAdmissao/trabalhador/trabEstrangeiro/filhosBr']],
|
@@ -230,19 +251,19 @@ module Teodoro
|
|
230
251
|
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoGeral_DescricaoComplementar', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabGeral/descComp']],
|
231
252
|
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoGeral_NumeroInscricao', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabGeral/nrInsc']],
|
232
253
|
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoGeral_TipoInscricao', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabGeral/tpInsc']],
|
233
|
-
|
234
|
-
|
254
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Uf'),
|
255
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_TipoLogradouro'),
|
235
256
|
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_TipoLogradouro_TEXT'],
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
257
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_NumeroLogradouro'),
|
258
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_DescricaoLogradouro'),
|
259
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Complemento'),
|
260
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_CodigoMunicipio'),
|
261
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Cep'),
|
262
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Bairro'),
|
242
263
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_NumeroInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideTomadorServ/nrInsc']],
|
243
264
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_TipoInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideTomadorServ/tpInsc']],
|
244
|
-
|
245
|
-
|
265
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_NumeroInscricao'),
|
266
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_TipoInscricao'),
|
246
267
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_HipoteseLegal', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/hipLeg']],
|
247
268
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_JustificaHipoteseLegal', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/justContr']],
|
248
269
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_TipoInclusaoContrato', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/tpInclContr']],
|
@@ -288,12 +309,98 @@ module Teodoro
|
|
288
309
|
["InfoVinculo_InfoContrato_FiliacaoSindical_#{seq}_CnpjSindicatoTrabalhador", filiacao['cnpjSindTrab']]
|
289
310
|
]
|
290
311
|
end.sum([])
|
312
|
+
# rubocop:enable Layout/LineLength
|
291
313
|
]
|
292
314
|
end
|
293
|
-
# rubocop:enable Metrics/MethodLength, Layout/LineLength, Metrics/AbcSize
|
294
315
|
|
295
|
-
def
|
296
|
-
|
316
|
+
def item_do_conteudo_do_arquivo_data(chave)
|
317
|
+
chaves_valores_de_acordo_com_a_versao_do_leiaute[chave]
|
318
|
+
end
|
319
|
+
|
320
|
+
def chaves_valores_de_acordo_com_a_versao_do_leiaute
|
321
|
+
@chaves_valores_de_acordo_com_a_versao_do_leiaute ||=
|
322
|
+
(leiaute_simplificado? ? ChavesValoresDoLeiauteSimplificado : ChavesValoresDoLeiaute2).new(evento)
|
323
|
+
end
|
324
|
+
|
325
|
+
module ChavesValores
|
326
|
+
private
|
327
|
+
|
328
|
+
def initialize(evento)
|
329
|
+
@evento = evento
|
330
|
+
end
|
331
|
+
|
332
|
+
attr_reader :evento
|
333
|
+
|
334
|
+
public
|
335
|
+
|
336
|
+
def [](chave)
|
337
|
+
de_chave_para_chave_valor[chave]
|
338
|
+
end
|
339
|
+
|
340
|
+
private
|
341
|
+
|
342
|
+
def de_chave_para_chave_valor
|
343
|
+
@de_chave_para_chave_valor ||=
|
344
|
+
itens_do_conteudo_do_arquivo_data.map { |chave, valor| [chave, [chave, valor]] }.to_h
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
class ChavesValoresDoLeiaute2
|
349
|
+
include ChavesValores
|
350
|
+
|
351
|
+
private
|
352
|
+
|
353
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
354
|
+
[
|
355
|
+
# rubocop:disable Layout/LineLength
|
356
|
+
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_ClassificacaoCondicao', evento['evtAdmissao/trabalhador/trabEstrangeiro/classTrabEstrang']],
|
357
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Uf', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/uf']],
|
358
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_TipoLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/tpLograd']],
|
359
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_NumeroLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/nrLograd']],
|
360
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_DescricaoLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/dscLograd']],
|
361
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Complemento', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/complemento']],
|
362
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_CodigoMunicipio', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/codMunic']],
|
363
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Cep', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/cep']],
|
364
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Bairro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/bairro']],
|
365
|
+
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_NumeroInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideTomadorServ/ideEstabVinc/nrInsc']],
|
366
|
+
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_TipoInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideTomadorServ/ideEstabVinc/tpInsc']]
|
367
|
+
# rubocop:enable Layout/LineLength
|
368
|
+
]
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
class ChavesValoresDoLeiauteSimplificado
|
373
|
+
include ChavesValores
|
374
|
+
|
375
|
+
private
|
376
|
+
|
377
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
378
|
+
[
|
379
|
+
# rubocop:disable Layout/LineLength
|
380
|
+
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_ClassificacaoCondicao', condicao_de_ingresso_do_trabalhador_imigrante],
|
381
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Uf', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/uf']],
|
382
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_TipoLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/tpLograd']],
|
383
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_NumeroLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/nrLograd']],
|
384
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_DescricaoLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/dscLograd']],
|
385
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Complemento', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/complemento']],
|
386
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_CodigoMunicipio', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/codMunic']],
|
387
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Cep', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/cep']],
|
388
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Bairro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/bairro']],
|
389
|
+
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_NumeroInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideEstabVinc/nrInsc']],
|
390
|
+
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_TipoInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideEstabVinc/tpInsc']]
|
391
|
+
# rubocop:enable Layout/LineLength
|
392
|
+
]
|
393
|
+
end
|
394
|
+
|
395
|
+
def condicao_de_ingresso_do_trabalhador_imigrante
|
396
|
+
{
|
397
|
+
'1' => 4,
|
398
|
+
'2' => 5,
|
399
|
+
'4' => 10,
|
400
|
+
'5' => 11,
|
401
|
+
'6' => 12
|
402
|
+
}[evento['evtAdmissao/trabalhador/trabImig/condIng']] || evento['evtAdmissao/trabalhador/trabImig/tmpResid']
|
403
|
+
end
|
297
404
|
end
|
298
405
|
end
|
299
406
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS2205 # rubocop:disable Metrics/ClassLength
|
4
4
|
include ArquivoDeEventoNaoPeriodico
|
5
5
|
|
@@ -40,7 +40,7 @@ module Teodoro
|
|
40
40
|
['VisualizarDadosCadastrais'],
|
41
41
|
['UrlRetorno'],
|
42
42
|
['visualizar'],
|
43
|
-
['DescricaoProcEmi',
|
43
|
+
['DescricaoProcEmi', processo_de_emissao_do_evento],
|
44
44
|
['VerProc', recibo['retornoEvento/processamento/versaoAppProcessamento']],
|
45
45
|
['IdEdicaoDependente'],
|
46
46
|
['commandArgument'],
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS2206 # rubocop:disable Metrics/ClassLength
|
4
4
|
include ArquivoDeEventoNaoPeriodico
|
5
5
|
|
@@ -10,11 +10,10 @@ module Teodoro
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def nome_do_arquivo_data
|
13
|
-
# FIXME: Tales dataDeAdmissao
|
14
13
|
@nome_do_arquivo_data ||= [
|
15
14
|
'TRA',
|
16
15
|
"[#{cpf_do_trabalhador}]",
|
17
|
-
"[EPG_#{matricula_do_trabalhador}
|
16
|
+
"[EPG_#{matricula_do_trabalhador}_#{data_de_admissao.delete('-')}]",
|
18
17
|
"-ACO[#{data_da_alteracao.delete('-')}]"
|
19
18
|
].join
|
20
19
|
end
|
@@ -27,6 +26,18 @@ module Teodoro
|
|
27
26
|
@matricula_do_trabalhador ||= evento['evtAltContratual/ideVinculo/matricula']
|
28
27
|
end
|
29
28
|
|
29
|
+
def data_de_admissao
|
30
|
+
admissao.data
|
31
|
+
end
|
32
|
+
|
33
|
+
def admissao
|
34
|
+
@admissao ||= admissoes_por_matricula[matricula_do_trabalhador]
|
35
|
+
end
|
36
|
+
|
37
|
+
def admissoes_por_matricula
|
38
|
+
empresa.admissoes_por_matricula
|
39
|
+
end
|
40
|
+
|
30
41
|
def data_da_alteracao
|
31
42
|
evento['evtAltContratual/altContratual/dtAlteracao']
|
32
43
|
end
|
@@ -38,7 +49,7 @@ module Teodoro
|
|
38
49
|
['ESX_MATRICULA', matricula_do_trabalhador],
|
39
50
|
['ESX_CATEGORIA', categoria_do_trabalhador],
|
40
51
|
%w[ESX_SEMVINCULO 0],
|
41
|
-
['ESX_DATAADMISSAO'],
|
52
|
+
['ESX_DATAADMISSAO', data_de_admissao],
|
42
53
|
['ESX_DATAALTERACAO', data_da_alteracao],
|
43
54
|
['cpfTrabalhador', cpf_do_trabalhador],
|
44
55
|
['nomeTrabalhador'],
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS2250
|
4
4
|
include ArquivoDeEventoNaoPeriodico
|
5
5
|
|
@@ -10,8 +10,8 @@ module Teodoro
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def nome_do_arquivo_data
|
13
|
-
|
14
|
-
|
13
|
+
@nome_do_arquivo_data ||=
|
14
|
+
"TRA[#{cpf_do_trabalhador}][EPG_#{matricula_do_trabalhador}_#{data_de_admissao.delete('-')}]-AVI"
|
15
15
|
end
|
16
16
|
|
17
17
|
def cpf_do_trabalhador
|
@@ -22,14 +22,26 @@ module Teodoro
|
|
22
22
|
@matricula_do_trabalhador ||= evento['evtAvPrevio/ideVinculo/matricula']
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
def data_de_admissao
|
26
|
+
admissao.data
|
27
|
+
end
|
28
|
+
|
29
|
+
def admissao
|
30
|
+
@admissao ||= admissoes_por_matricula[matricula_do_trabalhador]
|
31
|
+
end
|
32
|
+
|
33
|
+
def admissoes_por_matricula
|
34
|
+
empresa.admissoes_por_matricula
|
35
|
+
end
|
36
|
+
|
37
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
27
38
|
[
|
39
|
+
# rubocop:disable Layout/LineLength
|
28
40
|
['ESX_CPF', cpf_do_trabalhador],
|
29
41
|
['ESX_MATRICULA', matricula_do_trabalhador],
|
30
|
-
['ESX_CATEGORIA'],
|
42
|
+
['ESX_CATEGORIA', categoria_do_trabalhador],
|
31
43
|
%w[ESX_SEMVINCULO 0],
|
32
|
-
['ESX_DATAADMISSAO'],
|
44
|
+
['ESX_DATAADMISSAO', data_de_admissao],
|
33
45
|
['OperacaoAvisoPrevio'],
|
34
46
|
['MostrarCancelamento'],
|
35
47
|
['MostrarAvisoPrevio'],
|
@@ -52,11 +64,15 @@ module Teodoro
|
|
52
64
|
['IdEventoXml'],
|
53
65
|
['NrReciboEventoOriginal'],
|
54
66
|
['RequestVerificationToken'],
|
55
|
-
['DescricaoProcEmi',
|
67
|
+
['DescricaoProcEmi', processo_de_emissao_do_evento],
|
56
68
|
['VerProc', recibo['retornoEvento/processamento/versaoAppProcessamento']]
|
69
|
+
# rubocop:enable Layout/LineLength
|
57
70
|
]
|
58
71
|
end
|
59
|
-
|
72
|
+
|
73
|
+
def categoria_do_trabalhador
|
74
|
+
admissao.categoria_do_trabalhador
|
75
|
+
end
|
60
76
|
end
|
61
77
|
end
|
62
78
|
end
|