cnab240 0.0.7 → 0.0.8
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/README.md +14 -4
- data/docs/vendor/itau/SISPAG_CNAB_240.pdf +0 -0
- data/lib/cnab240/arquivo/builder.rb +36 -2
- data/lib/cnab240/arquivo/estrutura.rb +15 -1
- data/lib/cnab240/arquivo/lote.rb +1 -3
- data/lib/cnab240/arquivo/v80/header.rb +38 -0
- data/lib/cnab240/arquivo/v80/trailer.rb +17 -0
- data/lib/cnab240/ext/filler.rb +8 -0
- data/lib/cnab240/helper/debito_itau.rb +56 -0
- data/lib/cnab240/helper/pagamento_itau.rb +26 -32
- data/lib/cnab240/pagamentos/v80/header.rb +47 -0
- data/lib/cnab240/pagamentos/v80/trailer.rb +17 -0
- data/lib/cnab240/segmentos/v80/segmento_a.rb +45 -0
- data/lib/cnab240/version.rb +1 -1
- data/lib/cnab240.rb +7 -0
- data/spec/arquivo/v80/header_spec.rb +60 -0
- data/spec/arquivo/v80/trailer_spec.rb +26 -0
- data/spec/helper/debito_itau_spec.rb +54 -0
- data/spec/helper/pagamento_itau_spec.rb +30 -22
- data/spec/pagamentos/v80/header_spec.rb +52 -0
- data/spec/pagamentos/v80/lote_spec.rb +24 -0
- data/spec/pagamentos/v80/trailer_spec.rb +28 -0
- data/spec/segmentos/v80/segmento_a_spec.rb +70 -0
- data/spec/segmentos/v86/segmento_a_spec.rb +5 -5
- metadata +74 -63
data/README.md
CHANGED
@@ -7,6 +7,15 @@ Esta é uma implementação do Layout Padrão Febraban 240 posições, e algumas
|
|
7
7
|
|
8
8
|
Os padrões da febraban são fruto de incompêtencia que ultrapassa os limites do patético. Espero que essa implementação lhe poupe algumas horas de sofrimento.
|
9
9
|
|
10
|
+
Cada banco tem uma visão particular sobre o padrão, os bancos:
|
11
|
+
|
12
|
+
- Subdividem os campos em outros menores;
|
13
|
+
- Trocam o nome e utilidade de campos;
|
14
|
+
|
15
|
+
Tudo isso para que eu sumisse do Rio de Janeiro e não fizesse a descoberta de seu King Size.
|
16
|
+
|
17
|
+
Dê um git clone no master do repositório para que voce tenha acesso aos modelos (sem RDoc ainda).
|
18
|
+
|
10
19
|
|
11
20
|
Adicionar mais implementações é simples. Leia os testes. Aos poucos vou adicionando alguma documentação.
|
12
21
|
|
@@ -17,6 +26,7 @@ Somente pagamentos. Veja pasta docs/
|
|
17
26
|
|
18
27
|
- Layout Padrão FEBRABAN 240 posições V8.6
|
19
28
|
- Layout FEBRABAN 240 posições V4.0 (Itaú - SISDEB)
|
29
|
+
- Layout FEBRABAN 240 posições V8.0 (Itaú - SISPAG)
|
20
30
|
|
21
31
|
|
22
32
|
## Instalação
|
@@ -35,7 +45,7 @@ Ou adicione no seu chiqueiro:
|
|
35
45
|
|
36
46
|
## Como usar
|
37
47
|
|
38
|
-
Por enquanto sem muita documentação (veja os testes).
|
48
|
+
Por enquanto sem muita documentação (veja os testes). Você vai precisar ler os documentos da pasta docs para se situar, são muitos campos com nomes bem parecidos. Utilize a documentação dos bancos/febraban como referência.
|
39
49
|
|
40
50
|
|
41
51
|
Em algum lugar voce pode criar um arquivo de inicialização (não é obrigatório):
|
@@ -81,7 +91,7 @@ Ler do arquivo:
|
|
81
91
|
Voce pode usar os helpers que vao preencher os campos automaticamente, se possivel:
|
82
92
|
|
83
93
|
```ruby
|
84
|
-
|
94
|
+
debito = DebitoItau.new({
|
85
95
|
# header de arquivo
|
86
96
|
:empresa_tipo => '1',
|
87
97
|
:empresa_convenio => '1234',
|
@@ -94,7 +104,7 @@ Voce pode usar os helpers que vao preencher os campos automaticamente, se possiv
|
|
94
104
|
:arquivo_sequencia => '1'
|
95
105
|
})
|
96
106
|
|
97
|
-
|
107
|
+
debito.add({
|
98
108
|
# header do lote
|
99
109
|
:empresa_tipo => '2', # tipo empresa creditada
|
100
110
|
:empresa_numero => '999999999999', # cpf cnpj creditado
|
@@ -119,7 +129,7 @@ Voce pode usar os helpers que vao preencher os campos automaticamente, se possiv
|
|
119
129
|
:numero_inscricao => '12345678901234' # cpf ou cnpj do debitado
|
120
130
|
})
|
121
131
|
|
122
|
-
|
132
|
+
debito.save_to_file("spec/tmp/arquivo_itau.test")
|
123
133
|
```
|
124
134
|
|
125
135
|
## Considerações
|
Binary file
|
@@ -68,12 +68,24 @@ module Cnab240
|
|
68
68
|
def find_header_arquivo(line, line_number = -1)
|
69
69
|
arquivos << Cnab240::Arquivo::Arquivo.new
|
70
70
|
case line[RANGE_LAYOUT_ARQUIVO]
|
71
|
+
# when '080'
|
72
|
+
# arquivos.last.versao = 'V80'
|
73
|
+
# arquivos.last.header = Cnab240::V80::Arquivo::Header.read(line)
|
71
74
|
when '085'
|
72
75
|
arquivos.last.versao = 'V86'
|
73
76
|
arquivos.last.header = Cnab240::V86::Arquivo::Header.read(line)
|
74
77
|
when '040'
|
75
78
|
arquivos.last.versao = 'V40'
|
76
79
|
arquivos.last.header = Cnab240::V40::Arquivo::Header.read(line)
|
80
|
+
when '000' # possivelmente V80 do itau
|
81
|
+
if line[14..16] == '080'
|
82
|
+
arquivos.last.versao = 'V80'
|
83
|
+
arquivos.last.header = Cnab240::V80::Arquivo::Header.read(line)
|
84
|
+
else
|
85
|
+
raise "Versao de arquivo nao suportado: #{line[RANGE_LAYOUT_ARQUIVO]} na linha #{line_number}" if Cnab240.fallback == false
|
86
|
+
arquivos.last.versao = 'V86'
|
87
|
+
arquivos.last.header = Cnab240::V86::Arquivo::Header.read(line)
|
88
|
+
end
|
77
89
|
else
|
78
90
|
raise "Versao de arquivo nao suportado: #{line[RANGE_LAYOUT_ARQUIVO]} na linha #{line_number}" if Cnab240.fallback == false
|
79
91
|
arquivos.last.versao = 'V86'
|
@@ -83,13 +95,35 @@ module Cnab240
|
|
83
95
|
|
84
96
|
def find_header_lote(line, line_number = -1)
|
85
97
|
case line[RANGE_HEADER_LOTE]
|
98
|
+
when '030'
|
99
|
+
case arquivos.last.versao
|
100
|
+
when 'V80'
|
101
|
+
arquivos.last.lotes << Cnab240::Lote.new(:operacao => :pagamento, :tipo => :none) do |l|
|
102
|
+
l.header = Cnab240::V80::Pagamentos::Header.read(line)
|
103
|
+
end
|
104
|
+
when 'V40'
|
105
|
+
arquivos.last.lotes << Cnab240::Lote.new(:operacao => :pagamento, :tipo => :none) do |l|
|
106
|
+
l.header = Cnab240::V40::Pagamentos::Header.read(line)
|
107
|
+
end
|
108
|
+
else
|
109
|
+
raise "Header de lote nao suportado para a versao de arquivo."
|
110
|
+
end
|
86
111
|
when '044'
|
87
112
|
arquivos.last.lotes << Cnab240::Lote.new(:operacao => :pagamento, :tipo => :none) do |l|
|
88
113
|
l.header = Cnab240::V86::Pagamentos::Header.read(line)
|
89
114
|
end
|
90
115
|
when '040'
|
91
|
-
arquivos.last.
|
92
|
-
|
116
|
+
case arquivos.last.versao
|
117
|
+
when 'V80'
|
118
|
+
arquivos.last.lotes << Cnab240::Lote.new(:operacao => :pagamento, :tipo => :none) do |l|
|
119
|
+
l.header = Cnab240::V80::Pagamentos::Header.read(line)
|
120
|
+
end
|
121
|
+
when 'V86'
|
122
|
+
arquivos.last.lotes << Cnab240::Lote.new(:operacao => :pagamento_titulo_cobranca, :tipo => :none) do |l|
|
123
|
+
l.header = Cnab240::V86::PagamentosTitulos::Header.read(line)
|
124
|
+
end
|
125
|
+
else
|
126
|
+
raise "Header de lote nao suportado para a versao de arquivo."
|
93
127
|
end
|
94
128
|
when '011'
|
95
129
|
arquivos.last.lotes << Cnab240::Lote.new(:operacao => :pagamento_titulo_tributos, :tipo => :none) do |l|
|
@@ -1,5 +1,18 @@
|
|
1
1
|
module Cnab240
|
2
2
|
|
3
|
+
ESTRUTURA_V80 = {
|
4
|
+
:segmentos_implementados => [:a],
|
5
|
+
:pagamento => {
|
6
|
+
:header => Cnab240::V80::Pagamentos::Header,
|
7
|
+
:trailer => Cnab240::V80::Pagamentos::Trailer,
|
8
|
+
:segmentos => [:a],
|
9
|
+
:a => {
|
10
|
+
:remessa => true,
|
11
|
+
:retorno => true
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
3
16
|
ESTRUTURA_V40 = {
|
4
17
|
:segmentos_implementados => [:a],
|
5
18
|
:pagamento => {
|
@@ -78,7 +91,8 @@ module Cnab240
|
|
78
91
|
|
79
92
|
ESTRUTURA = {
|
80
93
|
'V40' => ESTRUTURA_V40,
|
81
|
-
'
|
94
|
+
'V80' => ESTRUTURA_V80,
|
95
|
+
'V86' => ESTRUTURA_V86
|
82
96
|
}
|
83
97
|
|
84
98
|
end
|
data/lib/cnab240/arquivo/lote.rb
CHANGED
@@ -29,9 +29,7 @@ module Cnab240
|
|
29
29
|
if tipo != :none
|
30
30
|
estrutura[:segmentos].each do |s|
|
31
31
|
raise "Tipo nao suportado: [#{s}][#{tipo}]" if (estrutura[s][tipo].nil?) && tipo != :any
|
32
|
-
if (tipo == :any) || (estrutura[s][tipo] == true)
|
33
|
-
self << s
|
34
|
-
end
|
32
|
+
self << s if (tipo == :any) || (estrutura[s][tipo] == true)
|
35
33
|
end
|
36
34
|
end
|
37
35
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Cnab240::V80::Arquivo
|
2
|
+
class Header < BinData::Record
|
3
|
+
|
4
|
+
include Cnab240::DefaultMixin
|
5
|
+
|
6
|
+
lstring :controle_banco, :length => 3, :pad_byte => '0'
|
7
|
+
lstring :controle_lote, :length => 4, :initial_value => '0000', :pad_byte => '0'
|
8
|
+
lstring :controle_registro, :length => 1, :initial_value => '0', :pad_byte => '0'
|
9
|
+
|
10
|
+
string :brancos_1, :length => 6, :initial_value => ' ', :pad_byte => ' '
|
11
|
+
string :arquivo_layout, :length => 3, :initial_value => '080'
|
12
|
+
|
13
|
+
lstring :empresa_tipo, :length => 1, :pad_byte => '0'
|
14
|
+
lstring :empresa_numero, :length => 14, :pad_byte => '0'
|
15
|
+
|
16
|
+
string :brancos_2, :length => 20, :initial_value => ' ', :pad_byte => ' '
|
17
|
+
|
18
|
+
lstring :empresa_agencia_codigo, :length => 5, :pad_byte => '0'
|
19
|
+
string :brancos_3, :length => 1, :initial_value => ' ', :pad_byte => ' '
|
20
|
+
lstring :empresa_conta_numero, :length => 12, :pad_byte => '0'
|
21
|
+
string :brancos_4, :length => 1, :initial_value => ' ', :pad_byte => ' '
|
22
|
+
string :empresa_agencia_conta_dv, :length => 1, :pad_byte => ' '
|
23
|
+
string :empresa_nome, :length => 30, :pad_byte => ' '
|
24
|
+
string :banco_nome, :length => 30, :pad_byte => ' '
|
25
|
+
string :brancos_5, :length => 10, :initial_value => ' ', :pad_byte => ' '
|
26
|
+
|
27
|
+
lstring :arquivo_codigo, :length => 1, :pad_byte => '0'
|
28
|
+
lstring :arquivo_data_geracao, :length => 8, :pad_byte => '0'
|
29
|
+
lstring :arquivo_hora_geracao,:length => 6, :pad_byte => '0'
|
30
|
+
|
31
|
+
string :brancos_6, :length => 9, :initial_value => ' ', :pad_byte => '0'
|
32
|
+
|
33
|
+
lstring :arquivo_densidade, :length => 5, :pad_byte => '0'
|
34
|
+
|
35
|
+
string :brancos_7, :length => 69, :pad_byte => ' '
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Cnab240::V80::Arquivo
|
2
|
+
class Trailer < BinData::Record
|
3
|
+
|
4
|
+
include Cnab240::DefaultMixin
|
5
|
+
|
6
|
+
string :controle_banco, :length => 3, :pad_byte => '0'
|
7
|
+
string :controle_lote, :length => 4, :initial_value => '9999', :pad_byte => '0'
|
8
|
+
string :controle_registro, :length => 1, :initial_value => '9', :pad_byte => '0'
|
9
|
+
|
10
|
+
string :cnab_g004_1, :length => 9, :pad_byte => ' '
|
11
|
+
|
12
|
+
lstring :totais_qtde_lotes, :length => 6, :pad_byte => '0'
|
13
|
+
lstring :totais_qtde_registros, :length => 6, :pad_byte => '0'
|
14
|
+
|
15
|
+
string :cnab_g004_2, :length => 211, :pad_byte => ' '
|
16
|
+
end
|
17
|
+
end
|
data/lib/cnab240/ext/filler.rb
CHANGED
@@ -0,0 +1,56 @@
|
|
1
|
+
module Cnab240
|
2
|
+
class DebitoItau
|
3
|
+
|
4
|
+
include Cnab240::Filler
|
5
|
+
|
6
|
+
attr_accessor :arquivo
|
7
|
+
|
8
|
+
def initialize(campos = {})
|
9
|
+
@arquivo = Cnab240::Arquivo::Arquivo.new('V40')
|
10
|
+
# header e trailer arquivo
|
11
|
+
campos[:controle_banco] ||= '341'
|
12
|
+
campos[:banco_nome] ||= 'BANCO ITAU'
|
13
|
+
campos[:arquivo_codigo] ||= '1'
|
14
|
+
campos[:arquivo_data_geracao] ||= Time.now.strftime("%d%m%Y")
|
15
|
+
campos[:arquivo_hora_geracao] ||= Time.now.strftime("%H%M")
|
16
|
+
|
17
|
+
fill campos, arquivo.header, arquivo.trailer
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
def add(campos = {})
|
22
|
+
@arquivo.lotes << lote = Cnab240::Lote.new(:operacao => :pagamento, :tipo => :remessa, :versao => 'V40')
|
23
|
+
|
24
|
+
campos[:controle_banco] ||= '341'
|
25
|
+
campos[:servico_operacao] ||= 'D'
|
26
|
+
campos[:servico_tipo] ||= '05'
|
27
|
+
campos[:servico_forma] ||= '50'
|
28
|
+
campos[:servico_codigo_movimento] ||= '000'
|
29
|
+
campos[:servico_numero_registro] ||= '00001'
|
30
|
+
campos[:credito_moeda_tipo] ||= 'REA'
|
31
|
+
campos[:totais_qtde_registros] ||= '000003'
|
32
|
+
|
33
|
+
campos[:controle_lote] ||= @arquivo.lotes.length.to_s
|
34
|
+
|
35
|
+
if campos[:valor]
|
36
|
+
campos[:credito_valor_pagamento] ||= campos[:valor]
|
37
|
+
end
|
38
|
+
|
39
|
+
if campos[:data]
|
40
|
+
campos[:credito_data_pagamento] ||= campos[:data]
|
41
|
+
end
|
42
|
+
|
43
|
+
fill campos, lote.header, lote.trailer, lote.segmento_a
|
44
|
+
end
|
45
|
+
|
46
|
+
def string
|
47
|
+
arquivo.string
|
48
|
+
end
|
49
|
+
|
50
|
+
def save_to_file(filename)
|
51
|
+
arquivo.save_to_file(filename)
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -6,45 +6,39 @@ module Cnab240
|
|
6
6
|
attr_accessor :arquivo
|
7
7
|
|
8
8
|
def initialize(campos = {})
|
9
|
-
@arquivo = Cnab240::Arquivo::Arquivo.new('
|
9
|
+
@arquivo = Cnab240::Arquivo::Arquivo.new('V80')
|
10
10
|
# header e trailer arquivo
|
11
|
-
campos[:controle_banco]
|
12
|
-
campos[:
|
13
|
-
campos[:
|
14
|
-
campos[:arquivo_data_geracao]
|
15
|
-
campos[:arquivo_hora_geracao]
|
11
|
+
campos[:controle_banco] ||= '341'
|
12
|
+
campos[:arquivo_codigo] ||= '1'
|
13
|
+
campos[:banco_nome] ||= 'BANCO ITAU'
|
14
|
+
campos[:arquivo_data_geracao] ||= Time.now.strftime("%d%m%Y")
|
15
|
+
campos[:arquivo_hora_geracao] ||= Time.now.strftime("%H%M")
|
16
16
|
|
17
17
|
fill campos, arquivo.header, arquivo.trailer
|
18
18
|
end
|
19
19
|
|
20
20
|
|
21
21
|
def add(campos = {})
|
22
|
-
@arquivo.lotes << lote = Cnab240::Lote.new(:operacao => :pagamento, :tipo => :remessa, :versao => '
|
23
|
-
|
24
|
-
|
25
|
-
campos[:
|
26
|
-
campos[:
|
27
|
-
|
28
|
-
campos[:
|
29
|
-
campos[:
|
30
|
-
campos[:
|
31
|
-
|
32
|
-
campos[:
|
33
|
-
campos[:
|
34
|
-
|
35
|
-
campos[:
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
if campos[:data]
|
43
|
-
campos[:credito_data_pagamento] = campos[:data]
|
44
|
-
campos[:credito_data_real] = campos[:data]
|
45
|
-
end
|
46
|
-
|
47
|
-
fill campos, lote.header, lote.trailer, lote.segmento_a
|
22
|
+
@arquivo.lotes << lote = Cnab240::Lote.new(:operacao => :pagamento, :tipo => :remessa, :versao => 'V80')
|
23
|
+
|
24
|
+
campos[:header] ||= {}
|
25
|
+
campos[:trailer] ||= {}
|
26
|
+
campos[:segmento_a] ||= {}
|
27
|
+
|
28
|
+
campos[:header][:controle_banco] ||= '341'
|
29
|
+
campos[:header][:servico_operacao] ||= 'C'
|
30
|
+
campos[:header][:controle_lote] ||= @arquivo.lotes.length.to_s
|
31
|
+
|
32
|
+
campos[:segmento_a][:controle_banco] ||= '341'
|
33
|
+
campos[:segmento_a][:controle_lote] ||= @arquivo.lotes.length.to_s
|
34
|
+
campos[:segmento_a][:servico_numero_registro] ||= '1'
|
35
|
+
campos[:segmento_a][:servico_tipo_movimento] ||= '000'
|
36
|
+
campos[:segmento_a][:credito_moeda_tipo] ||= 'REA'
|
37
|
+
campos[:trailer][:totais_qtde_registros] ||= '000003'
|
38
|
+
|
39
|
+
fill! campos[:header], lote.header
|
40
|
+
fill! campos[:segmento_a], lote.segmento_a
|
41
|
+
fill! campos[:trailer], lote.trailer
|
48
42
|
end
|
49
43
|
|
50
44
|
def string
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Cnab240::V80::Pagamentos
|
2
|
+
class Header < BinData::Record
|
3
|
+
|
4
|
+
include Cnab240::DefaultMixin
|
5
|
+
|
6
|
+
lstring :controle_banco, :length => 3, :pad_byte => '0'
|
7
|
+
lstring :controle_lote, :length => 4, :pad_byte => '0'
|
8
|
+
lstring :controle_registro, :length => 1, :initial_value => '1', :pad_byte => '0'
|
9
|
+
|
10
|
+
string :servico_operacao, :length => 1, :initial_value => 'C', :pad_byte => ' '
|
11
|
+
lstring :servico_tipo, :length => 2 , :pad_byte => '0'
|
12
|
+
lstring :servico_forma, :length => 2, :pad_byte => '0'
|
13
|
+
lstring :servico_layout, :length => 3, :initial_value => '040', :pad_byte => '0'
|
14
|
+
string :cnab_g004_1, :length => 1, :pad_byte => ' '
|
15
|
+
|
16
|
+
lstring :empresa_tipo, :length => 1, :pad_byte => '0'
|
17
|
+
lstring :empresa_numero, :length => 14, :pad_byte => '0'
|
18
|
+
string :identificacao_lancamento, :length => 4, :pad_byte => ' '
|
19
|
+
string :brancos_1, :length => 16, :pad_byte => ' '
|
20
|
+
|
21
|
+
lstring :empresa_agencia_codigo, :length => 5, :pad_byte => '0'
|
22
|
+
string :brancos_2, :length => 1, :pad_byte => ' '
|
23
|
+
lstring :empresa_conta_numero, :length => 12, :pad_byte => '0'
|
24
|
+
string :brancos_3, :length => 1, :pad_byte => ' '
|
25
|
+
string :empresa_agencia_conta_dv, :length => 1, :pad_byte => ' '
|
26
|
+
string :empresa_nome, :length => 30, :pad_byte => ' '
|
27
|
+
|
28
|
+
string :finalidade_lote, :length => 30, :pad_byte => ' '
|
29
|
+
string :historico_cc, :length => 10, :pad_byte => ' '
|
30
|
+
|
31
|
+
string :endereco_logradouro, :length => 30, :pad_byte => ' '
|
32
|
+
lstring :endereco_numero, :length => 5, :pad_byte => '0'
|
33
|
+
string :endereco_complemento, :length => 15, :pad_byte => ' '
|
34
|
+
string :endereco_cidade, :length => 20, :pad_byte => ' '
|
35
|
+
lstring :endereco_cep, :length => 8, :pad_byte => '0'
|
36
|
+
string :endereco_estado, :length => 2, :pad_byte => ' '
|
37
|
+
|
38
|
+
lstring :brancos_4, :length => 8, :pad_byte => '0'
|
39
|
+
string :ocorrencias, :length => 10, :pad_byte => ' '
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def auto_fill
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Cnab240::V80::Pagamentos
|
2
|
+
class Trailer < BinData::Record
|
3
|
+
|
4
|
+
include Cnab240::DefaultMixin
|
5
|
+
|
6
|
+
lstring :controle_banco, :length => 3, :pad_byte => '0'
|
7
|
+
lstring :controle_lote, :length => 4, :pad_byte => '0'
|
8
|
+
lstring :controle_registro, :length => 1, :initial_value => '5', :pad_byte => '0'
|
9
|
+
|
10
|
+
lstring :cnab_g004_1, :length => 9, :pad_byte => '0'
|
11
|
+
lstring :totais_qtde_registros, :length => 6, :pad_byte => '0'
|
12
|
+
lstring :totais_valor, :length => 18, :pad_byte => '0'
|
13
|
+
lstring :zeros, :length => 18, :pad_byte => '0'
|
14
|
+
string :cnab_g004_2, :length => 171, :pad_byte => ' '
|
15
|
+
string :ocorrencias, :length => 10, :pad_byte => ' '
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Cnab240::V80
|
2
|
+
class SegmentoA < BinData::Record
|
3
|
+
|
4
|
+
include Cnab240::DefaultMixin
|
5
|
+
include Cnab240::SegmentoMixin
|
6
|
+
|
7
|
+
lstring :controle_banco, :length => 3, :pad_byte => '0'
|
8
|
+
lstring :controle_lote, :length => 4, :pad_byte => '0'
|
9
|
+
string :controle_registro, :length => 1, :initial_value => '3', :pad_byte => '0'
|
10
|
+
|
11
|
+
lstring :servico_numero_registro, :length => 5, :pad_byte => '0'
|
12
|
+
string :servico_codigo_segmento, :length => 1, :initial_value => 'A', :pad_byte => ' '
|
13
|
+
lstring :servico_tipo_movimento, :length => 3, :pad_byte => '0'
|
14
|
+
lstring :zeros_1, :length => 3, :pad_byte => '0'
|
15
|
+
|
16
|
+
lstring :favorecido_banco, :length => 3, :pad_byte => '0'
|
17
|
+
lstring :favorecido_agencia_conta, :length => 20, :pad_byte => ' '
|
18
|
+
string :favorecido_nome, :length => 30, :pad_byte => ' '
|
19
|
+
string :credito_seu_numero, :length => 20, :pad_byte => ' '
|
20
|
+
lstring :credito_data_pagamento, :length => 8, :pad_byte => '0'
|
21
|
+
|
22
|
+
|
23
|
+
string :credito_moeda_tipo, :length => 3, :pad_byte => ' '
|
24
|
+
|
25
|
+
lstring :zeros_2, :length => 15, :pad_byte => '0'
|
26
|
+
lstring :credito_valor_pagamento, :length => 15, :pad_byte => '0'
|
27
|
+
string :credito_nosso_numero, :length => 15, :pad_byte => ' '
|
28
|
+
string :brancos_1, :length => 5, :pad_byte => ' '
|
29
|
+
|
30
|
+
lstring :credito_data_real, :length => 8, :pad_byte => '0'
|
31
|
+
lstring :credito_valor_real, :length => 15, :pad_byte => '0'
|
32
|
+
|
33
|
+
string :finalidade_detalhe, :length => 18, :pad_byte => ' '
|
34
|
+
string :brancos_2, :length => 2, :pad_byte => ' '
|
35
|
+
|
36
|
+
string :numero_documento, :length => 6, :pad_byte => ' '
|
37
|
+
string :numero_inscricao, :length => 14, :pad_byte => ' '
|
38
|
+
string :codigo_finalidade_complementar, :length => 2, :pad_byte => ' '
|
39
|
+
string :finalidade_ted, :length => 5, :pad_byte => ' '
|
40
|
+
string :brancos_3, :length => 5, :pad_byte => ' '
|
41
|
+
lstring :aviso, :length => 1, :pad_byte => ' '
|
42
|
+
string :ocorrencias, :length => 10, :pad_byte => ' '
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
data/lib/cnab240/version.rb
CHANGED
data/lib/cnab240.rb
CHANGED
@@ -32,14 +32,20 @@ require "cnab240/segmentos/v86/segmento_w"
|
|
32
32
|
require "cnab240/segmentos/v86/segmento_z"
|
33
33
|
|
34
34
|
require "cnab240/segmentos/v40/segmento_a"
|
35
|
+
require "cnab240/segmentos/v80/segmento_a"
|
35
36
|
|
36
37
|
require "cnab240/arquivo/arquivo"
|
37
38
|
|
39
|
+
require "cnab240/arquivo/v80/header"
|
40
|
+
require "cnab240/arquivo/v80/trailer"
|
38
41
|
require "cnab240/arquivo/v86/header"
|
39
42
|
require "cnab240/arquivo/v86/trailer"
|
40
43
|
require "cnab240/arquivo/v40/header"
|
41
44
|
require "cnab240/arquivo/v40/trailer"
|
42
45
|
|
46
|
+
|
47
|
+
require "cnab240/pagamentos/v80/header"
|
48
|
+
require "cnab240/pagamentos/v80/trailer"
|
43
49
|
require "cnab240/pagamentos/v86/header"
|
44
50
|
require "cnab240/pagamentos/v86/trailer"
|
45
51
|
require "cnab240/pagamentos/v86/titulos/header"
|
@@ -53,6 +59,7 @@ require "cnab240/pagamentos/v40/trailer"
|
|
53
59
|
require "cnab240/arquivo/estrutura"
|
54
60
|
require "cnab240/arquivo/builder"
|
55
61
|
|
62
|
+
require "cnab240/helper/debito_itau"
|
56
63
|
require "cnab240/helper/pagamento_itau"
|
57
64
|
|
58
65
|
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Cnab240::V80::Arquivo::Header do
|
4
|
+
|
5
|
+
it "deve ter campos de header" do
|
6
|
+
header = Cnab240::V80::Arquivo::Header.new
|
7
|
+
|
8
|
+
header.should respond_to(:controle_banco)
|
9
|
+
header.should respond_to(:controle_lote)
|
10
|
+
header.should respond_to(:controle_registro)
|
11
|
+
|
12
|
+
header.should respond_to(:brancos_1)
|
13
|
+
header.should respond_to(:arquivo_layout)
|
14
|
+
|
15
|
+
header.should respond_to(:empresa_tipo)
|
16
|
+
header.should respond_to(:empresa_numero)
|
17
|
+
|
18
|
+
header.should respond_to(:brancos_2)
|
19
|
+
|
20
|
+
header.should respond_to(:empresa_agencia_codigo)
|
21
|
+
header.should respond_to(:brancos_3)
|
22
|
+
header.should respond_to(:empresa_conta_numero)
|
23
|
+
header.should respond_to(:brancos_4)
|
24
|
+
header.should respond_to(:empresa_agencia_conta_dv)
|
25
|
+
header.should respond_to(:empresa_nome)
|
26
|
+
header.should respond_to(:banco_nome)
|
27
|
+
header.should respond_to(:brancos_5)
|
28
|
+
|
29
|
+
header.should respond_to(:arquivo_codigo)
|
30
|
+
header.should respond_to(:arquivo_data_geracao)
|
31
|
+
header.should respond_to(:arquivo_hora_geracao)
|
32
|
+
|
33
|
+
header.should respond_to(:brancos_6)
|
34
|
+
|
35
|
+
header.should respond_to(:arquivo_densidade)
|
36
|
+
|
37
|
+
header.should respond_to(:brancos_7)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "header deve ter 240 caracteres" do
|
41
|
+
header = Cnab240::V80::Arquivo::Header.new
|
42
|
+
header.linha.length.should be(240)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "conversao deve manter consistencia" do
|
46
|
+
header = Cnab240::V80::Arquivo::Header.new
|
47
|
+
|
48
|
+
header.controle_banco= "8"
|
49
|
+
header.controle_lote= "8"
|
50
|
+
header.controle_registro= "8"
|
51
|
+
|
52
|
+
|
53
|
+
linha1 = header.linha
|
54
|
+
|
55
|
+
header2 = Cnab240::V80::Arquivo::Header.read(linha1)
|
56
|
+
linha2 = header2.linha
|
57
|
+
|
58
|
+
linha1.should eq linha2
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe Cnab240::V80::Arquivo::Trailer do
|
5
|
+
|
6
|
+
it "deve conter campos trailer" do
|
7
|
+
header = Cnab240::V80::Arquivo::Trailer.new
|
8
|
+
|
9
|
+
header.should respond_to(:controle_banco)
|
10
|
+
header.should respond_to(:controle_lote)
|
11
|
+
header.should respond_to(:controle_registro)
|
12
|
+
|
13
|
+
header.should respond_to(:cnab_g004_1)
|
14
|
+
|
15
|
+
header.should respond_to(:totais_qtde_lotes)
|
16
|
+
header.should respond_to(:totais_qtde_registros)
|
17
|
+
|
18
|
+
header.should respond_to(:cnab_g004_2)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "trailer deve ter 240 caracteres" do
|
22
|
+
trailer = Cnab240::V80::Arquivo::Trailer.new
|
23
|
+
trailer.linha.length.should be(240)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include Cnab240
|
4
|
+
|
5
|
+
describe DebitoItau do
|
6
|
+
|
7
|
+
it "deve criar debito" do
|
8
|
+
|
9
|
+
debito = DebitoItau.new({
|
10
|
+
# header de arquivo
|
11
|
+
:empresa_convenio => '1234',
|
12
|
+
:empresa_tipo => '2',
|
13
|
+
:empresa_numero => '01234567891234',
|
14
|
+
:empresa_nome => 'EMPRESA FULANA',
|
15
|
+
:empresa_agencia_codigo => '',
|
16
|
+
:empresa_conta_numero => '',
|
17
|
+
:empresa_agencia_conta_dv => '',
|
18
|
+
:arquivo_sequencia => '1'
|
19
|
+
})
|
20
|
+
|
21
|
+
debito.add({
|
22
|
+
# header do lote
|
23
|
+
:empresa_tipo => '2', # tipo empresa creditada
|
24
|
+
:empresa_numero => '999999999999', # cpf cnpj creditado
|
25
|
+
:empresa_convenio => '12345', # convenio junto ao banco
|
26
|
+
:empresa_agencia_codigo => '2290', # agencia creditada
|
27
|
+
:empresa_conta_numero => '33595', # conta creditada
|
28
|
+
:empresa_agencia_conta_dv => '9', # dv conta agencia
|
29
|
+
:empresa_nome => 'ZECA URUBU',
|
30
|
+
:endereco_logradouro => 'AV BRASIL',
|
31
|
+
:endereco_numero => '123',
|
32
|
+
:endereco_cidade => 'RIO DE JANEIRO',
|
33
|
+
:endereco_cep => '12123412',
|
34
|
+
:endereco_estado => 'RJ',
|
35
|
+
# segmento a
|
36
|
+
:favorecido_agencia_codigo => '1234', # agencia do debitado
|
37
|
+
:favorecido_conta_numero => '12345', # conta do debitado
|
38
|
+
:favorecido_agencia_conta_dv => '1', # dv agencia e conta
|
39
|
+
:favorecido_nome => 'EMPRESA X', # nome do debitado
|
40
|
+
:credito_seu_numero => '1234',
|
41
|
+
:data => '30122012',
|
42
|
+
:valor => '100',
|
43
|
+
:numero_inscricao => '12345678901234' # cpf ou cnpj do debitado
|
44
|
+
})
|
45
|
+
|
46
|
+
|
47
|
+
debito.arquivo.header.banco_nome.strip.should eq 'BANCO ITAU'
|
48
|
+
|
49
|
+
debito.save_to_file("spec/tmp/arquivo_itau.test")
|
50
|
+
|
51
|
+
debito.string
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -20,28 +20,36 @@ describe PagamentoItau do
|
|
20
20
|
})
|
21
21
|
|
22
22
|
pagamento.add({
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
:
|
40
|
-
|
41
|
-
:
|
42
|
-
|
43
|
-
|
44
|
-
|
23
|
+
:header => {
|
24
|
+
:empresa_tipo => '2', # tipo empresa creditada
|
25
|
+
:empresa_numero => '999999999999', # cpf cnpj creditado
|
26
|
+
:empresa_agencia_codigo => '2290', # agencia creditada
|
27
|
+
:empresa_conta_numero => '33595', # conta creditada
|
28
|
+
:empresa_agencia_conta_dv => '9', # dv conta agencia
|
29
|
+
:empresa_nome => 'ZECA URUBU',
|
30
|
+
:endereco_logradouro => 'AV BRASIL',
|
31
|
+
:endereco_numero => '123',
|
32
|
+
:endereco_cidade => 'RIO DE JANEIRO',
|
33
|
+
:endereco_cep => '12123412',
|
34
|
+
:endereco_estado => 'RJ',
|
35
|
+
:servico_tipo => '98', # pagamentos - diversos
|
36
|
+
:servico_forma => '03', # doc, ted, etc
|
37
|
+
},
|
38
|
+
|
39
|
+
:trailer => {},
|
40
|
+
|
41
|
+
:segmento_a => {
|
42
|
+
:favorecido_banco => '001',
|
43
|
+
:favorecido_agencia_conta => '2290124',
|
44
|
+
:credito_seu_numero => '1234',
|
45
|
+
:credito_data_pagamento => '31122012',
|
46
|
+
:credito_valor_pagamento => '100',
|
47
|
+
:numero_inscricao => '12312312312312',
|
48
|
+
:favorecido_nome => 'EMPRESA X',
|
49
|
+
:credito_seu_numero => '1234',
|
50
|
+
:credito_data_pagamento => '30122012',
|
51
|
+
:credito_valor_pagamento => '100',
|
52
|
+
}
|
45
53
|
})
|
46
54
|
|
47
55
|
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Cnab240::V80::Pagamentos::Header do
|
4
|
+
|
5
|
+
it "deve conter campos header" do
|
6
|
+
header = Cnab240::V80::Pagamentos::Header.new
|
7
|
+
|
8
|
+
header.should respond_to(:controle_banco)
|
9
|
+
header.should respond_to(:controle_banco)
|
10
|
+
header.should respond_to(:controle_lote)
|
11
|
+
header.should respond_to(:controle_registro)
|
12
|
+
|
13
|
+
header.should respond_to(:servico_operacao)
|
14
|
+
header.should respond_to(:servico_tipo)
|
15
|
+
header.should respond_to(:servico_forma)
|
16
|
+
header.should respond_to(:servico_layout)
|
17
|
+
header.should respond_to(:cnab_g004_1)
|
18
|
+
|
19
|
+
header.should respond_to(:empresa_tipo)
|
20
|
+
header.should respond_to(:empresa_numero)
|
21
|
+
header.should respond_to(:identificacao_lancamento)
|
22
|
+
header.should respond_to(:brancos_1)
|
23
|
+
|
24
|
+
header.should respond_to(:empresa_agencia_codigo)
|
25
|
+
header.should respond_to(:brancos_2)
|
26
|
+
header.should respond_to(:empresa_conta_numero)
|
27
|
+
header.should respond_to(:brancos_3)
|
28
|
+
header.should respond_to(:empresa_agencia_conta_dv)
|
29
|
+
header.should respond_to(:empresa_nome)
|
30
|
+
|
31
|
+
header.should respond_to(:finalidade_lote)
|
32
|
+
header.should respond_to(:historico_cc)
|
33
|
+
|
34
|
+
header.should respond_to(:endereco_logradouro)
|
35
|
+
header.should respond_to(:endereco_numero)
|
36
|
+
header.should respond_to(:endereco_complemento)
|
37
|
+
header.should respond_to(:endereco_cidade)
|
38
|
+
header.should respond_to(:endereco_cep)
|
39
|
+
header.should respond_to(:endereco_estado)
|
40
|
+
|
41
|
+
header.should respond_to(:brancos_4)
|
42
|
+
header.should respond_to(:ocorrencias)
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
it "header deve ter 240 caracteres" do
|
48
|
+
header = Cnab240::V80::Pagamentos::Header.new
|
49
|
+
header.linha.length.should be(240)
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Cnab240::Lote do
|
4
|
+
|
5
|
+
it "deve conter trailer e header" do
|
6
|
+
lote = Cnab240::Lote.new(:operacao => :pagamento, :tipo => :remessa, :versao => 'V80')
|
7
|
+
lote.header.should be_an_instance_of(Cnab240::V80::Pagamentos::Header)
|
8
|
+
lote.trailer.should be_an_instance_of(Cnab240::V80::Pagamentos::Trailer)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "deve conter segmento a" do
|
12
|
+
lote = Cnab240::Lote.new(:operacao => :pagamento, :tipo => :remessa, :versao => 'V80')
|
13
|
+
lote.segmento_a.should be_an_instance_of(Cnab240::V80::SegmentoA)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "linhas devem ter 240" do
|
17
|
+
lote = Cnab240::Lote.new(:operacao => :pagamento, :tipo => :remessa, :versao => 'V80')
|
18
|
+
lote.linhas.each do |linha|
|
19
|
+
linha.length.should be(240)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Cnab240::V80::Pagamentos::Trailer do
|
4
|
+
|
5
|
+
it "deve conter campos trailer" do
|
6
|
+
trailer = Cnab240::V80::Pagamentos::Trailer.new
|
7
|
+
|
8
|
+
trailer.should respond_to(:controle_banco)
|
9
|
+
trailer.should respond_to(:controle_lote)
|
10
|
+
trailer.should respond_to(:controle_registro)
|
11
|
+
|
12
|
+
trailer.should respond_to(:cnab_g004_1)
|
13
|
+
|
14
|
+
trailer.should respond_to(:totais_qtde_registros)
|
15
|
+
trailer.should respond_to(:totais_valor)
|
16
|
+
trailer.should respond_to(:zeros)
|
17
|
+
|
18
|
+
trailer.should respond_to(:cnab_g004_2)
|
19
|
+
|
20
|
+
trailer.should respond_to(:ocorrencias)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "trailer deve ter 240 caracteres" do
|
24
|
+
trailer = Cnab240::V80::Pagamentos::Trailer.new
|
25
|
+
trailer.linha.length.should be(240)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include Cnab240::V80
|
4
|
+
|
5
|
+
describe Cnab240::V80::SegmentoA do
|
6
|
+
|
7
|
+
it "deve instanciar segmento" do
|
8
|
+
segmento = Cnab240::V80::SegmentoA.new
|
9
|
+
segmento.should be_an_instance_of(Cnab240::V80::SegmentoA)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "deve conter campos" do
|
13
|
+
segmento = Cnab240::V80::SegmentoA.new
|
14
|
+
|
15
|
+
segmento.should respond_to(:controle_banco)
|
16
|
+
|
17
|
+
segmento.should respond_to(:controle_banco)
|
18
|
+
segmento.should respond_to(:controle_lote)
|
19
|
+
segmento.should respond_to(:controle_registro)
|
20
|
+
|
21
|
+
segmento.should respond_to(:servico_numero_registro)
|
22
|
+
segmento.should respond_to(:servico_codigo_segmento)
|
23
|
+
segmento.should respond_to(:servico_tipo_movimento)
|
24
|
+
segmento.should respond_to(:zeros_1)
|
25
|
+
|
26
|
+
segmento.should respond_to(:favorecido_banco)
|
27
|
+
segmento.should respond_to(:favorecido_agencia_conta)
|
28
|
+
segmento.should respond_to(:favorecido_nome)
|
29
|
+
segmento.should respond_to(:credito_seu_numero)
|
30
|
+
segmento.should respond_to(:credito_data_pagamento)
|
31
|
+
|
32
|
+
|
33
|
+
segmento.should respond_to(:credito_moeda_tipo)
|
34
|
+
|
35
|
+
segmento.should respond_to(:zeros_2)
|
36
|
+
segmento.should respond_to(:credito_valor_pagamento)
|
37
|
+
segmento.should respond_to(:credito_nosso_numero)
|
38
|
+
segmento.should respond_to(:brancos_1)
|
39
|
+
|
40
|
+
segmento.should respond_to(:credito_data_real)
|
41
|
+
segmento.should respond_to(:credito_valor_real)
|
42
|
+
|
43
|
+
segmento.should respond_to(:finalidade_detalhe)
|
44
|
+
segmento.should respond_to(:brancos_2)
|
45
|
+
|
46
|
+
segmento.should respond_to(:numero_documento)
|
47
|
+
segmento.should respond_to(:numero_inscricao)
|
48
|
+
segmento.should respond_to(:codigo_finalidade_complementar)
|
49
|
+
segmento.should respond_to(:finalidade_ted)
|
50
|
+
segmento.should respond_to(:brancos_3)
|
51
|
+
segmento.should respond_to(:aviso)
|
52
|
+
segmento.should respond_to(:ocorrencias)
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
it "deve ter 240 caracteres" do
|
57
|
+
segmento = Cnab240::V80::SegmentoA.new
|
58
|
+
segmento.linha.length.should be(240)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "deve manter coesao" do
|
62
|
+
c = Cnab240::V80::SegmentoA
|
63
|
+
obj = c.new
|
64
|
+
linha1 = obj.linha
|
65
|
+
obj2 = c.read(linha1)
|
66
|
+
linha2 = obj2.linha
|
67
|
+
linha1.should eq linha2
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -2,15 +2,15 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
include Cnab240::V86
|
4
4
|
|
5
|
-
describe SegmentoA do
|
5
|
+
describe Cnab240::V86::SegmentoA do
|
6
6
|
|
7
7
|
it "deve instanciar segmento" do
|
8
|
-
segmento = SegmentoA.new
|
9
|
-
segmento.should be_an_instance_of(SegmentoA)
|
8
|
+
segmento = Cnab240::V86::SegmentoA.new
|
9
|
+
segmento.should be_an_instance_of(Cnab240::V86::SegmentoA)
|
10
10
|
end
|
11
11
|
|
12
12
|
it "deve conter campos" do
|
13
|
-
segmento = SegmentoA.new
|
13
|
+
segmento = Cnab240::V86::SegmentoA.new
|
14
14
|
|
15
15
|
segmento.should respond_to(:controle_banco)
|
16
16
|
segmento.should respond_to(:controle_lote)
|
@@ -49,7 +49,7 @@ describe SegmentoA do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
it "deve ter 240 caracteres" do
|
52
|
-
segmento = SegmentoA.new
|
52
|
+
segmento = Cnab240::V86::SegmentoA.new
|
53
53
|
segmento.linha.length.should be(240)
|
54
54
|
end
|
55
55
|
|
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
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 7
|
10
|
-
version: 0.0.7
|
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
|
-
|
19
|
-
|
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-07-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
33
15
|
name: rspec
|
34
|
-
|
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
|
-
|
42
|
-
|
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
|
@@ -65,6 +59,7 @@ files:
|
|
65
59
|
- Rakefile
|
66
60
|
- cnab240.gemspec
|
67
61
|
- docs/vendor/febraban/subcpadr12_layout_padrao_V86.pdf
|
62
|
+
- docs/vendor/itau/SISPAG_CNAB_240.pdf
|
68
63
|
- docs/vendor/itau/sisdeb_cnab_240.pdf
|
69
64
|
- lib/cnab240.rb
|
70
65
|
- lib/cnab240/arquivo/arquivo.rb
|
@@ -73,6 +68,8 @@ files:
|
|
73
68
|
- lib/cnab240/arquivo/lote.rb
|
74
69
|
- lib/cnab240/arquivo/v40/header.rb
|
75
70
|
- lib/cnab240/arquivo/v40/trailer.rb
|
71
|
+
- lib/cnab240/arquivo/v80/header.rb
|
72
|
+
- lib/cnab240/arquivo/v80/trailer.rb
|
76
73
|
- lib/cnab240/arquivo/v86/header.rb
|
77
74
|
- lib/cnab240/arquivo/v86/trailer.rb
|
78
75
|
- lib/cnab240/ext/attribute_accessors.rb
|
@@ -81,9 +78,12 @@ files:
|
|
81
78
|
- lib/cnab240/ext/filler.rb
|
82
79
|
- lib/cnab240/ext/lstring.rb
|
83
80
|
- lib/cnab240/ext/segmento_mixin.rb
|
81
|
+
- lib/cnab240/helper/debito_itau.rb
|
84
82
|
- lib/cnab240/helper/pagamento_itau.rb
|
85
83
|
- lib/cnab240/pagamentos/v40/header.rb
|
86
84
|
- lib/cnab240/pagamentos/v40/trailer.rb
|
85
|
+
- lib/cnab240/pagamentos/v80/header.rb
|
86
|
+
- lib/cnab240/pagamentos/v80/trailer.rb
|
87
87
|
- lib/cnab240/pagamentos/v86/header.rb
|
88
88
|
- lib/cnab240/pagamentos/v86/titulos/header.rb
|
89
89
|
- lib/cnab240/pagamentos/v86/titulos/trailer.rb
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/cnab240/pagamentos/v86/tributos/header.rb
|
92
92
|
- lib/cnab240/pagamentos/v86/tributos/trailer.rb
|
93
93
|
- lib/cnab240/segmentos/v40/segmento_a.rb
|
94
|
+
- lib/cnab240/segmentos/v80/segmento_a.rb
|
94
95
|
- lib/cnab240/segmentos/v86/segmento_a.rb
|
95
96
|
- lib/cnab240/segmentos/v86/segmento_b.rb
|
96
97
|
- lib/cnab240/segmentos/v86/segmento_c.rb
|
@@ -113,14 +114,20 @@ files:
|
|
113
114
|
- spec/arquivo/arquivo_spec.rb
|
114
115
|
- spec/arquivo/v40/header_spec.rb
|
115
116
|
- spec/arquivo/v40/trailer_spec.rb
|
117
|
+
- spec/arquivo/v80/header_spec.rb
|
118
|
+
- spec/arquivo/v80/trailer_spec.rb
|
116
119
|
- spec/arquivo/v86/header_spec.rb
|
117
120
|
- spec/arquivo/v86/trailer_spec.rb
|
118
121
|
- spec/bindata/bindata_spec.rb
|
119
122
|
- spec/cnab240_spec.rb
|
123
|
+
- spec/helper/debito_itau_spec.rb
|
120
124
|
- spec/helper/pagamento_itau_spec.rb
|
121
125
|
- spec/pagamentos/v40/header_spec.rb
|
122
126
|
- spec/pagamentos/v40/lote_spec.rb
|
123
127
|
- spec/pagamentos/v40/trailer_spec.rb
|
128
|
+
- spec/pagamentos/v80/header_spec.rb
|
129
|
+
- spec/pagamentos/v80/lote_spec.rb
|
130
|
+
- spec/pagamentos/v80/trailer_spec.rb
|
124
131
|
- spec/pagamentos/v86/header_spec.rb
|
125
132
|
- spec/pagamentos/v86/lote_spec.rb
|
126
133
|
- spec/pagamentos/v86/titulos/header_spec.rb
|
@@ -131,6 +138,7 @@ files:
|
|
131
138
|
- spec/pagamentos/v86/tributos/lote_spec.rb
|
132
139
|
- spec/pagamentos/v86/tributos/trailer_spec.rb
|
133
140
|
- spec/segmentos/v40/segmento_a_spec.rb
|
141
|
+
- spec/segmentos/v80/segmento_a_spec.rb
|
134
142
|
- spec/segmentos/v86/segmento_a_spec.rb
|
135
143
|
- spec/segmentos/v86/segmento_b_spec.rb
|
136
144
|
- spec/segmentos/v86/segmento_c_spec.rb
|
@@ -151,52 +159,54 @@ files:
|
|
151
159
|
- spec/segmentos/v86/segmento_z_spec.rb
|
152
160
|
- spec/spec_helper.rb
|
153
161
|
- spec/tmp/.gitkeep
|
154
|
-
|
155
|
-
homepage: ""
|
162
|
+
homepage: ''
|
156
163
|
licenses: []
|
157
|
-
|
158
164
|
post_install_message:
|
159
165
|
rdoc_options: []
|
160
|
-
|
161
|
-
require_paths:
|
166
|
+
require_paths:
|
162
167
|
- lib
|
163
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
168
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
164
169
|
none: false
|
165
|
-
requirements:
|
166
|
-
- -
|
167
|
-
- !ruby/object:Gem::Version
|
168
|
-
|
169
|
-
segments:
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
segments:
|
170
175
|
- 0
|
171
|
-
|
172
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
|
+
hash: 544104447877304933
|
177
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
178
|
none: false
|
174
|
-
requirements:
|
175
|
-
- -
|
176
|
-
- !ruby/object:Gem::Version
|
177
|
-
|
178
|
-
segments:
|
179
|
+
requirements:
|
180
|
+
- - ! '>='
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
183
|
+
segments:
|
179
184
|
- 0
|
180
|
-
|
185
|
+
hash: 544104447877304933
|
181
186
|
requirements: []
|
182
|
-
|
183
187
|
rubyforge_project: cnab240
|
184
|
-
rubygems_version: 1.
|
188
|
+
rubygems_version: 1.8.24
|
185
189
|
signing_key:
|
186
190
|
specification_version: 3
|
187
191
|
summary: Formato CNAB 240.
|
188
|
-
test_files:
|
192
|
+
test_files:
|
189
193
|
- spec/arquivo/arquivo_spec.rb
|
190
194
|
- spec/arquivo/v40/header_spec.rb
|
191
195
|
- spec/arquivo/v40/trailer_spec.rb
|
196
|
+
- spec/arquivo/v80/header_spec.rb
|
197
|
+
- spec/arquivo/v80/trailer_spec.rb
|
192
198
|
- spec/arquivo/v86/header_spec.rb
|
193
199
|
- spec/arquivo/v86/trailer_spec.rb
|
194
200
|
- spec/bindata/bindata_spec.rb
|
195
201
|
- spec/cnab240_spec.rb
|
202
|
+
- spec/helper/debito_itau_spec.rb
|
196
203
|
- spec/helper/pagamento_itau_spec.rb
|
197
204
|
- spec/pagamentos/v40/header_spec.rb
|
198
205
|
- spec/pagamentos/v40/lote_spec.rb
|
199
206
|
- spec/pagamentos/v40/trailer_spec.rb
|
207
|
+
- spec/pagamentos/v80/header_spec.rb
|
208
|
+
- spec/pagamentos/v80/lote_spec.rb
|
209
|
+
- spec/pagamentos/v80/trailer_spec.rb
|
200
210
|
- spec/pagamentos/v86/header_spec.rb
|
201
211
|
- spec/pagamentos/v86/lote_spec.rb
|
202
212
|
- spec/pagamentos/v86/titulos/header_spec.rb
|
@@ -207,6 +217,7 @@ test_files:
|
|
207
217
|
- spec/pagamentos/v86/tributos/lote_spec.rb
|
208
218
|
- spec/pagamentos/v86/tributos/trailer_spec.rb
|
209
219
|
- spec/segmentos/v40/segmento_a_spec.rb
|
220
|
+
- spec/segmentos/v80/segmento_a_spec.rb
|
210
221
|
- spec/segmentos/v86/segmento_a_spec.rb
|
211
222
|
- spec/segmentos/v86/segmento_b_spec.rb
|
212
223
|
- spec/segmentos/v86/segmento_c_spec.rb
|