sticutils 0.4.2 → 1.0.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: ad5fefab023dccbe4f729aab147786ab3e3c64453b0c03c4045de5f19e4191d6
4
- data.tar.gz: 2960b77f91eeaaec95eb3b1cdc1059733578e5980af163dada979aae11d84656
3
+ metadata.gz: 01e910a26c6c9313290cbb037e04f128954fa1d421acf662be6907bb46d7a18f
4
+ data.tar.gz: fb4393fd1129ad335df698f244f2082faceba2210a6a0a93b69e2f747c1f013e
5
5
  SHA512:
6
- metadata.gz: c65e244da066773f3d03dfbbd37b5712417c3fc82c785b01db8fa39313329f2a052026043c7325b4ecb2bb2454adcde62502823ad15a9502efed9ac5b62c1268
7
- data.tar.gz: 9a0a29ad606207c1a0fd81cc6ea7c349112bc0aa9960cf1d91dd0d7a4308acbfd2af17e977e64a3b5f6344efa847d862b172a60fb17a4e85f0b44cda1edfb96a
6
+ metadata.gz: 5bc72ee664d86e3045856ed74f821eb005eeab73eba2f3d39c482bb6879305bd02638e5a75b5b260c61cfdcd49fac5a7871bc2140f61fb9036fb97ff73603a75
7
+ data.tar.gz: 6463d575457efcffff72bc58b4be9d10fad601dc1be3c2481465be2d464fc5581cc46b993444387a6356394d91cb36060cd6d72e99e1faf932d561ce76f1558d
@@ -8,22 +8,19 @@ 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
12
11
 
13
12
  def liquido_total
14
13
  self.rendimento_total - self.desconto_total
15
14
  end
16
15
 
17
16
  def eventos_e_valores
18
- # .where.not('cdclassificacaoverba.cv_classificacao': 'DESCONTO_PREVIDENCIA_PUBLICA_IAPEP')
19
17
  Gestorh::MovimentoAcumulado.where(mv_regfolha: self.folhas, mv_matricula: self.matricula)
20
- .joins(verba: :classificacao_verba)
18
+ .joins(:evento_folha_pagamento)
19
+ .where.not('evento_folha_pagamentos.tipo': 'DESCONTO_PREVIDENCIA_PUBLICA_IAPEP')
21
20
  .select('mv_regfolha as folha_id', 'mv_verba as codigo_evento',
22
- 'cdverba.vb_nome as nome_evento',
23
- 'mv_dc as status', 'mv_total as valor',
24
- 'cdclassificacaoverba.cv_classificacao as tipo')
21
+ 'evento_folha_pagamentos.descricao as nome_evento',
22
+ 'mv_dc as status', 'mv_total as valor', 'evento_folha_pagamentos.tipo')
25
23
  .to_a
26
- .uniq{|x| [x.codigo_evento, x.status, x.valor] } # uniq temporario para remover verbas com 2 classificacoes
27
24
  end
28
25
 
29
26
  def remuneracao_paradigma
@@ -75,24 +72,18 @@ class Gestorh::FolhaAgrupada < Gestorh::GestorhRecord
75
72
  # diarias
76
73
  def diarias
77
74
  if Object.const_defined?('DailyRate')
78
- DailyRate.where(cpf: [cpf, numeric_cpf], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
75
+ DailyRate.where(cpf: numeric_cpf, date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
79
76
  .sum(:pago)
80
77
  end
81
78
  end
82
-
79
+
83
80
  def diarias_positivas
84
- if Object.const_defined?('DailyRate')
85
- DailyRate.where(cpf: [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])
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])
87
82
  .sum(:pago)
88
- end
89
83
  end
90
-
84
+
91
85
  def diarias_negativas
92
- if Object.const_defined?('DailyRate')
93
- DailyRate.where(cpf: [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])
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])
95
87
  .sum(:pago)
96
- end
97
88
  end
98
89
  end
@@ -14,15 +14,13 @@ 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')
18
17
  Gestorh::MovimentoAcumulado.where(mv_regfolha: self.folhas, mv_matricula: self.matricula)
