cnab240 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -2
- data/cnab240.gemspec +10 -12
- data/lib/cnab240.rb +108 -91
- data/lib/cnab240/arquivo/arquivo.rb +6 -9
- data/lib/cnab240/arquivo/builder.rb +111 -90
- data/lib/cnab240/arquivo/estrutura.rb +161 -99
- data/lib/cnab240/arquivo/v40/header.rb +27 -29
- data/lib/cnab240/arquivo/v40/trailer.rb +8 -10
- data/lib/cnab240/arquivo/v60/header.rb +38 -0
- data/lib/cnab240/arquivo/v60/trailer.rb +17 -0
- data/lib/cnab240/arquivo/v80/header.rb +23 -26
- data/lib/cnab240/arquivo/v80/trailer.rb +8 -9
- data/lib/cnab240/arquivo/v81/header.rb +37 -0
- data/lib/cnab240/arquivo/v81/trailer.rb +17 -0
- data/lib/cnab240/arquivo/v83/header.rb +25 -26
- data/lib/cnab240/arquivo/v83/trailer.rb +9 -9
- data/lib/cnab240/arquivo/v86/header.rb +25 -26
- data/lib/cnab240/arquivo/v86/trailer.rb +9 -10
- data/lib/cnab240/arquivo/v87/header.rb +25 -26
- data/lib/cnab240/arquivo/v87/trailer.rb +9 -10
- data/lib/cnab240/ext/attribute_accessors.rb +4 -4
- data/lib/cnab240/ext/bindata.rb +4 -4
- data/lib/cnab240/ext/default_mixin.rb +2 -4
- data/lib/cnab240/ext/filler.rb +1 -3
- data/lib/cnab240/ext/lstring.rb +9 -10
- data/lib/cnab240/ext/segmento_mixin.rb +1 -3
- data/lib/cnab240/helper/boleto_bancoob.rb +60 -0
- data/lib/cnab240/helper/helper.rb +1 -1
- data/lib/cnab240/helper/pagamento_bb.rb +7 -9
- data/lib/cnab240/helper/pagamento_bradesco.rb +6 -8
- data/lib/cnab240/helper/pagamento_itau.rb +6 -8
- data/lib/cnab240/helper/transferencia_citibank.rb +56 -0
- data/lib/cnab240/helper/{pagamento_sicoob.rb → transferencia_sicoob.rb} +8 -15
- data/lib/cnab240/{arquivo/lote.rb → lote.rb} +29 -14
- data/lib/cnab240/lote/v40/boletos/header.rb +46 -0
- data/lib/cnab240/lote/v40/boletos/trailer.rb +29 -0
- data/lib/cnab240/pagamentos/v40/header.rb +30 -32
- data/lib/cnab240/pagamentos/v40/trailer.rb +10 -11
- data/lib/cnab240/pagamentos/v60/header.rb +43 -0
- data/lib/cnab240/pagamentos/v60/trailer.rb +17 -0
- data/lib/cnab240/pagamentos/v80/header.rb +35 -37
- data/lib/cnab240/pagamentos/v80/trailer.rb +10 -11
- data/lib/cnab240/pagamentos/v83/header.rb +33 -35
- data/lib/cnab240/pagamentos/v83/trailer.rb +11 -12
- data/lib/cnab240/pagamentos/v86/header.rb +34 -36
- data/lib/cnab240/pagamentos/v86/titulos/header.rb +28 -30
- data/lib/cnab240/pagamentos/v86/titulos/trailer.rb +11 -12
- data/lib/cnab240/pagamentos/v86/trailer.rb +11 -12
- data/lib/cnab240/pagamentos/v86/tributos/header.rb +35 -37
- data/lib/cnab240/pagamentos/v86/tributos/trailer.rb +9 -10
- data/lib/cnab240/pagamentos/v87/header.rb +34 -36
- data/lib/cnab240/pagamentos/v87/titulos/header.rb +28 -30
- data/lib/cnab240/pagamentos/v87/titulos/trailer.rb +11 -12
- data/lib/cnab240/pagamentos/v87/trailer.rb +11 -12
- data/lib/cnab240/pagamentos/v87/tributos/header.rb +35 -37
- data/lib/cnab240/pagamentos/v87/tributos/trailer.rb +9 -10
- data/lib/cnab240/segmentos/v40/segmento_a.rb +40 -41
- data/lib/cnab240/segmentos/v60/segmento_a.rb +43 -0
- data/lib/cnab240/segmentos/v60/segmento_b.rb +38 -0
- data/lib/cnab240/segmentos/v60/segmento_j.rb +32 -0
- data/lib/cnab240/segmentos/v80/agencia_itau.rb +8 -9
- data/lib/cnab240/segmentos/v80/agencia_outros.rb +6 -7
- data/lib/cnab240/segmentos/v80/segmento_a.rb +30 -32
- data/lib/cnab240/segmentos/v81/segmento_p.rb +79 -0
- data/lib/cnab240/segmentos/v81/segmento_q.rb +36 -0
- data/lib/cnab240/segmentos/v81/segmento_r.rb +49 -0
- data/lib/cnab240/segmentos/v81/segmento_s.rb +37 -0
- data/lib/cnab240/segmentos/v83/segmento_a.rb +35 -36
- data/lib/cnab240/segmentos/v83/segmento_b.rb +33 -34
- data/lib/cnab240/segmentos/v83/segmento_j.rb +22 -23
- data/lib/cnab240/segmentos/v83/segmento_z.rb +10 -11
- data/lib/cnab240/segmentos/v86/segmento_a.rb +37 -38
- data/lib/cnab240/segmentos/v86/segmento_b.rb +33 -34
- data/lib/cnab240/segmentos/v86/segmento_c.rb +19 -20
- data/lib/cnab240/segmentos/v86/segmento_j.rb +22 -23
- data/lib/cnab240/segmentos/v86/segmento_j52.rb +19 -20
- data/lib/cnab240/segmentos/v86/segmento_n.rb +17 -18
- data/lib/cnab240/segmentos/v86/segmento_n1.rb +10 -11
- data/lib/cnab240/segmentos/v86/segmento_n2.rb +12 -13
- data/lib/cnab240/segmentos/v86/segmento_n3.rb +12 -13
- data/lib/cnab240/segmentos/v86/segmento_n4.rb +14 -15
- data/lib/cnab240/segmentos/v86/segmento_n5.rb +12 -13
- data/lib/cnab240/segmentos/v86/segmento_n6.rb +12 -13
- data/lib/cnab240/segmentos/v86/segmento_n7.rb +13 -14
- data/lib/cnab240/segmentos/v86/segmento_n8.rb +12 -14
- data/lib/cnab240/segmentos/v86/segmento_o.rb +17 -18
- data/lib/cnab240/segmentos/v86/segmento_w.rb +12 -13
- data/lib/cnab240/segmentos/v86/segmento_w1.rb +9 -10
- data/lib/cnab240/segmentos/v86/segmento_z.rb +10 -11
- data/lib/cnab240/segmentos/v87/segmento_a.rb +37 -38
- data/lib/cnab240/segmentos/v87/segmento_b.rb +33 -34
- data/lib/cnab240/segmentos/v87/segmento_c.rb +19 -20
- data/lib/cnab240/segmentos/v87/segmento_j.rb +22 -23
- data/lib/cnab240/segmentos/v87/segmento_j52.rb +19 -20
- data/lib/cnab240/segmentos/v87/segmento_n.rb +17 -18
- data/lib/cnab240/segmentos/v87/segmento_n1.rb +10 -11
- data/lib/cnab240/segmentos/v87/segmento_n2.rb +12 -13
- data/lib/cnab240/segmentos/v87/segmento_n3.rb +12 -13
- data/lib/cnab240/segmentos/v87/segmento_n4.rb +14 -15
- data/lib/cnab240/segmentos/v87/segmento_n5.rb +12 -13
- data/lib/cnab240/segmentos/v87/segmento_n6.rb +12 -13
- data/lib/cnab240/segmentos/v87/segmento_n7.rb +13 -14
- data/lib/cnab240/segmentos/v87/segmento_n8.rb +12 -14
- data/lib/cnab240/segmentos/v87/segmento_o.rb +17 -18
- data/lib/cnab240/segmentos/v87/segmento_w.rb +12 -13
- data/lib/cnab240/segmentos/v87/segmento_w1.rb +9 -10
- data/lib/cnab240/segmentos/v87/segmento_z.rb +10 -11
- data/lib/cnab240/version.rb +1 -1
- metadata +30 -40
@@ -0,0 +1,17 @@
|
|
1
|
+
module Cnab240::V60::Arquivo
|
2
|
+
class Trailer < BinData::Record
|
3
|
+
include Cnab240::DefaultMixin
|
4
|
+
|
5
|
+
string :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
string :controle_lote, length: 4, initial_value: '9999', pad_byte: '0'
|
7
|
+
string :controle_registro, length: 1, initial_value: '9', pad_byte: '0'
|
8
|
+
|
9
|
+
string :cnab_g004_1, length: 9, pad_byte: ' '
|
10
|
+
|
11
|
+
lstring :totais_qtde_lotes, length: 6, pad_byte: '0'
|
12
|
+
lstring :totais_qtde_registros, length: 6, pad_byte: '0'
|
13
|
+
lstring :totais_qtde_contas_conciliadas, length: 6, pad_byte: '0'
|
14
|
+
|
15
|
+
string :cnab_g004_2, length: 205, pad_byte: ' '
|
16
|
+
end
|
17
|
+
end
|
@@ -1,39 +1,36 @@
|
|
1
1
|
module Cnab240::V80::Arquivo
|
2
2
|
class Header < BinData::Record
|
3
|
-
|
4
3
|
include Cnab240::DefaultMixin
|
5
4
|
|
6
|
-
lstring :controle_banco, :
|
7
|
-
lstring :controle_lote, :
|
8
|
-
lstring :controle_registro, :
|
9
|
-
|
10
|
-
string :brancos_1, :length => 6, :initial_value => ' ', :pad_byte => ' '
|
11
|
-
string :arquivo_layout, :length => 3, :initial_value => '080'
|
5
|
+
lstring :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
lstring :controle_lote, length: 4, initial_value: '0000', pad_byte: '0'
|
7
|
+
lstring :controle_registro, length: 1, initial_value: '0', pad_byte: '0'
|
12
8
|
|
13
|
-
|
14
|
-
|
9
|
+
string :brancos_1, length: 6, initial_value: ' ', pad_byte: ' '
|
10
|
+
string :arquivo_layout, length: 3, initial_value: '080'
|
15
11
|
|
16
|
-
|
12
|
+
lstring :empresa_tipo, length: 1, pad_byte: '0'
|
13
|
+
lstring :empresa_numero, length: 14, pad_byte: '0'
|
17
14
|
|
18
|
-
|
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 => '0'
|
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 => ' '
|
15
|
+
string :brancos_2, length: 20, initial_value: ' ', pad_byte: ' '
|
26
16
|
|
27
|
-
lstring :
|
28
|
-
|
29
|
-
lstring :
|
17
|
+
lstring :empresa_agencia_codigo, length: 5, pad_byte: '0'
|
18
|
+
string :brancos_3, length: 1, initial_value: ' ', pad_byte: ' '
|
19
|
+
lstring :empresa_conta_numero, length: 12, pad_byte: '0'
|
20
|
+
string :brancos_4, length: 1, initial_value: ' ', pad_byte: ' '
|
21
|
+
string :empresa_agencia_conta_dv, length: 1, pad_byte: '0'
|
22
|
+
string :empresa_nome, length: 30, pad_byte: ' '
|
23
|
+
string :banco_nome, length: 30, pad_byte: ' '
|
24
|
+
string :brancos_5, length: 10, initial_value: ' ', pad_byte: ' '
|
30
25
|
|
31
|
-
|
32
|
-
lstring :
|
26
|
+
lstring :arquivo_codigo, length: 1, pad_byte: '0'
|
27
|
+
lstring :arquivo_data_geracao, length: 8, pad_byte: '0'
|
28
|
+
lstring :arquivo_hora_geracao, length: 6, pad_byte: '0'
|
33
29
|
|
34
|
-
lstring :
|
30
|
+
lstring :zeros_6, length: 9, pad_byte: '0'
|
35
31
|
|
36
|
-
|
32
|
+
lstring :arquivo_densidade, length: 5, pad_byte: '0'
|
37
33
|
|
34
|
+
string :brancos_7, length: 69, pad_byte: ' '
|
38
35
|
end
|
39
|
-
end
|
36
|
+
end
|
@@ -1,17 +1,16 @@
|
|
1
1
|
module Cnab240::V80::Arquivo
|
2
2
|
class Trailer < BinData::Record
|
3
|
-
|
4
3
|
include Cnab240::DefaultMixin
|
5
4
|
|
6
|
-
string :controle_banco, :
|
7
|
-
string :controle_lote, :
|
8
|
-
string :controle_registro, :
|
5
|
+
string :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
string :controle_lote, length: 4, initial_value: '9999', pad_byte: '0'
|
7
|
+
string :controle_registro, length: 1, initial_value: '9', pad_byte: '0'
|
9
8
|
|
10
|
-
string :cnab_g004_1, :
|
9
|
+
string :cnab_g004_1, length: 9, pad_byte: ' '
|
11
10
|
|
12
|
-
lstring :totais_qtde_lotes, :
|
13
|
-
lstring :totais_qtde_registros, :
|
11
|
+
lstring :totais_qtde_lotes, length: 6, pad_byte: '0'
|
12
|
+
lstring :totais_qtde_registros, length: 6, pad_byte: '0'
|
14
13
|
|
15
|
-
string :cnab_g004_2, :
|
14
|
+
string :cnab_g004_2, length: 211, pad_byte: ' '
|
16
15
|
end
|
17
|
-
end
|
16
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Cnab240::V81::Arquivo
|
2
|
+
class Header < BinData::Record
|
3
|
+
include Cnab240::DefaultMixin
|
4
|
+
|
5
|
+
lstring :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
lstring :controle_lote, length: 4, initial_value: '0000', pad_byte: '0'
|
7
|
+
lstring :controle_registro, length: 1, initial_value: '0', pad_byte: '0'
|
8
|
+
|
9
|
+
string :cnab_g004_1, length: 9, initial_value: ' ', pad_byte: ' '
|
10
|
+
|
11
|
+
lstring :empresa_tipo, length: 1, pad_byte: '0'
|
12
|
+
lstring :empresa_numero, length: 14, pad_byte: '0'
|
13
|
+
string :empresa_convenio, length: 20, pad_byte: ' '
|
14
|
+
lstring :empresa_agencia_codigo, length: 5, pad_byte: '0'
|
15
|
+
string :empresa_agencia_dv, length: 1, pad_byte: ' '
|
16
|
+
lstring :empresa_conta_numero, length: 12, pad_byte: '0'
|
17
|
+
string :empresa_conta_dv, length: 1, pad_byte: ' '
|
18
|
+
string :empresa_agencia_conta_dv, length: 1, pad_byte: ' '
|
19
|
+
string :empresa_nome, length: 30, pad_byte: ' '
|
20
|
+
|
21
|
+
string :banco_nome, length: 30, pad_byte: ' '
|
22
|
+
|
23
|
+
string :cnab_g004_2, length: 10, pad_byte: ' '
|
24
|
+
|
25
|
+
lstring :arquivo_codigo, length: 1, pad_byte: '0'
|
26
|
+
lstring :arquivo_data_geracao, length: 8, pad_byte: '0'
|
27
|
+
lstring :arquivo_hora_geracao, length: 6, pad_byte: '0'
|
28
|
+
lstring :arquivo_sequencia, length: 6, pad_byte: '0'
|
29
|
+
string :arquivo_layout, length: 3, initial_value: '081'
|
30
|
+
lstring :arquivo_densidade, length: 5, pad_byte: '0'
|
31
|
+
|
32
|
+
string :reservado_banco, length: 20, pad_byte: ' '
|
33
|
+
string :reservado_empresa, length: 20, pad_byte: ' '
|
34
|
+
|
35
|
+
string :cnab_g004_3, length: 29, pad_byte: ' '
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Cnab240::V81::Arquivo
|
2
|
+
class Trailer < BinData::Record
|
3
|
+
include Cnab240::DefaultMixin
|
4
|
+
|
5
|
+
string :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
string :controle_lote, length: 4, initial_value: '9999', pad_byte: '0'
|
7
|
+
string :controle_registro, length: 1, initial_value: '9', pad_byte: '0'
|
8
|
+
|
9
|
+
string :cnab_g004_1, length: 9, pad_byte: ' '
|
10
|
+
|
11
|
+
lstring :totais_qtde_lotes, length: 6, pad_byte: '0'
|
12
|
+
lstring :totais_qtde_registros, length: 6, pad_byte: '0'
|
13
|
+
lstring :totais_qtde_contas_concil, length: 6, pad_byte: '0'
|
14
|
+
|
15
|
+
string :cnab_g004_2, length: 205, pad_byte: ' '
|
16
|
+
end
|
17
|
+
end
|
@@ -1,38 +1,37 @@
|
|
1
1
|
module Cnab240::V83::Arquivo
|
2
2
|
class Header < BinData::Record
|
3
|
-
|
4
3
|
include Cnab240::DefaultMixin
|
5
4
|
|
6
|
-
lstring :controle_banco, :
|
7
|
-
lstring :controle_lote, :
|
8
|
-
lstring :controle_registro, :
|
5
|
+
lstring :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
lstring :controle_lote, length: 4, initial_value: '0000', pad_byte: '0'
|
7
|
+
lstring :controle_registro, length: 1, initial_value: '0', pad_byte: '0'
|
9
8
|
|
10
|
-
string :cnab_g004_1, :
|
9
|
+
string :cnab_g004_1, length: 9, initial_value: ' ', pad_byte: ' '
|
11
10
|
|
12
|
-
lstring :empresa_tipo, :
|
13
|
-
lstring :empresa_numero, :
|
14
|
-
string :empresa_convenio, :
|
15
|
-
lstring :empresa_agencia_codigo, :
|
16
|
-
string :empresa_agencia_dv, :
|
17
|
-
lstring :empresa_conta_numero, :
|
18
|
-
string :empresa_conta_dv, :
|
19
|
-
string :empresa_agencia_conta_dv, :
|
20
|
-
string :empresa_nome, :
|
11
|
+
lstring :empresa_tipo, length: 1, pad_byte: '0'
|
12
|
+
lstring :empresa_numero, length: 14, pad_byte: '0'
|
13
|
+
string :empresa_convenio, length: 20, pad_byte: ' '
|
14
|
+
lstring :empresa_agencia_codigo, length: 5, pad_byte: '0'
|
15
|
+
string :empresa_agencia_dv, length: 1, pad_byte: ' '
|
16
|
+
lstring :empresa_conta_numero, length: 12, pad_byte: '0'
|
17
|
+
string :empresa_conta_dv, length: 1, pad_byte: ' '
|
18
|
+
string :empresa_agencia_conta_dv, length: 1, pad_byte: ' '
|
19
|
+
string :empresa_nome, length: 30, pad_byte: ' '
|
21
20
|
|
22
|
-
string :banco_nome, :
|
21
|
+
string :banco_nome, length: 30, pad_byte: ' '
|
23
22
|
|
24
|
-
string :cnab_g004_2, :
|
23
|
+
string :cnab_g004_2, length: 10, pad_byte: ' '
|
25
24
|
|
26
|
-
lstring :arquivo_codigo, :
|
27
|
-
lstring :arquivo_data_geracao, :
|
28
|
-
lstring :arquivo_hora_geracao, :
|
29
|
-
lstring :arquivo_sequencia, :
|
30
|
-
string :arquivo_layout, :
|
31
|
-
lstring :arquivo_densidade, :
|
25
|
+
lstring :arquivo_codigo, length: 1, pad_byte: '0'
|
26
|
+
lstring :arquivo_data_geracao, length: 8, pad_byte: '0'
|
27
|
+
lstring :arquivo_hora_geracao, length: 6, pad_byte: '0'
|
28
|
+
lstring :arquivo_sequencia, length: 6, pad_byte: '0'
|
29
|
+
string :arquivo_layout, length: 3, initial_value: '083'
|
30
|
+
lstring :arquivo_densidade, length: 5, pad_byte: '0'
|
32
31
|
|
33
|
-
string :reservado_banco, :
|
34
|
-
string :reservado_empresa, :
|
32
|
+
string :reservado_banco, length: 20, pad_byte: ' '
|
33
|
+
string :reservado_empresa, length: 20, pad_byte: ' '
|
35
34
|
|
36
|
-
string :cnab_g004_3, :
|
35
|
+
string :cnab_g004_3, length: 29, pad_byte: ' '
|
37
36
|
end
|
38
|
-
end
|
37
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
1
|
module Cnab240::V83::Arquivo
|
2
2
|
class Trailer < BinData::Record
|
3
|
-
|
4
3
|
include Cnab240::DefaultMixin
|
5
4
|
|
6
|
-
string :controle_banco, :
|
7
|
-
string :controle_lote, :
|
8
|
-
string :controle_registro, :
|
5
|
+
string :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
string :controle_lote, length: 4, initial_value: '9999', pad_byte: '0'
|
7
|
+
string :controle_registro, length: 1, initial_value: '9', pad_byte: '0'
|
9
8
|
|
10
|
-
string :cnab_g004_1, :
|
9
|
+
string :cnab_g004_1, length: 9, pad_byte: ' '
|
11
10
|
|
12
|
-
lstring :totais_qtde_lotes, :
|
13
|
-
lstring :totais_qtde_registros, :
|
11
|
+
lstring :totais_qtde_lotes, length: 6, pad_byte: '0'
|
12
|
+
lstring :totais_qtde_registros, length: 6, pad_byte: '0'
|
13
|
+
lstring :totais_qtde_contas_concil, length: 6, pad_byte: '0'
|
14
14
|
|
15
|
-
string :cnab_g004_2, :
|
15
|
+
string :cnab_g004_2, length: 205, pad_byte: ' '
|
16
16
|
end
|
17
|
-
end
|
17
|
+
end
|
@@ -1,38 +1,37 @@
|
|
1
1
|
module Cnab240::V86::Arquivo
|
2
2
|
class Header < BinData::Record
|
3
|
-
|
4
3
|
include Cnab240::DefaultMixin
|
5
4
|
|
6
|
-
lstring :controle_banco, :
|
7
|
-
lstring :controle_lote, :
|
8
|
-
lstring :controle_registro, :
|
5
|
+
lstring :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
lstring :controle_lote, length: 4, initial_value: '0000', pad_byte: '0'
|
7
|
+
lstring :controle_registro, length: 1, initial_value: '0', pad_byte: '0'
|
9
8
|
|
10
|
-
string :cnab_g004_1, :
|
9
|
+
string :cnab_g004_1, length: 9, initial_value: ' ', pad_byte: ' '
|
11
10
|
|
12
|
-
lstring :empresa_tipo, :
|
13
|
-
lstring :empresa_numero, :
|
14
|
-
string :empresa_convenio, :
|
15
|
-
lstring :empresa_agencia_codigo, :
|
16
|
-
string :empresa_agencia_dv, :
|
17
|
-
lstring :empresa_conta_numero, :
|
18
|
-
string :empresa_conta_dv, :
|
19
|
-
string :empresa_agencia_conta_dv, :
|
20
|
-
string :empresa_nome, :
|
11
|
+
lstring :empresa_tipo, length: 1, pad_byte: '0'
|
12
|
+
lstring :empresa_numero, length: 14, pad_byte: '0'
|
13
|
+
string :empresa_convenio, length: 20, pad_byte: ' '
|
14
|
+
lstring :empresa_agencia_codigo, length: 5, pad_byte: '0'
|
15
|
+
string :empresa_agencia_dv, length: 1, pad_byte: ' '
|
16
|
+
lstring :empresa_conta_numero, length: 12, pad_byte: '0'
|
17
|
+
string :empresa_conta_dv, length: 1, pad_byte: ' '
|
18
|
+
string :empresa_agencia_conta_dv, length: 1, pad_byte: '0'
|
19
|
+
string :empresa_nome, length: 30, pad_byte: ' '
|
21
20
|
|
22
|
-
string :banco_nome, :
|
21
|
+
string :banco_nome, length: 30, pad_byte: ' '
|
23
22
|
|
24
|
-
string :cnab_g004_2, :
|
23
|
+
string :cnab_g004_2, length: 10, pad_byte: ' '
|
25
24
|
|
26
|
-
lstring :arquivo_codigo, :
|
27
|
-
lstring :arquivo_data_geracao, :
|
28
|
-
lstring :arquivo_hora_geracao, :
|
29
|
-
lstring :arquivo_sequencia, :
|
30
|
-
string :arquivo_layout, :
|
31
|
-
lstring :arquivo_densidade, :
|
25
|
+
lstring :arquivo_codigo, length: 1, pad_byte: '0'
|
26
|
+
lstring :arquivo_data_geracao, length: 8, pad_byte: '0'
|
27
|
+
lstring :arquivo_hora_geracao, length: 6, pad_byte: '0'
|
28
|
+
lstring :arquivo_sequencia, length: 6, pad_byte: '0'
|
29
|
+
string :arquivo_layout, length: 3, initial_value: '086'
|
30
|
+
lstring :arquivo_densidade, length: 5, pad_byte: '0'
|
32
31
|
|
33
|
-
string :reservado_banco, :
|
34
|
-
string :reservado_empresa, :
|
32
|
+
string :reservado_banco, length: 20, pad_byte: ' '
|
33
|
+
string :reservado_empresa, length: 20, pad_byte: ' '
|
35
34
|
|
36
|
-
string :cnab_g004_3, :
|
35
|
+
string :cnab_g004_3, length: 29, pad_byte: ' '
|
37
36
|
end
|
38
|
-
end
|
37
|
+
end
|
@@ -1,18 +1,17 @@
|
|
1
1
|
module Cnab240::V86::Arquivo
|
2
2
|
class Trailer < BinData::Record
|
3
|
-
|
4
3
|
include Cnab240::DefaultMixin
|
5
4
|
|
6
|
-
string :controle_banco, :
|
7
|
-
string :controle_lote, :
|
8
|
-
string :controle_registro, :
|
5
|
+
string :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
string :controle_lote, length: 4, initial_value: '9999', pad_byte: '0'
|
7
|
+
string :controle_registro, length: 1, initial_value: '9', pad_byte: '0'
|
9
8
|
|
10
|
-
string :cnab_g004_1, :
|
9
|
+
string :cnab_g004_1, length: 9, pad_byte: ' '
|
11
10
|
|
12
|
-
lstring :totais_qtde_lotes, :
|
13
|
-
lstring :totais_qtde_registros, :
|
14
|
-
lstring :totais_qtde_contas_concil, :
|
11
|
+
lstring :totais_qtde_lotes, length: 6, pad_byte: '0'
|
12
|
+
lstring :totais_qtde_registros, length: 6, pad_byte: '0'
|
13
|
+
lstring :totais_qtde_contas_concil, length: 6, pad_byte: '0'
|
15
14
|
|
16
|
-
string :cnab_g004_2, :
|
15
|
+
string :cnab_g004_2, length: 205, pad_byte: ' '
|
17
16
|
end
|
18
|
-
end
|
17
|
+
end
|
@@ -1,38 +1,37 @@
|
|
1
1
|
module Cnab240::V87::Arquivo
|
2
2
|
class Header < BinData::Record
|
3
|
-
|
4
3
|
include Cnab240::DefaultMixin
|
5
4
|
|
6
|
-
lstring :controle_banco, :
|
7
|
-
lstring :controle_lote, :
|
8
|
-
lstring :controle_registro, :
|
5
|
+
lstring :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
lstring :controle_lote, length: 4, initial_value: '0000', pad_byte: '0'
|
7
|
+
lstring :controle_registro, length: 1, initial_value: '0', pad_byte: '0'
|
9
8
|
|
10
|
-
string :cnab_g004_1, :
|
9
|
+
string :cnab_g004_1, length: 9, initial_value: ' ', pad_byte: ' '
|
11
10
|
|
12
|
-
lstring :empresa_tipo, :
|
13
|
-
lstring :empresa_numero, :
|
14
|
-
string :empresa_convenio, :
|
15
|
-
lstring :empresa_agencia_codigo, :
|
16
|
-
string :empresa_agencia_dv, :
|
17
|
-
lstring :empresa_conta_numero, :
|
18
|
-
string :empresa_conta_dv, :
|
19
|
-
string :empresa_agencia_conta_dv, :
|
20
|
-
string :empresa_nome, :
|
11
|
+
lstring :empresa_tipo, length: 1, pad_byte: '0'
|
12
|
+
lstring :empresa_numero, length: 14, pad_byte: '0'
|
13
|
+
string :empresa_convenio, length: 20, pad_byte: ' '
|
14
|
+
lstring :empresa_agencia_codigo, length: 5, pad_byte: '0'
|
15
|
+
string :empresa_agencia_dv, length: 1, pad_byte: ' '
|
16
|
+
lstring :empresa_conta_numero, length: 12, pad_byte: '0'
|
17
|
+
string :empresa_conta_dv, length: 1, pad_byte: ' '
|
18
|
+
string :empresa_agencia_conta_dv, length: 1, pad_byte: '0'
|
19
|
+
string :empresa_nome, length: 30, pad_byte: ' '
|
21
20
|
|
22
|
-
string :banco_nome, :
|
21
|
+
string :banco_nome, length: 30, pad_byte: ' '
|
23
22
|
|
24
|
-
string :cnab_g004_2, :
|
23
|
+
string :cnab_g004_2, length: 10, pad_byte: ' '
|
25
24
|
|
26
|
-
lstring :arquivo_codigo, :
|
27
|
-
lstring :arquivo_data_geracao, :
|
28
|
-
lstring :arquivo_hora_geracao, :
|
29
|
-
lstring :arquivo_sequencia, :
|
30
|
-
string :arquivo_layout, :
|
31
|
-
lstring :arquivo_densidade, :
|
25
|
+
lstring :arquivo_codigo, length: 1, pad_byte: '0'
|
26
|
+
lstring :arquivo_data_geracao, length: 8, pad_byte: '0'
|
27
|
+
lstring :arquivo_hora_geracao, length: 6, pad_byte: '0'
|
28
|
+
lstring :arquivo_sequencia, length: 6, pad_byte: '0'
|
29
|
+
string :arquivo_layout, length: 3, initial_value: '087'
|
30
|
+
lstring :arquivo_densidade, length: 5, pad_byte: '0'
|
32
31
|
|
33
|
-
string :reservado_banco, :
|
34
|
-
string :reservado_empresa, :
|
32
|
+
string :reservado_banco, length: 20, pad_byte: ' '
|
33
|
+
string :reservado_empresa, length: 20, pad_byte: ' '
|
35
34
|
|
36
|
-
string :cnab_g004_3, :
|
35
|
+
string :cnab_g004_3, length: 29, pad_byte: ' '
|
37
36
|
end
|
38
|
-
end
|
37
|
+
end
|
@@ -1,18 +1,17 @@
|
|
1
1
|
module Cnab240::V87::Arquivo
|
2
2
|
class Trailer < BinData::Record
|
3
|
-
|
4
3
|
include Cnab240::DefaultMixin
|
5
4
|
|
6
|
-
string :controle_banco, :
|
7
|
-
string :controle_lote, :
|
8
|
-
string :controle_registro, :
|
5
|
+
string :controle_banco, length: 3, pad_byte: '0'
|
6
|
+
string :controle_lote, length: 4, initial_value: '9999', pad_byte: '0'
|
7
|
+
string :controle_registro, length: 1, initial_value: '9', pad_byte: '0'
|
9
8
|
|
10
|
-
string :cnab_g004_1, :
|
9
|
+
string :cnab_g004_1, length: 9, pad_byte: ' '
|
11
10
|
|
12
|
-
lstring :totais_qtde_lotes, :
|
13
|
-
lstring :totais_qtde_registros, :
|
14
|
-
lstring :totais_qtde_contas_concil, :
|
11
|
+
lstring :totais_qtde_lotes, length: 6, pad_byte: '0'
|
12
|
+
lstring :totais_qtde_registros, length: 6, pad_byte: '0'
|
13
|
+
lstring :totais_qtde_contas_concil, length: 6, pad_byte: '0'
|
15
14
|
|
16
|
-
string :cnab_g004_2, :
|
15
|
+
string :cnab_g004_2, length: 205, pad_byte: ' '
|
17
16
|
end
|
18
|
-
end
|
17
|
+
end
|
@@ -7,7 +7,7 @@ class Module
|
|
7
7
|
unless defined? @@#{sym}
|
8
8
|
@@#{sym} = nil
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
def self.#{sym}
|
12
12
|
@@#{sym}
|
13
13
|
end
|
@@ -26,11 +26,11 @@ class Module
|
|
26
26
|
unless defined? @@#{sym}
|
27
27
|
@@#{sym} = nil
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def self.#{sym}=(obj)
|
31
31
|
@@#{sym} = obj
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
#{"
|
35
35
|
def #{sym}=(obj)
|
36
36
|
@@#{sym} = obj
|
@@ -44,4 +44,4 @@ class Module
|
|
44
44
|
mod_attr_reader(*syms)
|
45
45
|
mod_attr_writer(*syms)
|
46
46
|
end
|
47
|
-
end
|
47
|
+
end
|