sticutils 0.3.3 → 0.3.9

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: 72c6760fcdc8f0c42621dcc59fad94f2e5c8408bce8fd1c1f2785a67f015f38f
4
- data.tar.gz: 47e9578003b9865a83902a4038cfe5bc4731e37c4dd8287489d30c71e2048b4e
3
+ metadata.gz: 41225f441c7974574d9aa7158eb45d806e0519a6ccf403d7596cdb6172f0594e
4
+ data.tar.gz: 695acc88465bfb9ed2cfb2dcced891e0d23bfaf300f5df4863b2fbb8abd27569
5
5
  SHA512:
6
- metadata.gz: fe418e24e6d36cfa698fa3569d4927256cf75145b02097c53a5da85134799e83d17540c213d6b3eb0608c0dc700390abd57208e472bc21c9a63fce6eab09ee2d
7
- data.tar.gz: 4a6a8bca716f6108ebe1c9ae256b9107d86e1374612d406a422d2f6c602270f200e51548044af73c55dab9fa2d1192151a74a53722962d1505b9a1c51c07ba99
6
+ metadata.gz: 5f538e432c08acdbb92719e326742365f8f7aeb013a94236a30e518a24c9eb46b572711b51dc042a44b0eef010400b58134fe7af29e444b19c2e23314826e087
7
+ data.tar.gz: d684705c95e9aa77cf3fd95c0e846b15dab14c4eec73841f4560296245598eabf0e00338c70ac29db54f526ed256937f325731f32e923cce3e3e283ecd13d8c6
@@ -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,6 +8,7 @@ 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
@@ -74,14 +75,14 @@ class Gestorh::FolhaAgrupada < Gestorh::GestorhRecord
74
75
  # diarias
75
76
  def diarias
76
77
  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
+ DailyRate.where(cpf: [cpf, numeric_cpf], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
78
79
  .sum(:pago)
79
80
  end
80
81
  end
81
82
 
82
83
  def diarias_positivas
83
84
  if Object.const_defined?('DailyRate')
84
- DailyRate.where(cpf: numeric_cpf,
85
+ DailyRate.where(cpf: [cpf, numeric_cpf],
85
86
  pago: [0..Float::INFINITY], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
86
87
  .sum(:pago)
87
88
  end
@@ -89,7 +90,7 @@ class Gestorh::FolhaAgrupada < Gestorh::GestorhRecord
89
90
 
90
91
  def diarias_negativas
91
92
  if Object.const_defined?('DailyRate')
92
- DailyRate.where(cpf: numeric_cpf,
93
+ DailyRate.where(cpf: [cpf, numeric_cpf],
93
94
  pago: [-Float::INFINITY..0], date: [Date.new(self.ano, self.mes)..Date.new(self.ano, self.mes).at_end_of_month])
94
95
  .sum(:pago)
95
96
  end
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Sticutils
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.9"
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.3
4
+ version: 0.3.9
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-12-09 00:00:00.000000000 Z
11
+ date: 2021-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -68,6 +68,7 @@ files:
68
68
  - app/models/gestorh.rb
69
69
  - app/models/gestorh/banco.rb
70
70
  - app/models/gestorh/classificacao_verba.rb
71
+ - app/models/gestorh/ferias.rb
71
72
  - app/models/gestorh/folha.rb
72
73
  - app/models/gestorh/folha_agrupada.rb
73
74
  - app/models/gestorh/folha_agrupada_id_separado.rb
@@ -75,6 +76,7 @@ files:
75
76
  - app/models/gestorh/funcao.rb
76
77
  - app/models/gestorh/funcionario.rb
77
78
  - app/models/gestorh/gestorh_record.rb
79
+ - app/models/gestorh/local_trabalho.rb
78
80
  - app/models/gestorh/lotacao.rb
79
81
  - app/models/gestorh/movimento.rb
80
82
  - app/models/gestorh/movimento_acumulado.rb
@@ -264,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
264
266
  - !ruby/object:Gem::Version
265
267
  version: '0'
266
268
  requirements: []
267
- rubygems_version: 3.0.3
269
+ rubygems_version: 3.1.6
268
270
  signing_key:
269
271
  specification_version: 4
270
272
  summary: Utilidades para aplicações rails da STIC