teodoro 0.67.6 → 0.69.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cda0e5b46d3e83f27275316e64ab20d8554a1dfa28378babe48f797a49405db9
4
- data.tar.gz: de3cf38e310603cd7406ed0a67fe88a7017f8a2757fa00267270d98990ac9398
3
+ metadata.gz: 26c80e3876d1f891f0ac2474b4fb3794fb7a05527443bc884f7c973984d20aa8
4
+ data.tar.gz: e96cd3ff86d0e9d785525cf3c2c3b493ae7b405b441dcab7901b6649bacb0628
5
5
  SHA512:
6
- metadata.gz: ca2e6c475ea2b134a78d52bce19106fe6b2661fe4827020a149ede2f002cb4a6abf550582565bb14d8f7e499df2e92eeef0354afca21542acccfe5ed1b31f07f
7
- data.tar.gz: 8c105527da9d8a79af3b281c1140977afd0e9a2e41f60878e314c08a8b6863155717a2f855c1eee01c04ede1f0b122421df718fa14ffe83e3f265f0a75e00596
6
+ metadata.gz: 191e8c53c887d19a5dcb39d6531d5b56ebcbb276d0268002320f780bed29b562d7761b49fe66097af5eaa6c00a99b158aeacc1229e4f8384af4dfa1d3365078a
7
+ data.tar.gz: 0dd71ad61403f549cbb86886302480691fc8560d84f14f7f3aee8ec199170504a1e6ebb01a9693c609bc899093ea7a9541b865b7b0704ed322bff7908d5c947f
@@ -20,6 +20,7 @@ require_relative 'leiaute/arquivo_s2205'
20
20
  require_relative 'leiaute/arquivo_s2206'
21
21
  require_relative 'leiaute/arquivo_s2210'
22
22
  require_relative 'leiaute/arquivo_s2220'
23
+ require_relative 'leiaute/arquivo_s2221'
23
24
  require_relative 'leiaute/arquivo_s2230'
24
25
  require_relative 'leiaute/arquivo_s2240'
25
26
  require_relative 'leiaute/arquivo_s2250'
@@ -53,6 +54,7 @@ module Teodoro
53
54
  S2206
54
55
  S2210
55
56
  S2220
57
+ S2221
56
58
  S2230
57
59
  S2240
58
60
  S2250
@@ -74,6 +76,7 @@ module Teodoro
74
76
  S2206
75
77
  S2210
76
78
  S2220
79
+ S2221
77
80
  S2230
78
81
  S2240
79
82
  S2250
@@ -0,0 +1,26 @@
1
+ module Teodoro
2
+ class Empresa
3
+ class ArquivoDataPRE
4
+ private
5
+
6
+ def initialize(caminho)
7
+ @caminho = caminho
8
+ end
9
+
10
+ attr_reader :caminho
11
+
12
+ public
13
+
14
+ def inserir_matricula_do_trabalhador(matricula_do_trabalhador)
15
+ File
16
+ .readlines(caminho)
17
+ .then do |linhas_originais|
18
+ File.open(caminho, 'w') do |file|
19
+ (linhas_originais + ["Matricula=#{matricula_do_trabalhador}"])
20
+ .then { file.puts(_1) }
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -2,6 +2,7 @@ require_relative 'arquivo_de_origem'
2
2
  require_relative 'arquivo_xml'
3
3
  require_relative 'empresa/arquivos_data'
4
4
  require_relative 'empresa/arquivo_data_emp'
5
+ require_relative 'empresa/arquivo_data_pre'
5
6
  require_relative 'empresa/arquivo_data_rub'
6
7
  require_relative 'empresa/arquivo_de_dados_gerais'
7
8
  require_relative 'empresa/cargos_gerados'
@@ -9,6 +9,9 @@ module Teodoro
9
9
  super
10
10
 
11
11
  registrar_admissao
12
+
13
+ inserir_matricula_do_trabalhador_no_arquivo_data_de_pre_admissao if
14
+ inserir_matricula_do_trabalhador_no_arquivo_data_de_pre_admissao?
12
15
  end
13
16
 
14
17
  def registrar_admissao
@@ -136,6 +139,34 @@ module Teodoro
136
139
  end
137
140
  end
138
141
 
142
+ def inserir_matricula_do_trabalhador_no_arquivo_data_de_pre_admissao?
143
+ faz_referencia_a_uma_pre_admissao?
144
+ end
145
+
146
+ def faz_referencia_a_uma_pre_admissao?
147
+ evento['vinculo/nrRecInfPrelim']
148
+ end
149
+
150
+ def inserir_matricula_do_trabalhador_no_arquivo_data_de_pre_admissao
151
+ arquivo_data_de_pre_admissao.inserir_matricula_do_trabalhador(admissao.matricula_do_trabalhador)
152
+ end
153
+
154
+ def arquivo_data_de_pre_admissao
155
+ Empresa::ArquivoDataPRE.new(caminho_do_arquivo_data_de_pre_admissao)
156
+ end
157
+
158
+ def caminho_do_arquivo_data_de_pre_admissao
159
+ File.join(destino_dos_arquivos_data, nome_do_arquivo_data_de_pre_admissao)
160
+ end
161
+
162
+ def destino_dos_arquivos_data
163
+ empresa.destino_dos_arquivos_data
164
+ end
165
+
166
+ def nome_do_arquivo_data_de_pre_admissao
167
+ "PRE[#{trabalhador.cpf}][#{admissao.data_de_admissao.delete('-')}][].data"
168
+ end
169
+
139
170
  def dados_dos_arquivos_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
140
171
  [
141
172
  Obj.new(
@@ -0,0 +1,50 @@
1
+ module Teodoro
2
+ module Leiaute
3
+ class ArquivoS2221
4
+ include ArquivoDeEventoNaoPeriodicoNaoCancelavel
5
+
6
+ private
7
+
8
+ def dados_dos_arquivos_data
9
+ [
10
+ Obj.new(
11
+ operacao: :inclusao,
12
+ nome: "TOX[#{cpf_do_trabalhador}][#{matricula}][#{data_do_exame.delete('-')}]",
13
+ itens_do_conteudo: itens_do_conteudo
14
+ )
15
+ ]
16
+ end
17
+
18
+ def itens_do_conteudo # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
19
+ [
20
+ ['Id', id_do_evento],
21
+ ['procEmi', processo_de_emissao_do_evento],
22
+ ['verProc', versao_do_processo_de_emissao_do_evento],
23
+ ['ideEmpregador/tpInsc', tipo_de_inscricao_do_empregador],
24
+ ['ideEmpregador/nrInsc', numero_de_inscricao_do_empregador],
25
+ ['ideVinculo/cpfTrab', cpf_do_trabalhador],
26
+ ['ideVinculo/matricula', matricula],
27
+ ['dtExame', data_do_exame],
28
+ ['cnpjLab', evento['toxicologico/cnpjLab']],
29
+ ['codSeqExame', evento['toxicologico/codSeqExame']],
30
+ ['nmMed', evento['toxicologico/nmMed']],
31
+ ['nrCRM', evento['toxicologico/nrCRM']],
32
+ ['ufCRM', evento['toxicologico/ufCRM']],
33
+ ['nrRecibo', numero_do_recibo]
34
+ ]
35
+ end
36
+
37
+ def cpf_do_trabalhador
38
+ @cpf_do_trabalhador ||= evento['ideVinculo/cpfTrab']
39
+ end
40
+
41
+ def matricula
42
+ @matricula ||= evento['ideVinculo/matricula']
43
+ end
44
+
45
+ def data_do_exame
46
+ @data_do_exame ||= evento['toxicologico/dtExame']
47
+ end
48
+ end
49
+ end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module Teodoro
2
- VERSION = '0.67.6'.freeze
2
+ VERSION = '0.69.0'.freeze
3
3
  end
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.67.6
4
+ version: 0.69.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fortes Tecnologia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-30 00:00:00.000000000 Z
11
+ date: 2024-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -90,6 +90,7 @@ files:
90
90
  - lib/teodoro/console.rb
91
91
  - lib/teodoro/empresa.rb
92
92
  - lib/teodoro/empresa/arquivo_data_emp.rb
93
+ - lib/teodoro/empresa/arquivo_data_pre.rb
93
94
  - lib/teodoro/empresa/arquivo_data_rub.rb
94
95
  - lib/teodoro/empresa/arquivo_de_dados_gerais.rb
95
96
  - lib/teodoro/empresa/arquivos_data.rb
@@ -114,6 +115,7 @@ files:
114
115
  - lib/teodoro/leiaute/arquivo_s2206.rb
115
116
  - lib/teodoro/leiaute/arquivo_s2210.rb
116
117
  - lib/teodoro/leiaute/arquivo_s2220.rb
118
+ - lib/teodoro/leiaute/arquivo_s2221.rb
117
119
  - lib/teodoro/leiaute/arquivo_s2230.rb
118
120
  - lib/teodoro/leiaute/arquivo_s2240.rb
119
121
  - lib/teodoro/leiaute/arquivo_s2250.rb