sticutils 0.2.8 → 0.3.3

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: ff47f9a7fae10ea1abd3dff6a69aa7cc329469edddecab052eaccea3eb3958b4
4
- data.tar.gz: 9174de16f47095142f7d20d9de55a8f98f190525480d812921cbeb43b0fc54c0
3
+ metadata.gz: 72c6760fcdc8f0c42621dcc59fad94f2e5c8408bce8fd1c1f2785a67f015f38f
4
+ data.tar.gz: 47e9578003b9865a83902a4038cfe5bc4731e37c4dd8287489d30c71e2048b4e
5
5
  SHA512:
6
- metadata.gz: c9601e7c0a459ad28da42cccab34af0a8e1235a7e202c4daad9f07ceaae38c0d903c53fc93d756a645cd8b6abf0cbaa409a78ef5a67f8c6795f0d133b221d06f
7
- data.tar.gz: 7d3c90206eb93677f45d436ea21c669046fd98924fab49a58d9065b7f2050e25b3cdba67c54feb9d9d03d18a65e0434565943ce1170d8d142e84efcf410ce876
6
+ metadata.gz: fe418e24e6d36cfa698fa3569d4927256cf75145b02097c53a5da85134799e83d17540c213d6b3eb0608c0dc700390abd57208e472bc21c9a63fce6eab09ee2d
7
+ data.tar.gz: 4a6a8bca716f6108ebe1c9ae256b9107d86e1374612d406a422d2f6c602270f200e51548044af73c55dab9fa2d1192151a74a53722962d1505b9a1c51c07ba99
@@ -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
@@ -14,13 +14,15 @@ class Gestorh::FolhaAgrupada < 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
@@ -65,19 +67,31 @@ class Gestorh::FolhaAgrupada < Gestorh::GestorhRecord
65
67
  x.tipo == 'RENDIMENTO_VANTAGENS_PESSOAIS' || (x.tipo == 'RENDIMENTO_VANTAGENS_EVENTUAIS' && x.status == 'C')}
66
68
  end
67
69
 
70
+ def subsidio_com_gratificacao
71
+ self.subsidios.pluck(:valor).sum
72
+ end
73
+
68
74
  # diarias
69
75
  def diarias
70
- self.daily_rates.where(date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
71
- .sum(:pago)
76
+ if Object.const_defined?('DailyRate')
77
+ DailyRate.where(cpf: numeric_cpf, date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
78
+ .sum(:pago)
79
+ end
72
80
  end
73
-
81
+
74
82
  def diarias_positivas
75
- 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])
83
+ if Object.const_defined?('DailyRate')
84
+ DailyRate.where(cpf: numeric_cpf,
85
+ pago: [0..Float::INFINITY], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
76
86
  .sum(:pago)
87
+ end
77
88
  end
78
-
89
+
79
90
  def diarias_negativas
80
- 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])
91
+ if Object.const_defined?('DailyRate')
92
+ DailyRate.where(cpf: numeric_cpf,
93
+ pago: [-Float::INFINITY..0], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
81
94
  .sum(:pago)
95
+ end
82
96
  end
83
97
  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
@@ -1,4 +1,4 @@
1
1
  class Gestorh::GestorhRecord < ActiveRecord::Base
2
2
  self.abstract_class = true
3
- self.establish_connection(ENV['TRANSPARENCIA_DATABASE_URL'])
3
+ self.establish_connection :transparencia
4
4
  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,4 +1,4 @@
1
1
  class Intranet::IntranetRecord < ActiveRecord::Base
2
2
  self.abstract_class = true
3
- self.establish_connection(ENV['INTRANET_DATABASE_URL'])
3
+ self.establish_connection :intranet
4
4
  end
@@ -1,15 +1,14 @@
1
1
  class Intranet::LegislacaoDocumentocomprobatorio < Intranet::IntranetRecord
2
2
  self.table_name = 'legislacao_documentocomprobatorio'
3
3
 
4
- has_many :ferias_ferias, :class_name => 'FeriasFeria'
5
- has_many :ferias_fracaos, :class_name => 'FeriasFracao'
6
- belongs_to :legislacao_norma, :class_name => 'LegislacaoNorma', :foreign_key => :norma_id
7
- has_many :tjpi_cargo_embasamentos, :class_name => 'TjpiCargoEmbasamento'
8
- has_many :tjpi_carreiras, :class_name => 'TjpiCarreira'
9
- has_many :tjpi_declaracaoprevinculados, :class_name => 'TjpiDeclaracaoprevinculado'
10
- has_many :tjpi_declaracaoprevinculados, :class_name => 'TjpiDeclaracaoprevinculado'
11
- has_many :tjpi_exerciciofuncaos, :class_name => 'TjpiExerciciofuncao'
12
- has_many :tjpi_exerciciofuncaos, :class_name => 'TjpiExerciciofuncao'
13
- has_many :tjpi_funcao_embasamentos, :class_name => 'TjpiFuncaoEmbasamento'
14
- has_many :tjpi_vinculo_documentos, :class_name => 'TjpiVinculoDocumento', :foreign_key => :documentos_id
4
+ has_many :ferias_ferias, class_name: 'FeriasFeria', foreign_key: :documentoComprobatorio_id
5
+ has_many :ferias_fracaos, class_name: 'FeriasFracao', foreign_key: :DocumentoFerias_id
6
+ belongs_to :legislacao_norma, class_name: 'LegislacaoNorma', foreign_key: :norma_id
7
+ has_many :tjpi_cargo_embasamentos, class_name: 'TjpiCargoEmbasamento', foreign_key: :embasamento_id
8
+ has_many :tjpi_carreiras, class_name: 'TjpiCarreira', foreign_key: :documentoComprobatorio_id
9
+ has_many :tjpi_declaracaoprevinculados, class_name: 'TjpiDeclaracaoprevinculado', foreign_key: :comprovante_id
10
+ has_many :tjpi_exerciciofuncaos, class_name: 'TjpiExerciciofuncao', foreign_key: :documentoNomeacao_id
11
+ has_many :tjpi_exerciciofuncaos, class_name: 'TjpiExerciciofuncao', foreign_key: :documentoExoneracao_id
12
+ has_many :tjpi_funcao_embasamentos, class_name: 'TjpiFuncaoEmbasamento', foreign_key: :embasamento_id
13
+ has_many :tjpi_vinculo_documentos, class_name: 'TjpiVinculoDocumento', foreign_key: :documentos_id
15
14
  end
@@ -2,5 +2,4 @@ class Intranet::TjpiCampodeclaracaoprevinculado < Intranet::IntranetRecord
2
2
  self.table_name = 'tjpi_campodeclaracaoprevinculado'
3
3
 
4
4
  belongs_to :tjpi_declaracaoprevinculado, :class_name => 'TjpiDeclaracaoprevinculado', :foreign_key => :declaracao_id
5
- belongs_to :tjpi_declaracaoprevinculado, :class_name => 'TjpiDeclaracaoprevinculado', :foreign_key => :declaracao_id
6
5
  end
@@ -1,9 +1,7 @@
1
1
  class Intranet::TjpiDeclaracaoprevinculado < Intranet::IntranetRecord
2
2
  self.table_name = 'tjpi_declaracaoprevinculado'
3
3
 
4
- has_many :tjpi_campodeclaracaoprevinculados, :class_name => 'TjpiCampodeclaracaoprevinculado'
5
- has_many :tjpi_campodeclaracaoprevinculados, :class_name => 'TjpiCampodeclaracaoprevinculado'
6
- belongs_to :legislacao_documentocomprobatorio, :class_name => 'LegislacaoDocumentocomprobatorio', :foreign_key => :comprovante_id
7
- belongs_to :legislacao_documentocomprobatorio, :class_name => 'LegislacaoDocumentocomprobatorio', :foreign_key => :comprovante_id
8
- has_many :tjpi_previnculado_declaracoes, :class_name => 'TjpiPrevinculadoDeclaraco'
4
+ has_many :tjpi_campodeclaracaoprevinculados, :class_name => 'TjpiCampodeclaracaoprevinculado', foreign_key: :declaracao_id
5
+ belongs_to :legislacao_documentocomprobatorio, :class_name => 'LegislacaoDocumentocomprobatorio', foreign_key: :comprovante_id
6
+ has_many :tjpi_previnculado_declaracoes, :class_name => 'TjpiPrevinculadoDeclaracao', foreign_key: :declaracoes_id
9
7
  end
@@ -1,6 +1,6 @@
1
1
  class Intranet::TjpiFuncaoEmbasamento < Intranet::IntranetRecord
2
2
  self.table_name = 'tjpi_funcao_embasamento'
3
3
 
4
- belongs_to :legislacao_documentocomprobatorio, :class_name => 'LegislacaoDocumentocomprobatorio', :foreign_key => :embasamento_id
5
- belongs_to :tjpi_funcao, :class_name => 'TjpiFuncao', :foreign_key => :funcao_id
4
+ belongs_to :legislacao_documentocomprobatorio, :class_name => 'LegislacaoDocumentocomprobatorio', foreign_key: :embasamento_id
5
+ belongs_to :tjpi_funcao, :class_name => 'TjpiFuncao', foreign_key: :funcao_id
6
6
  end
@@ -12,7 +12,7 @@ class Intranet::TjpiPrevinculado < Intranet::IntranetRecord
12
12
  has_many :tjpi_vinculados, :class_name => 'TjpiVinculado'
13
13
  has_many :tjpi_vinculos, :class_name => 'TjpiVinculo'
14
14
 
15
- has_many :tjpi_previnculado_declaracoes, class_name: 'TjpiPrevinculadoDeclaraco', foreign_key: :preVinculado_id
15
+ has_many :tjpi_previnculado_declaracoes, class_name: 'TjpiPrevinculadoDeclaracao', foreign_key: :preVinculado_id
16
16
  belongs_to :tjpi_previnculadointervencao_ultima, class_name: 'TjpiPrevinculadointervencao', foreign_key: :intervencao_id
17
17
  belongs_to :tjpi_previnculadointervencao_anterior, class_name: 'TjpiPrevinculadointervencao', foreign_key: :anterior_id
18
18
  has_many :tjpi_previnculadointervencoes, class_name: 'TjpiPrevinculadointervencao', foreign_key: :preVinculado_id
@@ -1,4 +1,4 @@
1
- class Intranet::TjpiPrevinculadoDeclaraco < Intranet::IntranetRecord
1
+ class Intranet::TjpiPrevinculadoDeclaracao < Intranet::IntranetRecord
2
2
  self.table_name = 'tjpi_previnculado_declaracoes'
3
3
 
4
4
  belongs_to :tjpi_previnculado, :class_name => 'TjpiPrevinculado', :foreign_key => :preVinculado_id
@@ -9,10 +9,8 @@ class Intranet::TjpiVinculo < Intranet::IntranetRecord
9
9
  has_many :tjpi_exerciciofuncaos, :class_name => 'TjpiExerciciofuncao', :foreign_key => :vinculo_id
10
10
  has_many :tjpi_exerciciolotacaos, :class_name => 'TjpiExerciciolotacao'
11
11
  has_many :tjpi_gestorexcepcionals, :class_name => 'TjpiGestorexcepcional'
12
- has_many :tjpi_previnculados, :class_name => 'TjpiPrevinculado'
13
12
  has_many :tjpi_progressaocarreiras, :class_name => 'TjpiProgressaocarreira'
14
13
  has_many :tjpi_vinculados, :class_name => 'TjpiVinculado'
15
- belongs_to :tjpi_previnculado, :class_name => 'TjpiPrevinculado', :foreign_key => :cadastro_id
16
14
  belongs_to :tjpi_cargo, :class_name => 'TjpiCargo', :foreign_key => :cargo_id
17
15
  belongs_to :tjpi_terceirizacao_contrato, :class_name => 'TjpiTerceirizacaoContrato', :foreign_key => :contratoTerceirizacao_id
18
16
  belongs_to :tjpi_areaestagio, :class_name => 'TjpiAreaestagio', :foreign_key => :areaEstagio_id
@@ -35,6 +33,9 @@ class Intranet::TjpiVinculo < Intranet::IntranetRecord
35
33
  belongs_to :procurador, class_name: 'GlobalPrepessoafisica', foreign_key: :procurador_id
36
34
  belongs_to :conta_bancaria, class_name: 'GlobalContabancaria', foreign_key: :contaBancaria_id
37
35
 
36
+ has_many :tjpi_previnculados, class_name: 'TjpiPrevinculado', foreign_key: :vinculoPrincipal_id
37
+ belongs_to :tjpi_previnculado, class_name: 'TjpiPrevinculado', foreign_key: :cadastro_id
38
+
38
39
  has_many :tjpi_contrachequeagrupados, class_name: "TjpiContrachequeagrupado", foreign_key: :matricula, primary_key: :matricula
39
40
  has_many :tjpi_contrachequelegados, class_name: "TjpiContrachequelegado", foreign_key: :matricula, primary_key: :matricula
40
41
  end
@@ -1,3 +1,3 @@
1
1
  module Sticutils
2
- VERSION = "0.2.8"
2
+ VERSION = "0.3.3"
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.2.8
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-07 00:00:00.000000000 Z
11
+ date: 2020-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -67,6 +67,7 @@ files:
67
67
  - Rakefile
68
68
  - app/models/gestorh.rb
69
69
  - app/models/gestorh/banco.rb
70
+ - app/models/gestorh/classificacao_verba.rb
70
71
  - app/models/gestorh/folha.rb
71
72
  - app/models/gestorh/folha_agrupada.rb
72
73
  - app/models/gestorh/folha_agrupada_id_separado.rb
@@ -206,7 +207,7 @@ files:
206
207
  - app/models/intranet/tjpi_predependente.rb
207
208
  - app/models/intranet/tjpi_previnculado.rb
208
209
  - app/models/intranet/tjpi_previnculado_anexo.rb
209
- - app/models/intranet/tjpi_previnculado_declaraco.rb
210
+ - app/models/intranet/tjpi_previnculado_declaracao.rb
210
211
  - app/models/intranet/tjpi_previnculado_manifestaco.rb
211
212
  - app/models/intranet/tjpi_previnculadointervencao.rb
212
213
  - app/models/intranet/tjpi_previnculadopendencium.rb
@@ -238,9 +239,6 @@ files:
238
239
  - app/models/intranet/tjpi_vinculadoemfolha.rb
239
240
  - app/models/intranet/tjpi_vinculo.rb
240
241
  - 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
242
  - bin/console
245
243
  - bin/setup
246
244
  - 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(ENV['TRANSPARENCIA_DATABASE_URL'])
4
- end