cnab240 0.0.17 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +7 -0
  2. data/cnab240.gemspec +2 -1
  3. data/lib/cnab240/arquivo/arquivo.rb +89 -60
  4. data/lib/cnab240/arquivo/builder.rb +162 -154
  5. data/lib/cnab240/arquivo/estrutura.rb +159 -95
  6. data/lib/cnab240/arquivo/lote.rb +57 -57
  7. data/lib/cnab240/arquivo/v40/header.rb +30 -30
  8. data/lib/cnab240/arquivo/v40/trailer.rb +11 -11
  9. data/lib/cnab240/arquivo/v80/header.rb +28 -27
  10. data/lib/cnab240/arquivo/v80/trailer.rb +11 -11
  11. data/lib/cnab240/arquivo/v83/header.rb +38 -0
  12. data/lib/cnab240/arquivo/v83/trailer.rb +17 -0
  13. data/lib/cnab240/arquivo/v86/header.rb +27 -28
  14. data/lib/cnab240/arquivo/v86/trailer.rb +12 -12
  15. data/lib/cnab240/arquivo/v87/header.rb +38 -0
  16. data/lib/cnab240/arquivo/v87/trailer.rb +18 -0
  17. data/lib/cnab240/ext/attribute_accessors.rb +2 -2
  18. data/lib/cnab240/ext/bindata.rb +9 -9
  19. data/lib/cnab240/ext/default_mixin.rb +11 -12
  20. data/lib/cnab240/ext/filler.rb +16 -16
  21. data/lib/cnab240/ext/lstring.rb +5 -5
  22. data/lib/cnab240/ext/segmento_mixin.rb +4 -4
  23. data/lib/cnab240/helper/helper.rb +15 -0
  24. data/lib/cnab240/helper/pagamento_bb.rb +51 -0
  25. data/lib/cnab240/helper/pagamento_bradesco.rb +49 -0
  26. data/lib/cnab240/helper/pagamento_itau.rb +34 -49
  27. data/lib/cnab240/helper/pagamento_sicoob.rb +55 -0
  28. data/lib/cnab240/pagamentos/v40/header.rb +35 -37
  29. data/lib/cnab240/pagamentos/v40/trailer.rb +13 -13
  30. data/lib/cnab240/pagamentos/v80/header.rb +45 -45
  31. data/lib/cnab240/pagamentos/v80/trailer.rb +13 -13
  32. data/lib/cnab240/pagamentos/v83/header.rb +45 -0
  33. data/lib/cnab240/pagamentos/v83/trailer.rb +18 -0
  34. data/lib/cnab240/pagamentos/v86/header.rb +44 -44
  35. data/lib/cnab240/pagamentos/v86/titulos/header.rb +44 -44
  36. data/lib/cnab240/pagamentos/v86/titulos/trailer.rb +14 -14
  37. data/lib/cnab240/pagamentos/v86/trailer.rb +14 -14
  38. data/lib/cnab240/pagamentos/v86/tributos/header.rb +45 -45
  39. data/lib/cnab240/pagamentos/v86/tributos/trailer.rb +12 -12
  40. data/lib/cnab240/pagamentos/v87/header.rb +46 -0
  41. data/lib/cnab240/pagamentos/v87/titulos/header.rb +46 -0
  42. data/lib/cnab240/pagamentos/v87/titulos/trailer.rb +18 -0
  43. data/lib/cnab240/pagamentos/v87/trailer.rb +18 -0
  44. data/lib/cnab240/pagamentos/v87/tributos/header.rb +47 -0
  45. data/lib/cnab240/pagamentos/v87/tributos/trailer.rb +17 -0
  46. data/lib/cnab240/segmentos/v40/segmento_a.rb +45 -48
  47. data/lib/cnab240/segmentos/v80/agencia_itau.rb +11 -12
  48. data/lib/cnab240/segmentos/v80/agencia_outros.rb +9 -10
  49. data/lib/cnab240/segmentos/v80/segmento_a.rb +59 -61
  50. data/lib/cnab240/segmentos/v83/segmento_a.rb +42 -0
  51. data/lib/cnab240/segmentos/v83/segmento_b.rb +40 -0
  52. data/lib/cnab240/segmentos/v83/segmento_j.rb +33 -0
  53. data/lib/cnab240/segmentos/v83/segmento_z.rb +19 -0
  54. data/lib/cnab240/segmentos/v86/segmento_a.rb +42 -45
  55. data/lib/cnab240/segmentos/v86/segmento_b.rb +38 -39
  56. data/lib/cnab240/segmentos/v86/segmento_c.rb +23 -24
  57. data/lib/cnab240/segmentos/v86/segmento_j.rb +25 -26
  58. data/lib/cnab240/segmentos/v86/segmento_j52.rb +22 -24
  59. data/lib/cnab240/segmentos/v86/segmento_n.rb +50 -51
  60. data/lib/cnab240/segmentos/v86/segmento_n1.rb +13 -15
  61. data/lib/cnab240/segmentos/v86/segmento_n2.rb +15 -17
  62. data/lib/cnab240/segmentos/v86/segmento_n3.rb +15 -17
  63. data/lib/cnab240/segmentos/v86/segmento_n4.rb +17 -19
  64. data/lib/cnab240/segmentos/v86/segmento_n5.rb +15 -17
  65. data/lib/cnab240/segmentos/v86/segmento_n6.rb +15 -17
  66. data/lib/cnab240/segmentos/v86/segmento_n7.rb +16 -18
  67. data/lib/cnab240/segmentos/v86/segmento_n8.rb +15 -18
  68. data/lib/cnab240/segmentos/v86/segmento_o.rb +20 -21
  69. data/lib/cnab240/segmentos/v86/segmento_w.rb +16 -17
  70. data/lib/cnab240/segmentos/v86/segmento_w1.rb +12 -13
  71. data/lib/cnab240/segmentos/v86/segmento_z.rb +14 -14
  72. data/lib/cnab240/segmentos/v87/segmento_a.rb +44 -0
  73. data/lib/cnab240/segmentos/v87/segmento_b.rb +40 -0
  74. data/lib/cnab240/segmentos/v87/segmento_c.rb +32 -0
  75. data/lib/cnab240/segmentos/v87/segmento_j.rb +33 -0
  76. data/lib/cnab240/segmentos/v87/segmento_j52.rb +32 -0
  77. data/lib/cnab240/segmentos/v87/segmento_n.rb +59 -0
  78. data/lib/cnab240/segmentos/v87/segmento_n1.rb +19 -0
  79. data/lib/cnab240/segmentos/v87/segmento_n2.rb +21 -0
  80. data/lib/cnab240/segmentos/v87/segmento_n3.rb +21 -0
  81. data/lib/cnab240/segmentos/v87/segmento_n4.rb +23 -0
  82. data/lib/cnab240/segmentos/v87/segmento_n5.rb +21 -0
  83. data/lib/cnab240/segmentos/v87/segmento_n6.rb +21 -0
  84. data/lib/cnab240/segmentos/v87/segmento_n7.rb +21 -0
  85. data/lib/cnab240/segmentos/v87/segmento_n8.rb +22 -0
  86. data/lib/cnab240/segmentos/v87/segmento_o.rb +27 -0
  87. data/lib/cnab240/segmentos/v87/segmento_w.rb +24 -0
  88. data/lib/cnab240/segmentos/v87/segmento_w1.rb +16 -0
  89. data/lib/cnab240/segmentos/v87/segmento_z.rb +19 -0
  90. data/lib/cnab240/version.rb +1 -2
  91. data/lib/cnab240.rb +54 -24
  92. metadata +64 -133
  93. data/.gitignore +0 -19
  94. data/.rspec +0 -2
  95. data/.travis.yml +0 -4
  96. data/Gemfile +0 -6
  97. data/LICENSE +0 -22
  98. data/README.md +0 -135
  99. data/docs/vendor/febraban/subcpadr12_layout_padrao_V86.pdf +0 -0
  100. data/docs/vendor/itau/SISPAG_CNAB_240.pdf +0 -0
  101. data/docs/vendor/itau/sisdeb_cnab_240.pdf +0 -0
  102. data/spec/arquivo/arquivo_spec.rb +0 -95
  103. data/spec/arquivo/v40/header_spec.rb +0 -68
  104. data/spec/arquivo/v40/trailer_spec.rb +0 -25
  105. data/spec/arquivo/v80/header_spec.rb +0 -60
  106. data/spec/arquivo/v80/trailer_spec.rb +0 -26
  107. data/spec/arquivo/v86/header_spec.rb +0 -89
  108. data/spec/arquivo/v86/trailer_spec.rb +0 -27
  109. data/spec/bindata/bindata_spec.rb +0 -55
  110. data/spec/cnab240_spec.rb +0 -22
  111. data/spec/helper/pagamento_itau_spec.rb +0 -83
  112. data/spec/hom/hom_spec.rb +0 -65
  113. data/spec/hom/retorno/SB22112AIT.RET +0 -5
  114. data/spec/hom/retorno/SB23112AIT.RET +0 -5
  115. data/spec/pagamentos/v40/header_spec.rb +0 -59
  116. data/spec/pagamentos/v40/lote_spec.rb +0 -25
  117. data/spec/pagamentos/v40/trailer_spec.rb +0 -28
  118. data/spec/pagamentos/v80/header_spec.rb +0 -52
  119. data/spec/pagamentos/v80/lote_spec.rb +0 -25
  120. data/spec/pagamentos/v80/trailer_spec.rb +0 -28
  121. data/spec/pagamentos/v86/header_spec.rb +0 -53
  122. data/spec/pagamentos/v86/lote_spec.rb +0 -38
  123. data/spec/pagamentos/v86/titulos/header_spec.rb +0 -51
  124. data/spec/pagamentos/v86/titulos/lote_spec.rb +0 -37
  125. data/spec/pagamentos/v86/titulos/trailer_spec.rb +0 -30
  126. data/spec/pagamentos/v86/trailer_spec.rb +0 -30
  127. data/spec/pagamentos/v86/tributos/header_spec.rb +0 -53
  128. data/spec/pagamentos/v86/tributos/lote_spec.rb +0 -43
  129. data/spec/pagamentos/v86/tributos/trailer_spec.rb +0 -27
  130. data/spec/segmentos/v40/segmento_a_spec.rb +0 -70
  131. data/spec/segmentos/v80/segmento_a_spec.rb +0 -70
  132. data/spec/segmentos/v86/segmento_a_spec.rb +0 -65
  133. data/spec/segmentos/v86/segmento_b_spec.rb +0 -67
  134. data/spec/segmentos/v86/segmento_c_spec.rb +0 -51
  135. data/spec/segmentos/v86/segmento_j52_spec.rb +0 -55
  136. data/spec/segmentos/v86/segmento_j_spec.rb +0 -55
  137. data/spec/segmentos/v86/segmento_n1_spec.rb +0 -43
  138. data/spec/segmentos/v86/segmento_n2_spec.rb +0 -46
  139. data/spec/segmentos/v86/segmento_n3_spec.rb +0 -45
  140. data/spec/segmentos/v86/segmento_n4_spec.rb +0 -47
  141. data/spec/segmentos/v86/segmento_n5_spec.rb +0 -45
  142. data/spec/segmentos/v86/segmento_n6_spec.rb +0 -45
  143. data/spec/segmentos/v86/segmento_n7_spec.rb +0 -46
  144. data/spec/segmentos/v86/segmento_n8_spec.rb +0 -45
  145. data/spec/segmentos/v86/segmento_n_spec.rb +0 -73
  146. data/spec/segmentos/v86/segmento_o_spec.rb +0 -50
  147. data/spec/segmentos/v86/segmento_spec.rb +0 -12
  148. data/spec/segmentos/v86/segmento_w_spec.rb +0 -51
  149. data/spec/segmentos/v86/segmento_z_spec.rb +0 -42
  150. data/spec/spec_helper.rb +0 -10
  151. data/spec/tmp/.gitkeep +0 -0
@@ -1,55 +1,53 @@
1
1
  module Cnab240::V40::Pagamentos
2
- class Header < BinData::Record
3
-
4
- include Cnab240::DefaultMixin
2
+ class Header < BinData::Record
5
3
 
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'
4
+ include Cnab240::DefaultMixin
9
5
 
10
- string :servico_operacao, :length => 1, :initial_value => 'D', :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 => '030', :pad_byte => '0'
14
- string :cnab_g004_1, :length => 1, :pad_byte => ' '
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'
15
9
 
16
- lstring :empresa_tipo, :length => 1, :pad_byte => '0'
17
- lstring :empresa_numero, :length => 14, :pad_byte => '0'
18
- string :empresa_convenio, :length => 13, :pad_byte => ' '
10
+ string :servico_operacao, :length => 1, :initial_value => 'D', :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 => '030', :pad_byte => '0'
14
+ string :cnab_g004_1, :length => 1, :pad_byte => ' '
19
15
 
16
+ lstring :empresa_tipo, :length => 1, :pad_byte => '0'
17
+ lstring :empresa_numero, :length => 14, :pad_byte => '0'
18
+ string :empresa_convenio, :length => 13, :pad_byte => ' '
20
19
 
21
- string :brancos_1, :length => 7, :pad_byte => ' '
22
- lstring :brancos_2, :length => 1, :pad_byte => '0'
20
+ string :brancos_1, :length => 7, :pad_byte => ' '
21
+ lstring :brancos_2, :length => 1, :pad_byte => '0'
23
22
 
