invoicing_payments_processing 1.1.69 → 1.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a2630a4138eed9ce9bff82ca451f20580270ed4
4
- data.tar.gz: d3889d1e0d0d880681b7bbc289c28b2032a349c6
3
+ metadata.gz: 83c7c35048fbc3f1a5853b36501ed5da692693a3
4
+ data.tar.gz: 0d80c22903a5475d8c1c8b01fd7d522e92f47c7b
5
5
  SHA512:
6
- metadata.gz: 0c3138defd98ac56b073e3b004eb81586bef46c462a2d9746512fd77e65ecd7b0595eff0b57e0163fec87d4ddc8604f349592abf55cd67424fedb02c4697c6c7
7
- data.tar.gz: 26c8b39c421aa4fb18aa21f70d8ced37a117dd5d3263a2718e6d669575972b77fe93c7b9aff3ec1bdc26e982ffd1e43ed060e1bf62be4e761630823e8e1cb390
6
+ metadata.gz: 9aa1866d4ea9cae34e214992a1da21958ddd2b7855dec66caa476892aab1af13f3ee774832c181fc13aaf5a7c59abbb52e652a366965a2ad21f4cca58521a517
7
+ data.tar.gz: 1309c4832375a39d462217f6fdb13d4feb984001af0cfae0d27dbcdfe9cdfeba35aedbf6a3e9eb6b2ab4d446764c57ad42e69e3fa8c0205590807b3045923b4f
@@ -50,8 +50,14 @@ puts "get_client: self.invoice:#{self.invoice.to_s}:."
50
50
  puts 'get_client: a'
51
51
  if self.invoice.guid?
52
52
  puts 'get_client: a1'
53
+ puts "get_client: #{self.invoice.to_s}"
53
54
  i = BlackStack::Invoice.where(:id=>self.invoice).first
54
- c = i.client if !i.nil?
55
+ if !i.nil?
56
+ c = i.client
57
+ puts 'get_client: a1a'
58
+ else
59
+ puts 'get_client: a1b'
60
+ end
55
61
  end
56
62
  end
57
63
  if c.nil?
@@ -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') " +
45
+ ") " +
40
46
  "WHERE c.id = '#{self.id}' " +
41
47
  "ORDER BY m.create_time DESC "
42
48
  ].first
@@ -56,8 +62,8 @@ module BlackStack
56
62
  product_descriptors.each { |hprod|
57
63
  row = DB[
58
64
  "select isnull(sum(isnull(m.credits,0)),0) as credits, isnull(sum(isnull(m.amount,0)),0) as amount " +
59
- # "from movement m with (nolock index(IX_movement__id_client__product_code)) " +
60
- "from movement m with (nolock) " +
65
+ "from movement m with (nolock index(IX_movement__id_client__product_code)) " +
66
+ #"from movement m with (nolock) " +
61
67
  "where m.id_client='#{c.id}' " +
62
68
  "and m.product_code='#{hprod[:code]}' "
63
69
  ].first
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.69
4
+ version: 1.1.74
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-14 00:00:00.000000000 Z
11
+ date: 2020-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket