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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f05d882295f7b20a1fb839c214ee3ea4b6d188f4
4
- data.tar.gz: 624b138f5198234726a5fbe6f1c435269906d8bf
3
+ metadata.gz: 03642e6ff05908b903f7101dfb46527d1df67a40
4
+ data.tar.gz: fe13c8dbb7ef0a4ba3c04d69088f24edb755c15d
5
5
  SHA512:
6
- metadata.gz: ae17e1103cf879ae064712f5dba900548e1fed506c716975113cd4987d58dd4fb2f71f668d70292cc2f528c2631456e443455f74c3a334cb98e52089e953dedd
7
- data.tar.gz: 8d6ccf3797a3988488e7a2d3a826ce45e04465c8090a256a51fc33f51b11ddde2a314c13b87c1b5717b9ea6300b63b47ce86a7acc7ce461f38ef1fa0d327ef77
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 ( c.id=m.id_client AND m.create_time > ISNULL(c.last_stat_balance_update_time, '1900-01-01') ) " +
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: invoicing_payments_processing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.70
4
+ version: 1.1.71
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi