sticutils 0.3.1 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9685a388dbf49b4183b5e8498f66c88637c93265c8f5e2dd4d64d1b529a2d22b
4
- data.tar.gz: 410f2e22828e4169e986951bcb053119f709bb95e481fcf1ea13c983340bf78b
3
+ metadata.gz: d1c5769d5b66eb3ea6b6e6d9c611f30206297761a592bad78540831db2ea19f3
4
+ data.tar.gz: 330c9ccb0109dfa93bba6cb9c86c4a64f72a1c45732b909d9e97e701f8ef9d44
5
5
  SHA512:
6
- metadata.gz: cbf2d7be030c980e7d8eee96f73754c0fb8077d2be75a45aafcb752736cd206efc7bfc68dfd3f70a2c35ce27d41510842446a2d99db7c7a050eafaeabcd3bd9a
7
- data.tar.gz: f4838559e41529c83383a8a4b2c8f1fb0fb9857f58438c2fe62a75f49d84ac0a4e4cc7c0f567291741504df0b5a1c28842a4ecb92cba730145bb8508651615d2
6
+ metadata.gz: bac3486aff85bac718b6327af3047106b54587656d76517ee2159592c64d2eb486b1ed59bec4e8f2100a22ee49eeb55d04c04ef75390e772cee7551df2ab7670
7
+ data.tar.gz: f2a1058cff6d7c6318864b4f2b165f524801c91934cfc34f2b383a28aeb0ee188beb10972cf8534d26c9f6fc094558f0380631adc77a177d28c845590ba8d5f1
@@ -0,0 +1,5 @@
1
+ class Gestorh::ClassificacaoVerba < Gestorh::GestorhRecord
2
+ self.table_name = 'gestor_rh.cdclassificacaoverba'
3
+
4
+ belongs_to :verba, foreign_key: :cv_verba, primary_key: :vb_codigo
5
+ end
@@ -0,0 +1,4 @@
1
+ class Gestorh::Ferias < Gestorh::GestorhRecord
2
+ self.table_name = 'gestor_rh.cdferias'
3
+ belongs_to :funcionario, foreign_key: :fe_matricula, primary_key: :fn_matricula
4
+ end
@@ -8,19 +8,22 @@ class Gestorh::FolhaAgrupada < Gestorh::GestorhRecord
8
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
+ belongs_to :local_trabalho, foreign_key: :mvps_localtrab, primary_key: :lctb_codigo
11
12
 
12
13
  def liquido_total
13
14
  self.rendimento_total - self.desconto_total
14
15
  end
15
16
 
16
17
  def eventos_e_valores
18
+ # .where.not('cdclassificacaoverba.cv_classificacao': 'DESCONTO_PREVIDENCIA_PUBLICA_IAPEP')
17
19
  Gestorh::MovimentoAcumulado.where(mv_regfolha: self.folhas, mv_matricula: self.matricula)
18
- .joins(:evento_folha_pagamento)
19
- .where.not('evento_folha_pagamentos.tipo': 'DESCONTO_PREVIDENCIA_PUBLICA_IAPEP')
20
+ .joins(verba: :classificacao_verba)
20
21
  .select('mv_regfolha as folha_id', 'mv_verba as codigo_evento',
21
- 'evento_folha_pagamentos.descricao as nome_evento',
22
- 'mv_dc as status', 'mv_total as valor', 'evento_folha_pagamentos.tipo')
22
+ 'cdverba.vb_nome as nome_evento',
23
+ 'mv_dc as status', 'mv_total as valor',
24
+ 'cdclassificacaoverba.cv_classificacao as tipo')
23
25
  .to_a
26
+ .uniq{|x| [x.codigo_evento, x.status, x.valor] } # uniq temporario para remover verbas com 2 classificacoes
24
27
  end
25
28
 
26
29
  def remuneracao_paradigma
@@ -76,14 +79,20 @@ class Gestorh::FolhaAgrupada < Gestorh::GestorhRecord
76
79
  .sum(:pago)
77
80
  end
78
81
  end
79
-
82
+
80
83
  def diarias_positivas
81
- 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
+ if Object.const_defined?('DailyRate')
85
+ DailyRate.where(cpf: numeric_cpf,
86
+ pago: [0..Float::INFINITY], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
82
87
  .sum(:pago)
88
+ end
83
89
  end
84
-
90
+
85
91
  def diarias_negativas
86
- 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])
92
+ if Object.const_defined?('DailyRate')
93
+ DailyRate.where(cpf: numeric_cpf,
94
+ pago: [-Float::INFINITY..0], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
87
95
  .sum(:pago)
96
+ end
88
97
  end
89
98
  end
@@ -14,13 +14,15 @@ class Gestorh::FolhaAgrupadaIdSeparado < Gestorh::GestorhRecord
14
14
  end
15
15
 
16
16
  def eventos_e_valores
17
+ # .where.not('cdclassificacaoverba.cv_classificacao': 'DESCONTO_PREVIDENCIA_PUBLICA_IAPEP')
17
18
  Gestorh::MovimentoAcumulado.where(mv_regfolha: self.folhas, mv_matricula: self.matricula)
18
- .joins(:evento_folha_pagamento)
19
- .where.not('evento_folha_pagamentos.tipo': 'DESCONTO_PREVIDENCIA_PUBLICA_IAPEP')
19
+ .joins(verba: :classificacao_verba)
20
20
  .select('mv_regfolha as folha_id', 'mv_verba as codigo_evento',
21
- 'evento_folha_pagamentos.descricao as nome_evento',
22
- 'mv_dc as status', 'mv_total as valor', 'evento_folha_pagamentos.tipo')
21
+ 'cdverba.vb_nome as nome_evento',
22
+ 'mv_dc as status', 'mv_total as valor',
23
+ 'cdclassificacaoverba.cv_classificacao as tipo')
23
24
  .to_a
