ach 0.5.15 → 0.5.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ach/batch.rb +10 -0
- data/lib/ach/records/entry_detail.rb +10 -0
- data/lib/ach/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6f2cdcb923998c4fc08e11bd9efeb320e349187e657ab7b29ff79c325447510
|
4
|
+
data.tar.gz: 951a8528fb40feebb2ed689649b86cce1b25623a51fab780c0c6f994bfa8ffee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bbc5ff04f7a5ee0196495e00c8a31077dc0a2ad1439953ff6c5c7971d2bb256ad03321261c187a8364c96ddfe6db0983104b07f10266ada86ad24699c09dab2
|
7
|
+
data.tar.gz: 6d8158a6e81466d7d6017e4d017a948a898dfed6ed96880ff5b6be19cc4496890bd585da757d800dd921287e4334889d942d67390f7d020ebbefda9e2c69cbc8
|
data/lib/ach/batch.rb
CHANGED
@@ -51,8 +51,18 @@ module ACH
|
|
51
51
|
@control.company_identification = @header.company_identification
|
52
52
|
@control.originating_dfi_identification = @header.originating_dfi_identification
|
53
53
|
@control.batch_number = @header.batch_number
|
54
|
+
if last_entry.is_a? ACH::BalancingEntryDetail
|
55
|
+
@control.credit_total = last_entry.amount
|
56
|
+
@control.debit_total = last_entry.amount
|
57
|
+
end
|
54
58
|
|
55
59
|
[@header] + @entries + @addendas + [@control]
|
56
60
|
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def last_entry
|
65
|
+
@last_entry ||= @entries.last
|
66
|
+
end
|
57
67
|
end
|
58
68
|
end
|
@@ -85,4 +85,14 @@ module ACH::Records
|
|
85
85
|
nil, nil, /\A\d{8}\z/
|
86
86
|
field :trace_number, Integer, lambda { |f| sprintf('%07d', f)}
|
87
87
|
end
|
88
|
+
|
89
|
+
class BalancingEntryDetail < EntryDetail
|
90
|
+
@fields = EntryDetail.fields.slice(0, 5)
|
91
|
+
const_field :individual_id_number, (' ' * 15)
|
92
|
+
field :account_description, String, lambda { |f| left_justify(f, 22)}
|
93
|
+
field :discretionary_data, String, lambda { |f| left_justify(f, 2)}, ' '
|
94
|
+
field :addenda_record_indicator, Integer, lambda { |f| sprintf('%01d', f)}, 0
|
95
|
+
field :origin_routing_number, String, lambda { |f| sprintf('%08d', f.to_i) }
|
96
|
+
field :trace_number, Integer, lambda { |f| sprintf('%07d', f)}
|
97
|
+
end
|
88
98
|
end
|
data/lib/ach/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ach
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Morgan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: appraisal
|
@@ -125,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
|
129
|
-
rubygems_version: 2.7.6
|
128
|
+
rubygems_version: 3.0.3
|
130
129
|
signing_key:
|
131
130
|
specification_version: 4
|
132
131
|
summary: Helper for building ACH files
|