23
+ lstring :empresa_agencia_codigo, :length => 4, :pad_byte => '0'
24
24
 
25
- lstring :empresa_agencia_codigo, :length => 4, :pad_byte => '0'
25
+ string :brancos_3, :length => 1, :pad_byte => ' '
26
+ lstring :brancos_4, :length => 7, :pad_byte => '0'
26
27
 
27
- string :brancos_3, :length => 1, :pad_byte => ' '
28
- lstring :brancos_4, :length => 7, :pad_byte => '0'
28
+ lstring :empresa_conta_numero, :length => 5, :pad_byte => '0'
29
29
 
30
- lstring :empresa_conta_numero, :length => 5, :pad_byte => '0'
30
+ string :brancos_5, :length => 1, :pad_byte => ' '
31
31
 
32
- string :brancos_5, :length => 1, :pad_byte => ' '
32
+ string :empresa_agencia_conta_dv, :length => 1, :pad_byte => '0'
33
+ string :empresa_nome, :length => 30, :pad_byte => ' '
33
34
 
34
- string :empresa_agencia_conta_dv, :length => 1, :pad_byte => '0'
35
- string :empresa_nome, :length => 30, :pad_byte => ' '
35
+ string :informacao_1, :length => 40, :pad_byte => ' '
36
36
 
37
- string :informacao_1, :length => 40, :pad_byte => ' '
37
+ string :endereco_logradouro, :length => 30, :pad_byte => ' '
38
+ lstring :endereco_numero, :length => 5, :pad_byte => '0'
39
+ string :endereco_complemento, :length => 15, :pad_byte => ' '
40
+ string :endereco_cidade, :length => 20, :pad_byte => ' '
41
+ lstring :endereco_cep, :length => 8, :pad_byte => '0'
42
+ string :endereco_estado, :length => 2, :pad_byte => ' '
38
43
 
39
- string :endereco_logradouro, :length => 30, :pad_byte => ' '
40
- lstring :endereco_numero, :length => 5, :pad_byte => '0'
41
- string :endereco_complemento, :length => 15, :pad_byte => ' '
42
- string :endereco_cidade, :length => 20, :pad_byte => ' '
43
- lstring :endereco_cep, :length => 8, :pad_byte => '0'
44
- string :endereco_estado, :length => 2, :pad_byte => ' '
44
+ string :cnab_g004_2, :length => 8, :pad_byte => ' '
45
+ string :ocorrencias, :length => 10, :pad_byte => ' '
45
46
 
46
- string :cnab_g004_2, :length => 8, :pad_byte => ' '
47
- string :ocorrencias, :length => 10, :pad_byte => ' '
47
+ protected
48
48
 
49
- protected
50
-
51
- def auto_fill
49
+ def auto_fill
52
50
 
53
- end
54
- end
51
+ end
52
+ end
55
53
  end
@@ -1,18 +1,18 @@
1
1
  module Cnab240::V40::Pagamentos
2
- class Trailer < BinData::Record
3
-
4
- include Cnab240::DefaultMixin
2
+ class Trailer < BinData::Record
5
3
 
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'
4
+ include Cnab240::DefaultMixin
9
5
 
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 :totais_qtde_moeda, :length => 18, :pad_byte => '0'
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'
14
9
 
15
- string :cnab_g004_2, :length => 171, :pad_byte => ' '
16
- string :ocorrencias, :length => 10, :pad_byte => ' '
17
- end
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 :totais_qtde_moeda, :length => 18, :pad_byte => '0'
14
+
15
+ string :cnab_g004_2, :length => 171, :pad_byte => ' '
16
+ string :ocorrencias, :length => 10, :pad_byte => ' '
17
+ end
18
18
  end
@@ -1,47 +1,47 @@
1
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 => '0'
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
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 => '0'
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
+ string :brancos_4, :length => 8, :pad_byte => ' '
39
+ string :ocorrencias, :length => 10, :pad_byte => ' '
40
+
41
+ private
42
+
43
+ def auto_fill
44
+
45
+ end
46
+ end
47
47
  end
@@ -1,17 +1,17 @@
1
1
  module Cnab240::V80::Pagamentos
2
- class Trailer < BinData::Record
3
-
4
- include Cnab240::DefaultMixin
2
+ class Trailer < BinData::Record
5
3
 
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'
4
+ include Cnab240::DefaultMixin
9
5
 
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
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
+ string :cnab_g004_1, :length => 9, :pad_byte => ' '
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
17
  end
@@ -0,0 +1,45 @@
1
+ module Cnab240::V83::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 => '031', :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 :empresa_convenio, :length => 20, :pad_byte => ' '
19
+ lstring :empresa_agencia_codigo, :length => 5, :pad_byte => '0'
20
+ string :empresa_agencia_dv, :length => 1, :pad_byte => ' '
21
+ lstring :empresa_conta_numero, :length => 12, :pad_byte => '0'
22
+ string :empresa_conta_dv, :length => 1, :pad_byte => ' '
23
+ string :empresa_agencia_conta_dv, :length => 1, :pad_byte => ' '
24
+ string :empresa_nome, :length => 30, :pad_byte => ' '
25
+
26
+ string :informacao_1, :length => 40, :pad_byte => ' '
27
+
28
+ string :endereco_logradouro, :length => 30, :pad_byte => ' '
29
+ lstring :endereco_numero, :length => 5, :pad_byte => '0'
30
+ string :endereco_complemento, :length => 15, :pad_byte => ' '
31
+ string :endereco_cidade, :length => 20, :pad_byte => ' '
32
+ lstring :endereco_cep, :length => 5, :pad_byte => '0'
33
+ lstring :endereco_complemento_cep, :length => 3, :pad_byte => '0'
34
+ string :endereco_estado, :length => 2, :pad_byte => ' '
35
+
36
+ string :cnab_g004_2, :length => 8, :pad_byte => ' '
37
+ string :ocorrencias, :length => 10, :pad_byte => ' '
38
+
39
+ private
40
+
41
+ def auto_fill
42
+
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,18 @@
1
+ module Cnab240::V83::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 => ' '
11
+ lstring :totais_qtde_registros, :length => 6, :pad_byte => '0'
12
+ lstring :totais_valor, :length => 18, :pad_byte => '0'
13
+ lstring :totais_qtde_moeda, :length => 18, :pad_byte => '0'
14
+ lstring :numero_aviso_debito, :length => 6, :pad_byte => '0'
15
+ string :cnab_g004_2, :length => 165, :pad_byte => ' '
16
+ string :ocorrencias, :length => 10, :pad_byte => ' '
17
+ end
18
+ end
@@ -1,46 +1,46 @@
1
1
  module Cnab240::V86::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 => '044', :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 :empresa_convenio, :length => 20, :pad_byte => ' '
19
- lstring :empresa_agencia_codigo, :length => 5, :pad_byte => '0'
20
- string :empresa_agencia_dv, :length => 1, :pad_byte => '0'
21
- lstring :empresa_conta_numero, :length => 12, :pad_byte => '0'
22
- string :empresa_conta_dv, :length => 1, :pad_byte => ' '
23
- string :empresa_agencia_conta_dv, :length => 1, :pad_byte => '0'
24
- string :empresa_nome, :length => 30, :pad_byte => ' '
25
-
26
- string :informacao_1, :length => 40, :pad_byte => ' '
27
-
28
- string :endereco_logradouro, :length => 30, :pad_byte => ' '
29
- lstring :endereco_numero, :length => 5, :pad_byte => '0'
30
- string :endereco_complemento, :length => 15, :pad_byte => ' '
31
- string :endereco_cidade, :length => 20, :pad_byte => ' '
32
- lstring :endereco_cep, :length => 5, :pad_byte => '0'
33
- lstring :endereco_complemento_cep, :length => 3, :pad_byte => '0'
34
- string :endereco_estado, :length => 2, :pad_byte => ' '
35
-
36
- lstring :indicativo_forma_pagamento, :length => 2, :pad_byte => '0'
37
- string :cnab_g004_2, :length => 6, :pad_byte => ' '
38
- string :ocorrencias, :length => 10, :pad_byte => ' '
39
-
40
- private
41
-
42
- def auto_fill
43
-
44
- end
45
- end
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 => '044', :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 :empresa_convenio, :length => 20, :pad_byte => ' '
19
+ lstring :empresa_agencia_codigo, :length => 5, :pad_byte => '0'
20
+ string :empresa_agencia_dv, :length => 1, :pad_byte => '0'
21
+ lstring :empresa_conta_numero, :length => 12, :pad_byte => '0'
22
+ string :empresa_conta_dv, :length => 1, :pad_byte => ' '
23
+ string :empresa_agencia_conta_dv, :length => 1, :pad_byte => '0'
24
+ string :empresa_nome, :length => 30, :pad_byte => ' '
25
+
26
+ string :informacao_1, :length => 40, :pad_byte => ' '
27
+
28
+ string :endereco_logradouro, :length => 30, :pad_byte => ' '
29
+ lstring :endereco_numero, :length => 5, :pad_byte => '0'
30
+ string :endereco_complemento, :length => 15, :pad_byte => ' '
31
+ string :endereco_cidade, :length => 20, :pad_byte => ' '
32
+ lstring :endereco_cep, :length => 5, :pad_byte => '0'
33
+ lstring :endereco_complemento_cep, :length => 3, :pad_byte => '0'
34
+ string :endereco_estado, :length => 2, :pad_byte => ' '
35
+
36
+ lstring :indicativo_forma_pagamento, :length => 2, :pad_byte => '0'
37
+ string :cnab_g004_2, :length => 6, :pad_byte => ' '
38
+ string :ocorrencias, :length => 10, :pad_byte => ' '
39
+
40
+ private
41
+
42
+ def auto_fill
43
+
44
+ end
45
+ end
46
46
  end
