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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b262508f5bb5461883af0c385256bc6011ed4aa
4
- data.tar.gz: f57520e8d02e50ecdd5638d5392680223bb0e77c
3
+ metadata.gz: 47ac3657106765a3007b2e0c911f2d6a5cd18ce5
4
+ data.tar.gz: c1bc83fe3b6f7d73131bf19927fa99f8087b9768
5
5
  SHA512:
6
- metadata.gz: be69442d3cb147180d5a373f3bf1a71e81221de43957440df516751e954a1cdcd859da86685b8e76ab95fada8f63cd43044fec24dbc469b0c2daf33c866353b4
7
- data.tar.gz: 9c6ee401ce0094ba5c08f8476a65e10f3720ac0350dcf43cd627f78e0b326897b2cd9c8c8d1d3f283e0a0ce81c9e3f89edc5199467f5e04ca92982a86f9b6802
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.getPaidb.create_time) if i.canBePaid?
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()
@@ -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 += diff
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
@@ -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 (self.type==MOVEMENT_TYPE_ADD_PAYMENT)
18
+ def self.typeName(t)
19
+ if (t==MOVEMENT_TYPE_ADD_PAYMENT)
20
20
  return "Payment"
21
- elsif (self.type==MOVEMENT_TYPE_ADD_BONUS)
21
+ elsif (t==MOVEMENT_TYPE_ADD_BONUS)
22
22
  return "Bonus"
23
- elsif (self.type==MOVEMENT_TYPE_REASSIGN_BALANCE)
23
+ elsif (t==MOVEMENT_TYPE_REASSIGN_BALANCE)
24
24
  return "Reassignation"
25
- elsif (self.type==MOVEMENT_TYPE_REFUND_BALANCE)
25
+ elsif (t==MOVEMENT_TYPE_REFUND_BALANCE)
26
26
  return "Refund"
27
- elsif (self.type==MOVEMENT_TYPE_CANCELATION)
28
- return "Service"
29
- elsif (self.type==MOVEMENT_TYPE_EXPIRATION)
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 (self.type==MOVEMENT_TYPE_ADD_PAYMENT)
43
+ def self.typeColorName(t)
44
+ if (t==MOVEMENT_TYPE_ADD_PAYMENT)
36
45
  return "green"
37
- elsif (self.type==MOVEMENT_TYPE_ADD_BONUS)
46
+ elsif (t==MOVEMENT_TYPE_ADD_BONUS)
38
47
  return "orange"
39
- elsif (self.type==MOVEMENT_TYPE_REASSIGN_BALANCE)
48
+ elsif (t==MOVEMENT_TYPE_REASSIGN_BALANCE)
40
49
  return "black"
41
- elsif (self.type==MOVEMENT_TYPE_REFUND_BALANCE)
50
+ elsif (t==MOVEMENT_TYPE_REFUND_BALANCE)
42
51
  return "red"
43
- elsif (self.type==MOVEMENT_TYPE_CANCELATION)
52
+ elsif (t==MOVEMENT_TYPE_CANCELATION)
44
53
  return "blue"
45
- elsif (self.type==MOVEMENT_TYPE_EXPIRATION)
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)
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.41
4
+ version: 1.1.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi