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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47cf36089c143696101199550d31fdd5aea383384e76598293aed62a9ae0a899
4
- data.tar.gz: bd4592f80dc44dda3e1387754a8f1bdd95694b9cb06b65dde585cfe0284da6e4
3
+ metadata.gz: a6f2cdcb923998c4fc08e11bd9efeb320e349187e657ab7b29ff79c325447510
4
+ data.tar.gz: 951a8528fb40feebb2ed689649b86cce1b25623a51fab780c0c6f994bfa8ffee
5
5
  SHA512:
6
- metadata.gz: 7e8b3e3029633dd32d0aa58ff50d9cf7a3bbacc473d6d6b5e56095ae4bdefb3efc571382ab52f8064b5fda8589da1192becb5edd054ee688eec6545ac9538dd7
7
- data.tar.gz: 86e6069ff804c2490e7eb0adc934be78236828c83ea45a862e9a7e1dabc531042083dbf03fcac24a3c1054aa8fdc759ddc894e5d7309dff90d5eb69d9d965f59
6
+ metadata.gz: 1bbc5ff04f7a5ee0196495e00c8a31077dc0a2ad1439953ff6c5c7971d2bb256ad03321261c187a8364c96ddfe6db0983104b07f10266ada86ad24699c09dab2
7
+ data.tar.gz: 6d8158a6e81466d7d6017e4d017a948a898dfed6ed96880ff5b6be19cc4496890bd585da757d800dd921287e4334889d942d67390f7d020ebbefda9e2c69cbc8
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ACH
2
- VERSION = '0.5.15'.freeze
2
+ VERSION = '0.5.16'.freeze
3
3
  end
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.15
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-07-02 00:00:00.000000000 Z
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
- rubyforge_project:
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