sticutils 2.1.0 → 2.1.2

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: 7d11917684a5fcdc8f98d0724c97a16aa4c33b690764b4f15205313a297b0599
4
- data.tar.gz: c3dcd5e1bece67ce2e56023d56ce1e585aa922cf67645032e48ce22a69d62159
3
+ metadata.gz: 23f6b3b69b60d4f154d3c6ec1dec5f5239b0eda384d4b51a1f4689f04a2581ef
4
+ data.tar.gz: 730663c9f7643fc6fee19bd63e3ce526bf6222bc09564325a2f8fec40736a3d4
5
5
  SHA512:
6
- metadata.gz: da5e07e75d266cbb2172985c16f0c442c83fb7820ae59e08280716864ca7a4bdd8161b2337cdf923ac14935a8e5490e005474d321576d173e77efb054d72c9c7
7
- data.tar.gz: b3c17c4e504ba78e2d916308c181ab5c64dd36f51f67d04a245731662d1de3ada3112ded097fc3ffff07685674c955cad40443f05f92ccea1f78e2576473869a
6
+ metadata.gz: c36aa41471a6da09f5204b34377c07fb2bb150c5173c9a983ed61bf0ad7940d32436cd1a45b9284d9c495360547604ee96febfe9a1e5cf923bee1c7bf0bfea00
7
+ data.tar.gz: 9604df92c4ef449eeb9603c842e1e58576072e15710056f7be7d5a21c95220e668db6b6cb78052ca8b049416e3aeadc8b0c223ae3e10ecacadac747d96e98d0f
@@ -0,0 +1,4 @@
1
+ class Gestorh::Dependente < Gestorh::GestorhRecord
2
+ self.table_name = "gestor_rh.cddependentefolha"
3
+ belongs_to :funcionario, foreign_key: :dpf_matriculatitular, primary_key: :fn_matricula
4
+ end
@@ -1,16 +1,18 @@
1
1
  class Gestorh::FolhaAgrupadaIdSeparado < Gestorh::GestorhRecord
2
- self.table_name = 'public.folhas_agrupadas_gestorh_folha_id_separado'
2
+ self.table_name = "public.folhas_agrupadas_gestorh_folha_id_separado"
3
3
 
4
4
  belongs_to :funcionario, foreign_key: :matricula, primary_key: :fn_matricula
5
5
 
6
6
  belongs_to :vinculo, foreign_key: :mvps_vinculo, primary_key: :vc_codigo
7
7
  belongs_to :funcao, foreign_key: :mvps_funcao, primary_key: :fc_codigo
8
- belongs_to :cargo, foreign_key: :mvps_cargo, primary_key: :fc_codigo, class_name: 'Gestorh::Funcao'
8
+ belongs_to :cargo, foreign_key: :mvps_cargo, primary_key: :fc_codigo, class_name: "Gestorh::Funcao"
9
9
  belongs_to :lotacao, foreign_key: :mvps_reglotacao, primary_key: :lt_registro
10
10
  belongs_to :nivel_salario, foreign_key: :mvps_nivelsalario, primary_key: :ns_registro
11
11
 
12
+ has_many :dependentes, query_constraints: [:dpf_matriculatitular, :dpf_regfolha], primary_key: [:matricula, :folhas]
13
+
12
14
  def liquido_total
13
- self.rendimento_total - self.desconto_total
15
+ rendimento_total - desconto_total
14
16
  end
15
17
 
16
18
  def eventos_e_valores
@@ -26,66 +28,70 @@ class Gestorh::FolhaAgrupadaIdSeparado < Gestorh::GestorhRecord
26
28
  "cdclassificacaoverba.cv_classificacao as tipo",
27
29
  "mv_base as mv_base",
28
30
  "mv_competencia as competencia_inicio",
29
- "mv_competencia_final as competencia_fim")
31
+ "mv_competencia_final as competencia_fim,
32
+ mv_mesinicio as mes_inicio,
33
+ mv_mesfinal as mes_fim")
30
34
  .to_a
31
35
  .uniq { |x| [x.codigo_evento, x.status, x.valor] } # uniq temporario para remover verbas com 2 classificacoes
32
36
  end
33
37
 
34
38
  def remuneracao_paradigma
35
- if Date.new(ano, mes, 1) < Date.new(2013,7,1)
36
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_REMUNERACAO' && x.status == 'C'}
39
+ if Date.new(ano, mes, 1) < Date.new(2013, 7, 1)
40
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_REMUNERACAO" && x.status == "C" }
37
41
  else
38
42
  []
39
43
  end
40
44
  end
41
45
 
42
46
  def vantagens_pessoais
