invoicing_payments_processing 1.1.27 → 1.1.29

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/invoice.rb +5 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d97ab4f8d1bbf4504ea494d1f4f0654c6dedac5
4
- data.tar.gz: d2aa430675b74c58792d858b9446b961152a31dd
3
+ metadata.gz: 9f79b2b37439a781dd15dbe9407f09907f890773
4
+ data.tar.gz: 1c99bbda030268957826baaf318a30ff3fafde7e
5
5
  SHA512:
6
- metadata.gz: a19f653d1435378092a77cb576f8f92b21cf5f5fe68e03b349f16ae547ff93efe379de7d7cd4bd1509b3717cbe9d3d26a4cedba96b5a9e2e81fb1a671bb8f47f
7
- data.tar.gz: 9e6823c86dc08d36a8f629fd18eb605a105df7e8ad87603c40c6a199c448ca872daaa2725656376d0c594246af1872e95e21726f6620fbfaec4a5a029d1f8a49
6
+ metadata.gz: 4c43270e3ed5d5c63729935fbb609f209ead4420b24bfb02d5b3d282d2ce68844d8b60e8eca3a0a28a08379b329ac4027b028f2426045f057c37d3b7140088ce
7
+ data.tar.gz: 5d4315da2fdd53ccc55149cae0e5da568ca375f055b1dba014319095179171411e81908f779b535b653c191c08e0a51bcf4c1387c0f3c8b961326a794d570157
@@ -400,11 +400,12 @@ module BlackStack
400
400
 
401
401
  # le seteo la fecha de hoy
402
402
  self.billing_period_from = now()
403
-
403
+ #puts
404
+ #puts
404
405
  # si el plan tiene un primer trial, y
405
406
  # es la primer factura, entonces:
406
407
  # => se trata del primer pago por trial
407
- if h[:trial_fee] != nil && prev1.nil?
408
+ if h[:trial_fee] != nil && prev1.nil? && !self.disabled_for_trial_ssm
408
409
  #puts 'a'
409
410
  units = h[:trial_credits].to_i
410
411
  unit_price = h[:trial_fee].to_f / h[:trial_credits].to_f
@@ -420,13 +421,13 @@ module BlackStack
420
421
  billing_period_to = DB["SELECT DATEADD(#{h[:trial2_period].to_s}, +#{h[:trial2_units].to_s}, '#{self.billing_period_from.to_s}') AS [now]"].map(:now)[0].to_s
421
422
 
422
423
  # si el plan tiene un fee, y
423
- elsif h[:fee].to_f != nil && !prev1.nil? && !prev2.nil?
424
+ elsif h[:fee].to_f != nil && h[:type] == BlackStack::InvoicingPaymentsProcessing::BasePlan::PAYMENT_SUBSCRIPTION
424
425
  #puts 'c'
425
426
  units = n.to_i * h[:credits].to_i
426
427
  unit_price = h[:fee].to_f / h[:credits].to_f
427
428
  billing_period_to = DB["SELECT DATEADD(#{h[:period].to_s}, +#{h[:units].to_s}, '#{self.billing_period_from.to_s}') AS [now]"].map(:now)[0].to_s
428
429
 
429
- elsif (!isSubscription && h[:fee].to_f != nil)
430
+ elsif h[:fee].to_f != nil && h[:type] == BlackStack::InvoicingPaymentsProcessing::BasePlan::PAYMENT_PAY_AS_YOU_GO
430
431
  #puts 'd'
431
432
  units = n.to_i * h[:credits].to_i
432
433
  unit_price = h[:fee].to_f / h[: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.27
4
+ version: 1.1.29
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-09-21 00:00:00.000000000 Z
11
+ date: 2020-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket