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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e99d9449019c41677d5240d9a75a4168b7bb07a
4
- data.tar.gz: 196f3334037f74d2e7bacd0840e494836e36ab75
3
+ metadata.gz: f3f824917a87ee4d35bcc8033c4cf6697d9aaef5
4
+ data.tar.gz: d07e483979caf36ea1b09a7c947dbd56eca8f8be
5
5
  SHA512:
6
- metadata.gz: 55f30ded4f49409106d514b75857d27e4495ac5db0397372c14be7c7aeccec2f27c0e495d37674b83d938c05879439cb3ab948d496ac129bdb281e4d109da970
7
- data.tar.gz: 71328dd57a681c5d2aa9e9fd4b43e5c83fef1d35e43f5e03d27491700b7e2da19104d7275b6f12061a70addbe863248281fb0f6e57e11c7a9636b5b2512fca34
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
@@ -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,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 typeName()
19
- if (self.type==MOVEMENT_TYPE_ADD_PAYMENT)
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 (self.type==MOVEMENT_TYPE_ADD_BONUS)
34
+ elsif (t==MOVEMENT_TYPE_ADD_BONUS)
22
35
  return "Bonus"
23
- elsif (self.type==MOVEMENT_TYPE_REASSIGN_BALANCE)
36
+ elsif (t==MOVEMENT_TYPE_REASSIGN_BALANCE)
24
37
  return "Reassignation"
25
- elsif (self.type==MOVEMENT_TYPE_REFUND_BALANCE)
38
+ elsif (t==MOVEMENT_TYPE_REFUND_BALANCE)
26
39
  return "Refund"
27
- elsif (self.type==MOVEMENT_TYPE_CANCELATION)
28
- return "Service"
29
- elsif (self.type==MOVEMENT_TYPE_EXPIRATION)
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 (self.type==MOVEMENT_TYPE_ADD_PAYMENT)
56
+ def self.typeColorName(t)
57
+ if (t==MOVEMENT_TYPE_ADD_PAYMENT)
36
58
  return "green"
37
- elsif (self.type==MOVEMENT_TYPE_ADD_BONUS)
59
+ elsif (t==MOVEMENT_TYPE_ADD_BONUS)
38
60
  return "orange"
39
- elsif (self.type==MOVEMENT_TYPE_REASSIGN_BALANCE)
61
+ elsif (t==MOVEMENT_TYPE_REASSIGN_BALANCE)
40
62
  return "black"
41
- elsif (self.type==MOVEMENT_TYPE_REFUND_BALANCE)
63
+ elsif (t==MOVEMENT_TYPE_REFUND_BALANCE)
42
64
  return "red"
43
- elsif (self.type==MOVEMENT_TYPE_CANCELATION)
65
+ elsif (t==MOVEMENT_TYPE_CANCELATION)
44
66
  return "blue"
45
- elsif (self.type==MOVEMENT_TYPE_EXPIRATION)
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)
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.42
4
+ version: 1.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi