invoicing_payments_processing 1.1.15 → 1.1.16

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: f7e4d7194c2ac3594193e231417821a28b0daa0c
4
- data.tar.gz: 8cc60962a9ef7fc84ad96465544970d3e7e571ba
3
+ metadata.gz: d5cafb07fe19bdb27a26ac16c923fef00bcccbcb
4
+ data.tar.gz: 5783e53592afe0d64c66fe1f3318b4720adb3b88
5
5
  SHA512:
6
- metadata.gz: ab7b6a9840757feec565f44f1de5d8d84be2c0d295debfe16f19c6b6013dd41c64eca89f4709f76f415dd25790e537e2420ee50a78217f15b4e3d57b7cbdffd2
7
- data.tar.gz: c5c6a98c57439ebda830e94e5e1b44080b4a9998f44b66c3c6ccc6bae63e6fcf7f57e5ab692d3e7d462eb94ad4d9969be9713fa0660afbf903a38594d1003def
6
+ metadata.gz: 361eff4012d019b0e815febf653fc8c477207f291005648ca575c2e23a821fdd909ddc39cd44c467db7edda2218fb237acda98b6596599ca2195349da2d38be9
7
+ data.tar.gz: 25b95340499226f9fa6d46d7cf7b3e64f2a577a6d5427274fd1f557038213ba3d80a05444264ec7941f0641b8cada48354b21f945eaae1922001efc15c180177
@@ -110,6 +110,15 @@ module BlackStack
110
110
  o.amount = x
111
111
  o.profits_amount = -x
112
112
  o.save
113
+
114
+ # if there is negative credits
115
+ total_credits = 0.to_f - BlackStack::Balance.new(self.id, product_code).credits.to_f
116
+ total_amount = 0.to_f - BlackStack::Balance.new(self.id, product_code).amount.to_f
117
+ sleep(2) # delay to ensure the time of the bonus movement will be later than the time of the consumption movement
118
+ if total_credits < 0
119
+ self.adjustment(product_code, total_amount, total_credits, 'Adjustment Because Quota Has Been Exceeded.')
120
+ end
121
+
113
122
  end
114
123
  amount_paid += 0.to_f - o.amount.to_f
115
124
  credits_paid += 0.to_i - o.credits.to_i
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.15
4
+ version: 1.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi