ach 0.3.0 → 0.3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ order and alignment, and adds padding lines to end of file.
12
12
  EOF
13
13
  gem.email = "jmorgan@morgancreative.net"
14
14
  gem.homepage = "http://github.com/jm81/ach"
15
- gem.authors = ["Jared Morgan"]
15
+ gem.authors = ["Jared Morgan", "Josh Puetz"]
16
16
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
17
  end
18
18
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.0.1
@@ -5,10 +5,10 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ach}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Jared Morgan"]
11
+ s.authors = ["Jared Morgan", "Josh Puetz"]
12
12
  s.date = %q{2009-11-29}
13
13
  s.description = %q{ach is a Ruby helper for builder ACH files. In particular, it helps with field
14
14
  order and alignment, and adds padding lines to end of file.
data/lib/ach.rb CHANGED
@@ -3,12 +3,12 @@ module ACH
3
3
  CHECKING_CREDIT = '22'
4
4
  CHECKING_DEBIT = '27'
5
5
  CHECKING_CREDIT_PRENOTE = '23'
6
- CHECKING_DEBIT_PRENOT = '28'
6
+ CHECKING_DEBIT_PRENOTE = '28'
7
7
 
8
8
  SAVING_CREDIT = '32'
9
9
  SAVING_DEBIT = '37'
10
10
  SAVING_CREDIT_PRENOTE = '33'
11
- SAVING_DEBIT_PRENOT = '38'
11
+ SAVING_DEBIT_PRENOTE = '38'
12
12
 
13
13
  # Valid service class codes
14
14
  SERVICE_CLASS_CODES = [
@@ -48,8 +48,14 @@ module ACH
48
48
  batch.entries.each do | entry |
49
49
  lines << left_justify(entry.individual_name + ": ", 25) +
50
50
  sprintf("% 7d.%02d", entry.amount / 100, entry.amount % 100)
51
- end
51
+ end
52
52
  end
53
+ lines << ""
54
+ lines << left_justify("Debit Total: ", 25) +
55
+ sprintf("% 7d.%02d", @control.debit_total / 100, @control.debit_total % 100)
56
+ lines << left_justify("Credit Total: ", 25) +
57
+ sprintf("% 7d.%02d", @control.credit_total / 100, @control.credit_total % 100)
58
+
53
59
  lines.join("\r\n")
54
60
  end
55
61
  end
@@ -1,5 +1,7 @@
1
1
  module ACH::Records
2
2
  class EntryDetail < Record
3
+ CREDIT_RECORD_TRANSACTION_CODE_ENDING_DIGITS = ["0", "1", "2", "3", "4"]
4
+
3
5
  @fields = []
4
6
 
5
7
  attr_accessor :sorter
@@ -21,7 +23,7 @@ module ACH::Records
21
23
  field :trace_number, Integer, lambda { |f| sprintf('%07d', f)}
22
24
 
23
25
  def credit?
24
- @transaction_code[1..1] == '2' || @transaction_code[1..1] == '3'
26
+ CREDIT_RECORD_TRANSACTION_CODE_ENDING_DIGITS.include?(@transaction_code[1..1])
25
27
  end
26
28
 
27
29
  def debit?
metadata CHANGED
@@ -1,10 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ach
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ hash: 85
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 3
9
+ - 0
10
+ - 1
11
+ version: 0.3.0.1
5
12
  platform: ruby
6
13
  authors:
7
14
  - Jared Morgan
15
+ - Josh Puetz
8
16
  autorequire:
9
17
  bindir: bin
10
18
  cert_chain: []
@@ -62,21 +70,27 @@ rdoc_options:
62
70
  require_paths:
63
71
  - lib
64
72
  required_ruby_version: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ">="
67
76
  - !ruby/object:Gem::Version
77
+ hash: 3
78
+ segments:
79
+ - 0
68
80
  version: "0"
69
- version:
70
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
+ none: false
71
83
  requirements:
72
84
  - - ">="
73
85
  - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
88
+ - 0
74
89
  version: "0"
75
- version:
76
90
  requirements: []
77
91
 
78
92
  rubyforge_project:
79
- rubygems_version: 1.3.5
93
+ rubygems_version: 1.6.2
80
94
  signing_key:
81
95
  specification_version: 3
82
96
  summary: Helper for building ACH files in Ruby