invoicing_payments_processing 1.1.15 → 1.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/extend_client_by_invoicing_payments_processing.rb +9 -0
- 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: d5cafb07fe19bdb27a26ac16c923fef00bcccbcb
|
4
|
+
data.tar.gz: 5783e53592afe0d64c66fe1f3318b4720adb3b88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|