25
+ .uniq{|x| [x.codigo_evento, x.status, x.valor] } # uniq temporario para remover verbas com 2 classificacoes
24
26
  end
25
27
 
26
28
  def remuneracao_paradigma
@@ -3,4 +3,6 @@ class Gestorh::Funcionario < Gestorh::GestorhRecord
3
3
 
4
4
  has_many :movimento_acumulados, foreign_key: :mv_matricula, primary_key: :fn_matricula
5
5
  has_many :folhas, through: :movimento_acumulados
6
+ has_many :ferias, foreign_key: :fe_matricula, primary_key: :fn_matricula, class_name: 'Gestorh::Ferias'
7
+ belongs_to :vinculo, foreign_key: :fn_vinculo
6
8
  end
@@ -0,0 +1,3 @@
1
+ class Gestorh::LocalTrabalho < Gestorh::GestorhRecord
2
+ self.table_name = 'gestor_rh.cdlocaistrabalho'
3
+ end
@@ -4,6 +4,4 @@ class Gestorh::MovimentoAcumulado < Gestorh::GestorhRecord
4
4
  belongs_to :verba, foreign_key: :mv_verba, primary_key: :vb_codigo
5
5
  belongs_to :funcionario, foreign_key: :mv_matricula, primary_key: :fn_matricula
6
6
  belongs_to :folha, foreign_key: :mv_regfolha, primary_key: :fp_registro
7
-
8
- belongs_to :evento_folha_pagamento, foreign_key: :mv_verba, primary_key: :codigo, class_name: 'Transparencia::EventoFolhaPagamento'
9
7
  end
@@ -1,3 +1,5 @@
1
1
  class Gestorh::Verba < Gestorh::GestorhRecord
2
2
  self.table_name = 'gestor_rh.cdverba'
3
+
4
+ has_one :classificacao_verba, foreign_key: :cv_verba, primary_key: :vb_codigo
3
5
  end
@@ -1,3 +1,5 @@
1
1
  class Gestorh::Vinculo < Gestorh::GestorhRecord
2
2
  self.table_name = 'gestor_rh.cdvinculo'
3
+
4
+ has_many :funcionarios, foreign_key: :fn_vinculo
3
5
  end
@@ -33,7 +33,7 @@ class Intranet::TjpiVinculo < Intranet::IntranetRecord
33
33
  belongs_to :procurador, class_name: 'GlobalPrepessoafisica', foreign_key: :procurador_id
34
34
  belongs_to :conta_bancaria, class_name: 'GlobalContabancaria', foreign_key: :contaBancaria_id
35
35
 
36
- has_many :tjpi_previnculados, class_name: 'TjpiPrevinculado'
36
+ has_many :tjpi_previnculados, class_name: 'TjpiPrevinculado', foreign_key: :vinculoPrincipal_id
37
37
  belongs_to :tjpi_previnculado, class_name: 'TjpiPrevinculado', foreign_key: :cadastro_id
38
38
 
39
39
  has_many :tjpi_contrachequeagrupados, class_name: "TjpiContrachequeagrupado", foreign_key: :matricula, primary_key: :matricula
@@ -1,3 +1,3 @@
1
1
  module Sticutils
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.8"
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: 0.3.1
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-16 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -67,6 +67,8 @@ files:
67
67
  - Rakefile
68
68
  - app/models/gestorh.rb
69
69
  - app/models/gestorh/banco.rb
70
+ - app/models/gestorh/classificacao_verba.rb
71
+ - app/models/gestorh/ferias.rb
70
72
  - app/models/gestorh/folha.rb
71
73
  - app/models/gestorh/folha_agrupada.rb
72
74
  - app/models/gestorh/folha_agrupada_id_separado.rb
@@ -74,6 +76,7 @@ files:
74
76
  - app/models/gestorh/funcao.rb
75
77
  - app/models/gestorh/funcionario.rb
76
78
  - app/models/gestorh/gestorh_record.rb
79
+ - app/models/gestorh/local_trabalho.rb
77
80
  - app/models/gestorh/lotacao.rb
78
81
  - app/models/gestorh/movimento.rb
79
82
  - app/models/gestorh/movimento_acumulado.rb
@@ -238,9 +241,6 @@ files:
238
241
  - app/models/intranet/tjpi_vinculadoemfolha.rb
239
242
  - app/models/intranet/tjpi_vinculo.rb
240
243
  - app/models/intranet/tjpi_vinculo_documento.rb
241
- - app/models/transparencia.rb
242
- - app/models/transparencia/evento_folha_pagamento.rb
243
- - app/models/transparencia/transparencia_record.rb
244
244
  - bin/console
245
245
  - bin/setup
246
246
  - lib/sticutils.rb
@@ -1,2 +0,0 @@
1
- module Transparencia
2
- end
@@ -1,3 +0,0 @@
1
- class Transparencia::EventoFolhaPagamento < Transparencia::TransparenciaRecord
2
- has_many :folha_pagamento_detalhadas
3
- end
@@ -1,4 +0,0 @@
1
- class Transparencia::TransparenciaRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- self.establish_connection :transparencia
4
- end