sticutils 2.0.9 → 2.1.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: 8be9ac9aa7ba01d00242931097d34028f6446e3165517941483abbb7d37cbd5e
4
- data.tar.gz: b8f3f059619f04a608e5bf4d3830dccdb5ca3d83defcc2e2fd5ac535195176e1
3
+ metadata.gz: 7d11917684a5fcdc8f98d0724c97a16aa4c33b690764b4f15205313a297b0599
4
+ data.tar.gz: c3dcd5e1bece67ce2e56023d56ce1e585aa922cf67645032e48ce22a69d62159
5
5
  SHA512:
6
- metadata.gz: 06a237a2baed7aebcee540460221012b8c46eabe0775c24179e1b7028fcdec05302c79523f67d93604fed879105b03f7ecd6b25c055cb7c80d50808dcf751f55
7
- data.tar.gz: 4d6e962c6544e6e8a0b5189f469e68497bcfce86d7741685747211dbf4ebc8b13f07e0391d7cfaaedd89c819bddd8e00eec80e0a8892f3a84f515e11ccd5d816
6
+ metadata.gz: da5e07e75d266cbb2172985c16f0c442c83fb7820ae59e08280716864ca7a4bdd8161b2337cdf923ac14935a8e5490e005474d321576d173e77efb054d72c9c7
7
+ data.tar.gz: b3c17c4e504ba78e2d916308c181ab5c64dd36f51f67d04a245731662d1de3ada3112ded097fc3ffff07685674c955cad40443f05f92ccea1f78e2576473869a
@@ -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,3 +1,3 @@
1
1
  module Sticutils
2
- VERSION = "2.0.9"
2
+ VERSION = "2.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-05 00:00:00.000000000 Z
11
+ date: 2024-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
275
275
  - !ruby/object:Gem::Version
276
276
  version: '0'
277
277
  requirements: []
278
- rubygems_version: 3.5.5
278
+ rubygems_version: 3.5.14
279
279
  signing_key:
280
280
  specification_version: 4
281
281
  summary: Utilidades para aplicações rails da STIC