invoicing_payments_processing 1.1.41 → 1.1.46
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 +4 -4
- data/lib/invoice.rb +2 -2
- data/lib/movement.rb +33 -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: 47ac3657106765a3007b2e0c911f2d6a5cd18ce5
|
4
|
+
data.tar.gz: c1bc83fe3b6f7d73131bf19927fa99f8087b9768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf3dbb3323b05a383925f958f20a6402ed4f5ccc17de7d96ffccdac5066149f92a26c6da1357d7769dcadf87a0f1d56f1aad04b3e3664155f68b378e6bc76f08
|
7
|
+
data.tar.gz: cc0474ff9ac7f199036f20161a781a092396dc1deccfadba46f8b181073a9be3f5b1bcfb534a3e7d82442c78352bf403a37b5e5616d726cbbc4efad30d4d3beb
|
@@ -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
|
@@ -302,7 +302,7 @@ puts "params2:#{params.to_s}:."
|
|
302
302
|
|
303
303
|
# marco la factura como pagada
|
304
304
|
# registro contable - bookkeeping
|
305
|
-
i.
|
305
|
+
i.getPaid(b.create_time) if i.canBePaid?
|
306
306
|
|
307
307
|
# crea una factura para el periodo siguiente (dia, semana, mes, anio)
|
308
308
|
j = BlackStack::Invoice.new()
|
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,55 @@ 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 typeName()
|
19
|
-
if (
|
18
|
+
def self.typeName(t)
|
19
|
+
if (t==MOVEMENT_TYPE_ADD_PAYMENT)
|
20
20
|
return "Payment"
|
21
|
-
elsif (
|
21
|
+
elsif (t==MOVEMENT_TYPE_ADD_BONUS)
|
22
22
|
return "Bonus"
|
23
|
-
elsif (
|
23
|
+
elsif (t==MOVEMENT_TYPE_REASSIGN_BALANCE)
|
24
24
|
return "Reassignation"
|
25
|
-
elsif (
|
25
|
+
elsif (t==MOVEMENT_TYPE_REFUND_BALANCE)
|
26
26
|
return "Refund"
|
27
|
-
elsif (
|
28
|
-
return "
|
29
|
-
elsif (
|
27
|
+
elsif (t==MOVEMENT_TYPE_CANCELATION)
|
28
|
+
return "Consumption"
|
29
|
+
elsif (t==MOVEMENT_TYPE_EXPIRATION)
|
30
30
|
return "Expiration"
|
31
|
+
elsif (t==MOVEMENT_TYPE_ADJUSTMENT)
|
32
|
+
return "Adjustement"
|
33
|
+
elsif (t==MOVEMENT_TYPE_REFUND_ADJUSTMENT)
|
34
|
+
return "Adjustement"
|
31
35
|
end
|
36
|
+
'(unknown)'
|
37
|
+
end
|
38
|
+
|
39
|
+
def typeName()
|
40
|
+
BlackStack::Movement::typeName(self.type)
|
32
41
|
end
|
33
42
|
|
34
|
-
def typeColorName()
|
35
|
-
if (
|
43
|
+
def self.typeColorName(t)
|
44
|
+
if (t==MOVEMENT_TYPE_ADD_PAYMENT)
|
36
45
|
return "green"
|
37
|
-
elsif (
|
46
|
+
elsif (t==MOVEMENT_TYPE_ADD_BONUS)
|
38
47
|
return "orange"
|
39
|
-
elsif (
|
48
|
+
elsif (t==MOVEMENT_TYPE_REASSIGN_BALANCE)
|
40
49
|
return "black"
|
41
|
-
elsif (
|
50
|
+
elsif (t==MOVEMENT_TYPE_REFUND_BALANCE)
|
42
51
|
return "red"
|
43
|
-
elsif (
|
52
|
+
elsif (t==MOVEMENT_TYPE_CANCELATION)
|
44
53
|
return "blue"
|
45
|
-
elsif (
|
54
|
+
elsif (t==MOVEMENT_TYPE_EXPIRATION)
|
46
55
|
return "blue"
|
56
|
+
elsif (t==MOVEMENT_TYPE_ADJUSTMENT)
|
57
|
+
return "green"
|
58
|
+
elsif (t==MOVEMENT_TYPE_REFUND_ADJUSTMENT)
|
59
|
+
return "green"
|
47
60
|
end
|
48
61
|
end
|
49
|
-
|
62
|
+
|
63
|
+
def typeName()
|
64
|
+
BlackStack::Movement::typeColorName(self.type)
|
65
|
+
end
|
66
|
+
|
50
67
|
# actualiza el registro con los valores del item de una factura
|
51
68
|
# type may be either MOVEMENT_TYPE_ADD_PAYMENT or MOVEMENT_TYPE_ADD_BONUS or MOVEMENT_TYPE_REFUND_BALANCE, but not other value
|
52
69
|
def parse(item, type=MOVEMENT_TYPE_ADD_PAYMENT, description='n/a', payment_time=nil, id_item=nil)
|