invoicing_payments_processing 1.1.33 → 1.1.34

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 +21 -12
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5243e3335e6493c1a4ce19769c46730729576904
4
- data.tar.gz: 068bb5e32c323da931510da9c205606a8778e645
3
+ metadata.gz: 3f6d8cf264ed1fc60388ab5c360b3cfbb8fb9bbb
4
+ data.tar.gz: 7809b0efc41be10f4db464c4a37860abd6ebba02
5
5
  SHA512:
6
- metadata.gz: 5310182c911009e0e22aae4f5ceaacce08472298b9c4126953ba0831850a60cb161b6979b85d29e890b8da028620b71b657a2abbaf6e4656b901f85d8208f2a3
7
- data.tar.gz: 2b86a7c418f70faa014d76e3025423b680c011eed88bb29c0176c1e0402fe67b647d83c5cdd20a77ee0a2e9a493ec48690da965c35c543eddd854af4bc26a572
6
+ metadata.gz: ed2466965d78a825e7f4d991f62a8a57a61775d59f6fffc2dc0bffe53204312e676059607668463a6b6a558a52c68b4a3859e49587ea1c343ee8f41943d5323c
7
+ data.tar.gz: ba1ef476b3106b96f6957c02e85421f719dc1b224fae248d144b1f282841e3c5fe5a05534c9aece1ac84fcba7ab7613b662cd31811e497ff77ae7b840bab130c
@@ -420,25 +420,34 @@ module BlackStack
420
420
  # le seteo la fecha de hoy
421
421
  self.billing_period_from = now()
422
422
  #puts
423
- #puts
423
+ #puts
424
+ # si el plan tiene un segundo trial, y
425
+ # es la primer factura, entonces:
426
+ # => se trata del segundo pago por segundo trial
427
+ if h[:trial2_fee] != nil && prev1.nil?
428
+ #puts 'b'
429
+ units = h[:trial2_credits].to_i
430
+ unit_price = h[:trial2_fee].to_f / h[:trial2_credits].to_f
431
+ 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
432
+
433
+ # si el plan tiene un segundo trial, y
434
+ # es la segunda factura, entonces:
435
+ # => se trata del segundo pago por segundo trial
436
+ if h[:trial2_fee] != nil && !prev1.nil? && prev2.nil?
437
+ #puts 'b'
438
+ units = h[:trial_credits].to_i
439
+ unit_price = h[:trial_fee].to_f / h[:trial_credits].to_f
440
+ billing_period_to = DB["SELECT DATEADD(#{h[:trial_period].to_s}, +#{h[:trial_units].to_s}, '#{self.billing_period_from.to_s}') AS [now]"].map(:now)[0].to_s
441
+
424
442
  # si el plan tiene un primer trial, y
425
443
  # es la primer factura, entonces:
426
444
  # => se trata del primer pago por trial
427
- if h[:trial_fee] != nil && prev1.nil? && !self.disabled_for_trial_ssm
445
+ elsif h[:trial_fee] != nil && prev1.nil? && !self.disabled_for_trial_ssm
428
446
  #puts 'a'
429
447
  units = h[:trial_credits].to_i
430
448
  unit_price = h[:trial_fee].to_f / h[:trial_credits].to_f
431
449
  billing_period_to = DB["SELECT DATEADD(#{h[:trial_period].to_s}, +#{h[:trial_units].to_s}, '#{self.billing_period_from.to_s}') AS [now]"].map(:now)[0].to_s
432
-
433
- # si el plan tiene un segundo trial, y
434
- # es la segunda factura, entonces:
435
- # => se trata del segundo pago por segundo trial
436
- elsif h[:trial2_fee] != nil && !prev1.nil? && prev2.nil?
437
- #puts 'b'
438
- units = h[:trial2_credits].to_i
439
- unit_price = h[:trial2_fee].to_f / h[:trial2_credits].to_f
440
- 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
441
-
450
+
442
451
  # si el plan tiene un fee, y
443
452
  elsif h[:fee].to_f != nil && h[:type] == BlackStack::InvoicingPaymentsProcessing::BasePlan::PAYMENT_SUBSCRIPTION
444
453
  #puts 'c'
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.33
4
+ version: 1.1.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi