teodoro 0.40.3 → 0.42.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29ec7f364493911d10565a2501b275843a19f6bd18a345d96ad595a2c02fa615
4
- data.tar.gz: 1962eedd713cf5d5d0402fecfd675ee95f93047914625e358d578396320555ac
3
+ metadata.gz: 23d7496d9f0dfe8a4d7a8bd35718f1fd07b12a6ea135c8397a71c9acd0119f5f
4
+ data.tar.gz: e9f7413d247b53090fa21779cf74322482f6d9bc7754ac20c01ea522c28d4057
5
5
  SHA512:
6
- metadata.gz: c850788fc616fc813fbdd3659026cdfb057afa316c21bc61e4d32b0a79e03bf2b50d0a258cfad904ba6a2c1cb8dc02b53552c8a102dc2320bfd8dea41c83f614
7
- data.tar.gz: a822530efec002f1147d9313801dfb1aa657e1b269e924e70dfd6c5ce01dacab147a4472044b6043fa78df7a6274ea7313d60f5d9bd707ce84429291b5cda100
6
+ metadata.gz: cb18a1c15a107971a7c358176379e2a9699c7d008b3da55d9aa3cea760e282e4b4767b655bc4aa6c5326e4232bf536e5988f0fa4e901eaac4a29b02664133409
7
+ data.tar.gz: 31e947a06a83fbb496a496cac750e562b6d2a3bdcc3e010b5af07036ca5a4431559346847b491e43f417bfac44124434d4274dab1f44ced3c02a80deac6e3cee
@@ -73,7 +73,7 @@ module Teodoro
73
73
  data_aaaammdd: proc { _1.delete('-') if _1 },
74
74
  decimal: proc { _1.tr('.', ',') if _1 },
75
75
  mes_ano: proc { "#{_1[-2..]}/#{_1[0..3]}" if _1 },
76
- vazio: proc { nil }
76
+ vazio: proc {}
77
77
  }.freeze
78
78
 
79
79
  private
@@ -395,7 +395,24 @@ module Teodoro
395
395
  end
396
396
 
397
397
  def opcao_pelo_fgts
398
- @opcao_pelo_fgts ||= evento['vinculo/infoRegimeTrab/infoCeletista/FGTS'] ? 1 : 2
398
+ @opcao_pelo_fgts ||= optante_pelo_fgts? ? 1 : 2
399
+ end
400
+
401
+ def optante_pelo_fgts?
402
+ data_de_admissao >= (empregado_domestico? ? '2015-10-01' : '1988-10-05') ||
403
+ evento['vinculo/infoRegimeTrab/infoCeletista/FGTS']
404
+ end
405
+
406
+ def data_de_admissao
407
+ evento['vinculo/infoRegimeTrab/infoCeletista/dtAdm']
408
+ end
409
+
410
+ def empregado_domestico?
411
+ categoria_do_trabalhador == '104'
412
+ end
413
+
414
+ def categoria_do_trabalhador
415
+ evento['vinculo/infoContrato/codCateg']
399
416
  end
400
417
 
401
418
  def data_de_opcao_pelo_fgts
@@ -27,6 +27,7 @@ module Teodoro
27
27
  trabalhador: trabalhador,
28
28
  categoria_do_trabalhador: evento['infoTSVInicio/codCateg'],
29
29
  data_de_inicio: evento['infoTSVInicio/dtInicio'],
30
+ matricula: evento['infoTSVInicio/matricula'],
30
31
  recibo: numero_do_recibo
31
32
  )
32
33
  end
@@ -222,6 +223,7 @@ module Teodoro
222
223
  ['EventoAdmissao_InformacoesInicio_InformacoesComplementares_InfoEstagiario_NrApoliceSeguro', evento['infoTSVInicio/infoComplementares/infoEstagiario/nrApol']],
223
224
  ['EventoAdmissao_InformacoesInicio_InformacoesComplementares_InfoEstagiario_ValorBolsa', evento['infoTSVInicio/infoComplementares/infoEstagiario/vlrBolsa'], :decimal],
224
225
  ['EventoAdmissao_InformacoesInicio_CodigoCategoria', inicio_de_contrato.categoria_do_trabalhador],
226
+ ['EventoAdmissao_InformacoesInicio_Matricula', inicio_de_contrato.matricula],
225
227
  ['DescricaoProcEmi', processo_de_emissao_do_evento],
226
228
  ['IdEventoXml', id_do_evento],
227
229
  ['EventoAdmissao_InfoTrabalhador_InfoEndereco_EnderecoResidencialBR_Bairro', trabalhador.endereco.bairro],
@@ -0,0 +1,3 @@
1
+ module Teodoro
2
+ VERSION = '0.42.1'.freeze
3
+ end
data/lib/teodoro.rb CHANGED
@@ -7,13 +7,12 @@ require 'rainbow'
7
7
  require 'securerandom'
8
8
  require 'zip'
9
9
 
10
+ require_relative 'teodoro/version'
10
11
  require_relative 'teodoro/console'
11
12
  require_relative 'teodoro/empresa'
12
13
  require_relative 'teodoro/obj'
13
14
 
14
15
  module Teodoro
15
- VERSION = '0.40.3'.freeze
16
-
17
16
  CBOs = __FILE__
18
17
  .then { File.dirname(_1) }
19
18
  .then { File.join(_1, 'CBOs.json') }
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.40.3
4
+ version: 0.42.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clavius Tales
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-14 00:00:00.000000000 Z
11
+ date: 2021-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -228,6 +228,7 @@ files:
228
228
  - lib/teodoro/leiaute/arquivo_s3000.rb
229
229
  - lib/teodoro/leiaute_simplificado.rb
230
230
  - lib/teodoro/obj.rb
231
+ - lib/teodoro/version.rb
231
232
  - lib/teodoro/xml.rb
232
233
  - lib/tipos_de_logradouro.json
233
234
  homepage: