abank 0.4.5 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/abank/big.rb +7 -6
- data/lib/abank/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d761d5fef0e23fff5c5b9f8b8fe7fcc20d763da37a1e2e0739ee67dc8fa944d1
|
4
|
+
data.tar.gz: 974801c5d97d31803a390bcc2b2f58ee83bd327faa9ae2307a7a6673e033915e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9abd56522474b5c67ec18b690ec81a195b97dec3591549c241266d94467713d20e6f30c2b34dae2d833ab9751fc73ab022114adc13221573e40a69f736f93a6f
|
7
|
+
data.tar.gz: 4c7386cf7f96b3aacee3b5a79f2f6101ae3f07f6df77016df3202a2944886e53f068e948e742acf74760446871daecd2e57686821d69223e7549d08ebcf5cf2c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
abank (0.4.
|
4
|
+
abank (0.4.7)
|
5
5
|
google-cloud-bigquery
|
6
6
|
roo
|
7
7
|
thor
|
@@ -57,7 +57,7 @@ GEM
|
|
57
57
|
net-http (>= 0.5.0)
|
58
58
|
google-apis-bigquery_v2 (0.83.0)
|
59
59
|
google-apis-core (>= 0.15.0, < 2.a)
|
60
|
-
google-apis-core (0.
|
60
|
+
google-apis-core (0.16.0)
|
61
61
|
addressable (~> 2.5, >= 2.5.1)
|
62
62
|
googleauth (~> 1.9)
|
63
63
|
httpclient (>= 2.8.3, < 3.a)
|
data/lib/abank/big.rb
CHANGED
@@ -119,6 +119,7 @@ module Abank
|
|
119
119
|
ctlct.map! do |ctr|
|
120
120
|
opcao[:c] = ctr[:ct]
|
121
121
|
lre = sql(sql_last_re)[0]
|
122
|
+
lre[:dl] += -1 if lre[:cnt] == 0
|
122
123
|
ctr.merge(lre, mv: sql(sql_novo_mv(lre[:dl])))
|
123
124
|
end
|
124
125
|
self
|
@@ -151,14 +152,14 @@ module Abank
|
|
151
152
|
|
152
153
|
# @return [String] sql para obter ultima renda do contrato arrendamento
|
153
154
|
def sql_last_re
|
154
|
-
'select ct,
|
155
|
-
|
156
|
-
|
155
|
+
'select r1.ct,r0.dl dc,r1.ano,r1.cnt,r1.dl,CAST(REGEXP_EXTRACT(r1.ct,r"\d+") as numeric)/100 vr '\
|
156
|
+
"from #{BD}.re r1 join hernanilr.ab.re r0 on (r0.ct=r1.ct and r0.cnt=0)"\
|
157
|
+
" where r1.ct='#{opcao[:c]}' order by r1.ano desc,r1.cnt desc limit 1"
|
157
158
|
end
|
158
159
|
|
159
160
|
# @return [String] sql para obter movimentos novos (depois da ultima renda do contrato arrendamento)
|
160
161
|
def sql_novo_mv(mdl)
|
161
|
-
"select dl,vl from #{BD}.
|
162
|
+
"select dl,vl from #{BD}.mvgem where ct='#{opcao[:c]}' and dl>='#{(mdl + 1).strftime(DF)}' order by dl,dv"
|
162
163
|
end
|
163
164
|
|
164
165
|
# @return [String] sql para obter dados do inicio contrato arrendamento
|
@@ -225,7 +226,7 @@ module Abank
|
|
225
226
|
def re_proximos_dados
|
226
227
|
# valor renda paga retirada do movimento
|
227
228
|
re_atual_mv[:vl] -= re_atual[:vr]
|
228
|
-
dre = cnt.zero? ? Date.new(
|
229
|
+
dre = cnt.zero? ? Date.new(re_atual[:dc].year, re_atual[:dc].month, 1) : Date.new(ano, cnt, 1) >> 1
|
229
230
|
re_atual.merge!(ano: dre.year, cnt: dre.month)
|
230
231
|
end
|
231
232
|
|
@@ -262,7 +263,7 @@ module Abank
|
|
262
263
|
|
263
264
|
# @return [Integer] dias atraso/antecipo neste pagamento renda
|
264
265
|
def dias
|
265
|
-
re_atual_mv[:dl].mjd -
|
266
|
+
re_atual_mv[:dl].mjd - Date.new(ano, cnt, 1).mjd
|
266
267
|
end
|
267
268
|
|
268
269
|
# @param [String] cmd comando a executar
|
data/lib/abank/version.rb
CHANGED
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.
|
4
|
+
version: 0.4.7
|
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-
|
11
|
+
date: 2025-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|