teodoro 0.23.1 → 0.28.0
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/municipios.json +22262 -0
- data/lib/teodoro.rb +35 -11
- data/lib/teodoro/arquivo_xml.rb +6 -5
- data/lib/teodoro/empresa.rb +41 -1
- data/lib/teodoro/empresa/arquivo_data_emp.rb +33 -0
- data/lib/teodoro/empresa/arquivo_data_rub.rb +30 -0
- data/lib/teodoro/empresa/contratos_de_emprego.rb +18 -2
- data/lib/teodoro/empresa/trabalhadores.rb +19 -0
- data/lib/teodoro/leiaute/arquivo_s2200.rb +61 -34
- data/lib/teodoro/leiaute/arquivo_s2205.rb +56 -29
- data/lib/teodoro/leiaute/arquivo_s2206.rb +1 -0
- data/lib/teodoro/leiaute/arquivo_s2230.rb +0 -2
- data/lib/teodoro/leiaute/arquivo_s2299.rb +22 -18
- data/lib/teodoro/leiaute/arquivo_s2300.rb +6 -2
- data/lib/teodoro/leiaute/arquivo_s2306.rb +1 -1
- data/lib/teodoro/leiaute/arquivo_s2399.rb +1 -1
- data/lib/tipos_de_logradouro.json +730 -0
- metadata +7 -2
data/lib/teodoro.rb
CHANGED
@@ -12,7 +12,7 @@ require_relative 'teodoro/empresa'
|
|
12
12
|
require_relative 'teodoro/obj'
|
13
13
|
|
14
14
|
module Teodoro
|
15
|
-
VERSION = '0.
|
15
|
+
VERSION = '0.28.0'.freeze
|
16
16
|
|
17
17
|
CBOs = __FILE__
|
18
18
|
.then { File.dirname(_1) }
|
@@ -23,15 +23,28 @@ module Teodoro
|
|
23
23
|
.to_h
|
24
24
|
.freeze
|
25
25
|
|
26
|
+
Municipios = __FILE__
|
27
|
+
.then { File.dirname(_1) }
|
28
|
+
.then { File.join(_1, 'municipios.json') }
|
29
|
+
.then { File.read(_1) }
|
30
|
+
.then { JSON.parse(_1) }
|
31
|
+
.map { [_1['codigo'], _1['nome']] }
|
32
|
+
.to_h
|
33
|
+
.freeze
|
34
|
+
|
35
|
+
TiposDeLogradouro = __FILE__
|
36
|
+
.then { File.dirname(_1) }
|
37
|
+
.then { File.join(_1, 'tipos_de_logradouro.json') }
|
38
|
+
.then { File.read(_1) }
|
39
|
+
.then { JSON.parse(_1) }
|
40
|
+
.map { [_1['codigo'], _1['descricao']] }
|
41
|
+
.to_h
|
42
|
+
.freeze
|
43
|
+
|
26
44
|
def self.call(args)
|
27
45
|
Execution.new(args).call
|
28
46
|
end
|
29
47
|
|
30
|
-
@production = true
|
31
|
-
def self.production?
|
32
|
-
@production
|
33
|
-
end
|
34
|
-
|
35
48
|
class Execution
|
36
49
|
NOME_DO_PROGRAMA = 'teodoro'.freeze
|
37
50
|
|
@@ -49,6 +62,7 @@ module Teodoro
|
|
49
62
|
validar_argumentos
|
50
63
|
validar_existencia_do_diretorio_de_origem
|
51
64
|
validar_existencia_do_diretorio_de_destino
|
65
|
+
validar_que_diretorio_de_origem_nao_contem_arquivo
|
52
66
|
validar_que_diretorio_de_origem_nao_esta_vazio
|
53
67
|
validar_que_diretorio_de_destino_esta_vazio
|
54
68
|
validar_que_nao_ha_nova_versao_disponivel
|
@@ -59,7 +73,7 @@ module Teodoro
|
|
59
73
|
private
|
60
74
|
|
61
75
|
def validar_argumentos
|
62
|
-
erro
|
76
|
+
erro("#{NOME_DO_PROGRAMA} [diretório de origem] [diretório de destino]", saiba_mais: true) unless args.size == 2
|
63
77
|
end
|
64
78
|
|
65
79
|
def validar_que_nao_ha_nova_versao_disponivel
|
@@ -113,16 +127,26 @@ module Teodoro
|
|
113
127
|
@destino ||= args[1].tr('\\', '/')
|
114
128
|
end
|
115
129
|
|
130
|
+
def validar_que_diretorio_de_origem_nao_contem_arquivo
|
131
|
+
return unless diretorio_de_origem_contem_arquivo?
|
132
|
+
|
133
|
+
erro('Diretório de origem deve conter apenas diretórios de empresa.', saiba_mais: true)
|
134
|
+
end
|
135
|
+
|
136
|
+
def diretorio_de_origem_contem_arquivo?
|
137
|
+
Dir[File.join(origem, '*')].any? { File.file?(_1) }
|
138
|
+
end
|
139
|
+
|
116
140
|
def validar_que_diretorio_de_origem_nao_esta_vazio
|
117
|
-
erro
|
141
|
+
erro('Diretório de origem vazio.', saiba_mais: true) if Dir.empty?(origem)
|
118
142
|
end
|
119
143
|
|
120
144
|
def validar_que_diretorio_de_destino_esta_vazio
|
121
|
-
erro
|
145
|
+
erro('Diretório de destino deve estar vazio.', saiba_mais: true) unless Dir.empty?(destino)
|
122
146
|
end
|
123
147
|
|
124
|
-
def erro(erro)
|
125
|
-
puts erro
|
148
|
+
def erro(erro, saiba_mais: false)
|
149
|
+
puts [erro, *('Saiba mais em sites.google.com/fortestecnologia.com.br/teodoro.' if saiba_mais)]
|
126
150
|
exit
|
127
151
|
end
|
128
152
|
|
data/lib/teodoro/arquivo_xml.rb
CHANGED
@@ -49,6 +49,7 @@ module Teodoro
|
|
49
49
|
].freeze
|
50
50
|
|
51
51
|
TIPOS_DE_EVENTO_RETIFICAVEIS = %w[
|
52
|
+
S2190
|
52
53
|
S2200
|
53
54
|
S2205
|
54
55
|
S2206
|
@@ -126,11 +127,11 @@ module Teodoro
|
|
126
127
|
end
|
127
128
|
|
128
129
|
def validar_versao_do_leiaute
|
129
|
-
raise unless [
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
130
|
+
raise unless %w[
|
131
|
+
02_04_01
|
132
|
+
02_04_02
|
133
|
+
02_05_00
|
134
|
+
_S_01_00_00
|
134
135
|
].include?(versao_do_leiaute)
|
135
136
|
end
|
136
137
|
|
data/lib/teodoro/empresa.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
require_relative 'arquivo_de_origem'
|
2
2
|
require_relative 'arquivo_xml'
|
3
3
|
require_relative 'empresa/arquivos_data'
|
4
|
+
require_relative 'empresa/arquivo_data_emp'
|
5
|
+
require_relative 'empresa/arquivo_data_rub'
|
4
6
|
require_relative 'empresa/cargos_gerados'
|
5
7
|
require_relative 'empresa/contratos_de_emprego'
|
6
8
|
require_relative 'empresa/contratos_de_trabalho_sem_vinculo'
|
9
|
+
require_relative 'empresa/trabalhadores'
|
7
10
|
|
8
11
|
module Teodoro
|
9
12
|
class Empresa
|
@@ -46,6 +49,7 @@ module Teodoro
|
|
46
49
|
ordenar_arquivos_xml
|
47
50
|
processar_arquivos_xml
|
48
51
|
processar_cargos_gerados
|
52
|
+
setar_proximo_identificador_de_tabela_de_rubricas_nos_arquivos_data_emp
|
49
53
|
ajustar_nome_do_ultimo_arquivo_emp_data
|
50
54
|
end
|
51
55
|
|
@@ -57,8 +61,12 @@ module Teodoro
|
|
57
61
|
@arquivos_data ||= ArquivosData.new(destino_dos_arquivos_data)
|
58
62
|
end
|
59
63
|
|
64
|
+
def trabalhadores
|
65
|
+
@trabalhadores ||= Trabalhadores.new
|
66
|
+
end
|
67
|
+
|
60
68
|
def contratos_de_emprego
|
61
|
-
@contratos_de_emprego ||= ContratosDeEmprego.new
|
69
|
+
@contratos_de_emprego ||= ContratosDeEmprego.new(trabalhadores)
|
62
70
|
end
|
63
71
|
|
64
72
|
def contratos_de_trabalho_sem_vinculo
|
@@ -149,6 +157,38 @@ module Teodoro
|
|
149
157
|
cargos_gerados.each(&:processar)
|
150
158
|
end
|
151
159
|
|
160
|
+
def setar_proximo_identificador_de_tabela_de_rubricas_nos_arquivos_data_emp
|
161
|
+
arquivos_data_emp.each(&:setar_proximo_identificador_de_tabela_de_rubricas)
|
162
|
+
end
|
163
|
+
|
164
|
+
def arquivos_data_emp
|
165
|
+
Dir[File.join(destino_dos_arquivos_data, 'EMP*.data')]
|
166
|
+
.map { ArquivoDataEMP.new(
|
167
|
+
caminho: _1,
|
168
|
+
proximo_identificador_de_tabela_de_rubricas: proximo_identificador_de_tabela_de_rubricas
|
169
|
+
) }
|
170
|
+
end
|
171
|
+
|
172
|
+
def proximo_identificador_de_tabela_de_rubricas
|
173
|
+
(ultimo_identificador_de_tabela_de_rubricas || 0) + 1
|
174
|
+
end
|
175
|
+
|
176
|
+
def ultimo_identificador_de_tabela_de_rubricas
|
177
|
+
identificadores_de_tabela_de_rubrica
|
178
|
+
.select { _1&.match?(/^\d+$/) }
|
179
|
+
.map(&:to_i)
|
180
|
+
.max
|
181
|
+
end
|
182
|
+
|
183
|
+
def identificadores_de_tabela_de_rubrica
|
184
|
+
arquivos_data_rub.map(&:identificador_da_tabela_de_rubricas)
|
185
|
+
end
|
186
|
+
|
187
|
+
def arquivos_data_rub
|
188
|
+
Dir[File.join(destino_dos_arquivos_data, 'RUB*.data')]
|
189
|
+
.map { ArquivoDataRUB.new(_1) }
|
190
|
+
end
|
191
|
+
|
152
192
|
def ajustar_nome_do_ultimo_arquivo_emp_data
|
153
193
|
File.rename(caminho_do_ultimo_arquivo_emp_data, novo_caminho_do_ultimo_arquivo_emp_data)
|
154
194
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Teodoro
|
2
|
+
class Empresa
|
3
|
+
class ArquivoDataEMP
|
4
|
+
private
|
5
|
+
|
6
|
+
def initialize(caminho:, proximo_identificador_de_tabela_de_rubricas:)
|
7
|
+
@caminho = caminho
|
8
|
+
@proximo_identificador_de_tabela_de_rubricas = proximo_identificador_de_tabela_de_rubricas
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_reader :caminho, :proximo_identificador_de_tabela_de_rubricas
|
12
|
+
|
13
|
+
public
|
14
|
+
|
15
|
+
def setar_proximo_identificador_de_tabela_de_rubricas
|
16
|
+
File.write(caminho, novo_conteudo)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def novo_conteudo
|
22
|
+
conteudo_anterior.sub(
|
23
|
+
"\nESX_TABELARUBRICA=\n",
|
24
|
+
"\nESX_TABELARUBRICA=#{proximo_identificador_de_tabela_de_rubricas}\n"
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def conteudo_anterior
|
29
|
+
File.read(caminho)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Teodoro
|
2
|
+
class Empresa
|
3
|
+
class ArquivoDataRUB
|
4
|
+
private
|
5
|
+
|
6
|
+
def initialize(caminho)
|
7
|
+
@caminho = caminho
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_reader :caminho
|
11
|
+
|
12
|
+
public
|
13
|
+
|
14
|
+
def identificador_da_tabela_de_rubricas
|
15
|
+
chaves_valores['IdTabelaRubrica']
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def chaves_valores
|
21
|
+
File
|
22
|
+
.readlines(caminho)
|
23
|
+
.map(&:strip)
|
24
|
+
.map { _1.split('=') }
|
25
|
+
.map { _1.size == 2 ? _1 : [_1.first, nil] }
|
26
|
+
.to_h
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,8 +1,19 @@
|
|
1
1
|
module Teodoro
|
2
2
|
class Empresa
|
3
3
|
class ContratosDeEmprego
|
4
|
+
private
|
5
|
+
|
6
|
+
def initialize(trabalhadores)
|
7
|
+
@trabalhadores = trabalhadores
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_reader :trabalhadores
|
11
|
+
|
12
|
+
public
|
13
|
+
|
4
14
|
def registrar_admissao(admissao:, afastamento:)
|
5
15
|
contratos_por_matricula[admissao.matricula] = Contrato.new(admissao: admissao, afastamento: afastamento)
|
16
|
+
trabalhadores << admissao.trabalhador
|
6
17
|
end
|
7
18
|
|
8
19
|
def [](matricula)
|
@@ -11,7 +22,7 @@ module Teodoro
|
|
11
22
|
|
12
23
|
def *(cpf_do_trabalhador:, data:)
|
13
24
|
contratos
|
14
|
-
.select { _1.
|
25
|
+
.select { _1.trabalhador.cpf == cpf_do_trabalhador && _1.ativo?(data) }
|
15
26
|
.sort_by(&:data_de_admissao)
|
16
27
|
end
|
17
28
|
|
@@ -43,7 +54,12 @@ module Teodoro
|
|
43
54
|
|
44
55
|
extend Forwardable
|
45
56
|
|
46
|
-
def_delegators :admissao,
|
57
|
+
def_delegators :admissao,
|
58
|
+
:trabalhador,
|
59
|
+
:matricula,
|
60
|
+
:data_de_admissao,
|
61
|
+
:categoria_do_trabalhador,
|
62
|
+
:primeiro_emprego_do_trabalhador,
|
47
63
|
:recibo
|
48
64
|
|
49
65
|
attr_accessor :afastamento
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Teodoro
|
2
|
+
class Empresa
|
3
|
+
class Trabalhadores
|
4
|
+
def <<(trabalhador)
|
5
|
+
trabalhadores[trabalhador.cpf] = trabalhador
|
6
|
+
end
|
7
|
+
|
8
|
+
def [](cpf)
|
9
|
+
trabalhadores[cpf]
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def trabalhadores
|
15
|
+
@trabalhadores ||= {}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -13,17 +13,47 @@ module Teodoro
|
|
13
13
|
|
14
14
|
def registrar_admissao
|
15
15
|
contratos_de_emprego.registrar_admissao(
|
16
|
-
admissao:
|
17
|
-
matricula: matricula_do_trabalhador,
|
18
|
-
data_de_admissao: data_de_admissao,
|
19
|
-
categoria_do_trabalhador: categoria_do_trabalhador,
|
20
|
-
cpf_do_trabalhador: cpf_do_trabalhador,
|
21
|
-
recibo: numero_do_recibo
|
22
|
-
),
|
16
|
+
admissao: admissao,
|
23
17
|
afastamento: afastamento
|
24
18
|
)
|
25
19
|
end
|
26
20
|
|
21
|
+
def admissao
|
22
|
+
Obj.new(
|
23
|
+
trabalhador: trabalhador,
|
24
|
+
matricula: matricula_do_trabalhador,
|
25
|
+
data_de_admissao: data_de_admissao,
|
26
|
+
categoria_do_trabalhador: categoria_do_trabalhador,
|
27
|
+
primeiro_emprego_do_trabalhador: evento['trabalhador/indPriEmpr'],
|
28
|
+
recibo: numero_do_recibo
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
def trabalhador # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
33
|
+
@trabalhador ||= Obj.new(
|
34
|
+
cpf: evento['trabalhador/cpfTrab'],
|
35
|
+
nis: evento['trabalhador/nisTrab'],
|
36
|
+
nome: evento['trabalhador/nmTrab'],
|
37
|
+
sexo: evento['trabalhador/sexo'],
|
38
|
+
raca_cor: evento['trabalhador/racaCor'],
|
39
|
+
estado_civil: evento['trabalhador/estCiv'],
|
40
|
+
grau_de_instrucao: evento['trabalhador/grauInstr'],
|
41
|
+
nome_social: evento['trabalhador/nmSoc'],
|
42
|
+
data_de_nascimento: evento['trabalhador/nascimento/dtNascto'],
|
43
|
+
pais_de_nascimento: evento['trabalhador/nascimento/paisNascto'],
|
44
|
+
pais_de_nacionalidade: evento['trabalhador/nascimento/paisNac'],
|
45
|
+
codigo_do_municipio_de_nascimento: evento['trabalhador/nascimento/codMunic'],
|
46
|
+
uf_de_nascimento: evento['trabalhador/nascimento/uf'],
|
47
|
+
nome_da_mae: evento['trabalhador/nascimento/nmMae'],
|
48
|
+
nome_do_pai: evento['trabalhador/nascimento/nmPai'],
|
49
|
+
reside_no_exterior?: evento['trabalhador/endereco/exterior'],
|
50
|
+
endereco: Obj.new(
|
51
|
+
tipo_de_logradouro: evento['trabalhador/endereco/brasil/tpLograd'],
|
52
|
+
codigo_do_municipio: evento['trabalhador/endereco/brasil/codMunic']
|
53
|
+
)
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
27
57
|
def contratos_de_emprego
|
28
58
|
empresa.contratos_de_emprego
|
29
59
|
end
|
@@ -40,10 +70,6 @@ module Teodoro
|
|
40
70
|
@categoria_do_trabalhador ||= evento['vinculo/infoContrato/codCateg']
|
41
71
|
end
|
42
72
|
|
43
|
-
def cpf_do_trabalhador
|
44
|
-
@cpf_do_trabalhador ||= evento['trabalhador/cpfTrab']
|
45
|
-
end
|
46
|
-
|
47
73
|
def afastamento
|
48
74
|
evento['vinculo/afastamento']&.then { Obj.new(
|
49
75
|
data_de_inicio: _1['dtIniAfast'],
|
@@ -54,10 +80,10 @@ module Teodoro
|
|
54
80
|
def dados_dos_arquivos_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
55
81
|
[
|
56
82
|
Obj.new(
|
57
|
-
nome: "TRA[#{
|
83
|
+
nome: "TRA[#{trabalhador.cpf}][EPG_#{matricula_do_trabalhador}_#{data_de_admissao.delete('-')}]-ADM",
|
58
84
|
itens_do_conteudo: [
|
59
85
|
# rubocop:disable Layout/LineLength
|
60
|
-
['ESX_CPF',
|
86
|
+
['ESX_CPF', trabalhador.cpf],
|
61
87
|
['ESX_MATRICULA', matricula_do_trabalhador],
|
62
88
|
['ESX_CATEGORIA', categoria_do_trabalhador],
|
63
89
|
%w[ESX_SEMVINCULO 0],
|
@@ -81,43 +107,43 @@ module Teodoro
|
|
81
107
|
['DescricaoProcEmi', processo_de_emissao_do_evento],
|
82
108
|
['VerProc', versao_do_processo_de_emissao_do_evento],
|
83
109
|
['HorarioTela_Dia'],
|
84
|
-
['EventoAdmissao_InfoTrabalhador_Cpf',
|
85
|
-
['EventoAdmissao_InfoTrabalhador_Nome',
|
86
|
-
['EventoAdmissao_InfoTrabalhador_Nis',
|
87
|
-
['EventoAdmissao_InfoTrabalhador_Sexo',
|
110
|
+
['EventoAdmissao_InfoTrabalhador_Cpf', trabalhador.cpf],
|
111
|
+
['EventoAdmissao_InfoTrabalhador_Nome', trabalhador.nome],
|
112
|
+
['EventoAdmissao_InfoTrabalhador_Nis', trabalhador.nis],
|
113
|
+
['EventoAdmissao_InfoTrabalhador_Sexo', trabalhador.sexo],
|
88
114
|
['EventoAdmissao_InfoTrabalhador_Sexo_TEXT'],
|
89
|
-
['EventoAdmissao_InfoTrabalhador_RacaCor',
|
115
|
+
['EventoAdmissao_InfoTrabalhador_RacaCor', trabalhador.raca_cor],
|
90
116
|
['EventoAdmissao_InfoTrabalhador_RacaCor_TEXT'],
|
91
|
-
['EventoAdmissao_InfoTrabalhador_EstadoCivil',
|
117
|
+
['EventoAdmissao_InfoTrabalhador_EstadoCivil', trabalhador.estado_civil],
|
92
118
|
['EventoAdmissao_InfoTrabalhador_EstadoCivil_TEXT'],
|
93
|
-
['EventoAdmissao_InfoTrabalhador_GrauInstrucao',
|
119
|
+
['EventoAdmissao_InfoTrabalhador_GrauInstrucao', trabalhador.grau_de_instrucao],
|
94
120
|
['EventoAdmissao_InfoTrabalhador_GrauInstrucao_TEXT'],
|
95
121
|
['EventoAdmissao_InfoTrabalhador_PrimeiroEmprego', evento['trabalhador/indPriEmpr']],
|
96
|
-
['EventoAdmissao_InfoTrabalhador_NomeSocial',
|
97
|
-
['EventoAdmissao_InfoTrabalhador_Nascimento_CodigoMunicipio',
|
98
|
-
['EventoAdmissao_InfoTrabalhador_Nascimento_CodigoMunicipio_TEXT'],
|
99
|
-
['EventoAdmissao_InfoTrabalhador_Nascimento_DataNascimento',
|
100
|
-
['EventoAdmissao_InfoTrabalhador_Nascimento_NomeMae',
|
101
|
-
['EventoAdmissao_InfoTrabalhador_Nascimento_NomePai',
|
102
|
-
['EventoAdmissao_InfoTrabalhador_Nascimento_PaisNascimento',
|
122
|
+
['EventoAdmissao_InfoTrabalhador_NomeSocial', trabalhador.nome_social],
|
123
|
+
['EventoAdmissao_InfoTrabalhador_Nascimento_CodigoMunicipio', trabalhador.codigo_do_municipio_de_nascimento],
|
124
|
+
['EventoAdmissao_InfoTrabalhador_Nascimento_CodigoMunicipio_TEXT', Municipios[trabalhador.codigo_do_municipio_de_nascimento]],
|
125
|
+
['EventoAdmissao_InfoTrabalhador_Nascimento_DataNascimento', trabalhador.data_de_nascimento, :data],
|
126
|
+
['EventoAdmissao_InfoTrabalhador_Nascimento_NomeMae', trabalhador.nome_da_mae],
|
127
|
+
['EventoAdmissao_InfoTrabalhador_Nascimento_NomePai', trabalhador.nome_do_pai],
|
128
|
+
['EventoAdmissao_InfoTrabalhador_Nascimento_PaisNascimento', trabalhador.pais_de_nascimento],
|
103
129
|
['EventoAdmissao_InfoTrabalhador_Nascimento_PaisNascimento_TEXT'],
|
104
|
-
['EventoAdmissao_InfoTrabalhador_Nascimento_PaisNacionalidade',
|
130
|
+
['EventoAdmissao_InfoTrabalhador_Nascimento_PaisNacionalidade', trabalhador.pais_de_nacionalidade],
|
105
131
|
['EventoAdmissao_InfoTrabalhador_Nascimento_PaisNacionalidade_TEXT'],
|
106
|
-
['EventoAdmissao_InfoTrabalhador_Nascimento_Uf',
|
132
|
+
['EventoAdmissao_InfoTrabalhador_Nascimento_Uf', trabalhador.uf_de_nascimento],
|
107
133
|
['EventoAdmissao_InfoTrabalhador_Nascimento_Uf_TEXT'],
|
108
134
|
['EventoAdmissao_EnderecoResidencialBR_Bairro', evento['trabalhador/endereco/brasil/bairro']],
|
109
135
|
['EventoAdmissao_EnderecoResidencialBR_Cep', evento['trabalhador/endereco/brasil/cep']],
|
110
|
-
['EventoAdmissao_EnderecoResidencialBR_CodigoMunicipio',
|
111
|
-
['EventoAdmissao_EnderecoResidencialBR_CodigoMunicipio_TEXT'],
|
136
|
+
['EventoAdmissao_EnderecoResidencialBR_CodigoMunicipio', trabalhador.endereco.codigo_do_municipio],
|
137
|
+
['EventoAdmissao_EnderecoResidencialBR_CodigoMunicipio_TEXT', Municipios[trabalhador.endereco.codigo_do_municipio]],
|
112
138
|
['EventoAdmissao_EnderecoResidencialBR_Complemento', evento['trabalhador/endereco/brasil/complemento']],
|
113
139
|
['EventoAdmissao_EnderecoResidencialBR_DescricaoLogradouro', evento['trabalhador/endereco/brasil/dscLograd']],
|
114
140
|
['EventoAdmissao_EnderecoResidencialBR_NumeroLogradouro', evento['trabalhador/endereco/brasil/nrLograd']],
|
115
141
|
['SemNumeroLogradouroEnderecoBR'],
|
116
|
-
['EventoAdmissao_EnderecoResidencialBR_TipoLogradouro',
|
117
|
-
['EventoAdmissao_EnderecoResidencialBR_TipoLogradouro_TEXT'],
|
142
|
+
['EventoAdmissao_EnderecoResidencialBR_TipoLogradouro', trabalhador.endereco.tipo_de_logradouro],
|
143
|
+
['EventoAdmissao_EnderecoResidencialBR_TipoLogradouro_TEXT', trabalhador.endereco.tipo_de_logradouro.then { "#{_1} - #{TiposDeLogradouro[_1]}" }],
|
118
144
|
['EventoAdmissao_EnderecoResidencialBR_Uf', evento['trabalhador/endereco/brasil/uf']],
|
119
145
|
['EventoAdmissao_EnderecoResidencialBR_Uf_TEXT'],
|
120
|
-
['ResideExterior',
|
146
|
+
['ResideExterior', trabalhador.reside_no_exterior?, :bool],
|
121
147
|
['SemNumeroLogradouroEnderecoEX'],
|
122
148
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_CasadoComBrasileiro', evento['trabalhador/trabEstrangeiro/casadoBr']],
|
123
149
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_DataChegada', evento['trabalhador/trabEstrangeiro/dtChegada'], :data],
|
@@ -207,6 +233,7 @@ module Teodoro
|
|
207
233
|
de_acordo_com_a_versao_do_leiaute['EventoAdmissao_InfoVinculo_InfoContrato_HorarioContratual_TipoJornada'],
|
208
234
|
de_acordo_com_a_versao_do_leiaute['EventoAdmissao_InfoVinculo_InfoContrato_HorarioContratual_DescricaoTipoJornada'],
|
209
235
|
['EventoAdmissao_InfoVinculo_InfoContrato_HorarioContratual_JornadaTempoParcial', evento['vinculo/infoContrato/horContratual/tmpParc']],
|
236
|
+
*([['HorarioNoturno', evento['vinculo/infoContrato/horContratual/horNoturno']]] if leiaute_simplificado?),
|
210
237
|
['EventoAdmissao_InfoVinculo_DataInicioAfastamento', evento['vinculo/afastamento/dtIniAfast'], :data],
|
211
238
|
['EventoAdmissao_InfoVinculo_CodigoMotivoAfastamento', evento['vinculo/afastamento/codMotAfast']],
|
212
239
|
['EventoAdmissao_InfoVinculo_SucessaoVinculo_DataTransferencia', evento['vinculo/sucessaoVinc/dtTransf'], :data],
|