43
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_VANTAGENS_PESSOAIS' && x.status == 'C'}
47
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_VANTAGENS_PESSOAIS" && x.status == "C" }
44
48
  end
45
49
 
46
50
  def subsidios
47
- if Date.new(ano, mes, 1) < Date.new(2013,7,1)
51
+ if Date.new(ano, mes, 1) < Date.new(2013, 7, 1)
48
52
  []
49
53
  else
50
- self.eventos_e_valores.select{|x| (x.tipo == 'RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO' || x.tipo == 'RENDIMENTO_REMUNERACAO') && x.status == 'C'}
54
+ eventos_e_valores.select { |x| (x.tipo == "RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO" || x.tipo == "RENDIMENTO_REMUNERACAO") && x.status == "C" }
51
55
  end
52
56
  end
53
57
 
54
58
  def indenizacoes
55
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_INDENIZACOES' && x.status == 'C' }
59
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_INDENIZACOES" && x.status == "C" }
56
60
  end
57
61
 
58
62
  def vantagens_eventuais
59
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_VANTAGENS_EVENTUAIS' && x.status == 'C'}
63
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_VANTAGENS_EVENTUAIS" && x.status == "C" }
60
64
  end
61
65
 
62
66
  def gratificacoes
63
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_GRATIFICACOES' && x.status == 'C'}
67
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_GRATIFICACOES" && x.status == "C" }
64
68
  end
65
69
 
66
70
  # sobrou da show
67
71
  def subsidio_vantagens_pessoais
68
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_VANTAGENS_EVENTUAIS' || x.tipo == 'RENDIMENTO_VANTAGENS_PESSOAIS'}
72
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_VANTAGENS_EVENTUAIS" || x.tipo == "RENDIMENTO_VANTAGENS_PESSOAIS" }
69
73
  end
70
74
 
71
75
  def subsidio_vantagens_pessoais_eventuais
72
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO' ||
73
- x.tipo == 'RENDIMENTO_VANTAGENS_PESSOAIS' || (x.tipo == 'RENDIMENTO_VANTAGENS_EVENTUAIS' && x.status == 'C')}
76
+ eventos_e_valores.select { |x|
77
+ x.tipo == "RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO" ||
78
+ x.tipo == "RENDIMENTO_VANTAGENS_PESSOAIS" || (x.tipo == "RENDIMENTO_VANTAGENS_EVENTUAIS" && x.status == "C")
79
+ }
74
80
  end
75
81
 
76
82
  # diarias
77
83
  def diarias
78
- self.daily_rates.where(date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
84
+ daily_rates.where(date: [Date.new(ano, mes)..Date.new(ano, mes).at_end_of_month])
79
85
  .sum(:pago)
80
86
  end
81
87
 
82
88
  def diarias_positivas
83
- self.daily_rates.where(pago: [0..Float::INFINITY], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
84
- .sum(:pago)
89
+ daily_rates.where(pago: [0..Float::INFINITY], date: [Date.new(ano, mes)..Date.new(ano, mes).at_end_of_month])
90
+ .sum(:pago)
85
91
  end
86
92
 
87
93
  def diarias_negativas
88
- self.daily_rates.where(pago: [-Float::INFINITY..0], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
89
- .sum(:pago)
94
+ daily_rates.where(pago: [-Float::INFINITY..0], date: [Date.new(ano, mes)..Date.new(ano, mes).at_end_of_month])
95
+ .sum(:pago)
90
96
  end
91
97
  end
@@ -1,3 +1,3 @@
1
1
  module Sticutils
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sticutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-07-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -68,6 +67,7 @@ files:
68
67
  - app/models/gestorh.rb
69
68
  - app/models/gestorh/banco.rb
70
69
  - app/models/gestorh/classificacao_verba.rb
70
+ - app/models/gestorh/dependente.rb
71
71
  - app/models/gestorh/ferias.rb
72
72
  - app/models/gestorh/folha.rb
73
73
  - app/models/gestorh/folha_agrupada.rb
@@ -260,7 +260,6 @@ homepage: http://gitlab.tjpi.jus.br/
260
260
  licenses:
261
261
  - MIT
262
262
  metadata: {}
263
- post_install_message:
264
263
  rdoc_options: []
265
264
  require_paths:
266
265
  - lib
@@ -275,8 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
275
274
  - !ruby/object:Gem::Version
276
275
  version: '0'
277
276
  requirements: []
278
- rubygems_version: 3.5.14
279
- signing_key:
277
+ rubygems_version: 3.6.7
280
278
  specification_version: 4
281
279
  summary: Utilidades para aplicações rails da STIC
282
280
  test_files: []