@@ -1,46 +1,46 @@
1
1
  module Cnab240::V86::PagamentosTitulos
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
-
15
- string :cnab_g004_1, :length => 1, :pad_byte => ' '
16
-
17
- lstring :empresa_tipo, :length => 1, :pad_byte => '0'
18
- lstring :empresa_numero, :length => 14, :pad_byte => '0'
19
- string :empresa_convenio, :length => 20, :pad_byte => ' '
20
- lstring :empresa_agencia_codigo, :length => 5, :pad_byte => '0'
21
- string :empresa_agencia_dv, :length => 1, :pad_byte => '0'
22
- lstring :empresa_conta_numero, :length => 12, :pad_byte => '0'
23
- string :empresa_conta_dv, :length => 1, :pad_byte => '0'
24
- string :empresa_agencia_conta_dv, :length => 1, :pad_byte => '0'
25
- string :empresa_nome, :length => 30, :pad_byte => ' '
26
-
27
- string :informacao_1, :length => 40, :pad_byte => ' '
28
-
29
- string :endereco_logradouro, :length => 30, :pad_byte => ' '
30
- lstring :endereco_numero, :length => 5, :pad_byte => '0'
31
- string :endereco_complemento, :length => 15, :pad_byte => ' '
32
- string :endereco_cidade, :length => 20, :pad_byte => ' '
33
- lstring :endereco_cep, :length => 5, :pad_byte => '0'
34
- lstring :endereco_complemento_cep, :length => 3, :pad_byte => '0'
35
- string :endereco_estado, :length => 2, :pad_byte => ' '
36
-
37
- string :cnab_g004_2, :length => 8, :pad_byte => ' '
38
- string :ocorrencias, :length => 10, :pad_byte => ' '
39
-
40
- private
41
-
42
- def auto_fill
43
-
44
- end
45
- end
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
+
15
+ string :cnab_g004_1, :length => 1, :pad_byte => ' '
16
+
17
+ lstring :empresa_tipo, :length => 1, :pad_byte => '0'
18
+ lstring :empresa_numero, :length => 14, :pad_byte => '0'
19
+ string :empresa_convenio, :length => 20, :pad_byte => ' '
20
+ lstring :empresa_agencia_codigo, :length => 5, :pad_byte => '0'
21
+ string :empresa_agencia_dv, :length => 1, :pad_byte => '0'
22
+ lstring :empresa_conta_numero, :length => 12, :pad_byte => '0'
23
+ string :empresa_conta_dv, :length => 1, :pad_byte => '0'
24
+ string :empresa_agencia_conta_dv, :length => 1, :pad_byte => '0'
25
+ string :empresa_nome, :length => 30, :pad_byte => ' '
26
+
27
+ string :informacao_1, :length => 40, :pad_byte => ' '
28
+
29
+ string :endereco_logradouro, :length => 30, :pad_byte => ' '
30
+ lstring :endereco_numero, :length => 5, :pad_byte => '0'
31
+ string :endereco_complemento, :length => 15, :pad_byte => ' '
32
+ string :endereco_cidade, :length => 20, :pad_byte => ' '
33
+ lstring :endereco_cep, :length => 5, :pad_byte => '0'
34
+ lstring :endereco_complemento_cep, :length => 3, :pad_byte => '0'
35
+ string :endereco_estado, :length => 2, :pad_byte => ' '
36
+
37
+ string :cnab_g004_2, :length => 8, :pad_byte => ' '
38
+ string :ocorrencias, :length => 10, :pad_byte => ' '
39
+
40
+ private
41
+
42
+ def auto_fill
43
+
44
+ end
45
+ end
46
46
  end
@@ -1,18 +1,18 @@
1
1
  module Cnab240::V86::PagamentosTitulos
2
- class Trailer < BinData::Record
3
-
4
- include Cnab240::DefaultMixin
2
+ class Trailer < BinData::Record
5
3
 
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'
4
+ include Cnab240::DefaultMixin
9
5
 
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 :totais_qtde_moeda, :length => 18, :pad_byte => '0'
14
- lstring :numero_aviso_debito, :length => 6, :pad_byte => '0'
15
- string :cnab_g004_2, :length => 165, :pad_byte => ' '
16
- string :ocorrencias, :length => 10, :pad_byte => ' '
17
- end
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 :totais_qtde_moeda, :length => 18, :pad_byte => '0'
14
+ lstring :numero_aviso_debito, :length => 6, :pad_byte => '0'
15
+ string :cnab_g004_2, :length => 165, :pad_byte => ' '
16
+ string :ocorrencias, :length => 10, :pad_byte => ' '
17
+ end
18
18
  end
@@ -1,18 +1,18 @@
1
1
  module Cnab240::V86::Pagamentos
2
- class Trailer < BinData::Record
3
-
4
- include Cnab240::DefaultMixin
2
+ class Trailer < BinData::Record
5
3
 
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'
4
+ include Cnab240::DefaultMixin
9
5
 
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 :totais_qtde_moeda, :length => 18, :pad_byte => '0'
14
- lstring :numero_aviso_debito, :length => 6, :pad_byte => '0'
15
- string :cnab_g004_2, :length => 165, :pad_byte => ' '
16
- string :ocorrencias, :length => 10, :pad_byte => ' '
17
- end
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 :totais_qtde_moeda, :length => 18, :pad_byte => '0'
14
+ lstring :numero_aviso_debito, :length => 6, :pad_byte => '0'
15
+ string :cnab_g004_2, :length => 165, :pad_byte => ' '
16
+ string :ocorrencias, :length => 10, :pad_byte => ' '
17
+ end
18
18
  end