sticutils 2.0.9 → 2.1.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: 8be9ac9aa7ba01d00242931097d34028f6446e3165517941483abbb7d37cbd5e
4
- data.tar.gz: b8f3f059619f04a608e5bf4d3830dccdb5ca3d83defcc2e2fd5ac535195176e1
3
+ metadata.gz: 81652f5712e52d72d71776d3442576f0e84af8f7aaf957f852e9bcb57315aff6
4
+ data.tar.gz: e72320b98d8f435903428baa9257578ab4e9b575d9ed9bc145a2f3330cf8c71a
5
5
  SHA512:
6
- metadata.gz: 06a237a2baed7aebcee540460221012b8c46eabe0775c24179e1b7028fcdec05302c79523f67d93604fed879105b03f7ecd6b25c055cb7c80d50808dcf751f55
7
- data.tar.gz: 4d6e962c6544e6e8a0b5189f469e68497bcfce86d7741685747211dbf4ebc8b13f07e0391d7cfaaedd89c819bddd8e00eec80e0a8892f3a84f515e11ccd5d816
6
+ metadata.gz: fc06929876557da7694c05c7444c7f63a463185949a6f0e5a238290180bbf14423bdcc8e5cc4612fd695655dee4bad973d21ebb21cc39f6899261e76ec10ce01
7
+ data.tar.gz: 49e1af6d082cfb2557509b5199b8880fae8e84e25ff9bff1e6654bce76976298864f359e849b759c842149859221e3b5386d4ee988d0b2fbd0f1e9846ca7158e
@@ -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,100 +1,110 @@
1
1
  class Gestorh::FolhaAgrupada < Gestorh::GestorhRecord
2
- self.table_name = 'public.folhas_agrupadas_gestorh'
2
+ self.table_name = "public.folhas_agrupadas_gestorh"
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
  belongs_to :local_trabalho, foreign_key: :mvps_localtrab, primary_key: :lctb_codigo
12
12
 
13
13
  def liquido_total
14
- self.rendimento_total - self.desconto_total
14
+ rendimento_total - desconto_total
15
15
  end
16
16
 
17
17
  def eventos_e_valores
18
18
  # .where.not('cdclassificacaoverba.cv_classificacao': 'DESCONTO_PREVIDENCIA_PUBLICA_IAPEP')
19
- Gestorh::MovimentoAcumulado.where(mv_regfolha: self.folhas, mv_matricula: self.matricula)
19
+ Gestorh::MovimentoAcumulado.where(mv_regfolha: folhas, mv_matricula: matricula)
20
20
  .joins(verba: :classificacao_verba)
21
- .select('mv_regfolha as folha_id',
22
- 'mv_verba as codigo_evento',
23
- 'mv_referencia as fator',
24
- 'cdverba.vb_nome as nome_evento',
25
- 'mv_dc as status', 'mv_total as valor',
26
- 'cdclassificacaoverba.cv_classificacao as tipo')
21
+ .select("mv_regfolha as folha_id",
22
+ "mv_verba as codigo_evento",
23
+ "mv_referencia as fator",
24
+ "cdverba.vb_nome as nome_evento",
25
+ "mv_dc as status", "mv_total as valor",
26
+ "cdclassificacaoverba.cv_classificacao as tipo")
27
27
  .to_a
28
- .uniq{|x| [x.codigo_evento, x.status, x.valor] } # uniq temporario para remover verbas com 2 classificacoes
28
+ .uniq { |x| [x.codigo_evento, x.status, x.valor] } # uniq temporario para remover verbas com 2 classificacoes
29
29
  end
30
30
 
31
31
  def remuneracao_paradigma
32
- if Date.new(ano, mes, 1) < Date.new(2013,7,1)
33
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_REMUNERACAO' && x.status == 'C'}
32
+ if Date.new(ano, mes, 1) < Date.new(2013, 7, 1)
33
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_REMUNERACAO" && x.status == "C" }
34
34
  else
35
35
  []
36
36
  end
37
37
  end
38
38
 
39
39
  def vantagens_pessoais
40
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_VANTAGENS_PESSOAIS' && x.status == 'C'}
40
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_VANTAGENS_PESSOAIS" && x.status == "C" }
41
41
  end
42
42
 
43
43
  def subsidios
44
- if Date.new(ano, mes, 1) < Date.new(2013,7,1)
44
+ if Date.new(ano, mes, 1) < Date.new(2013, 7, 1)
45
45
  []
46
46
  else
47
- self.eventos_e_valores.select{|x| (x.tipo == 'RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO' || x.tipo == 'RENDIMENTO_REMUNERACAO') && x.status == 'C'}
47
+ eventos_e_valores.select { |x| (x.tipo == "RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO" || x.tipo == "RENDIMENTO_REMUNERACAO") && x.status == "C" }
48
48
  end
49
49
  end
50
50
 
51
51
  def indenizacoes
52
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_INDENIZACOES' && x.status == 'C' }
52
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_INDENIZACOES" && x.status == "C" }
53
53
  end
54
54
 
55
55
  def vantagens_eventuais
56
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_VANTAGENS_EVENTUAIS' && x.status == 'C'}
56
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_VANTAGENS_EVENTUAIS" && x.status == "C" }
57
57
  end
58
58
 
59
59
  def gratificacoes
60
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_GRATIFICACOES' && x.status == 'C'}
60
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_GRATIFICACOES" && x.status == "C" }
61
61
  end
62
62
 
63
63
  # sobrou da show
64
64
  def subsidio_vantagens_pessoais
65
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_VANTAGENS_EVENTUAIS' || x.tipo == 'RENDIMENTO_VANTAGENS_PESSOAIS'}
65
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_VANTAGENS_EVENTUAIS" || x.tipo == "RENDIMENTO_VANTAGENS_PESSOAIS" }
66
66
  end
67
67
 
68
68
  def subsidio_vantagens_pessoais_eventuais
69
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO' ||
70
- x.tipo == 'RENDIMENTO_VANTAGENS_PESSOAIS' || (x.tipo == 'RENDIMENTO_VANTAGENS_EVENTUAIS' && x.status == 'C')}
69
+ eventos_e_valores.select { |x|
70
+ x.tipo == "RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO" ||
71
+ x.tipo == "RENDIMENTO_VANTAGENS_PESSOAIS" || (x.tipo == "RENDIMENTO_VANTAGENS_EVENTUAIS" && x.status == "C")
72
+ }
71
73
  end
72
74
 
73
75
  def subsidio_com_gratificacao
74
- self.subsidios.pluck(:valor).sum
76
+ subsidios.pluck(:valor).sum
75
77
  end
76
78
 
77
79
  # diarias
78
80
  def diarias
79
- if Object.const_defined?('DailyRate')
80
- DailyRate.where(cpf: [cpf, numeric_cpf], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
81
+ if Object.const_defined?(:DailyRate)
82
+ DailyRate.where(cpf: [cpf, numeric_cpf], date: [Date.new(ano, mes)..Date.new(ano, mes).at_end_of_month])
81
83
  .sum(:pago)
82
84
  end
83
85
  end
84
-
86
+
85
87
  def diarias_positivas
86
- if Object.const_defined?('DailyRate')
87
- DailyRate.where(cpf: [cpf, numeric_cpf],
88
- pago: [0..Float::INFINITY], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
88
+ if Object.const_defined?(:DailyRate)
89
+ DailyRate.where(cpf: [cpf, numeric_cpf],
90
+ pago: [0..Float::INFINITY], date: [Date.new(ano, mes)..Date.new(ano, mes).at_end_of_month])
89
91
  .sum(:pago)
90
92
  end
91
93
  end
92
-
94
+
93
95
  def diarias_negativas
94
- if Object.const_defined?('DailyRate')
96
+ if Object.const_defined?(:DailyRate)
95
97
  DailyRate.where(cpf: [cpf, numeric_cpf],
96
- pago: [-Float::INFINITY..0], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
98
+ pago: [-Float::INFINITY..0], date: [Date.new(ano, mes)..Date.new(ano, mes).at_end_of_month])
97
99
  .sum(:pago)
98
100
  end
99
101
  end
102
+
103
+ def self.ransackable_attributes(auth_object = nil)
104
+ ["ano", "cpf", "desconto_diversos", "desconto_imposto_renda", "desconto_previdencia_publica", "desconto_retencao_teto_constitucional",
105
+ "desconto_total", "folhas", "matricula", "mes", "mvps_banco", "mvps_cargo", "mvps_funcao", "mvps_grauinstrucao", "mvps_inativo",
106
+ "mvps_localtrab", "mvps_lotacao", "mvps_nivelsalario", "mvps_reglotacao", "mvps_vinculo", "nome", "numeric_cpf", "remuneracao_orgao_origem",
107
+ "rendimento_gratificacoes", "rendimento_indenizacoes", "rendimento_remuneracao", "rendimento_subsidio_diferenca_funcao", "rendimento_total",
108
+ "rendimento_vantagens_eventuais", "rendimento_vantagens_pessoais"]
109
+ end
100
110
  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
@@ -32,60 +34,62 @@ class Gestorh::FolhaAgrupadaIdSeparado < Gestorh::GestorhRecord
32
34
  end
33
35
 
34
36
  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'}
37
+ if Date.new(ano, mes, 1) < Date.new(2013, 7, 1)
38
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_REMUNERACAO" && x.status == "C" }
37
39
  else
38
40
  []
39
41
  end
40
42
  end
41
43
 
42
44
  def vantagens_pessoais
43
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_VANTAGENS_PESSOAIS' && x.status == 'C'}
45
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_VANTAGENS_PESSOAIS" && x.status == "C" }
44
46
  end
45
47
 
46
48
  def subsidios
47
- if Date.new(ano, mes, 1) < Date.new(2013,7,1)
49
+ if Date.new(ano, mes, 1) < Date.new(2013, 7, 1)
48
50
  []
49
51
  else
50
- self.eventos_e_valores.select{|x| (x.tipo == 'RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO' || x.tipo == 'RENDIMENTO_REMUNERACAO') && x.status == 'C'}
52
+ eventos_e_valores.select { |x| (x.tipo == "RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO" || x.tipo == "RENDIMENTO_REMUNERACAO") && x.status == "C" }
51
53
  end
52
54
  end
53
55
 
54
56
  def indenizacoes
55
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_INDENIZACOES' && x.status == 'C' }
57
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_INDENIZACOES" && x.status == "C" }
56
58
  end
57
59
 
58
60
  def vantagens_eventuais
59
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_VANTAGENS_EVENTUAIS' && x.status == 'C'}
61
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_VANTAGENS_EVENTUAIS" && x.status == "C" }
60
62
  end
61
63
 
62
64
  def gratificacoes
63
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_GRATIFICACOES' && x.status == 'C'}
65
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_GRATIFICACOES" && x.status == "C" }
64
66
  end
65
67
 
66
68
  # sobrou da show
67
69
  def subsidio_vantagens_pessoais
68
- self.eventos_e_valores.select{|x| x.tipo == 'RENDIMENTO_VANTAGENS_EVENTUAIS' || x.tipo == 'RENDIMENTO_VANTAGENS_PESSOAIS'}
70
+ eventos_e_valores.select { |x| x.tipo == "RENDIMENTO_VANTAGENS_EVENTUAIS" || x.tipo == "RENDIMENTO_VANTAGENS_PESSOAIS" }
69
71
  end
70
72
 
71
73
  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')}
74
+ eventos_e_valores.select { |x|
75
+ x.tipo == "RENDIMENTO_SUBSIDIO_DIFERENCA_FUNCAO" ||
76
+ x.tipo == "RENDIMENTO_VANTAGENS_PESSOAIS" || (x.tipo == "RENDIMENTO_VANTAGENS_EVENTUAIS" && x.status == "C")
77
+ }
74
78
  end
75
79
 
76
80
  # diarias
77
81
  def diarias
78
- self.daily_rates.where(date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
82
+ daily_rates.where(date: [Date.new(ano, mes)..Date.new(ano, mes).at_end_of_month])
79
83
  .sum(:pago)
80
84
  end
81
85
 
82
86
  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)
87
+ daily_rates.where(pago: [0..Float::INFINITY], date: [Date.new(ano, mes)..Date.new(ano, mes).at_end_of_month])
88
+ .sum(:pago)
85
89
  end
86
90
 
87
91
  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)
92
+ daily_rates.where(pago: [-Float::INFINITY..0], date: [Date.new(ano, mes)..Date.new(ano, mes).at_end_of_month])
93
+ .sum(:pago)
90
94
  end
91
95
  end
@@ -1,3 +1,3 @@
1
1
  module Sticutils
2
- VERSION = "2.0.9"
2
+ VERSION = "2.1.1"
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.0.9
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-03-05 00:00:00.000000000 Z
10
+ date: 2025-04-15 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.5
279
- signing_key:
277
+ rubygems_version: 3.6.5
280
278
  specification_version: 4
281
279
  summary: Utilidades para aplicações rails da STIC
282
280
  test_files: []