sticutils 0.3.3 → 0.3.9
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:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 41225f441c7974574d9aa7158eb45d806e0519a6ccf403d7596cdb6172f0594e
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 695acc88465bfb9ed2cfb2dcced891e0d23bfaf300f5df4863b2fbb8abd27569
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 5f538e432c08acdbb92719e326742365f8f7aeb013a94236a30e518a24c9eb46b572711b51dc042a44b0eef010400b58134fe7af29e444b19c2e23314826e087
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d684705c95e9aa77cf3fd95c0e846b15dab14c4eec73841f4560296245598eabf0e00338c70ac29db54f526ed256937f325731f32e923cce3e3e283ecd13d8c6
         
     | 
| 
         @@ -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
         
     | 
    
        data/lib/sticutils/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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:  
     | 
| 
      
 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. 
     | 
| 
      
 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
         
     |