cnab240 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,6 +25,14 @@ module Cnab240
25
25
 
26
26
  end
27
27
 
28
+ def add_lote(campos = {})
29
+ @arquivo.lotes << lote = Cnab240::Lote.new(:operacao => :pagamento, :tipo => :remessa, :versao => 'V80')
30
+
31
+ campos[:servico_operacao] ||= 'C'
32
+ campos[:controle_lote] ||= '0001'
33
+
34
+ fill campos, lote.header
35
+ end
28
36
 
29
37
  def <<(campos)
30
38
  lote = @arquivo.lotes.last
@@ -32,11 +40,6 @@ module Cnab240
32
40
  campos[:controle_banco] ||= '341'
33
41
  campos[:controle_lote] ||= @arquivo.lotes.length.to_s
34
42
  campos[:servico_numero_registro] ||= (lote.segmentos.length+1).to_s
35
- puts "lote #{campos[:servico_numero_registro]}"
36
- puts "lote #{campos[:servico_numero_registro]}"
37
- puts "lote #{campos[:servico_numero_registro]}"
38
- puts "lote #{campos[:servico_numero_registro]}"
39
- puts "lote #{campos[:servico_numero_registro]}"
40
43
  campos[:servico_tipo_movimento] ||= '000'
41
44
  campos[:credito_moeda_tipo] ||= 'REA'
42
45
  campos[:totais_qtde_registros] ||= (lote.segmentos.length + 2).to_s
@@ -1,4 +1,4 @@
1
1
  module Cnab240
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
4
4
 
@@ -52,6 +52,24 @@ describe PagamentoItau do
52
52
  :credito_valor_pagamento => '100'
53
53
  }
54
54
 
55
+
56
+ pagamento.add_lote({ :servico_tipo => '98', # pagamentos - diversos
57
+ :servico_forma => '03' # doc, ted, et
58
+ })
59
+
60
+ pagamento << { :favorecido_banco => '001',
61
+ :favorecido_agencia => '2290',
62
+ :favorecido_conta => '335959',
63
+ :credito_seu_numero => '1234',
64
+ :credito_data_pagamento => '31122012',
65
+ :credito_valor_pagamento => '100',
66
+ :numero_inscricao => '12312312312312',
67
+ :favorecido_nome => 'EMPRESA X',
68
+ :credito_seu_numero => '1234',
69
+ :credito_data_pagamento => '30122012',
70
+ :credito_valor_pagamento => '100'
71
+ }
72
+
55
73
 
56
74
  pagamento.arquivo.header.banco_nome.strip.should eq 'BANCO ITAU'
57
75
 
metadata CHANGED
@@ -1,61 +1,55 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cnab240
3
- version: !ruby/object:Gem::Version
4
- hash: 7
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.13
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 12
10
- version: 0.0.12
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Eduardo Mourao
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-09-10 00:00:00 -04:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 0
30
- version: "0"
31
- requirement: *id001
32
- prerelease: false
12
+ date: 2012-11-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
33
15
  name: rspec
34
- type: :development
35
- - !ruby/object:Gem::Dependency
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
37
17
  none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- hash: 3
42
- segments:
43
- - 0
44
- version: "0"
45
- requirement: *id002
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
46
23
  prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
47
31
  name: bindata
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
48
38
  type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
49
46
  description: Formato CNAB 240.
50
- email:
47
+ email:
51
48
  - eduardo.a20@gmail.com
52
49
  executables: []
53
-
54
50
  extensions: []
55
-
56
51
  extra_rdoc_files: []
57
-
58
- files:
52
+ files:
59
53
  - .gitignore
60
54
  - .rspec
61
55
  - .travis.yml
@@ -166,41 +160,37 @@ files:
166
160
  - spec/segmentos/v86/segmento_z_spec.rb
167
161
  - spec/spec_helper.rb
168
162
  - spec/tmp/.gitkeep
169
- has_rdoc: true
170
- homepage: ""
163
+ homepage: ''
171
164
  licenses: []
172
-
173
165
  post_install_message:
174
166
  rdoc_options: []
175
-
176
- require_paths:
167
+ require_paths:
177
168
  - lib
178
- required_ruby_version: !ruby/object:Gem::Requirement
169
+ required_ruby_version: !ruby/object:Gem::Requirement
179
170
  none: false
180
- requirements:
181
- - - ">="
182
- - !ruby/object:Gem::Version
183
- hash: 3
184
- segments:
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ segments:
185
176
  - 0
186
- version: "0"
187
- required_rubygems_version: !ruby/object:Gem::Requirement
177
+ hash: 2879206540769969001
178
+ required_rubygems_version: !ruby/object:Gem::Requirement
188
179
  none: false
189
- requirements:
190
- - - ">="
191
- - !ruby/object:Gem::Version
192
- hash: 3
193
- segments:
180
+ requirements:
181
+ - - ! '>='
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ segments:
194
185
  - 0
195
- version: "0"
186
+ hash: 2879206540769969001
196
187
  requirements: []
197
-
198
188
  rubyforge_project: cnab240
199
- rubygems_version: 1.5.3
189
+ rubygems_version: 1.8.24
200
190
  signing_key:
201
191
  specification_version: 3
202
192
  summary: Formato CNAB 240.
203
- test_files:
193
+ test_files:
204
194
  - spec/arquivo/arquivo_spec.rb
205
195
  - spec/arquivo/v40/header_spec.rb
206
196
  - spec/arquivo/v40/trailer_spec.rb