invoicing_payments_processing 1.1.34 → 1.1.36
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 +4 -4
- data/lib/invoice.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 965a8f6366881eb0e4bc2bfc47bc1afe2ce09e11
|
|
4
|
+
data.tar.gz: a9b9c23cfed343171d9e815574cb56659e652bf4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 261a8ac7175609664b8580f69259a96e39cc8f495ed448ed6dcc4d8e1ad8e87e7f9f297e1b4ff461b21c0d95ea92a9f958b39199977ff9c73c11a0448a08ae9a
|
|
7
|
+
data.tar.gz: aee9ab4c785dcc5072b008ed1547debd27763a5283b6088dc7013f9f92649cc7856a79cd1be54446e92115dfc333e91e09bc0635e2634172c7143f180e879170
|
data/lib/invoice.rb
CHANGED
|
@@ -211,8 +211,8 @@ module BlackStack
|
|
|
211
211
|
trial2 = allow_trials && plan_descriptor[:trial2_fee]!=nil && plan_descriptor[:trial2_period]!=nil && plan_descriptor[:trial2_units]!=nil
|
|
212
212
|
|
|
213
213
|
values[:a3] = 0
|
|
214
|
-
self.items.each { |i|
|
|
215
|
-
if trial1 && i.units!=i.plan_descriptor[:trial_credits]
|
|
214
|
+
self.items.each { |i|
|
|
215
|
+
if ( !trial2 && trial1 && i.units!=i.plan_descriptor[:trial_credits] ) || ( trial2 && trial1 && i.units!=i.plan_descriptor[:trial2_credits] )
|
|
216
216
|
raise 'Cannot order more than 1 package and trial in the same invoice'
|
|
217
217
|
elsif trial1
|
|
218
218
|
values[:a3] += i.plan_descriptor[:fee].to_f
|
|
@@ -433,7 +433,7 @@ module BlackStack
|
|
|
433
433
|
# si el plan tiene un segundo trial, y
|
|
434
434
|
# es la segunda factura, entonces:
|
|
435
435
|
# => se trata del segundo pago por segundo trial
|
|
436
|
-
|
|
436
|
+
elsif h[:trial2_fee] != nil && !prev1.nil? && prev2.nil?
|
|
437
437
|
#puts 'b'
|
|
438
438
|
units = h[:trial_credits].to_i
|
|
439
439
|
unit_price = h[:trial_fee].to_f / h[:trial_credits].to_f
|