invoicing_payments_processing 1.1.70 → 1.1.71
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/extend_client_by_invoicing_payments_processing.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03642e6ff05908b903f7101dfb46527d1df67a40
|
4
|
+
data.tar.gz: fe13c8dbb7ef0a4ba3c04d69088f24edb755c15d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 832296731ab80f51100056338d3f2a3672e7a63df3b225cf6aeb57b835fe1207ab14fb247ebc5f01a0a1ec2dc09c10b81d65a6e2dbfd285c38c85cdd40a71900
|
7
|
+
data.tar.gz: cad3907f4259afa7b890dc02e1bb2a06cdbfc68060491a597b2fda847940044895dd6c9d43bbcb66b979b11d8597ba7d4c3c7bc7f71c1a7576da801be08bc81a
|
@@ -32,11 +32,17 @@ module BlackStack
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# how many minutes ago should have updated the table stat_balance with the amount and credits of this client, for each product.
|
35
|
+
# return a positive integer if either:
|
36
|
+
# 1. the client didn't update stats in the last 24 hours, or
|
37
|
+
# 2. the client has a new record in the table movements after its last update in the table stat_balance.
|
35
38
|
def stat_balance_delay_minutes
|
36
39
|
row = DB[
|
37
40
|
"SELECT TOP 1 m.id " +
|
38
41
|
"FROM client c WITH (NOLOCK) " +
|
39
|
-
"JOIN movement m WITH (NOLOCK INDEX(IX_movement__id_client__create_time_desc)) ON (
|
42
|
+
"JOIN movement m WITH (NOLOCK INDEX(IX_movement__id_client__create_time_desc)) ON ( " +
|
43
|
+
" c.id=m.id_client AND " +
|
44
|
+
" ( m.create_time > ISNULL(c.last_stat_balance_update_time, '1900-01-01') OR ISNULL(c.last_stat_balance_update_time, '1900-01-01') < DATEADD(DD,-1,GETDATE()) ) " +
|
45
|
+
") " +
|
40
46
|
"WHERE c.id = '#{self.id}' " +
|
41
47
|
"ORDER BY m.create_time DESC "
|
42
48
|
].first
|