invoicing_payments_processing 1.1.42 → 1.1.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bufferpaypalnotification.rb +3 -3
- data/lib/invoice.rb +2 -2
- data/lib/movement.rb +46 -16
- 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: f3f824917a87ee4d35bcc8033c4cf6697d9aaef5
|
4
|
+
data.tar.gz: d07e483979caf36ea1b09a7c947dbd56eca8f8be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aca60368b308f9f06cc8b5ca4e72f257db428b709652f8112cc404a07609b7bb07e704ce02caf66b1ba29659dab19616d32e80648338d0ffa45e85400ace6777
|
7
|
+
data.tar.gz: 7a281e9f26c5111adae3c82ed3424a82e2d6b8287e409ec1d2809fadb219ab58c2d888eaf0ef7925595f4167e2c283a43c8f25255986dc82ae9348c0bcbf4f46
|
@@ -236,9 +236,9 @@ module BlackStack
|
|
236
236
|
def self.process(params)
|
237
237
|
DB.transaction do
|
238
238
|
# verifico que no existe ya una notificacion
|
239
|
-
puts
|
240
|
-
puts
|
241
|
-
puts "params2:#{params.to_s}:."
|
239
|
+
#puts
|
240
|
+
#puts
|
241
|
+
#puts "params2:#{params.to_s}:."
|
242
242
|
b = BlackStack::BufferPayPalNotification.where(:id=>params['id']).first
|
243
243
|
if b.nil?
|
244
244
|
# proceso la notificacion
|
data/lib/invoice.rb
CHANGED
@@ -316,9 +316,9 @@ module BlackStack
|
|
316
316
|
self.status = BlackStack::Invoice::STATUS_PAID
|
317
317
|
self.delete_time = nil
|
318
318
|
if self.previous.nil? # si es la primer factura de una suscripcion, o no es una suscripcion
|
319
|
-
diff = payment_time - self.billing_period_from
|
319
|
+
diff = payment_time.to_time - self.billing_period_from.to_time
|
320
320
|
self.billing_period_from = payment_time
|
321
|
-
self.billing_period_to
|
321
|
+
self.billing_period_to = self.billing_period_to.to_time + diff
|
322
322
|
end
|
323
323
|
self.save
|
324
324
|
# expiracion de creditos de la factura anterior
|
data/lib/movement.rb
CHANGED
@@ -15,38 +15,68 @@ module BlackStack
|
|
15
15
|
MOVEMENT_TYPE_ADJUSTMENT = 6 # it can be recalculated
|
16
16
|
MOVEMENT_TYPE_REFUND_ADJUSTMENT = 7 # it cannot be recalculated
|
17
17
|
|
18
|
-
def
|
19
|
-
|
18
|
+
def self.types()
|
19
|
+
[
|
20
|
+
MOVEMENT_TYPE_ADD_PAYMENT,
|
21
|
+
MOVEMENT_TYPE_ADD_BONUS,
|
22
|
+
MOVEMENT_TYPE_REASSIGN_BALANCE,
|
23
|
+
MOVEMENT_TYPE_REFUND_BALANCE,
|
24
|
+
MOVEMENT_TYPE_CANCELATION,
|
25
|
+
MOVEMENT_TYPE_EXPIRATION,
|
26
|
+
MOVEMENT_TYPE_ADJUSTMENT,
|
27
|
+
MOVEMENT_TYPE_REFUND_ADJUSTMENT
|
28
|
+
]
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.typeName(t)
|
32
|
+
if (t==MOVEMENT_TYPE_ADD_PAYMENT)
|
20
33
|
return "Payment"
|
21
|
-
elsif (
|
34
|
+
elsif (t==MOVEMENT_TYPE_ADD_BONUS)
|
22
35
|
return "Bonus"
|
23
|
-
elsif (
|
36
|
+
elsif (t==MOVEMENT_TYPE_REASSIGN_BALANCE)
|
24
37
|
return "Reassignation"
|
25
|
-
elsif (
|
38
|
+
elsif (t==MOVEMENT_TYPE_REFUND_BALANCE)
|
26
39
|
return "Refund"
|
27
|
-
elsif (
|
28
|
-
return "
|
29
|
-
elsif (
|
40
|
+
elsif (t==MOVEMENT_TYPE_CANCELATION)
|
41
|
+
return "Consumption"
|
42
|
+
elsif (t==MOVEMENT_TYPE_EXPIRATION)
|
30
43
|
return "Expiration"
|
44
|
+
elsif (t==MOVEMENT_TYPE_ADJUSTMENT)
|
45
|
+
return "Adjustement"
|
46
|
+
elsif (t==MOVEMENT_TYPE_REFUND_ADJUSTMENT)
|
47
|
+
return "Adjustement"
|
31
48
|
end
|
49
|
+
'(unknown)'
|
50
|
+
end
|
51
|
+
|
52
|
+
def typeName()
|
53
|
+
BlackStack::Movement::typeName(self.type)
|
32
54
|
end
|
33
55
|
|
34
|
-
def typeColorName()
|
35
|
-
if (
|
56
|
+
def self.typeColorName(t)
|
57
|
+
if (t==MOVEMENT_TYPE_ADD_PAYMENT)
|
36
58
|
return "green"
|
37
|
-
elsif (
|
59
|
+
elsif (t==MOVEMENT_TYPE_ADD_BONUS)
|
38
60
|
return "orange"
|
39
|
-
elsif (
|
61
|
+
elsif (t==MOVEMENT_TYPE_REASSIGN_BALANCE)
|
40
62
|
return "black"
|
41
|
-
elsif (
|
63
|
+
elsif (t==MOVEMENT_TYPE_REFUND_BALANCE)
|
42
64
|
return "red"
|
43
|
-
elsif (
|
65
|
+
elsif (t==MOVEMENT_TYPE_CANCELATION)
|
44
66
|
return "blue"
|
45
|
-
elsif (
|
67
|
+
elsif (t==MOVEMENT_TYPE_EXPIRATION)
|
46
68
|
return "blue"
|
69
|
+
elsif (t==MOVEMENT_TYPE_ADJUSTMENT)
|
70
|
+
return "green"
|
71
|
+
elsif (t==MOVEMENT_TYPE_REFUND_ADJUSTMENT)
|
72
|
+
return "green"
|
47
73
|
end
|
48
74
|
end
|
49
|
-
|
75
|
+
|
76
|
+
def typeName()
|
77
|
+
BlackStack::Movement::typeColorName(self.type)
|
78
|
+
end
|
79
|
+
|
50
80
|
# actualiza el registro con los valores del item de una factura
|
51
81
|
# type may be either MOVEMENT_TYPE_ADD_PAYMENT or MOVEMENT_TYPE_ADD_BONUS or MOVEMENT_TYPE_REFUND_BALANCE, but not other value
|
52
82
|
def parse(item, type=MOVEMENT_TYPE_ADD_PAYMENT, description='n/a', payment_time=nil, id_item=nil)
|