sticutils 1.0.7 → 1.4.1

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: 76885aaed498a28a327cf9ea2f804390ce982ae63f1d191ddcd7862f83d7ea96
4
- data.tar.gz: 629308e5410aa422dfecae788f945cd0e4f186efa19095fa68a74b607c337cee
3
+ metadata.gz: 46a9fe2516c0cda974638b2d5761309281c00642a6d2fbbe3296a482b048e797
4
+ data.tar.gz: 71aceffbd5aa1f9edf644da60b229b6c8eb408683ef4d3a4f8562217e20f4a71
5
5
  SHA512:
6
- metadata.gz: 8adc05e3e5e318cdab80592daef0fc544c7645b9655a32f8226202db3d31ea2d0426925b783b83bc2a7758440cb560bbd0efe5d1d3327ce61ff8093d1b08407a
7
- data.tar.gz: 5be8d2f429102c37e02aa5cb190f7ae0e285f9d8a5ec98d0b6c0cdfe315e5881f85f50b6544e143bebc38c7dada23a368cfec53a404d427a1d7a00d13536db35
6
+ metadata.gz: e8e62b4fc05d5def3eb8d02429937b998f0ae030511a4550e118ec3e658c40953d8a21c0807f45dc7461e4eaad197480ef691f080989f969284971f6fd9ee80e
7
+ data.tar.gz: 83d44504eda2f709df81870df3a7800663abb81cb58dc8b34532f6dc8aada8cbb696ba55fe6b56bdc6f63e38a38379cf97f35a82d79c7e91b3cebfba5af209bb
@@ -75,14 +75,14 @@ class Gestorh::FolhaAgrupada < Gestorh::GestorhRecord
75
75
  # diarias
76
76
  def diarias
77
77
  if Object.const_defined?('DailyRate')
78
- DailyRate.where(cpf: numeric_cpf, date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
78
+ DailyRate.where(cpf: [cpf, numeric_cpf], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
79
79
  .sum(:pago)
80
80
  end
81
81
  end
82
82
 
83
83
  def diarias_positivas
84
84
  if Object.const_defined?('DailyRate')
85
- DailyRate.where(cpf: numeric_cpf,
85
+ DailyRate.where(cpf: [cpf, numeric_cpf],
86
86
  pago: [0..Float::INFINITY], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
87
87
  .sum(:pago)
88
88
  end
@@ -90,7 +90,7 @@ class Gestorh::FolhaAgrupada < Gestorh::GestorhRecord
90
90
 
91
91
  def diarias_negativas
92
92
  if Object.const_defined?('DailyRate')
93
- DailyRate.where(cpf: numeric_cpf,
93
+ DailyRate.where(cpf: [cpf, numeric_cpf],
94
94
  pago: [-Float::INFINITY..0], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
95
95
  .sum(:pago)
96
96
  end
@@ -4,4 +4,5 @@ class Gestorh::Funcionario < Gestorh::GestorhRecord
4
4
  has_many :movimento_acumulados, foreign_key: :mv_matricula, primary_key: :fn_matricula
5
5
  has_many :folhas, through: :movimento_acumulados
6
6
  has_many :ferias, foreign_key: :fe_matricula, primary_key: :fn_matricula, class_name: 'Gestorh::Ferias'
7
+ belongs_to :vinculo, foreign_key: :fn_vinculo
7
8
  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
@@ -35,4 +35,6 @@ 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
38
40
  end
@@ -3,10 +3,15 @@ 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 :global_cidade, :class_name => 'GlobalCidade', :foreign_key => :tituloEleitorCidade_id
6
+ belongs_to :cidade_titulo, :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'
10
8
  has_many :tjpi_predependentes, :class_name => 'TjpiPredependente', foreign_key: :prePessoaFisica_id
11
- has_many :tjpi_previnculados, :class_name => 'TjpiPrevinculado'
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
12
17
  end
@@ -9,11 +9,18 @@ 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'
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
14
17
 
15
18
  has_many :tjpi_previnculado_declaracoes, class_name: 'TjpiPrevinculadoDeclaracao', foreign_key: :preVinculado_id
16
19
  belongs_to :tjpi_previnculadointervencao_ultima, class_name: 'TjpiPrevinculadointervencao', foreign_key: :intervencao_id
17
20
  belongs_to :tjpi_previnculadointervencao_anterior, class_name: 'TjpiPrevinculadointervencao', foreign_key: :anterior_id
18
21
  has_many :tjpi_previnculadointervencoes, class_name: 'TjpiPrevinculadointervencao', foreign_key: :preVinculado_id
22
+
23
+ def tjpi_vinculos
24
+ [self.tjpi_vinculo_principal]
25
+ end
19
26
  end
@@ -1,3 +1,3 @@
1
1
  module Sticutils
2
- VERSION = "1.0.7"
2
+ VERSION = "1.4.1"
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: 1.0.7
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-24 00:00:00.000000000 Z
11
+ date: 2022-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -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.0.3
269
+ rubygems_version: 3.1.6
270
270
  signing_key:
271
271
  specification_version: 4
272
272
  summary: Utilidades para aplicações rails da STIC