19
- .joins(verba: :classificacao_verba)
18
+ .joins(:evento_folha_pagamento)
19
+ .where.not('evento_folha_pagamentos.tipo': 'DESCONTO_PREVIDENCIA_PUBLICA_IAPEP')
20
20
  .select('mv_regfolha as folha_id', 'mv_verba as codigo_evento',
21
- 'cdverba.vb_nome as nome_evento',
22
- 'mv_dc as status', 'mv_total as valor',
23
- 'cdclassificacaoverba.cv_classificacao as tipo')
21
+ 'evento_folha_pagamentos.descricao as nome_evento',
22
+ 'mv_dc as status', 'mv_total as valor', 'evento_folha_pagamentos.tipo')
24
23
  .to_a
25
- .uniq{|x| [x.codigo_evento, x.status, x.valor] } # uniq temporario para remover verbas com 2 classificacoes
26
24
  end
27
25
 
28
26
  def remuneracao_paradigma
@@ -3,6 +3,4 @@ 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
8
6
  end
@@ -4,4 +4,6 @@ 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'
7
9
  end
@@ -1,5 +1,3 @@
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
5
3
  end
@@ -1,5 +1,3 @@
1
1
  class Gestorh::Vinculo < Gestorh::GestorhRecord
2
2
  self.table_name = 'gestor_rh.cdvinculo'
3
-
4
- has_many :funcionarios, foreign_key: :fn_vinculo
5
3
  end
@@ -35,6 +35,4 @@ class Intranet::GlobalOrgao < Intranet::IntranetRecord
35
35
  has_many :tjpi_vinculos_ensino, :class_name => 'TjpiVinculo', foreign_key: :instituicaoDeEnsino_id
36
36
  has_many :tjpi_vinculos_atuais, :class_name => 'TjpiVinculo', foreign_key: :lotacaoAtual_id
37
37
  has_many :tjpi_vinculos_origem, :class_name => 'TjpiVinculo', foreign_key: :orgaoOrigem_id
38
-
39
- has_many :global_contatos, through: :global_orgao_contatos
40
38
  end
@@ -3,15 +3,10 @@ class Intranet::GlobalPrepessoafisica < Intranet::IntranetRecord
3
3
 
4
4
  belongs_to :cidade_nascimento, :class_name => 'GlobalCidade', :foreign_key => :nascimentoCidade_id
5
5
  belongs_to :global_endereco, :class_name => 'GlobalEndereco', :foreign_key => :endereco_id
6
- belongs_to :cidade_titulo, :class_name => 'GlobalCidade', :foreign_key => :tituloEleitorCidade_id
6
+ belongs_to :global_cidade, :class_name => 'GlobalCidade', :foreign_key => :tituloEleitorCidade_id
7
7
  belongs_to :global_estado, :class_name => 'GlobalEstado', :foreign_key => :rgOrgaoExpedidorUF_sigla
8
+ has_many :global_prepessoafisica_contasbancarias, :class_name => 'GlobalPrepessoafisicaContasbancaria'
9
+ has_many :global_prepessoafisica_contatos, :class_name => 'GlobalPrepessoafisicaContato'
8
10
  has_many :tjpi_predependentes, :class_name => 'TjpiPredependente', foreign_key: :prePessoaFisica_id
9
-
10
- has_many :global_prepessoafisica_contasbancarias, class_name: 'GlobalPrepessoafisicaContasbancaria'
11
- has_many :global_prepessoafisica_contatos, class_name: 'GlobalPrepessoafisicaContato', foreign_key: :pessoaFisica_id
12
- has_many :global_contatos, through: :global_prepessoafisica_contatos
13
-
14
- has_one :tjpi_previnculados, :class_name => 'TjpiPrevinculado', foreign_key: :prePessoaFisica_id
15
- has_one :tjpi_vinculado, :class_name => 'TjpiPrevinculado', foreign_key: :prePessoaFisica_id
16
- has_many :tjpi_vinculos, through: :tjpi_vinculado, source: :tjpi_vinculo_principal
11
+ has_many :tjpi_previnculados, :class_name => 'TjpiPrevinculado'
17
12
  end
@@ -9,12 +9,8 @@ class Intranet::TjpiPrevinculado < Intranet::IntranetRecord
9
9
  has_many :tjpi_previnculado_manifestacoes, :class_name => 'TjpiPrevinculadoManifestaco'
10
10
  has_many :tjpi_previnculadopendencia, :class_name => 'TjpiPrevinculadopendencium'
11
11
  has_many :tjpi_previnculadopendencia, :class_name => 'TjpiPrevinculadopendencium'
12
- # has_many :tjpi_vinculados, :class_name => 'TjpiVinculado'
13
- # has_many :tjpi_vinculos, :class_name => 'TjpiVinculo'
14
-
15
- belongs_to :tjpi_vinculo_principal, :class_name => 'TjpiVinculo', foreign_key: :vinculoPrincipal_id
16
- belongs_to :tjpi_vinculo, :class_name => 'TjpiVinculo', foreign_key: :vinculoPrincipal_id
17
- has_many :tjpi_vinculos, :class_name => 'TjpiVinculo', foreign_key: :cadastro_id
12
+ has_many :tjpi_vinculados, :class_name => 'TjpiVinculado'
13
+ has_many :tjpi_vinculos, :class_name => 'TjpiVinculo'
18
14
 
19
15
  has_many :tjpi_previnculado_declaracoes, class_name: 'TjpiPrevinculadoDeclaracao', foreign_key: :preVinculado_id
20
16
  belongs_to :tjpi_previnculadointervencao_ultima, class_name: 'TjpiPrevinculadointervencao', foreign_key: :intervencao_id
@@ -13,31 +13,29 @@ class Intranet::TjpiVinculo < Intranet::IntranetRecord
13
13
  has_many :tjpi_vinculados, :class_name => 'TjpiVinculado'
14
14
  belongs_to :tjpi_cargo, :class_name => 'TjpiCargo', :foreign_key => :cargo_id
15
15
  belongs_to :tjpi_terceirizacao_contrato, :class_name => 'TjpiTerceirizacaoContrato', :foreign_key => :contratoTerceirizacao_id
16
+ belongs_to :tjpi_areaestagio, :class_name => 'TjpiAreaestagio', :foreign_key => :areaEstagio_id
16
17
  belongs_to :tjpi_categoriavinculoconfig, :class_name => 'TjpiCategoriavinculoconfig', :foreign_key => :categoria
17
18
  belongs_to :global_estado, :class_name => 'GlobalEstado', :foreign_key => :seccionalOAB_sigla
18
19
  belongs_to :tjpi_terceirizacao_postodetrabalho, :class_name => 'TjpiTerceirizacaoPostodetrabalho', :foreign_key => :postoDeTrabalho_id
19
20
  belongs_to :tjpi_contratocargotemporario, :class_name => 'TjpiContratocargotemporario', :foreign_key => :contrato_id
21
+ belongs_to :global_orgao_instituicao, :class_name => 'GlobalOrgao', :foreign_key => :instituicaoDeEnsino_id
20
22
  belongs_to :tjpi_nivelreferencium, :class_name => 'TjpiNivelreferencium', :foreign_key => :nivelReferenciaAtual_id
21
23
  belongs_to :tjpi_vinculo, :class_name => 'TjpiVinculo', :foreign_key => :vinculoOrigem_id
22
24
  belongs_to :tjpi_vinculado, :class_name => 'TjpiVinculado', :foreign_key => :vinculado_id
23
25
  has_one :tjpi_vinculado_principal, :class_name => 'TjpiVinculado', :foreign_key => :vinculoPrincipal_id
24
26
  belongs_to :global_orgao_atual, :class_name => 'GlobalOrgao', :foreign_key => :lotacaoAtual_id
25
27
  belongs_to :global_orgao_origem, :class_name => 'GlobalOrgao', :foreign_key => :orgaoOrigem_id
28
+ belongs_to :global_cidade, :class_name => 'GlobalCidade', :foreign_key => :vagaOrigem_id
26
29
  has_many :tjpi_vinculo_documentos, :class_name => 'TjpiVinculoDocumento', :foreign_key => :vinculo_id
27
30
  belongs_to :global_unidadeorganizacional, :class_name => 'GlobalUnidadeorganizacional', :foreign_key => :lotacaoAtual_id
28
31
  belongs_to :orgao_origem_cargo, :class_name => 'GlobalOrgao', :foreign_key => :origemCargo_id
29
32
  belongs_to :instituidor, class_name: 'GlobalPrepessoafisica', foreign_key: :instituidor_id
30
33
  belongs_to :procurador, class_name: 'GlobalPrepessoafisica', foreign_key: :procurador_id
31
34
  belongs_to :conta_bancaria, class_name: 'GlobalContabancaria', foreign_key: :contaBancaria_id
32
-
33
- has_many :tjpi_previnculados, class_name: 'TjpiPrevinculado', foreign_key: :vinculoPrincipal_id
35
+
36
+ has_many :tjpi_previnculados, class_name: 'TjpiPrevinculado'
34
37
  belongs_to :tjpi_previnculado, class_name: 'TjpiPrevinculado', foreign_key: :cadastro_id
35
38
 
36
39
  has_many :tjpi_contrachequeagrupados, class_name: "TjpiContrachequeagrupado", foreign_key: :matricula, primary_key: :matricula
37
40
  has_many :tjpi_contrachequelegados, class_name: "TjpiContrachequelegado", foreign_key: :matricula, primary_key: :matricula
38
-
39
- # estagio
40
- belongs_to :area_estagio, :class_name => 'TjpiAreaestagio', :foreign_key => :areaEstagio_id
41
- belongs_to :instituicao_ensino, :class_name => 'GlobalOrgao', :foreign_key => :instituicaoDeEnsino_id
42
- belongs_to :vaga_origem, :class_name => 'GlobalCidade', :foreign_key => :vagaOrigem_id
43
41
  end
@@ -0,0 +1,3 @@
1
+ class Transparencia::EventoFolhaPagamento < Transparencia::TransparenciaRecord
2
+ has_many :folha_pagamento_detalhadas
3
+ end
@@ -0,0 +1,4 @@
1
+ class Transparencia::TransparenciaRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ self.establish_connection :transparencia
4
+ end
@@ -0,0 +1,2 @@
1
+ module Transparencia
2
+ end
@@ -1,4 +1,3 @@
1
1
  module Sticutils
2
- VERSION = "0.4.2"
3
- # VERSION = "1.4.1"
2
+ VERSION = "1.0.0"
4
3
  end
data/sticutils.gemspec CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency 'rails', '~> 5.0'
33
+ spec.add_dependency 'rails', '~> 6.0'
34
34
 
35
35
  spec.add_development_dependency "bundler", "~> 1.16"
36
36
  spec.add_development_dependency "rake", "~> 10.0"
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.4.2
4
+ version: 1.0.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: 2022-01-31 00:00:00.000000000 Z
11
+ date: 2020-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '6.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '6.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -67,8 +67,6 @@ 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
72
70
  - app/models/gestorh/folha.rb
73
71
  - app/models/gestorh/folha_agrupada.rb
74
72
  - app/models/gestorh/folha_agrupada_id_separado.rb
@@ -76,7 +74,6 @@ files:
76
74
  - app/models/gestorh/funcao.rb
77
75
  - app/models/gestorh/funcionario.rb
78
76
  - app/models/gestorh/gestorh_record.rb
79
- - app/models/gestorh/local_trabalho.rb
80
77
  - app/models/gestorh/lotacao.rb
81
78
  - app/models/gestorh/movimento.rb
82
79
  - app/models/gestorh/movimento_acumulado.rb
@@ -241,6 +238,9 @@ files:
241
238
  - app/models/intranet/tjpi_vinculadoemfolha.rb
242
239
  - app/models/intranet/tjpi_vinculo.rb
243
240
  - 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
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  - !ruby/object:Gem::Version
267
267
  version: '0'
268
268
  requirements: []
269
- rubygems_version: 3.1.6
269
+ rubygems_version: 3.0.3
270
270
  signing_key:
271
271
  specification_version: 4
272
272
  summary: Utilidades para aplicações rails da STIC
@@ -1,5 +0,0 @@
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
@@ -1,4 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- class Gestorh::LocalTrabalho < Gestorh::GestorhRecord
2
- self.table_name = 'gestor_rh.cdlocaistrabalho'
3
- end