abank 0.4.7 → 0.4.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: d761d5fef0e23fff5c5b9f8b8fe7fcc20d763da37a1e2e0739ee67dc8fa944d1
4
- data.tar.gz: 974801c5d97d31803a390bcc2b2f58ee83bd327faa9ae2307a7a6673e033915e
3
+ metadata.gz: 6226a5dfabceca906dc4184df86a56a73e0011bed42f585d32b6670611c45079
4
+ data.tar.gz: 3553914f765583d647c71adfa780ec1c0d5cb82d374d19364be04401ab471aa4
5
5
  SHA512:
6
- metadata.gz: 9abd56522474b5c67ec18b690ec81a195b97dec3591549c241266d94467713d20e6f30c2b34dae2d833ab9751fc73ab022114adc13221573e40a69f736f93a6f
7
- data.tar.gz: 4c7386cf7f96b3aacee3b5a79f2f6101ae3f07f6df77016df3202a2944886e53f068e948e742acf74760446871daecd2e57686821d69223e7549d08ebcf5cf2c
6
+ metadata.gz: 1f5b4022cc832335806b74273b2ddc2a5201ed6cf42b0c19fc3c9993cc1c9903b7a33fa66a7e1eb1f29da6f1ed55b88dccef31a1904ce8c9e52501521c4cae51
7
+ data.tar.gz: c78f07a0573bd68e4368ea4c5488812a1074c1c7857091199095faef8470db3c460501027f333ed25e65cff4deef03c916c07dcf7414d46b0698a8d12c5457dd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- abank (0.4.7)
4
+ abank (0.4.9)
5
5
  google-cloud-bigquery
6
6
  roo
7
7
  thor
@@ -16,7 +16,7 @@ GEM
16
16
  base64 (0.2.0)
17
17
  benchmark (0.4.0)
18
18
  bigdecimal (3.1.9)
19
- concurrent-ruby (1.3.4)
19
+ concurrent-ruby (1.3.5)
20
20
  declarative (0.0.20)
21
21
  diff-lcs (1.5.1)
22
22
  dry-configurable (1.3.0)
data/lib/abank/big.rb CHANGED
@@ -54,7 +54,7 @@ module Abank
54
54
  @ctlct = []
55
55
  unless mvkys.empty?
56
56
  # obtem lista contratos arrendamento associados aos movimentos a apagar
57
- @ctlct = sql("select distinct ct from #{BD}.mv where #{ky_mv} in(#{mvkys}) and substr(ct,1,1)='r'")
57
+ @ctlct = sql("select distinct ct from #{BD}.mv where #{BD}.ky(dl,dv,ds,vl,nc) in(#{mvkys}) and substr(ct,1,1)='r'")
58
58
 
59
59
  # apaga todas as rendas dos contratos arrendamento associados aos movimentos a apagar
60
60
  opcao[:t] = true unless ctlct.empty?
@@ -65,23 +65,18 @@ module Abank
65
65
 
66
66
  # apaga movimentos no bigquery
67
67
  def mv_delete_dml
68
- dml("delete from #{BD}.mv where #{ky_mv} in(#{mvkys})")
68
+ dml("delete from #{BD}.mv where #{BD}.ky(dl,dv,ds,vl,nc) in(#{mvkys})")
69
69
  puts("MOVIMENTOS APAGADOS #{bqnrs}")
70
70
  end
71
71
 
72
72
  # (see CLI#tag)
73
73
  def mv_classifica
74
- dml("update #{BD}.mv set mv.ct=tt.nct from (select * from #{BD}.cl) as tt where #{ky_mv}=tt.ky")
74
+ dml("update #{BD}.mv set mv.ct=tt.nct from (select * from #{BD}.cl) as tt where #{BD}.ky(mv.dl,mv.dv,mv.ds,mv.vl,mv.nc)=tt.ky")
75
75
  puts("MOVIMENTOS CLASSIFICADOS #{bqnrs}")
76
76
  @ctlct = sql("select distinct ct from #{BD}.re") if bqnrs.positive?
77
77
  self
78
78
  end
79
79
 
80
- # @return [String] expressao sql da chave de movimentos
81
- def ky_mv
82
- 'FARM_FINGERPRINT(CONCAT(CAST(mv.nc as STRING),mv.ds,CAST(mv.dl as STRING),CAST(mv.vl as STRING)))'
83
- end
84
-
85
80
  # (see CLI#criact)
86
81
  def ct_cria
87
82
  unless ct_existe?
@@ -159,7 +154,7 @@ module Abank
159
154
 
160
155
  # @return [String] sql para obter movimentos novos (depois da ultima renda do contrato arrendamento)
161
156
  def sql_novo_mv(mdl)
162
- "select dl,vl from #{BD}.mvgem where ct='#{opcao[:c]}' and dl>='#{(mdl + 1).strftime(DF)}' order by dl,dv"
157
+ "select * from #{BD}.mvgem where ct='#{opcao[:c]}' and dl>='#{(mdl + 1).strftime(DF)}' order by 1,2"
163
158
  end
164
159
 
165
160
  # @return [String] sql para obter dados do inicio contrato arrendamento
data/lib/abank/folha.rb CHANGED
@@ -147,7 +147,7 @@ module Abank
147
147
 
148
148
  # @return [String] sql para movimentos no bigquery
149
149
  def sql_existe_mv
150
- "select *,#{ky_mv} as ky from #{BD}.mv where nc=#{conta} and dl='#{rowfc[0].strftime(DF)}' and vl=#{rowfc[3]}"
150
+ "select *,#{BD}.ky(dl,dv,ds,vl,nc) ky from #{BD}.mv where nc=#{conta} and dl='#{rowfc[0].strftime(DF)}' and vl=#{rowfc[3]}"
151
151
  end
152
152
 
153
153
  # obtem movimento (values.mv) para inserir
data/lib/abank/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Abank
4
- VERSION = '0.4.7'
4
+ VERSION = '0.4.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hernâni Rodrigues Vaz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-15 00:00:00.000000000 Z
11
+ date: 2025-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler