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
@@ -0,0 +1,19 @@
1
+ module Cnab240::V87
2
+ class SegmentoN1 < BinData::Record
3
+
4
+ include Cnab240::DefaultMixin
5
+ include Cnab240::SegmentoMixin
6
+
7
+ string :receita, :length => 6, :pad_byte => ' '
8
+ lstring :tipo_identificacao_contribuinte, :length => 2, :pad_byte => '0'
9
+ lstring :identificacao_contribuinte, :length => 14, :pad_byte => '0'
10
+ string :identificacao_tributo, :length => 2, :pad_byte => ' '
11
+
12
+ lstring :mes_ano_competencia, :length => 6, :pad_byte => '0'
13
+ lstring :valor_tributo, :length => 15, :pad_byte => '0'
14
+ lstring :valor_outras_entidades, :length => 15, :pad_byte => '0'
15
+ lstring :atualizacao_monetaria, :length => 15, :pad_byte => '0'
16
+
17
+ string :cnab, :length => 45, :pad_byte => ' '
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ module Cnab240::V87
2
+ class SegmentoN2 < BinData::Record
3
+
4
+ include Cnab240::DefaultMixin
5
+ include Cnab240::SegmentoMixin
6
+
7
+ string :receita, :length => 6, :pad_byte => ' '
8
+ lstring :tipo_identificacao_contribuinte, :length => 2, :pad_byte => '0'
9
+ lstring :identificacao_contribuinte, :length => 14, :pad_byte => '0'
10
+ string :identificacao_tributo, :length => 2, :pad_byte => ' '
11
+
12
+ lstring :periodo_apuracao, :length => 8, :pad_byte => '0'
13
+ lstring :numero_referencia, :length => 17, :pad_byte => '0'
14
+ lstring :valor_principal, :length => 15, :pad_byte => '0'
15
+ lstring :valor_multa, :length => 15, :pad_byte => '0'
16
+ lstring :valor_juros_encargos, :length => 15, :pad_byte => '0'
17
+ lstring :data_vencimento, :length => 8, :pad_byte => '0'
18
+
19
+ string :cnab, :length => 18, :pad_byte => ' '
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module Cnab240::V87
2
+ class SegmentoN3 < BinData::Record
3
+
4
+ include Cnab240::DefaultMixin
5
+ include Cnab240::SegmentoMixin
6
+
7
+ string :receita, :length => 6, :pad_byte => ' '
8
+ lstring :tipo_identificacao_contribuinte, :length => 2, :pad_byte => '0'
9
+ lstring :identificacao_contribuinte, :length => 14, :pad_byte => '0'
10
+ string :identificacao_tributo, :length => 2, :pad_byte => ' '
11
+
12
+ lstring :periodo_apuracao, :length => 8, :pad_byte => '0'
13
+ lstring :receita_bruta, :length => 15, :pad_byte => '0'
14
+ lstring :percentual, :length => 7, :pad_byte => '0'
15
+ lstring :valor_principal, :length => 15, :pad_byte => '0'
16
+ lstring :valor_multa, :length => 15, :pad_byte => '0'
17
+ lstring :valor_juros_encargos, :length => 15, :pad_byte => '0'
18
+
19
+ string :cnab, :length => 21, :pad_byte => ' '
20
+ end
21
+ end
@@ -0,0 +1,23 @@
1
+ module Cnab240::V87
2
+ class SegmentoN4 < BinData::Record
3
+
4
+ include Cnab240::DefaultMixin
5
+ include Cnab240::SegmentoMixin
6
+
7
+ string :receita, :length => 6, :pad_byte => ' '
8
+ lstring :tipo_identificacao_contribuinte, :length => 2, :pad_byte => '0'
9
+ lstring :identificacao_contribuinte, :length => 14, :pad_byte => '0'
10
+ string :identificacao_tributo, :length => 2, :pad_byte => ' '
11
+
12
+ lstring :vencimento, :length => 8, :pad_byte => '0'
13
+ lstring :ie_munic_declar, :length => 12, :pad_byte => '0'
14
+ lstring :divida_ativa_etiqueta, :length => 13, :pad_byte => '0'
15
+ lstring :periodo_referencia, :length => 6, :pad_byte => '0'
16
+ lstring :numero_parcela_notificacao, :length => 13, :pad_byte => '0'
17
+ lstring :valor_receita, :length => 15, :pad_byte => '0'
18
+ lstring :valor_juros_encargos, :length => 14, :pad_byte => '0'
19
+ lstring :valor_multa, :length => 14, :pad_byte => '0'
20
+
21
+ string :cnab, :length => 1, :pad_byte => ' '
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ module Cnab240::V87
2
+ class SegmentoN5 < BinData::Record
3
+
4
+ include Cnab240::DefaultMixin
5
+ include Cnab240::SegmentoMixin
6
+
7
+ string :receita, :length => 6, :pad_byte => ' '
8
+ lstring :tipo_identificacao_contribuinte, :length => 2, :pad_byte => '0'
9
+ lstring :identificacao_contribuinte, :length => 14, :pad_byte => '0'
10
+ string :identificacao_tributo, :length => 2, :pad_byte => ' '
11
+
12
+ lstring :exercicio, :length => 4, :pad_byte => '0'
13
+ lstring :renavam, :length => 9, :pad_byte => '0'
14
+ string :uf, :length => 2, :pad_byte => ' '
15
+ lstring :municipio, :length => 5, :pad_byte => '0'
16
+ string :placa, :length => 7, :pad_byte => ' '
17
+ string :opcao_pagamento, :length => 1, :pad_byte => ' '
18
+
19
+ string :cnab, :length => 68, :pad_byte => ' '
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module Cnab240::V87
2
+ class SegmentoN6 < BinData::Record
3
+
4
+ include Cnab240::DefaultMixin
5
+ include Cnab240::SegmentoMixin
6
+
7
+ string :receita, :length => 6, :pad_byte => ' '
8
+ lstring :tipo_identificacao_contribuinte, :length => 2, :pad_byte => '0'
9
+ lstring :identificacao_contribuinte, :length => 14, :pad_byte => '0'
10
+ string :identificacao_tributo, :length => 2, :pad_byte => ' '
11
+
12
+ lstring :exercicio, :length => 4, :pad_byte => '0'
13
+ lstring :renavam, :length => 9, :pad_byte => '0'
14
+ string :uf, :length => 2, :pad_byte => ' '
15
+ lstring :municipio, :length => 5, :pad_byte => '0'
16
+ string :placa, :length => 7, :pad_byte => ' '
17
+ string :opcao_pagamento, :length => 1, :pad_byte => ' '
18
+
19
+ string :cnab, :length => 68, :pad_byte => ' '
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module Cnab240::V87
2
+ class SegmentoN7 < BinData::Record
3
+
4
+ include Cnab240::DefaultMixin
5
+ include Cnab240::SegmentoMixin
6
+
7
+ string :receita, :length => 6, :pad_byte => ' '
8
+ lstring :tipo_identificacao_contribuinte, :length => 2, :pad_byte => '0'
9
+ lstring :identificacao_contribuinte, :length => 14, :pad_byte => '0'
10
+ string :identificacao_tributo, :length => 2, :pad_byte => ' '
11
+
12
+ lstring :exercicio, :length => 4, :pad_byte => '0'
13
+ lstring :renavam, :length => 9, :pad_byte => '0'
14
+ string :uf, :length => 2, :pad_byte => ' '
15
+ lstring :municipio, :length => 5, :pad_byte => '0'
16
+ string :placa, :length => 7, :pad_byte => ' '
17
+ string :opcao_pagamento, :length => 1, :pad_byte => ' '
18
+ string :opcao_retirada, :length => 1, :pad_byte => ' '
19
+ string :cnab, :length => 67, :pad_byte => ' '
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ module Cnab240::V87
2
+ class SegmentoN8 < BinData::Record
3
+
4
+ include Cnab240::DefaultMixin
5
+ include Cnab240::SegmentoMixin
6
+
7
+ string :receita, :length => 6, :pad_byte => ' '
8
+ lstring :tipo_identificacao_contribuinte, :length => 2, :pad_byte => '0'
9
+ lstring :identificacao_contribuinte, :length => 14, :pad_byte => '0'
10
+
11
+
12
+ string :ie_munic_declar, :length => 8, :pad_byte => ' '
13
+
14
+ lstring :origem, :length => 16, :pad_byte => '0'
15
+ lstring :valor_principal, :length => 15, :pad_byte => '0'
16
+ string :atualizacao_monetaria, :length => 15, :pad_byte => ' '
17
+ lstring :valor_mora, :length => 15, :pad_byte => '0'
18
+ string :valor_multa, :length => 15, :pad_byte => ' '
19
+ string :data_vencimento, :length => 8, :pad_byte => ' '
20
+ string :periodo_parcela, :length => 6, :pad_byte => ' '
21
+ end
22
+ end
@@ -0,0 +1,27 @@
1
+ module Cnab240::V87
2
+ class SegmentoO < 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
+ lstring :servico_codigo_segmento, :length => 1, :initial_value => 'O', :pad_byte => ' '
13
+ lstring :servico_tipo_movimento, :length => 1, :pad_byte => '0'
14
+ lstring :servico_codigo_movimento, :length => 2, :pad_byte => '0'
15
+
16
+ string :codigo_barras, :length => 44, :pad_byte => ' '
17
+ string :nome_concessionaria, :length => 30, :pad_byte => ' '
18
+ lstring :data_vencimento, :length => 8, :pad_byte => '0'
19
+ lstring :data_pagamento, :length => 8, :pad_byte => '0'
20
+ lstring :valor_pagamento, :length => 15, :pad_byte => '0'
21
+ string :seu_numero, :length => 20, :pad_byte => ' '
22
+ string :nosso_numero, :length => 20, :pad_byte => ' '
23
+
24
+ string :cnab_g004_1, :length => 68, :pad_byte => ' '
25
+ string :ocorrencias, :length => 10, :pad_byte => ' '
26
+ end
27
+ end
@@ -0,0 +1,24 @@
1
+ module Cnab240::V87
2
+ class SegmentoW < 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 => 'W', :pad_byte => ' '
13
+ lstring :complemento, :length => 1, :pad_byte => '0'
14
+
15
+ string :uso_informacoes_1_e_2, :length => 1, :pad_byte => ' '
16
+ string :informacao_1, :length => 80, :pad_byte => ' '
17
+ string :informacao_2, :length => 80, :pad_byte => ' '
18
+
19
+ segmento_w1 :w1
20
+
21
+ string :reservado, :length => 2, :pad_byte => ' '
22
+ string :ocorrencias, :length => 10, :pad_byte => ' '
23
+ end
24
+ end
@@ -0,0 +1,16 @@
1
+ module Cnab240::V87
2
+ class SegmentoW1 < BinData::Record
3
+
4
+ include Cnab240::DefaultMixin
5
+ include Cnab240::SegmentoMixin
6
+
7
+ string :identificador_tributo, :length => 2, :pad_byte => ' '
8
+ string :receita, :length => 6, :pad_byte => ' '
9
+ string :tipo_identificacao_contribuinte, :length => 2, :pad_byte => ' '
10
+ string :identificacao_contribuinte, :length => 14, :pad_byte => ' '
11
+ string :identificador_fgts, :length => 16, :pad_byte => ' '
12
+ string :lacre_conectividade, :length => 9, :pad_byte => ' '
13
+ string :digito_lacre_conectividade, :length => 2, :pad_byte => ' '
14
+ string :cnab_g004_1, :length => 1, :pad_byte => ' '
15
+ end
16
+ end
@@ -0,0 +1,19 @@
1
+ module Cnab240::V87
2
+ class SegmentoZ < 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 => 'Z', :pad_byte => ' '
13
+
14
+ string :autenticacao, :length => 64, :pad_byte => ' '
15
+ string :controle_bancario, :length => 25, :pad_byte => ' '
16
+ string :cnab_g004_1, :length => 127, :pad_byte => ' '
17
+ string :ocorrencias, :length => 10, :pad_byte => ' '
18
+ end
19
+ end
@@ -1,4 +1,3 @@
1
1
  module Cnab240
2
- VERSION = "0.0.17"
2
+ VERSION = "0.1.0"
3
3
  end
4
-
data/lib/cnab240.rb CHANGED
@@ -2,7 +2,6 @@ require "cnab240/version"
2
2
 
3
3
  require 'bindata'
4
4
 
5
-
6
5
  require "cnab240/ext/attribute_accessors"
7
6
  require "cnab240/ext/bindata"
8
7
  require "cnab240/ext/lstring"
@@ -12,6 +11,10 @@ require "cnab240/ext/filler"
12
11
 
13
12
  require "cnab240/arquivo/lote"
14
13
 
14
+ require "cnab240/segmentos/v83/segmento_a"
15
+ require "cnab240/segmentos/v83/segmento_b"
16
+ require "cnab240/segmentos/v83/segmento_z"
17
+ require "cnab240/segmentos/v83/segmento_j"
15
18
  require "cnab240/segmentos/v86/segmento_a"
16
19
  require "cnab240/segmentos/v86/segmento_b"
17
20
  require "cnab240/segmentos/v86/segmento_c"
@@ -30,62 +33,89 @@ require "cnab240/segmentos/v86/segmento_n"
30
33
  require "cnab240/segmentos/v86/segmento_w1"
31
34
  require "cnab240/segmentos/v86/segmento_w"
32
35
  require "cnab240/segmentos/v86/segmento_z"
33
-
36
+ require "cnab240/segmentos/v87/segmento_a"
37
+ require "cnab240/segmentos/v87/segmento_b"
38
+ require "cnab240/segmentos/v87/segmento_c"
39
+ require "cnab240/segmentos/v87/segmento_j"
40
+ require "cnab240/segmentos/v87/segmento_j52"
41
+ require "cnab240/segmentos/v87/segmento_o"
42
+ require "cnab240/segmentos/v87/segmento_n8"
43
+ require "cnab240/segmentos/v87/segmento_n7"
44
+ require "cnab240/segmentos/v87/segmento_n6"
45
+ require "cnab240/segmentos/v87/segmento_n5"
46
+ require "cnab240/segmentos/v87/segmento_n4"
47
+ require "cnab240/segmentos/v87/segmento_n3"
48
+ require "cnab240/segmentos/v87/segmento_n2"
49
+ require "cnab240/segmentos/v87/segmento_n1"
50
+ require "cnab240/segmentos/v87/segmento_n"
51
+ require "cnab240/segmentos/v87/segmento_w1"
52
+ require "cnab240/segmentos/v87/segmento_w"
53
+ require "cnab240/segmentos/v87/segmento_z"
34
54
  require "cnab240/segmentos/v80/agencia_itau"
35
55
  require "cnab240/segmentos/v80/agencia_outros"
36
- require "cnab240/segmentos/v40/segmento_a"
37
56
  require "cnab240/segmentos/v80/segmento_a"
57
+ require "cnab240/segmentos/v40/segmento_a"
38
58
 
39
59
  require "cnab240/arquivo/arquivo"
40
60
 
41
61
  require "cnab240/arquivo/v80/header"
42
62
  require "cnab240/arquivo/v80/trailer"
63
+ require "cnab240/arquivo/v83/header"
64
+ require "cnab240/arquivo/v83/trailer"
43
65
  require "cnab240/arquivo/v86/header"
44
66
  require "cnab240/arquivo/v86/trailer"
45
67
  require "cnab240/arquivo/v40/header"
46
68
  require "cnab240/arquivo/v40/trailer"
47
-
69
+ require "cnab240/arquivo/v87/header"
70
+ require "cnab240/arquivo/v87/trailer"
48
71
 
49
72
  require "cnab240/pagamentos/v80/header"
50
73
  require "cnab240/pagamentos/v80/trailer"
74
+ require "cnab240/pagamentos/v83/header"
75
+ require "cnab240/pagamentos/v83/trailer"
51
76
  require "cnab240/pagamentos/v86/header"
52
77
  require "cnab240/pagamentos/v86/trailer"
53
78
  require "cnab240/pagamentos/v86/titulos/header"
54
79
  require "cnab240/pagamentos/v86/titulos/trailer"
55
80
  require "cnab240/pagamentos/v86/tributos/header"
56
81
  require "cnab240/pagamentos/v86/tributos/trailer"
57
-
82
+ require "cnab240/pagamentos/v87/header"
83
+ require "cnab240/pagamentos/v87/trailer"
84
+ require "cnab240/pagamentos/v87/titulos/header"
85
+ require "cnab240/pagamentos/v87/titulos/trailer"
86
+ require "cnab240/pagamentos/v87/tributos/header"
87
+ require "cnab240/pagamentos/v87/tributos/trailer"
58
88
  require "cnab240/pagamentos/v40/header"
59
89
  require "cnab240/pagamentos/v40/trailer"
60
90
 
61
91
  require "cnab240/arquivo/estrutura"
62
92
  require "cnab240/arquivo/builder"
63
93
 
94
+ require "cnab240/helper/helper"
64
95
  require "cnab240/helper/pagamento_itau"
65
-
96
+ require "cnab240/helper/pagamento_bradesco"
97
+ require "cnab240/helper/pagamento_bb"
98
+ require "cnab240/helper/pagamento_sicoob"
66
99
 
67
100
  module Cnab240
68
101
 
69
- mod_attr_accessor :defaults
70
- @@defaults = {}
102
+ mod_attr_accessor :defaults
103
+ @@defaults = {}
71
104
 
72
- mod_attr_accessor :fallback
73
- @@fallback = "V86"
105
+ mod_attr_accessor :fallback
106
+ @@fallback = "V86"
74
107
 
75
- mod_attr_accessor :auto_fill_enabled
76
- @@auto_fill_enabled = true
108
+ mod_attr_accessor :auto_fill_enabled
109
+ @@auto_fill_enabled = true
77
110
 
78
- # Yield self for configuration block:
79
- #
80
- # Cnab240.setup do |config|
81
- # config.banco = "001"
82
- # end
83
- #
84
- def self.setup
85
- yield self
86
- end
111
+ # Yield self for configuration block:
112
+ #
113
+ # Cnab240.setup do |config|
114
+ # config.banco = "001"
115
+ # end
116
+ #
117
+ def self.setup
118
+ yield self
119
+ end
87
120
 
88
121
  end
89
-
90
-
91
-