invoicing_payments_processing 1.1.52 → 1.1.58

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: a041204eaed01ab7a77e725d80a2097b8483304c
4
- data.tar.gz: 8fb9df52feccc39824f57a4275541f8d40fe300f
3
+ metadata.gz: ffa569d58e22432b0ad9f214a6e83faef4f424c0
4
+ data.tar.gz: 2dc2ab0fc91b4b7350985678eefb3865bbba9e2c
5
5
  SHA512:
6
- metadata.gz: 429e8b18fcea87ba90503ce9080cce97dc26e9814ea3302fdf4aa20d5f1aa2a5839f76b20178d3e876ce2d40e994adba1f8a5b636a3bb088514d7149258a28f6
7
- data.tar.gz: 2b1f92d1d307dba79c5db11f15a78fc99c1e457bba6b32d2fcb86db569ff20c6d5aae493753d027897b2a8babd1cf70dfa2e9178feccb89962cfb094e1f10c33
6
+ metadata.gz: fdd78f088152e5373a9eff70f66d7ab5629dd290349e84e8d9aa7c91ebb0ad3530ab2c97efda541ad0c56de463b932f05fa9f3f9f6f2231009779fe83ac940b7
7
+ data.tar.gz: 20252301b10406afce4d398ebf1e5bcd9965b985b84afcbd5be6b98519661ad97d7e42bdf9aeebbefa66845babd6197e56f3b4102aa94d66904329beae5acb5f
@@ -10,14 +10,21 @@ module BlackStack
10
10
  end
11
11
 
12
12
  def calculate()
13
- q =
14
- "select cast(sum(cast(amount as numeric(18,12))) as numeric(18,6)) as amount, sum(credits) as credits " +
15
- "from movement with (nolock index(IX_movement__id_client__product_code)) " +
16
- "where id_client='#{self.client.id}' " +
17
- "and product_code='#{self.product_code}' "
18
-
19
- q += "and create_time < '#{self.up_time.to_time.to_sql}' " if !self.up_time.nil?
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
@@ -403,7 +403,7 @@ puts "self.invoice:#{self.invoice.to_s}:."
403
403
  "SELECT TOP 1 i.id " +
404
404
  "FROM buffer_paypal_notification b " +
405
405
  "JOIN invoice i ON ( b.id=i.id_buffer_paypal_notification AND i.status=#{BlackStack::Invoice::STATUS_PAID.to_s} ) " +
406
- "WHERE b.invoice='#{b.invoice.invoice.split(".").last.to_s}' " +
406
+ "WHERE b.invoice='#{b.invoice}' " +
407
407
  "ORDER BY i.create_time DESC "
408
408
  ].first
409
409
  if row.nil?
@@ -246,7 +246,7 @@ module BlackStack
246
246
  end
247
247
 
248
248
  # return url
249
- "#{BlackStack::InvoicingPaymentsProcessing::PAYPAL_ORDERS_URL}/cgi-bin/webscr?" + URI.encode_www_form(values)
249
+ "#{BlackStack::InvoicingPaymentsProcessing::paypal_orders_url}/cgi-bin/webscr?" + URI.encode_www_form(values)
250
250
  end
251
251
 
252
252
  # retorna true si el estado de la factura sea NULL o UNPAID
@@ -13,10 +13,19 @@ module BlackStack
13
13
 
14
14
  # static attributes
15
15
  @@paypal_business_email = "sardi.leandro.daniel@gmail.com"
16
+ @@paypal_orders_url = BlackStack::InvoicingPaymentsProcessing::PAYPAL_ORDERS_URL
17
+ @@paypal_ipn_listener = "#{BlackStack::Pampa::api_url.to_s}/api1.3/accounting/paypal/notify_new_invoice.json"
18
+
16
19
  @@products_descriptor = []
17
20
  @@plans_descriptor = []
18
-
21
+
19
22
  # getters & setters
23
+ def self.set_config(h)
24
+ @@paypal_business_email = h[:paypal_business_email]
25
+ @@paypal_orders_url = h[:paypal_orders_url]
26
+ @@paypal_ipn_listener = h[:paypal_ipn_listener]
27
+ end
28
+
20
29
  def self.set_paypal_business_email(email)
21
30
  @@paypal_business_email = email
22
31
  end # def self.set_paypal_business_email
@@ -25,10 +34,14 @@ module BlackStack
25
34
  @@paypal_business_email
26
35
  end # def self.set_paypal_business_email
27
36
 
28
- def self.paypal_ipn_listener()
29
- "#{BlackStack::Pampa::api_url.to_s}/api1.3/accounting/paypal/notify_new_invoice.json"
37
+ def self.paypal_orders_url()
38
+ @@paypal_orders_url
30
39
  end
31
40
 
41
+ def self.paypal_ipn_listener()
42
+ @@paypal_ipn_listener
43
+ end
44
+
32
45
 
33
46
  def self.set_products(h)
34
47
  @@products_descriptor = h
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.52
4
+ version: 1.1.58
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-01 00:00:00.000000000 Z
11
+ date: 2020-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket