invoicing_payments_processing 1.1.51 → 1.1.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/balance.rb +15 -8
- data/lib/bufferpaypalnotification.rb +8 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbf8d14ab09274cca1347069880dd42704276aa6
|
4
|
+
data.tar.gz: fe4f4472a6e138fc6d5763bf1f3d10cfa5dfffa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cf1c203a98b89cb889b6f3b81cda659a72ff25eef71b1c00797f7233bfff1908d119dde2bf3bf656395db258de309a96824b1eef205482f5ce7239a67f7a510
|
7
|
+
data.tar.gz: beb36ff2205f605672c8905362feff35c42642f2390c12c95959a9a84bd0da3a698109928f32c0882e1f63b12420ba387e6f3fb3ad3fd6954afb8abf3db0eb66
|
data/lib/balance.rb
CHANGED
@@ -10,14 +10,21 @@ module BlackStack
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def calculate()
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
if !self.up_time.nil?
|
14
|
+
q =
|
15
|
+
"select cast(sum(cast(amount as numeric(18,12))) as numeric(18,6)) as amount, sum(credits) as credits " +
|
16
|
+
"from movement with (nolock) " +
|
17
|
+
"where id_client='#{self.client.id}' " +
|
18
|
+
"and product_code='#{self.product_code}' " +
|
19
|
+
"and create_time < '#{self.up_time.to_time.to_sql}' "
|
20
|
+
else
|
21
|
+
q =
|
22
|
+
"select cast(sum(cast(amount as numeric(18,12))) as numeric(18,6)) as amount, sum(credits) as credits " +
|
23
|
+
"from stat_balance x with (nolock) " +
|
24
|
+
"where x.id_client='#{self.client.id}' " +
|
25
|
+
"and x.product_code='#{self.product_code}' "
|
26
|
+
end
|
27
|
+
|
21
28
|
row = DB[q].first
|
22
29
|
self.amount = row[:amount].to_f
|
23
30
|
self.credits = row[:credits].to_f
|
@@ -48,19 +48,21 @@ puts "self.invoice:#{self.invoice.to_s}:."
|
|
48
48
|
# obtengo el cliente que machea con este perfil
|
49
49
|
c = nil
|
50
50
|
if c.nil?
|
51
|
-
puts 'a'
|
52
51
|
if self.invoice.guid?
|
53
|
-
puts 'b'
|
54
52
|
i = BlackStack::Invoice.where(:id=>self.invoice).first
|
55
53
|
c = i.client if !i.nil?
|
56
54
|
end
|
57
55
|
end
|
58
56
|
if c.nil?
|
59
|
-
|
57
|
+
iid = self.invoice.split(".").last.to_s
|
58
|
+
if iid.guid?
|
59
|
+
i = BlackStack::Invoice.where(:id=>iid).first
|
60
|
+
c = i.client if !i.nil?
|
61
|
+
end
|
62
|
+
end
|
63
|
+
if c.nil?
|
60
64
|
cid = self.invoice.split(".").first.to_s
|
61
|
-
puts "c:#{cid}:."
|
62
65
|
if cid.guid?
|
63
|
-
puts 'd'
|
64
66
|
c = BlackStack::Client.where(:id=>cid).first
|
65
67
|
end
|
66
68
|
end
|
@@ -353,7 +355,7 @@ puts 'd'
|
|
353
355
|
s.save
|
354
356
|
|
355
357
|
# obtengo la factura que se creo con esta suscripcion
|
356
|
-
i = BlackStack::Invoice.where(:id=>b.invoice).first
|
358
|
+
i = BlackStack::Invoice.where(:id=>b.invoice.split(".").last.to_s).first
|
357
359
|
|
358
360
|
# vinculo esta suscripcion a la factura que la genero, y a todas las facturas siguientes
|
359
361
|
i.set_subscription(s)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invoicing_payments_processing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: websocket
|