teodoro 0.48.0 → 0.49.1
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/arquivo_de_evento_de_tabela.rb +2 -2
- data/lib/teodoro/arquivo_xml.rb +0 -1
- data/lib/teodoro/empresa/arquivo_data_de_admissao_de_trabalhador_sem_vinculo.rb +39 -0
- data/lib/teodoro/empresa.rb +12 -0
- data/lib/teodoro/leiaute/arquivo_s2200.rb +2 -1
- data/lib/teodoro/leiaute/arquivo_s2300.rb +10 -4
- data/lib/teodoro/version.rb +1 -1
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37e8ecabeca146c207419bd9913bd837bf375ffefedf3d5a5a1b5d453157cefb
|
4
|
+
data.tar.gz: 26306bffa4c86ae0049e35bc5c46fe159e1d208c5fed3364f0b00ee43d20f098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2947309578038f6e26ea1046f9ecc2318d289a316a01c98f5c0c55bf4212221f40d378ff85bd91978f7e67fcbfcb0f9df40fd8e17e6f0bd1a0d06fcbf4c71f77
|
7
|
+
data.tar.gz: 1f32b05e88e2025ba151f260d03187c47f39c089c67089784062406573ca8cb3a97a54952572e70f5ec4ab2a633bc93ed8c2a42f01cb3e1e8738472e3e703346
|
@@ -116,8 +116,8 @@ module Teodoro
|
|
116
116
|
def nome_base_do_arquivo_data
|
117
117
|
identificacao[0] + identificacao[1..].map { "[#{_1}]" }
|
118
118
|
.join
|
119
|
-
.tr('àáäâãèéëẽêìíïîĩòóöôõùúüûũñç'.then{ _1 + _1.upcase },
|
120
|
-
'aaaaaeeeeeiiiiiooooouuuuunc'.then{ _1 + _1.upcase })
|
119
|
+
.tr('àáäâãèéëẽêìíïîĩòóöôõùúüûũñç'.then { _1 + _1.upcase },
|
120
|
+
'aaaaaeeeeeiiiiiooooouuuuunc'.then { _1 + _1.upcase })
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
data/lib/teodoro/arquivo_xml.rb
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
module Teodoro
|
2
|
+
class Empresa
|
3
|
+
class ArquivoDataDeAdmissaoDeTrabalhadorSemVinculo
|
4
|
+
private
|
5
|
+
|
6
|
+
def initialize(caminho)
|
7
|
+
@caminho = caminho
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_reader :caminho
|
11
|
+
|
12
|
+
public
|
13
|
+
|
14
|
+
def remover_matricula_do_nome
|
15
|
+
File.rename(caminho, caminho_com_nome_sem_matricula)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def caminho_com_nome_sem_matricula
|
21
|
+
File.join(diretorio, nome_sem_a_matricula)
|
22
|
+
end
|
23
|
+
|
24
|
+
def diretorio
|
25
|
+
File.dirname(caminho)
|
26
|
+
end
|
27
|
+
|
28
|
+
def nome_sem_a_matricula
|
29
|
+
nome_original
|
30
|
+
.then { _1.match(/^(TRA\[.*\]\[TSV_.*_.*)(_.*)(\]-ADM\.data)$/) }
|
31
|
+
.then { "#{_1[1]}#{_1[3]}" }
|
32
|
+
end
|
33
|
+
|
34
|
+
def nome_original
|
35
|
+
File.basename(caminho)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/teodoro/empresa.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
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_de_admissao_de_trabalhador_sem_vinculo'
|
4
5
|
require_relative 'empresa/arquivo_data_emp'
|
5
6
|
require_relative 'empresa/arquivo_data_rub'
|
6
7
|
require_relative 'empresa/arquivo_de_dados_gerais'
|
@@ -53,6 +54,7 @@ module Teodoro
|
|
53
54
|
gerar_arquivo_de_dados_gerais
|
54
55
|
processar_cargos_gerados
|
55
56
|
processar_funcoes_geradas
|
57
|
+
remover_matricula_do_nome_dos_arquivos_data_de_admissao_de_trabalhador_sem_vinculo
|
56
58
|
setar_proximo_identificador_de_tabela_de_rubricas_nos_arquivos_data_emp
|
57
59
|
ajustar_nome_do_ultimo_arquivo_emp_data
|
58
60
|
end
|
@@ -192,6 +194,16 @@ module Teodoro
|
|
192
194
|
funcoes_geradas.each(&:processar)
|
193
195
|
end
|
194
196
|
|
197
|
+
def remover_matricula_do_nome_dos_arquivos_data_de_admissao_de_trabalhador_sem_vinculo
|
198
|
+
arquivos_data_de_admissao_de_trabalhador_sem_vinculo.each(&:remover_matricula_do_nome)
|
199
|
+
end
|
200
|
+
|
201
|
+
def arquivos_data_de_admissao_de_trabalhador_sem_vinculo
|
202
|
+
File.join(destino_dos_arquivos_data, 'TRA*TSV_*_*_*-ADM.data')
|
203
|
+
.then { Dir[_1] }
|
204
|
+
.map { ArquivoDataDeAdmissaoDeTrabalhadorSemVinculo.new(_1) }
|
205
|
+
end
|
206
|
+
|
195
207
|
def setar_proximo_identificador_de_tabela_de_rubricas_nos_arquivos_data_emp
|
196
208
|
arquivos_data_emp.each(&:setar_proximo_identificador_de_tabela_de_rubricas)
|
197
209
|
end
|
@@ -131,7 +131,8 @@ module Teodoro
|
|
131
131
|
evento['vinculo/afastamento']&.then do |afastamento|
|
132
132
|
Obj.new(
|
133
133
|
data_de_inicio: afastamento['dtIniAfast'],
|
134
|
-
codigo_do_motivo: afastamento['codMotAfast']
|
134
|
+
codigo_do_motivo: afastamento['codMotAfast'],
|
135
|
+
numero_do_recibo: numero_do_recibo
|
135
136
|
)
|
136
137
|
end
|
137
138
|
end
|
@@ -123,7 +123,8 @@ module Teodoro
|
|
123
123
|
evento['infoTSVInicio/afastamento']&.then do |afastamento|
|
124
124
|
Obj.new(
|
125
125
|
data_de_inicio: afastamento['dtIniAfast'],
|
126
|
-
codigo_do_motivo: afastamento['codMotAfast']
|
126
|
+
codigo_do_motivo: afastamento['codMotAfast'],
|
127
|
+
numero_do_recibo: numero_do_recibo
|
127
128
|
)
|
128
129
|
end
|
129
130
|
end
|
@@ -132,9 +133,14 @@ module Teodoro
|
|
132
133
|
[
|
133
134
|
Obj.new(
|
134
135
|
nome: [
|
135
|
-
"TRA[#{trabalhador.cpf}]",
|
136
|
-
|
137
|
-
|
136
|
+
"TRA[#{trabalhador.cpf}][",
|
137
|
+
[
|
138
|
+
'TSV',
|
139
|
+
inicio_de_contrato.categoria_do_trabalhador,
|
140
|
+
inicio_de_contrato.data_de_inicio.delete('-'),
|
141
|
+
inicio_de_contrato.matricula_do_trabalhador
|
142
|
+
].join('_'),
|
143
|
+
']-ADM'
|
138
144
|
].join,
|
139
145
|
itens_do_conteudo: [
|
140
146
|
# rubocop:disable Layout/LineLength
|
data/lib/teodoro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teodoro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.49.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fortes Tecnologia
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -178,8 +178,8 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
-
description:
|
182
|
-
email:
|
181
|
+
description:
|
182
|
+
email:
|
183
183
|
executables:
|
184
184
|
- teodoro
|
185
185
|
extensions: []
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- lib/teodoro/cnpj.rb
|
202
202
|
- lib/teodoro/console.rb
|
203
203
|
- lib/teodoro/empresa.rb
|
204
|
+
- lib/teodoro/empresa/arquivo_data_de_admissao_de_trabalhador_sem_vinculo.rb
|
204
205
|
- lib/teodoro/empresa/arquivo_data_emp.rb
|
205
206
|
- lib/teodoro/empresa/arquivo_data_rub.rb
|
206
207
|
- lib/teodoro/empresa/arquivo_de_dados_gerais.rb
|
@@ -242,11 +243,11 @@ files:
|
|
242
243
|
- lib/teodoro/version.rb
|
243
244
|
- lib/teodoro/xml.rb
|
244
245
|
- lib/tipos_de_logradouro.json
|
245
|
-
homepage:
|
246
|
+
homepage:
|
246
247
|
licenses: []
|
247
248
|
metadata:
|
248
249
|
rubygems_mfa_required: 'true'
|
249
|
-
post_install_message:
|
250
|
+
post_install_message:
|
250
251
|
rdoc_options: []
|
251
252
|
require_paths:
|
252
253
|
- lib
|
@@ -261,8 +262,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
262
|
- !ruby/object:Gem::Version
|
262
263
|
version: '0'
|
263
264
|
requirements: []
|
264
|
-
rubygems_version: 3.
|
265
|
-
signing_key:
|
265
|
+
rubygems_version: 3.3.26
|
266
|
+
signing_key:
|
266
267
|
specification_version: 4
|
267
268
|
summary: ''
|
268
269
|
test_files: []
|