erp_invoicing 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  class PaymentApplication < ActiveRecord::Base
2
2
 
3
- belongs_to :financial_txn, :dependent => :destroy
3
+ belongs_to :financial_txn
4
4
  belongs_to :payment_applied_to, :polymorphic => true
5
5
  belongs_to :money, :foreign_key => 'applied_money_amount_id', :dependent => :destroy
6
6
 
@@ -25,12 +25,14 @@ class PaymentApplication < ActiveRecord::Base
25
25
  def unapply_payment
26
26
  #check the calculate balance strategy, if it includes payments then do nothing
27
27
  #if it doesn't include payments then update the balance on the model
28
- unless self.payment_applied_to.calculate_balance_strategy_type.nil?
29
- unless self.payment_applied_to.calculate_balance_strategy_type.iid =~ /payment/
28
+ if self.payment_applied_to.respond_to? :calculate_balance_strategy_type
29
+ if !self.payment_applied_to.calculate_balance_strategy_type.nil?
30
+ if self.payment_applied_to.calculate_balance_strategy_type.iid !=~ /payment/ and !self.is_pending?
31
+ update_applied_to_balance(:credit)
32
+ end
33
+ elsif !self.is_pending?
30
34
  update_applied_to_balance(:credit)
31
35
  end
32
- else
33
- update_applied_to_balance(:credit)
34
36
  end
35
37
  end
36
38
 
@@ -2,7 +2,7 @@ module ErpInvoicing
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_invoicing
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-05 00:00:00.000000000 Z
12
+ date: 2012-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erp_inventory
16
- requirement: &2152724880 !ruby/object:Gem::Requirement
16
+ requirement: &70249999417200 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152724880
24
+ version_requirements: *70249999417200
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: erp_work_effort
27
- requirement: &2152723880 !ruby/object:Gem::Requirement
27
+ requirement: &70249999412520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152723880
35
+ version_requirements: *70249999412520
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: erp_commerce
38
- requirement: &2152722720 !ruby/object:Gem::Requirement
38
+ requirement: &70249999424560 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '3.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2152722720
46
+ version_requirements: *70249999424560
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: erp_dev_svcs
49
- requirement: &2152721260 !ruby/object:Gem::Requirement
49
+ requirement: &70249999420280 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '3.0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2152721260
57
+ version_requirements: *70249999420280
58
58
  description: ErpInvoicing adds models and services to the CompassAE core to handle
59
59
  invoicing and billing functions. It includes extensions to the core ERP classes
60
60
  for accounts and things that are 'billable' (products, work efforts), and additional
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  version: '0'
180
180
  requirements: []
181
181
  rubyforge_project:
182
- rubygems_version: 1.8.15
182
+ rubygems_version: 1.8.11
183
183
  signing_key:
184
184
  specification_version: 3
185
185
  summary: ErpInvoicing adds models and services to the CompassAE core to handle invoicing