teodoro 0.15.1 → 0.16.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/teodoro/arquivo_data.rb +0 -2
- data/lib/teodoro/leiaute/arquivo_s1010.rb +28 -1
- data/lib/teodoro/leiaute/arquivo_s2306.rb +21 -76
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f341fed6ea7a5070e4abf7e28517c4bdc380d4b416911df29be0aeaa10dd63ec
|
4
|
+
data.tar.gz: bb82b0556bc58101136ae7c92351ab273a5a80ea5122fa44e314ad68678709ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be0f3f4feae90ee3b59ca1053971572dfbcc848855d99457169b77e2017d5b1216cecbe7f38d84a448586e1b81899d29f520181eaf493ffd0a019c03e102d7c4
|
7
|
+
data.tar.gz: daec189dc224a65acd9e8969eef7939269832429b0c9252e1f08518d502c1ababc81cbb10fda22753c42f108cadf14fd2638b57f4dd43f86b3a902b2198c9b5c
|
data/lib/teodoro/arquivo_data.rb
CHANGED
@@ -21,8 +21,6 @@ module Teodoro
|
|
21
21
|
raise caminho if File.exist?(caminho)
|
22
22
|
|
23
23
|
File.open(caminho, 'w') { |f| f.puts(itens_do_conteudo.map { "#{_1}=#{Valor.new(_2, formato: _3)}" }) }
|
24
|
-
# FIXME: Tales
|
25
|
-
# File.write(caminho, (itens_do_conteudo.map { "#{_1}=#{Valor.new(_2, formato: _3)}" } + ['']).join("\n"))
|
26
24
|
end
|
27
25
|
|
28
26
|
private
|
@@ -41,7 +41,7 @@ module Teodoro
|
|
41
41
|
['DadosRubrica_Natureza', evento['infoRubrica/*/dadosRubrica/natRubr']],
|
42
42
|
['DadosRubrica_TipoRubrica', evento['infoRubrica/*/dadosRubrica/tpRubr']],
|
43
43
|
['DadosRubrica_CodigoIncidenciaPrevidencia', evento['infoRubrica/*/dadosRubrica/codIncCP']],
|
44
|
-
['DadosRubrica_CodigoIncidenciaIR'
|
44
|
+
de_acordo_com_a_versao_do_leiaute['DadosRubrica_CodigoIncidenciaIR'],
|
45
45
|
['DadosRubrica_CodigoIncidenciaFGTS', evento['infoRubrica/*/dadosRubrica/codIncFGTS']],
|
46
46
|
['DadosRubrica_CodigoIncidenciaSindical', evento['infoRubrica/*/dadosRubrica/codIncSIND']],
|
47
47
|
['IdEventoXml'],
|
@@ -54,6 +54,33 @@ module Teodoro
|
|
54
54
|
['hd_ProcessoSindicato']
|
55
55
|
]
|
56
56
|
end
|
57
|
+
|
58
|
+
def de_acordo_com_a_versao_do_leiaute # rubocop:disable Metrics/MethodLength
|
59
|
+
@de_acordo_com_a_versao_do_leiaute ||=
|
60
|
+
(
|
61
|
+
if leiaute_simplificado?
|
62
|
+
[
|
63
|
+
[
|
64
|
+
'DadosRubrica_CodigoIncidenciaIR',
|
65
|
+
evento['infoRubrica/*/dadosRubrica/codIncIRRF'].then { {
|
66
|
+
'0' => '00',
|
67
|
+
'1' => '01',
|
68
|
+
'9' => '09',
|
69
|
+
'700' => '79',
|
70
|
+
'701' => '79'
|
71
|
+
}[_1] || _1 }
|
72
|
+
]
|
73
|
+
]
|
74
|
+
else
|
75
|
+
[
|
76
|
+
[
|
77
|
+
'DadosRubrica_CodigoIncidenciaIR',
|
78
|
+
evento['infoRubrica/*/dadosRubrica/codIncIRRF']
|
79
|
+
]
|
80
|
+
]
|
81
|
+
end
|
82
|
+
).map { [_1.first, _1] }.to_h
|
83
|
+
end
|
57
84
|
end
|
58
85
|
end
|
59
86
|
end
|
@@ -180,83 +180,28 @@ module Teodoro
|
|
180
180
|
@data_da_alteracao ||= evento['infoTSVAlteracao/dtAlteracao']
|
181
181
|
end
|
182
182
|
|
183
|
-
def de_acordo_com_a_versao_do_leiaute
|
183
|
+
def de_acordo_com_a_versao_do_leiaute # rubocop:disable Metrics/MethodLength
|
184
184
|
@de_acordo_com_a_versao_do_leiaute ||=
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
def indice
|
206
|
-
@indice ||= chaves_valores.map { [_1.first, _1] }.to_h
|
207
|
-
end
|
208
|
-
end
|
209
|
-
|
210
|
-
class Leiaute2
|
211
|
-
include Leiaute
|
212
|
-
|
213
|
-
private
|
214
|
-
|
215
|
-
def initialize(evento)
|
216
|
-
@evento = evento
|
217
|
-
end
|
218
|
-
|
219
|
-
def chaves_valores
|
220
|
-
[
|
221
|
-
[
|
222
|
-
'InfoVinculo_InfoContrato_CodigoCargo',
|
223
|
-
evento['infoTSVAlteracao/infoComplementares/cargoFuncao/codCargo']
|
224
|
-
]
|
225
|
-
]
|
226
|
-
end
|
227
|
-
end
|
228
|
-
|
229
|
-
class LeiauteSimplificado
|
230
|
-
include Leiaute
|
231
|
-
|
232
|
-
private
|
233
|
-
|
234
|
-
def initialize(empresa:, evento:)
|
235
|
-
@empresa = empresa
|
236
|
-
@evento = evento
|
237
|
-
end
|
238
|
-
|
239
|
-
attr_reader :empresa
|
240
|
-
|
241
|
-
def chaves_valores
|
242
|
-
[
|
243
|
-
[
|
244
|
-
'InfoVinculo_InfoContrato_CodigoCargo',
|
245
|
-
codigo_do_cargo
|
246
|
-
]
|
247
|
-
]
|
248
|
-
end
|
249
|
-
|
250
|
-
def codigo_do_cargo
|
251
|
-
cargo&.codigo
|
252
|
-
end
|
253
|
-
|
254
|
-
def cargo
|
255
|
-
empresa.cargos_gerados[
|
256
|
-
nome: evento['infoTSVAlteracao/infoComplementares/cargoFuncao/nmCargo'],
|
257
|
-
cbo: evento['infoTSVAlteracao/infoComplementares/cargoFuncao/CBOCargo']
|
258
|
-
]
|
259
|
-
end
|
185
|
+
(
|
186
|
+
if leiaute_simplificado?
|
187
|
+
[
|
188
|
+
[
|
189
|
+
'InfoVinculo_InfoContrato_CodigoCargo',
|
190
|
+
empresa.cargos_gerados[
|
191
|
+
nome: evento['infoTSVAlteracao/infoComplementares/cargoFuncao/nmCargo'],
|
192
|
+
cbo: evento['infoTSVAlteracao/infoComplementares/cargoFuncao/CBOCargo']
|
193
|
+
]&.codigo
|
194
|
+
]
|
195
|
+
]
|
196
|
+
else
|
197
|
+
[
|
198
|
+
[
|
199
|
+
'InfoVinculo_InfoContrato_CodigoCargo',
|
200
|
+
evento['infoTSVAlteracao/infoComplementares/cargoFuncao/codCargo']
|
201
|
+
]
|
202
|
+
]
|
203
|
+
end
|
204
|
+
).map { [_1.first, _1] }.to_h
|
260
205
|
end
|
261
206
|
end
|
262
207
|
end
|