invoicing_payments_processing 1.1.54 → 1.1.55
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
- 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: 1294cf94b7e332d6ef0444b22134b388188e647e
|
4
|
+
data.tar.gz: 6351ac02e50156091d71ad80a3d3966247900d6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0d92dba76c788bc2bd44012d55df5939290b06eb6559954dd11dcd6901dc30945a781215db9bd3e1b95b6e9b785b7012f72dbde057c2a555cf34f1b8a4c8c63
|
7
|
+
data.tar.gz: c69783fc4a9433009feaaa33feefc279e9c1e4acae1cb2ca70efb18c566d3780c7b43f6c0f341a3821671bdc17ce63e857d0fc7d556b930245abe4eb7801c618
|
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
|
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.55
|
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
|