brcobranca 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -20,6 +20,8 @@ pkg
20
20
  scratch_directory
21
21
  tmp
22
22
  .yardoc
23
+ .rvmrc
24
+ .idea
23
25
 
24
26
  ## PROJECT::SPECIFIC
25
27
  config
@@ -28,3 +30,4 @@ pkg
28
30
  pkg/*.8
29
31
  doc
30
32
  doc/*.*
33
+ Gemfile.lock
data/Gemfile.lock CHANGED
@@ -1,37 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brcobranca (3.0.0)
5
- activemodel (>= 3.0.0)
4
+ brcobranca (3.1.0)
5
+ activemodel (~> 3)
6
6
  parseline (>= 1.0.3)
7
- rghost (>= 0.8.7)
8
- rghost_barcode (>= 0.8)
7
+ rghost (~> 0.8)
8
+ rghost_barcode (~> 0.9)
9
9
 
10
10
  GEM
11
11
  remote: http://rubygems.org/
12
12
  specs:
13
- activemodel (3.0.6)
14
- activesupport (= 3.0.6)
15
- builder (~> 2.1.2)
16
- i18n (~> 0.5.0)
17
- activesupport (3.0.6)
18
- builder (2.1.2)
19
- columnize (0.3.2)
20
- diff-lcs (1.1.2)
21
- i18n (0.5.0)
22
- linecache (0.43)
13
+ activemodel (3.2.3)
14
+ activesupport (= 3.2.3)
15
+ builder (~> 3.0.0)
16
+ activesupport (3.2.3)
17
+ i18n (~> 0.6)
18
+ multi_json (~> 1.0)
19
+ builder (3.0.0)
20
+ columnize (0.3.6)
21
+ diff-lcs (1.1.3)
22
+ i18n (0.6.0)
23
+ linecache (0.46)
24
+ rbx-require-relative (> 0.0.4)
25
+ multi_json (1.3.2)
23
26
  parseline (1.0.3)
24
- rake (0.8.7)
25
- rghost (0.8.7.5)
27
+ rake (0.9.2.2)
28
+ rbx-require-relative (0.0.9)
29
+ rghost (0.8.7.7)
26
30
  rghost_barcode (0.9)
27
- rspec (2.5.0)
28
- rspec-core (~> 2.5.0)
29
- rspec-expectations (~> 2.5.0)
30
- rspec-mocks (~> 2.5.0)
31
- rspec-core (2.5.1)
32
- rspec-expectations (2.5.0)
33
- diff-lcs (~> 1.1.2)
34
- rspec-mocks (2.5.0)
31
+ rspec (2.9.0)
32
+ rspec-core (~> 2.9.0)
33
+ rspec-expectations (~> 2.9.0)
34
+ rspec-mocks (~> 2.9.0)
35
+ rspec-core (2.9.0)
36
+ rspec-expectations (2.9.1)
37
+ diff-lcs (~> 1.1.3)
38
+ rspec-mocks (2.9.0)
35
39
  ruby-debug (0.10.4)
36
40
  columnize (>= 0.1)
37
41
  ruby-debug-base (~> 0.10.4.0)
@@ -40,6 +44,7 @@ GEM
40
44
 
41
45
  PLATFORMS
42
46
  ruby
47
+ x86-mingw32
43
48
 
44
49
  DEPENDENCIES
45
50
  brcobranca!
data/README.rdoc CHANGED
@@ -39,14 +39,21 @@ Gem para emissão de bloquetos de cobrança para bancos brasileiros
39
39
  * Banco Caixa
40
40
  * Sem registro (SR) by Túlio Ornelas - https://github.com/tulios
41
41
 
42
- == Esta perdido?
42
+ * Banco SICREDI
43
+
44
+ == Retornos Disponíveis
45
+
46
+ * CBR643
47
+ * CNAB240
48
+
49
+ == Está perdido?
43
50
 
44
51
  Veja a documentação da versão atual em http://rubydoc.info/gems/brcobranca e da versão de desenvolvimento em http://rubydoc.info/github/kivanio/brcobranca/master/frames
45
52
 
46
53
  == REQUISITOS
47
54
 
48
- * rghost >= 0.8.7
49
- * rghost_barcode >= 0.8
55
+ * rghost >= 0.8
56
+ * rghost_barcode >= 0.9
50
57
  * parseline >= 1.0.3
51
58
  * GhostScript > 8.0
52
59
 
@@ -70,7 +77,7 @@ Informe em http://github.com/kivanio/brcobranca/issues
70
77
 
71
78
  Recomende-nos no http://www.workingwithrails.com/recommendation/new/person/5679-kivanio-pereira-barbosa
72
79
 
73
- == LICENSA
80
+ == LICENÇA
74
81
 
75
82
  BSD
76
83
 
data/brcobranca.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Brcobranca::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Kivanio Barbosa"]
10
- s.date = %q{2011-04-14}
10
+ s.date = %q{2012-04-20}
11
11
  s.description = %q{Gem para emissão de bloquetos de cobrança de bancos brasileiros.}
12
12
  s.summary = %q{Gem que permite trabalhar com bloquetos de cobrança para bancos brasileiros.}
13
13
  s.email = %q{kivanio@gmail.com}
@@ -21,10 +21,10 @@ Gem::Specification.new do |s|
21
21
  s.requirements = ["GhostScript > 8.0, para gear PDF e c\303\263digo de Barras"]
22
22
  s.rubyforge_project = "brcobranca"
23
23
 
24
- s.add_runtime_dependency(%q<rghost>, [">= 0.8.7"])
25
- s.add_runtime_dependency(%q<rghost_barcode>, [">= 0.8"])
24
+ s.add_runtime_dependency(%q<rghost>, ["~> 0.8"])
25
+ s.add_runtime_dependency(%q<rghost_barcode>, ["~> 0.9"])
26
26
  s.add_runtime_dependency(%q<parseline>, [">= 1.0.3"])
27
- s.add_runtime_dependency(%q<activemodel>, [">= 3.0.0"])
27
+ s.add_runtime_dependency(%q<activemodel>, ["~> 3"])
28
28
 
29
29
  s.post_install_message = %[
30
30
  ===========================================================================
data/lib/brcobranca.rb CHANGED
@@ -47,7 +47,7 @@ module Brcobranca
47
47
  # Para mudar as configurações padrão, você pode fazer assim:
48
48
  # config/environments/test.rb:
49
49
  #
50
- # Brcobranca.configure do |config|
50
+ # Brcobranca.setup do |config|
51
51
  # config.formato = :gif
52
52
  # end
53
53
  #
@@ -68,6 +68,13 @@ module Brcobranca
68
68
  # @param [Integer] (Padrão: 150)
69
69
  attr_accessor :resolucao
70
70
 
71
+ # Ajusta o Encoding externo (do arquivo) - Ruby 1.9
72
+ # Ex: Caso esteja dando UndefinedConversionError - from ASCII-8BIT to UTF-8
73
+ # configurar com a string 'ascii-8bit'
74
+ # @return [String]
75
+ # @param [String] (Padrão: nil)
76
+ attr_accessor :external_encoding
77
+
71
78
  # Atribui valores padrões de configuração
72
79
  def initialize
73
80
  self.gerador = :rghost
@@ -96,6 +103,7 @@ module Brcobranca
96
103
  autoload :Bradesco, 'brcobranca/boleto/bradesco'
97
104
  autoload :Unibanco, 'brcobranca/boleto/unibanco'
98
105
  autoload :Caixa, 'brcobranca/boleto/caixa'
106
+ autoload :Sicredi, 'brcobranca/boleto/sicredi'
99
107
 
100
108
  # Módulos para classes de template
101
109
  module Template
@@ -108,5 +116,7 @@ module Brcobranca
108
116
  module Retorno
109
117
  autoload :Base, 'brcobranca/retorno/base'
110
118
  autoload :RetornoCbr643, 'brcobranca/retorno/retorno_cbr643'
119
+ autoload :RetornoCnab240, 'brcobranca/retorno/retorno_cnab240'
111
120
  end
112
- end
121
+ end
122
+
@@ -56,7 +56,7 @@ module Brcobranca
56
56
  # Utiliza-se o [-1..-1] para retornar o último caracter
57
57
  # @return [String]
58
58
  def nosso_numero_dv
59
- "#{carteira}#{numero_documento}".modulo11_9to2.to_s[-1..-1]
59
+ "#{carteira}#{numero_documento}".modulo11_2to9_caixa.to_s
60
60
  end
61
61
 
62
62
  # Número da agência/código cedente do cliente para exibir no boleto.
@@ -70,7 +70,7 @@ module Brcobranca
70
70
  # Dígito verificador do convênio ou código do cedente
71
71
  # @return [String]
72
72
  def convenio_dv
73
- "#{convenio.modulo11_2to9}"
73
+ "#{convenio.modulo11_2to9_caixa}"
74
74
  end
75
75
 
76
76
  # Monta a segunda parte do código de barras.
@@ -92,7 +92,7 @@ module Brcobranca
92
92
  "#{nosso_numero_boleto[1..1]}" <<
93
93
  "#{nosso_numero_boleto[8..16]}"
94
94
 
95
- "#{campo_livre}#{campo_livre.modulo11_2to9}"
95
+ "#{campo_livre}#{campo_livre.modulo11_2to9_caixa}"
96
96
  end
97
97
 
98
98
  end
@@ -0,0 +1,108 @@
1
+ # -*- encoding: utf-8 -*-
2
+ module Brcobranca
3
+ module Boleto
4
+ class Sicredi < Base # Banco SICREDI
5
+ # <b>REQUERIDO</b>: Código do posto da cooperativa de crédito
6
+ attr_accessor :posto
7
+
8
+ # <b>REQUERIDO</b>: Byte de identificação do cedente do bloqueto utilizado para compor o nosso número.
9
+ attr_accessor :byte_idt
10
+
11
+ validates_length_of :agencia, :maximum => 4, :message => "deve ser menor ou igual a 4 dígitos."
12
+ validates_length_of :numero_documento, :maximum => 5, :message => "deve ser menor ou igual a 5 dígitos."
13
+ validates_length_of :conta_corrente, :maximum => 5, :message => "deve ser menor ou igual a 5 dígitos."
14
+ validates_length_of :carteira, :maximum => 2, :message => "deve ser menor ou igual a 2 dígitos."
15
+
16
+ # Nova instancia do Bradesco
17
+ # @param (see Brcobranca::Boleto::Base#initialize)
18
+ def initialize(campos={})
19
+ campos = {:carteira => "03", :especie_documento => "A"}.merge!(campos)
20
+ super(campos)
21
+ end
22
+
23
+ # Codigo do banco emissor (3 dígitos sempre)
24
+ #
25
+ # @return [String] 3 caracteres numéricos.
26
+ def banco
27
+ "748"
28
+ end
29
+
30
+ # Carteira
31
+ #
32
+ # @return [String] 2 caracteres numéricos.
33
+ def carteira=(valor)
34
+ @carteira = valor.to_s.rjust(2,'0') unless valor.nil?
35
+ end
36
+
37
+ # Posto
38
+ #
39
+ # @return [String] 2 caracteres numéricos.
40
+ def posto=(valor)
41
+ @posto = valor.to_s.rjust(2, '0') unless valor.nil?
42
+ end
43
+
44
+ # Número da conta corrente
45
+ # @return [String] 5 caracteres numéricos.
46
+ def conta_corrente=(valor)
47
+ @conta_corrente = valor.to_s.rjust(5,'0') unless valor.nil?
48
+ end
49
+
50
+ # Dígito verificador do banco
51
+ # @return [String] 1 caractere.
52
+ def banco_dv
53
+ 'X'
54
+ end
55
+
56
+ # Nosso número para exibir no boleto.
57
+ # @return [String]
58
+ # @example
59
+ # boleto.nosso_numero_boleto #=> "06/00000004042-8"
60
+ def nosso_numero_boleto
61
+ "#{numero_documento_with_byte_idt[0..1]}/#{numero_documento_with_byte_idt[2..-1]}-#{self.nosso_numero_dv}"
62
+ end
63
+
64
+ def numero_documento_with_byte_idt
65
+ "#{self.data_documento.strftime('%y')}#{self.byte_idt}#{self.numero_documento}"
66
+ end
67
+
68
+ # Número seqüencial utilizado para identificar o boleto.
69
+ # @return [String] 5 caracteres numéricos.
70
+ def numero_documento=(valor)
71
+ @numero_documento = valor.to_s.rjust(5,'0') unless valor.nil?
72
+ end
73
+
74
+ # Codigo referente ao tipo de cobrança
75
+ # @return [String]: 1 caractere numérico
76
+ def tipo_cobranca
77
+ "3"
78
+ end
79
+
80
+ # Codigo referente ao tipo de carteira
81
+ # @return [String]: 1 caractere numérico
82
+ def tipo_carteira
83
+ if self.carteira == "03"
84
+ "1"
85
+ end
86
+ end
87
+ # Dígito verificador do nosso número
88
+ # @return [Integer] 1 caracteres numéricos.
89
+ def nosso_numero_dv
90
+ "#{agencia_posto_conta}#{numero_documento_with_byte_idt}".modulo11_9to2
91
+ end
92
+
93
+ def agencia_conta_boleto
94
+ "#{self.agencia}.#{self.posto}.#{conta_corrente}"
95
+ end
96
+
97
+ def agencia_posto_conta
98
+ "#{self.agencia}#{self.posto}#{conta_corrente}"
99
+ end
100
+
101
+ # Segunda parte do código de barras.
102
+ def codigo_barras_segunda_parte
103
+ campo_livre = "#{self.tipo_cobranca}#{self.tipo_carteira}#{self.nosso_numero_boleto.gsub(/\D/, '')}#{self.agencia_posto_conta}10"
104
+ campo_livre + campo_livre.modulo11_9to2_10_como_zero.to_s
105
+ end
106
+ end
107
+ end
108
+ end
@@ -23,6 +23,7 @@ module Brcobranca
23
23
  module Rghost
24
24
  extend self
25
25
  include RGhost unless self.include?(RGhost)
26
+ RGhost::Config::GS[:external_encoding] = Brcobranca.configuration.external_encoding
26
27
 
27
28
  # Gera o boleto em usando o formato desejado [:pdf, :jpg, :tif, :png, :ps, :laserjet, ... etc]
28
29
  #
@@ -225,3 +226,4 @@ module Brcobranca
225
226
  end
226
227
  end
227
228
  end
229
+
@@ -58,6 +58,16 @@ module Brcobranca
58
58
  valor = (11 - (total % 11))
59
59
  return [0,10,11].include?(valor) ? 1 : valor
60
60
  end
61
+
62
+ # Calcula módulo 11 com multiplicaroes de 2 a 9 (Utilizado pela CAIXA - boletos SIGCB).
63
+ #
64
+ # @return [Integer]
65
+ def modulo11_2to9_caixa
66
+ total = self.multiplicador([2,3,4,5,6,7,8,9])
67
+ total = (total % 11) unless total < 11
68
+ valor = (11 - total)
69
+ return valor > 9 ? 0 : valor
70
+ end
61
71
 
62
72
  # Calcula módulo 11 com multiplicaroes de 9 a 2 trocando retorno <b>10 por X</b>.
63
73
  #
@@ -0,0 +1,89 @@
1
+ require 'parseline'
2
+ module Brcobranca
3
+ module Retorno
4
+ # Formato de Retorno CNAB 240
5
+ class RetornoCnab240 < Base
6
+ # Regex para remoção de headers e trailers além de registros diferentes de T ou U
7
+ REGEX_DE_EXCLUSAO_DE_REGISTROS_NAO_T_OU_U = /^((?!^.{7}3.{5}[T|U].*$).)*$/
8
+
9
+ def self.load_lines(file, options={})
10
+ default_options = {:except => REGEX_DE_EXCLUSAO_DE_REGISTROS_NAO_T_OU_U}
11
+ options = default_options.merge!(options)
12
+
13
+ Line.load_lines(file, options).each_slice(2).inject([]) do |retornos, cnab_lines|
14
+ retornos << generate_retorno_based_on_cnab_lines(cnab_lines)
15
+ end
16
+ end
17
+
18
+ def self.generate_retorno_based_on_cnab_lines(cnab_lines)
19
+ retorno = self.new
20
+ cnab_lines.each do |line|
21
+ if line.tipo_registro == 'T'
22
+ Line::REGISTRO_T_FIELDS.each do |attr|
23
+ retorno.send(attr + '=', line.send(attr))
24
+ end
25
+ else
26
+ Line::REGISTRO_U_FIELDS.each do |attr|
27
+ retorno.send(attr + '=', line.send(attr))
28
+ end
29
+ end
30
+ end
31
+ retorno
32
+ end
33
+
34
+ # Linha de mapeamento do retorno do arquivo CNAB 240
35
+ # O registro CNAB 240 possui 2 tipos de registros que juntos geram um registro de retorno bancário
36
+ # O primeiro é do tipo T que retorna dados gerais sobre a transação
37
+ # O segundo é do tipo U que retorna os valores da transação
38
+ class Line < Base
39
+ extend ParseLine::FixedWidth # Extendendo parseline
40
+
41
+ REGISTRO_T_FIELDS = %w(agencia_com_dv cedente_com_dv nosso_numero carteira data_vencimento valor_titulo banco_recebedor agencia_recebedora_com_dv sequencial)
42
+ REGISTRO_U_FIELDS = %w(desconto_concedito valor_abatimento iof_desconto juros_mora valor_recebido outras_despesas outros_recebimento data_credito)
43
+
44
+ attr_accessor :tipo_registro
45
+
46
+ fixed_width_layout do |parse|
47
+ parse.field :tipo_registro, 13..13
48
+ parse.field :sequencial,8..12
49
+ parse.field :agencia_com_dv,17..22
50
+ parse.field :cedente_com_dv,23..35
51
+ parse.field :nosso_numero,46..56
52
+ parse.field :carteira,57..57
53
+ parse.field :data_vencimento,73..80
54
+ parse.field :valor_titulo,81..95
55
+ parse.field :banco_recebedor,96..98
56
+ parse.field :agencia_recebedora_com_dv,99..104
57
+ parse.field :data_credito,145..152
58
+ parse.field :outras_despesas,107..121
59
+ parse.field :iof_desconto,62..76
60
+ parse.field :valor_abatimento,47..61
61
+ parse.field :desconto_concedito,32..46
62
+ parse.field :valor_recebido,77..91
63
+ parse.field :juros_mora,17..31
64
+ parse.field :outros_recebimento,122..136
65
+
66
+ # Dados que não consegui extrair dos registros T e U
67
+ #parse.field :convenio,31..37
68
+ #parse.field :tipo_cobranca,80..80
69
+ #parse.field :tipo_cobranca_anterior,81..81
70
+ #parse.field :natureza_recebimento,86..87
71
+ #parse.field :carteira_variacao,91..93
72
+ #parse.field :desconto,95..99
73
+ #parse.field :iof,100..104
74
+ #parse.field :comando,108..109
75
+ #parse.field :data_liquidacao,110..115
76
+ #parse.field :especie_documento,173..174
77
+ #parse.field :valor_tarifa,181..187
78
+ #parse.field :juros_desconto,201..213
79
+ #parse.field :abatimento_nao_aproveitado,292..304
80
+ #parse.field :valor_lancamento,305..317
81
+ #parse.field :indicativo_lancamento,318..318
82
+ #parse.field :indicador_valor,319..319
83
+ #parse.field :valor_ajuste,320..331
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+
@@ -1,3 +1,3 @@
1
1
  module Brcobranca
2
- VERSION = "3.0.0"
2
+ VERSION = "3.1.0"
3
3
  end
@@ -1,28 +1,28 @@
1
- 02RETORNO01COBRANCA 33251000289353000000INSTITUTO MATO-GROSSENSE DO AL001BANCO DO BRASIL2001090000007 000000009703754590 1622420 000001
2
- 70000000000000000332510002893531622420 1622420000000000310000001 01900000000000 1806200109 000000000000000906400114923002201090000500000000000000000000000000000000000000000000000000000000000000000000000000009064000000000000000000000000000000000000000000000000856420000000000000 0000000000000000000000000000000000000000000000000004000002
3
- 70000000000000000332510002893531622420 1622420000000003010000001 01900000000000 1806200109 000000000000002235239909430002201090000500000000000000000000000000000000000000000000000000000000000000000000000000022352000000000000000000000000000000000000000000000002185220000000000000 0000000000000000000000000000000000000000000000000010000003
4
- 70000000000000000332510002893531622420 1622420000000003110000001 01900000000000 1806200109 00000000000000165330012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000016533000000000000000000000000000000000000000000000001603320000000000000 0000000000000000000000000000000000000000000000000002000004
5
- 70000000000000000332510002893531622420 1622420000000003210000001 01900000000000 1806200109 00000000000000157740012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000015774000000000000000000000000000000000000000000000001527420000000000000 0000000000000000000000000000000000000000000000000002000005
6
- 70000000000000000332510002893531622420 1622420000000003310000001 01900000000000 1806200109 00000000000000414440012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000041444000000000000000000000000000000000000000000000004094420000000000000 0000000000000000000000000000000000000000000000000002000006
7
- 70000000000000000332510002893531622420 1622420000000003410000001 01900000000000 1806200109 00000000000000610280012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000061028000000000000000000000000000000000000000000000006052820000000000000 0000000000000000000000000000000000000000000000000002000007
8
- 70000000000000000332510002893531622420 1622420000000003510000001 01900000000000 1806200109 00000000000000608040012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000060804000000000000000000000000000000000000000000000006030420000000000000 0000000000000000000000000000000000000000000000000002000008
9
- 70000000000000000332510002893531622420 1622420000000003610000001 01900000000000 1806200109 000000000000005610074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000010000009
10
- 70000000000000000332510002893531622420 1622420000000003710000001 01900000000000 1806200109 000000000000000565474808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000005654000000000000000000000000000000000000000000000000515420000000000000 0000000000000000000000000000000000000000000000000010000010
11
- 70000000000000000332510002893531622420 1622420000000003810000001 01900000000000 1806200109 000000000000005610074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000010000011
12
- 70000000000000000332510002893531622420 1622420000000003910000001 01900000000000 1806200109 000000000000000528074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000005280000000000000000000000000000000000000000000000000478020000000000000 0000000000000000000000000000000000000000000000000010000012
13
- 70000000000000000332510002893531622420 1622420000000004010000001 01900000000000 1806200109 000000000000005610074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000010000013
14
- 70000000000000000332510002893531622420 1622420000000004110000001 01900000000000 1806200109 000000000000000528074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000005280000000000000000000000000000000000000000000000000478020000000000000 0000000000000000000000000000000000000000000000000010000014
15
- 70000000000000000332510002893531622420 1622420000000004210000001 01900000000000 1806200109 000000000000005610000136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000004000015
16
- 70000000000000000332510002893531622420 1622420000000004310000001 01900000000000 1806200109 000000000000001672000136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000016720000000000000000000000000000000000000000000000001622020000000000000 0000000000000000000000000000000000000000000000000004000016
17
- 70000000000000000332510002893531622420 1622420000000004410000001 01900000000000 1806200109 000000000000000535300136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000005353000000000000000000000000000000000000000000000000485320000000000000 0000000000000000000000000000000000000000000000000004000017
18
- 70000000000000000332510002893531622420 1622420000000004510000001 01900000000000 1806200109 000000000000005210700130376002201090000500000000000000000000000000000000000000000000000000000000000000000000000000052107000000000000000000000000000000000000000000000005160720000000000000 0000000000000000000000000000000000000000000000000008000018
19
- 70000000000000000332510002893531622420 1622420000000004610000001 01900000000000 1806200109 000000000000006043600114923002201090000500000000000000000000000000000000000000000000000000000000000000000000000000060436000000000000000000000000000000000000000000000005993620000000000000 0000000000000000000000000000000000000000000000000002000019
20
- 70000000000000000332510002893531622420 1622420000000004710000001 01900000000000 1806200109 000000000000005610000136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000004000020
21
- 70000000000000000332510002893531622420 1622420000000004810000001 01900000000000 1806200109 000000000000000495000136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000004950000000000000000000000000000000000000000000000000445020000000000000 0000000000000000000000000000000000000000000000000004000021
22
- 70000000000000000332510002893531622420 1622420000000005010000001 01900000000000 1806200109 000000000000005707000114923002201090000500000000000000000000000000000000000000000000000000000000000000000000000000057070000000000000000000000000000000000000000000000005657020000000000000 0000000000000000000000000000000000000000000000000002000022
23
- 70000000000000000332510002893531622420 1622420000000005110000001 01900000000000 1806200109 000000000000005638600106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056386000000000000000000000000000000000000000000000005588620000000000000 0000000000000000000000000000000000000000000000000002000023
24
- 70000000000000000332510002893531622420 1622420000000005210000001 01900000000000 1806200109 000000000000005610000106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000002000024
25
- 70000000000000000332510002893531622420 1622420000000005310000001 01900000000000 1806200109 000000000000005856400106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000058564000000000000000000000000000000000000000000000005806420000000000000 0000000000000000000000000000000000000000000000000002000025
26
- 70000000000000000332510002893531622420 1622420000000005410000001 01900000000000 1806200109 000000000000005704600106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000057046000000000000000000000000000000000000000000000005654620000000000000 0000000000000000000000000000000000000000000000000002000026
27
- 70000000000000000332510002893531622420 1622420000000005510000001 01900000000000 1806200109 000000000000005673800106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056738000000000000000000000000000000000000000000000005623820000000000000 0000000000000000000000000000000000000000000000000002000027
28
- 9201001 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 000028
1
+ 02RETORNO01COBRANCA 33251000289353000000INSTITUTO MATO-GROSSENSE DO AL001BANCO DO BRASIL2001090000007 000000009703754590 1622420 000001
2
+ 70000000000000000332510002893531622420 1622420000000000310000001 01900000000000 1806200109 000000000000000906400114923002201090000500000000000000000000000000000000000000000000000000000000000000000000000000009064000000000000000000000000000000000000000000000000856420000000000000 0000000000000000000000000000000000000000000000000004000002
3
+ 70000000000000000332510002893531622420 1622420000000003010000001 01900000000000 1806200109 000000000000002235239909430002201090000500000000000000000000000000000000000000000000000000000000000000000000000000022352000000000000000000000000000000000000000000000002185220000000000000 0000000000000000000000000000000000000000000000000010000003
4
+ 70000000000000000332510002893531622420 1622420000000003110000001 01900000000000 1806200109 00000000000000165330012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000016533000000000000000000000000000000000000000000000001603320000000000000 0000000000000000000000000000000000000000000000000002000004
5
+ 70000000000000000332510002893531622420 1622420000000003210000001 01900000000000 1806200109 00000000000000157740012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000015774000000000000000000000000000000000000000000000001527420000000000000 0000000000000000000000000000000000000000000000000002000005
6
+ 70000000000000000332510002893531622420 1622420000000003310000001 01900000000000 1806200109 00000000000000414440012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000041444000000000000000000000000000000000000000000000004094420000000000000 0000000000000000000000000000000000000000000000000002000006
7
+ 70000000000000000332510002893531622420 1622420000000003410000001 01900000000000 1806200109 00000000000000610280012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000061028000000000000000000000000000000000000000000000006052820000000000000 0000000000000000000000000000000000000000000000000002000007
8
+ 70000000000000000332510002893531622420 1622420000000003510000001 01900000000000 1806200109 00000000000000608040012970X002201090000500000000000000000000000000000000000000000000000000000000000000000000000000060804000000000000000000000000000000000000000000000006030420000000000000 0000000000000000000000000000000000000000000000000002000008
9
+ 70000000000000000332510002893531622420 1622420000000003610000001 01900000000000 1806200109 000000000000005610074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000010000009
10
+ 70000000000000000332510002893531622420 1622420000000003710000001 01900000000000 1806200109 000000000000000565474808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000005654000000000000000000000000000000000000000000000000515420000000000000 0000000000000000000000000000000000000000000000000010000010
11
+ 70000000000000000332510002893531622420 1622420000000003810000001 01900000000000 1806200109 000000000000005610074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000010000011
12
+ 70000000000000000332510002893531622420 1622420000000003910000001 01900000000000 1806200109 000000000000000528074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000005280000000000000000000000000000000000000000000000000478020000000000000 0000000000000000000000000000000000000000000000000010000012
13
+ 70000000000000000332510002893531622420 1622420000000004010000001 01900000000000 1806200109 000000000000005610074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000010000013
14
+ 70000000000000000332510002893531622420 1622420000000004110000001 01900000000000 1806200109 000000000000000528074808110002201090000500000000000000000000000000000000000000000000000000000000000000000000000000005280000000000000000000000000000000000000000000000000478020000000000000 0000000000000000000000000000000000000000000000000010000014
15
+ 70000000000000000332510002893531622420 1622420000000004210000001 01900000000000 1806200109 000000000000005610000136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000004000015
16
+ 70000000000000000332510002893531622420 1622420000000004310000001 01900000000000 1806200109 000000000000001672000136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000016720000000000000000000000000000000000000000000000001622020000000000000 0000000000000000000000000000000000000000000000000004000016
17
+ 70000000000000000332510002893531622420 1622420000000004410000001 01900000000000 1806200109 000000000000000535300136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000005353000000000000000000000000000000000000000000000000485320000000000000 0000000000000000000000000000000000000000000000000004000017
18
+ 70000000000000000332510002893531622420 1622420000000004510000001 01900000000000 1806200109 000000000000005210700130376002201090000500000000000000000000000000000000000000000000000000000000000000000000000000052107000000000000000000000000000000000000000000000005160720000000000000 0000000000000000000000000000000000000000000000000008000018
19
+ 70000000000000000332510002893531622420 1622420000000004610000001 01900000000000 1806200109 000000000000006043600114923002201090000500000000000000000000000000000000000000000000000000000000000000000000000000060436000000000000000000000000000000000000000000000005993620000000000000 0000000000000000000000000000000000000000000000000002000019
20
+ 70000000000000000332510002893531622420 1622420000000004710000001 01900000000000 1806200109 000000000000005610000136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000004000020
21
+ 70000000000000000332510002893531622420 1622420000000004810000001 01900000000000 1806200109 000000000000000495000136439002201090000500000000000000000000000000000000000000000000000000000000000000000000000000004950000000000000000000000000000000000000000000000000445020000000000000 0000000000000000000000000000000000000000000000000004000021
22
+ 70000000000000000332510002893531622420 1622420000000005010000001 01900000000000 1806200109 000000000000005707000114923002201090000500000000000000000000000000000000000000000000000000000000000000000000000000057070000000000000000000000000000000000000000000000005657020000000000000 0000000000000000000000000000000000000000000000000002000022
23
+ 70000000000000000332510002893531622420 1622420000000005110000001 01900000000000 1806200109 000000000000005638600106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056386000000000000000000000000000000000000000000000005588620000000000000 0000000000000000000000000000000000000000000000000002000023
24
+ 70000000000000000332510002893531622420 1622420000000005210000001 01900000000000 1806200109 000000000000005610000106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056100000000000000000000000000000000000000000000000005560020000000000000 0000000000000000000000000000000000000000000000000002000024
25
+ 70000000000000000332510002893531622420 1622420000000005310000001 01900000000000 1806200109 000000000000005856400106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000058564000000000000000000000000000000000000000000000005806420000000000000 0000000000000000000000000000000000000000000000000002000025
26
+ 70000000000000000332510002893531622420 1622420000000005410000001 01900000000000 1806200109 000000000000005704600106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000057046000000000000000000000000000000000000000000000005654620000000000000 0000000000000000000000000000000000000000000000000002000026
27
+ 70000000000000000332510002893531622420 1622420000000005510000001 01900000000000 1806200109 000000000000005673800106599002201090000500000000000000000000000000000000000000000000000000000000000000000000000000056738000000000000000000000000000000000000000000000005623820000000000000 0000000000000000000000000000000000000000000000000002000027
28
+ 9201001 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 000028
@@ -0,0 +1,74 @@
1
+ 00100000 2356438990001450019999570014 0123450000000054321 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxBANCO DO BRASIL 22912201101431900210803000000920674440PROCESSAMEN
2
+ 00100011T0100020 20356438990001450019999570014 0123450000000054321 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 000000002912201100000000 000000000
3
+ 0010001300001T 170123450000000054321 14499570000020673 7 00000000000000000034400001020850 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
4
+ 0010001300002U 170000000000000090000000000000010000000000000020000000000000030000000000344000000000000342970000000000000040000000000000052912201102012012 000000000000000 000
5
+ 0010001300003T 170123450000000054321 14499570000020807 7 00000000000000000032117237003210 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
6
+ 0010001300004U 170000000000000000000000000000000000000000000000000000000000000000000000321170000000000320140000000000000000000000000000002912201102012012 000000000000000 000
7
+ 0010001300005T 170123450000000054321 14499570000020821 7 00000000000000000075147237003210 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
8
+ 0010001300006U 170000000000000000000000000000000000000000000000000000000000000000000000751470000000000750440000000000000000000000000000002912201102012012 000000000000000 000
9
+ 0010001300007T 170123450000000054321 14499570000020823 7 00000000000000000086618001043915 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
10
+ 0010001300008U 170000000000000000000000000000000000000000000000000000000000000000000000866180000000000865150000000000000000000000000000002912201102012012 000000000000000 000
11
+ 0010001300009T 170123450000000054321 14499570000020826 7 00000000000000000083000237021340 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
12
+ 0010001300010U 170000000000000000000000000000000000000000000000000000000000000000000000830000000000000828970000000000000000000000000000002912201102012012 000000000000000 000
13
+ 0010001300011T 170123450000000054321 14499570000020830 7 00000000000000000206255237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
14
+ 0010001300012U 170000000000000000000000000000000000000000000000000000000000000000000002062550000000002061520000000000000000000000000000002912201102012012 000000000000000 000
15
+ 0010001300013T 170123450000000054321 14499570000020831 7 00000000000000000084993237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
16
+ 0010001300014U 170000000000000000000000000000000000000000000000000000000000000000000000849930000000000848900000000000000000000000000000002912201102012012 000000000000000 000
17
+ 0010001300015T 170123450000000054321 14499570000020832 7 00000000000000000050682237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
18
+ 0010001300016U 170000000000000000000000000000000000000000000000000000000000000000000000506820000000000505790000000000000000000000000000002912201102012012 000000000000000 000
19
+ 0010001300017T 170123450000000054321 14499570000020833 7 00000000000000000050682237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
20
+ 0010001300018U 170000000000000000000000000000000000000000000000000000000000000000000000506820000000000505790000000000000000000000000000002912201102012012 000000000000000 000
21
+ 0010001300019T 170123450000000054321 14499570000020834 7 00000000000000000050682237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
22
+ 0010001300020U 170000000000000000000000000000000000000000000000000000000000000000000000506820000000000505790000000000000000000000000000002912201102012012 000000000000000 000
23
+ 0010001300021T 170123450000000054321 14499570000020835 7 00000000000000000050682237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
24
+ 0010001300022U 170000000000000000000000000000000000000000000000000000000000000000000000506820000000000505790000000000000000000000000000002912201102012012 000000000000000 000
25
+ 0010001300023T 170123450000000054321 14499570000020836 7 00000000000000000050682237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
26
+ 0010001300024U 170000000000000000000000000000000000000000000000000000000000000000000000506820000000000505790000000000000000000000000000002912201102012012 000000000000000 000
27
+ 0010001300025T 170123450000000054321 14499570000020839 7 0000000000000000003668600104301X 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
28
+ 0010001300026U 170000000000000000000000000000000000000000000000000000000000000000000000366860000000000365830000000000000000000000000000002912201102012012 000000000000000 000
29
+ 0010001300027T 170123450000000054321 14499570000020846 7 00000000000000000089829001015334 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
30
+ 0010001300028U 170000000000000000000000000000000000000000000000000000000000000000000000898290000000000897260000000000000000000000000000002912201102012012 000000000000000 000
31
+ 0010001300029T 170123450000000054321 14499570000020847 7 00000000000000000105147422001610 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
32
+ 0010001300030U 170000000000000000000000000000000000000000000000000000000000000000000001051470000000001050440000000000000000000000000000002912201102012012 000000000000000 000
33
+ 0010001300031T 170123450000000054321 14499570000020855 7 00000000000000000054500001026239 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
34
+ 0010001300032U 170000000000000000000000000000000000000000000000000000000000000000000000545000000000000543970000000000000000000000000000002912201102012012 000000000000000 000
35
+ 0010001300033T 170123450000000054321 14499570000020864 7 00000000000000000018167001011061 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
36
+ 0010001300034U 170000000000000000000000000000000000000000000000000000000000000000000000181670000000000180640000000000000000000000000000002912201102012012 000000000000000 000
37
+ 0010001300035T 170123450000000054321 14499570000020867 7 00000000000000000036686001005991 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
38
+ 0010001300036U 170000000000000000000000000000000000000000000000000000000000000000000000366860000000000365830000000000000000000000000000002912201102012012 000000000000000 000
39
+ 0010001300037T 170123450000000054321 14499570000020868 7 00000000000000000018167001011061 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
40
+ 0010001300038U 170000000000000000000000000000000000000000000000000000000000000000000000181670000000000180640000000000000000000000000000002912201102012012 000000000000000 000
41
+ 0010001300039T 170123450000000054321 14499570000020877 7 00000000000000000035000237021730 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
42
+ 0010001300040U 170000000000000000000000000000000000000000000000000000000000000000000000350000000000000348970000000000000000000000000000002912201102012012 000000000000000 000
43
+ 0010001300041T 170123450000000054321 14499570000020884 7 00000000000000000086618399013620 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
44
+ 0010001300042U 170000000000000000000000000000000000000000000000000000000000000000000000866180000000000865150000000000000000000000000000002912201102012012 000000000000000 000
45
+ 0010001300043T 170123450000000054321 14499570000020910 7 00000000000000000017985104007370 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
46
+ 0010001300044U 170000000000000000000000000000000000000000000000000000000000000000000000179850000000000178820000000000000000000000000000002912201102012012 000000000000000 000
47
+ 0010001300045T 170123450000000054321 14499570000020911 7 00000000000000000050682237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
48
+ 0010001300046U 170000000000000000000000000000000000000000000000000000000000000000000000506820000000000505790000000000000000000000000000002912201102012012 000000000000000 000
49
+ 0010001300047T 170123450000000054321 14499570000020912 7 00000000000000000013625237003210 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
50
+ 0010001300048U 170000000000000000000000000000000000000000000000000000000000000000000000136250000000000135220000000000000000000000000000002912201102012012 000000000000000 000
51
+ 0010001300049T 170123450000000054321 14499570000020917 7 00000000000000000025108237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
52
+ 0010001300050U 170000000000000000000000000000000000000000000000000000000000000000000000251080000000000250050000000000000000000000000000002912201102012012 000000000000000 000
53
+ 0010001300051T 170123450000000054321 14499570000020925 7 00000000000000000050682237011020 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
54
+ 0010001300052U 170000000000000000000000000000000000000000000000000000000000000000000000506820000000000505790000000000000000000000000000002912201102012012 000000000000000 000
55
+ 0010001300053T 170123450000000054321 14499570000020931 7 00000000000000000040578237035930 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
56
+ 0010001300054U 170000000000000000000000000000000000000000000000000000000000000000000000405780000000000404750000000000000000000000000000002912201102012012 000000000000000 000
57
+ 0010001300055T 170123450000000054321 14499570000020934 7 00000000000000000049691001031836 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
58
+ 0010001300056U 170000000000000000000000000000000000000000000000000000000000000000000000496910000000000495880000000000000000000000000000002912201102012012 000000000000000 000
59
+ 0010001300057T 170123450000000054321 14499570000020947 7 00000000000000000065400001020354 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
60
+ 0010001300058U 170000000000000000000000000000000000000000000000000000000000000000000000654000000000000652970000000000000000000000000000002912201102012012 000000000000000 000
61
+ 0010001300059T 170123450000000054321 14499570000020986 7 00000000000000000030000001005428 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
62
+ 0010001300060U 170000000000000000000000000000000000000000000000000000000000000000000000300000000000000298970000000000000000000000000000002912201102012012 000000000000000 000
63
+ 0010001300061T 170123450000000054321 14499570000020987 7 00000000000000000030000001005428 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
64
+ 0010001300062U 170000000000000000000000000000000000000000000000000000000000000000000000300000000000000298970000000000000000000000000000002912201102012012 000000000000000 000
65
+ 0010001300063T 170123450000000054321 14499570000021024 7 0000000000000000006000000104847X 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
66
+ 0010001300064U 170000000000000000000000000000000000000000000000000000000000000000000000600000000000000598970000000000000000000000000000002912201102012012 000000000000000 000
67
+ 0010001300065T 170123450000000054321 14499570000021066 7 00000000000000000302400104025580 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
68
+ 0010001300066U 170000000000000000000000000000000000000000000000000000000000000000000003024000000000003022970000000000000000000000000000002912201102012012 000000000000000 000
69
+ 0010001300067T 170123450000000054321 14499570007451637 7 00000000000000000077203237004540 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
70
+ 0010001300068U 170000000000000000000000000000000000000000000000000000000000000000000000772030000000000771000000000000000000000000000000002912201102012012 000000000000000 000
71
+ 0010001300069T 170123450000000054321 14499570007451702 7 00000000000000000038000001043699 0900000000000000000000000000000000000000000000000000000 000000000000000000000010303 170191449957
72
+ 0010001300070U 170000000000000000000000000000000000000000000000000000000000000000000000380000000000000378970000000000000000000000000000002912201102012012 000000000000000 000
73
+ 00100015 000072000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
74
+ 00199999 000001000074000000 00000000000000000000000000000
@@ -11,16 +11,16 @@ describe Brcobranca::Boleto::Caixa do #:nodoc:[all]
11
11
  :dias_vencimento => 1,
12
12
  :aceite => 'S',
13
13
  :quantidade => 1,
14
- :valor => 1.23,
14
+ :valor => 10.00,
15
15
  :local_pagamento => 'QUALQUER BANCO ATÉ O VENCIMENTO',
16
- :cedente => 'Túlio Ornelas',
17
- :documento_cedente => '200874000687',
18
- :sacado => 'Ana Carolina Mascarenhas',
19
- :sacado_documento => '93463665751',
20
- :agencia => '1565',
21
- :conta_corrente => '0013877',
22
- :convenio => '100000',
23
- :numero_documento => '123456789123456'
16
+ :cedente => 'PREFEITURA MUNICIPAL DE VILHENA',
17
+ :documento_cedente => '04092706000181',
18
+ :sacado => 'João Paulo Barbosa',
19
+ :sacado_documento => '77777777777',
20
+ :agencia => '1825',
21
+ :conta_corrente => '0000528',
22
+ :convenio => '245274',
23
+ :numero_documento => '000000000000001'
24
24
  }
25
25
  end
26
26
 
@@ -56,14 +56,14 @@ describe Brcobranca::Boleto::Caixa do #:nodoc:[all]
56
56
  it 'Gerar o dígito verificador do convênio' do
57
57
  boleto_novo = Brcobranca::Boleto::Caixa.new @valid_attributes
58
58
  boleto_novo.convenio_dv.should_not be_nil
59
- boleto_novo.convenio_dv.should == '4'
59
+ boleto_novo.convenio_dv.should == '0'
60
60
  end
61
61
 
62
62
  it "Gerar o código de barras" do
63
63
  boleto_novo = Brcobranca::Boleto::Caixa.new @valid_attributes
64
64
  lambda { boleto_novo.codigo_barras }.should_not raise_error
65
65
  boleto_novo.codigo_barras_segunda_parte.should_not be_blank
66
- boleto_novo.codigo_barras_segunda_parte.should eql('1000004123245647891234568')
66
+ boleto_novo.codigo_barras_segunda_parte.should eql('2452740000200040000000010')
67
67
  end
68
68
 
69
69
  it "Não permitir gerar boleto com atributos inválidos" do
@@ -111,10 +111,10 @@ describe Brcobranca::Boleto::Caixa do #:nodoc:[all]
111
111
  it "Montar agencia_conta_boleto" do
112
112
  boleto_novo = Brcobranca::Boleto::Caixa.new(@valid_attributes)
113
113
 
114
- boleto_novo.agencia_conta_boleto.should eql("1565/100000-4")
114
+ boleto_novo.agencia_conta_boleto.should eql("1825/245274-0")
115
115
 
116
116
  boleto_novo.convenio = "123456"
117
- boleto_novo.agencia_conta_boleto.should eql("1565/123456-1")
117
+ boleto_novo.agencia_conta_boleto.should eql("1825/123456-0")
118
118
 
119
119
  boleto_novo.agencia = "2030"
120
120
  boleto_novo.convenio = "654321"
@@ -0,0 +1,160 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
3
+
4
+ describe Brcobranca::Boleto::Sicredi do
5
+ before(:each) do
6
+ @valid_attributes = {
7
+ :especie_documento => "A",
8
+ :moeda => "9",
9
+ :data_documento => Date.parse('2012-01-18'),
10
+ :dias_vencimento => 1,
11
+ :aceite => "S",
12
+ :quantidade => 1,
13
+ :valor => 0.0,
14
+ :local_pagamento => "QUALQUER BANCO ATÉ O VENCIMENTO",
15
+ :cedente => "Kivanio Barbosa",
16
+ :documento_cedente => "12345678912",
17
+ :sacado => "Claudio Pozzebom",
18
+ :sacado_documento => "12345678900",
19
+ :agencia => "4042",
20
+ :conta_corrente => "61900",
21
+ :convenio => 12387989,
22
+ :numero_documento => "00168",
23
+ :posto => '18',
24
+ :byte_idt => '2'
25
+ }
26
+ end
27
+
28
+ it "Criar nova instancia com atributos padrões" do
29
+ boleto_novo = Brcobranca::Boleto::Sicredi.new
30
+ boleto_novo.banco.should eql("748")
31
+ boleto_novo.especie_documento.should eql("A")
32
+ boleto_novo.especie.should eql("R$")
33
+ boleto_novo.moeda.should eql("9")
34
+ boleto_novo.data_documento.should eql(Date.today)
35
+ boleto_novo.dias_vencimento.should eql(1)
36
+ boleto_novo.data_vencimento.should eql(Date.today + 1)
37
+ boleto_novo.aceite.should eql("S")
38
+ boleto_novo.quantidade.should eql(1)
39
+ boleto_novo.valor.should eql(0.0)
40
+ boleto_novo.valor_documento.should eql(0.0)
41
+ boleto_novo.local_pagamento.should eql("QUALQUER BANCO ATÉ O VENCIMENTO")
42
+ boleto_novo.carteira.should eql("03")
43
+
44
+ end
45
+
46
+ it "Criar nova instancia com atributos válidos" do
47
+ boleto_novo = Brcobranca::Boleto::Sicredi.new(@valid_attributes)
48
+ boleto_novo.banco.should eql("748")
49
+ boleto_novo.especie_documento.should eql("A")
50
+ boleto_novo.especie.should eql("R$")
51
+ boleto_novo.moeda.should eql("9")
52
+ boleto_novo.data_documento.should eql(Date.parse('2012-01-18'))
53
+ boleto_novo.dias_vencimento.should eql(1)
54
+ boleto_novo.data_vencimento.should eql(Date.parse('2012-01-18') + 1)
55
+ boleto_novo.aceite.should eql("S")
56
+ boleto_novo.quantidade.should eql(1)
57
+ boleto_novo.valor.should eql(0.0)
58
+ boleto_novo.valor_documento.should eql(0.0)
59
+ boleto_novo.local_pagamento.should eql("QUALQUER BANCO ATÉ O VENCIMENTO")
60
+ boleto_novo.cedente.should eql("Kivanio Barbosa")
61
+ boleto_novo.documento_cedente.should eql("12345678912")
62
+ boleto_novo.sacado.should eql("Claudio Pozzebom")
63
+ boleto_novo.sacado_documento.should eql("12345678900")
64
+ boleto_novo.conta_corrente.should eql("61900")
65
+ boleto_novo.agencia.should eql("4042")
66
+ boleto_novo.convenio.should eql(12387989)
67
+ boleto_novo.numero_documento.should eql("00168")
68
+ boleto_novo.carteira.should eql("03")
69
+ end
70
+
71
+ it "Montar código de barras para carteira número 03" do
72
+ @valid_attributes[:valor] = 2952.95
73
+ @valid_attributes[:dias_vencimento] = 5
74
+ @valid_attributes[:data_documento] = Date.parse("2012-01-19")
75
+ @valid_attributes[:numero_documento] = "13871"
76
+ @valid_attributes[:conta_corrente] = "12345"
77
+ @valid_attributes[:agencia] = "1234"
78
+ @valid_attributes[:carteira] = "03"
79
+ @valid_attributes[:posto] = "18"
80
+ @valid_attributes[:aceite] = "N"
81
+ @valid_attributes[:byte_idt] = "2"
82
+ boleto_novo = Brcobranca::Boleto::Sicredi.new(@valid_attributes)
83
+
84
+ boleto_novo.codigo_barras.linha_digitavel.should eql("74893.11220 13871.512342 18123.451009 1 52220000295295")
85
+ boleto_novo.codigo_barras_segunda_parte.should eql("3112213871512341812345100")
86
+ #boleto_novo.codigo_barras.should eql("23791377000000135004042030077770016800619000")
87
+ end
88
+
89
+ it "Não permitir gerar boleto com atributos inválido" do
90
+ boleto_novo = Brcobranca::Boleto::Sicredi.new
91
+ lambda { boleto_novo.codigo_barras }.should raise_error(Brcobranca::BoletoInvalido)
92
+ boleto_novo.errors.count.should eql(3)
93
+ end
94
+
95
+ it "Montar nosso_numero_boleto" do
96
+ boleto_novo = Brcobranca::Boleto::Sicredi.new(@valid_attributes)
97
+
98
+ boleto_novo.byte_idt = "2"
99
+ boleto_novo.agencia = "1234"
100
+ boleto_novo.posto = "18"
101
+ boleto_novo.conta_corrente = "12345"
102
+ boleto_novo.numero_documento = "13871"
103
+ boleto_novo.carteira = "03"
104
+ boleto_novo.nosso_numero_boleto.should eql("12/213871-5")
105
+ boleto_novo.nosso_numero_dv.should eql(5)
106
+ end
107
+
108
+ it "Montar agencia_conta_boleto" do
109
+ boleto_novo = Brcobranca::Boleto::Sicredi.new(@valid_attributes)
110
+
111
+ boleto_novo.agencia = "1234"
112
+ boleto_novo.posto = "18"
113
+ boleto_novo.conta_corrente = "12345"
114
+ boleto_novo.agencia_conta_boleto.should eql("1234.18.12345")
115
+ end
116
+
117
+ it "Busca logotipo do banco" do
118
+ boleto_novo = Brcobranca::Boleto::Sicredi.new
119
+ File.exist?(boleto_novo.logotipo).should be_true
120
+ File.stat(boleto_novo.logotipo).zero?.should be_false
121
+ end
122
+
123
+ it "Gerar boleto nos formatos válidos com método to_" do
124
+ boleto_novo = Brcobranca::Boleto::Sicredi.new(@valid_attributes)
125
+
126
+ %w| pdf jpg tif png ps |.each do |format|
127
+ file_body=boleto_novo.send("to_#{format}".to_sym)
128
+ tmp_file=Tempfile.new("foobar." << format)
129
+ tmp_file.puts file_body
130
+ tmp_file.close
131
+ File.exist?(tmp_file.path).should be_true
132
+ File.stat(tmp_file.path).zero?.should be_false
133
+ File.delete(tmp_file.path).should eql(1)
134
+ File.exist?(tmp_file.path).should be_false
135
+ end
136
+ end
137
+
138
+ it "Gerar boleto nos formatos válidos" do
139
+ @valid_attributes[:valor] = 2952.95
140
+ @valid_attributes[:data_documento] = Date.parse("2009-04-30")
141
+ @valid_attributes[:dias_vencimento] = 0
142
+ @valid_attributes[:numero_documento] = "86452"
143
+ @valid_attributes[:conta_corrente] = "03005"
144
+ @valid_attributes[:agencia] = "1172"
145
+ boleto_novo = Brcobranca::Boleto::Sicredi.new(@valid_attributes)
146
+
147
+ %w| pdf jpg tif png ps |.each do |format|
148
+ file_body=boleto_novo.to(format)
149
+ tmp_file=Tempfile.new("foobar." << format)
150
+ tmp_file.puts file_body
151
+ tmp_file.close
152
+ File.exist?(tmp_file.path).should be_true
153
+ File.stat(tmp_file.path).zero?.should be_false
154
+ File.delete(tmp_file.path).should eql(1)
155
+ File.exist?(tmp_file.path).should be_false
156
+ end
157
+ end
158
+
159
+ end
160
+
@@ -31,17 +31,17 @@ describe Brcobranca::Retorno::RetornoCbr643 do
31
31
  pagamentos.first.nosso_numero.should eql("16224200000000003")
32
32
  end
33
33
 
34
- it "Transforma arquivo de retorno em objetos de retorno excluindo a primeira linha com a opção :except e :length" do
35
- pagamentos = Brcobranca::Retorno::RetornoCbr643.load_lines(@arquivo,{:except => [1], :length => 400})
36
- pagamentos.first.sequencial.should eql("000002")
37
- pagamentos.first.agencia_com_dv.should eql("33251")
38
- pagamentos.first.cedente_com_dv.should eql("000289353")
39
- pagamentos.first.convenio.should eql("1622420")
40
- pagamentos.first.data_liquidacao.should eql("200109")
41
- pagamentos.first.data_credito.should eql("220109")
42
- pagamentos.first.valor_recebido.should eql("0000000009064")
43
- pagamentos.first.nosso_numero.should eql("16224200000000003")
44
- end
34
+ # it "Transforma arquivo de retorno em objetos de retorno excluindo a primeira linha com a opção :except e :length" do
35
+ # pagamentos = Brcobranca::Retorno::RetornoCbr643.load_lines(@arquivo,{:except => [1], :length => 400})
36
+ # pagamentos.first.sequencial.should eql("000002")
37
+ # pagamentos.first.agencia_com_dv.should eql("33251")
38
+ # pagamentos.first.cedente_com_dv.should eql("000289353")
39
+ # pagamentos.first.convenio.should eql("1622420")
40
+ # pagamentos.first.data_liquidacao.should eql("200109")
41
+ # pagamentos.first.data_credito.should eql("220109")
42
+ # pagamentos.first.valor_recebido.should eql("0000000009064")
43
+ # pagamentos.first.nosso_numero.should eql("16224200000000003")
44
+ # end
45
45
 
46
46
  it "Transforma arquivo de retorno em objetos de retorno excluindo a primeira linha com a opção :except em regex" do
47
47
  pagamentos = Brcobranca::Retorno::RetornoCbr643.load_lines(@arquivo,{:except => /^[^7]/})
@@ -55,16 +55,16 @@ describe Brcobranca::Retorno::RetornoCbr643 do
55
55
  pagamentos.first.nosso_numero.should eql("16224200000000003")
56
56
  end
57
57
 
58
- it "Transforma arquivo de retorno em objetos de retorno excluindo a primeira linha com a opção :except em regex e :length" do
59
- pagamentos = Brcobranca::Retorno::RetornoCbr643.load_lines(@arquivo,{:except => /^[^7]/, :length => 400})
60
- pagamentos.first.sequencial.should eql("000002")
61
- pagamentos.first.agencia_com_dv.should eql("33251")
62
- pagamentos.first.cedente_com_dv.should eql("000289353")
63
- pagamentos.first.convenio.should eql("1622420")
64
- pagamentos.first.data_liquidacao.should eql("200109")
65
- pagamentos.first.data_credito.should eql("220109")
66
- pagamentos.first.valor_recebido.should eql("0000000009064")
67
- pagamentos.first.nosso_numero.should eql("16224200000000003")
68
- end
58
+ # it "Transforma arquivo de retorno em objetos de retorno excluindo a primeira linha com a opção :except em regex e :length" do
59
+ # pagamentos = Brcobranca::Retorno::RetornoCbr643.load_lines(@arquivo,{:except => /^[^7]/, :length => 400})
60
+ # pagamentos.first.sequencial.should eql("000002")
61
+ # pagamentos.first.agencia_com_dv.should eql("33251")
62
+ # pagamentos.first.cedente_com_dv.should eql("000289353")
63
+ # pagamentos.first.convenio.should eql("1622420")
64
+ # pagamentos.first.data_liquidacao.should eql("200109")
65
+ # pagamentos.first.data_credito.should eql("220109")
66
+ # pagamentos.first.valor_recebido.should eql("0000000009064")
67
+ # pagamentos.first.nosso_numero.should eql("16224200000000003")
68
+ # end
69
69
 
70
70
  end
@@ -0,0 +1,51 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
3
+
4
+ describe Brcobranca::Retorno::RetornoCnab240 do
5
+ before(:each) do
6
+ @arquivo = File.join(File.dirname(__FILE__), '..', 'arquivos', 'CNAB240.RET')
7
+ end
8
+
9
+ it 'Transforma arquivo de retorno em objetos de retorno retornando somente as linhas de pagamentos de títulos sem registro' do
10
+ pagamentos = Brcobranca::Retorno::RetornoCnab240.load_lines(@arquivo)
11
+ pagamentos.size.should == 35
12
+ pagamento = pagamentos.first
13
+ pagamento.agencia_com_dv.should eql('012345')
14
+ pagamento.cedente_com_dv.should eql('0000000054321')
15
+ pagamento.nosso_numero.should eql('00020673')
16
+ pagamento.carteira.should eql('7')
17
+ pagamento.data_vencimento.should eql('00000000')
18
+ pagamento.valor_titulo.should eql('000000000034400')
19
+ pagamento.banco_recebedor.should eql('001')
20
+ pagamento.agencia_recebedora_com_dv.should eql('020850')
21
+ pagamento.data_credito.should eql('02012012')
22
+ pagamento.outras_despesas.should eql('000000000000004')
23
+ pagamento.iof_desconto.should eql('000000000000003')
24
+ pagamento.valor_abatimento.should eql('000000000000002')
25
+ pagamento.desconto_concedito.should eql('000000000000001')
26
+ pagamento.valor_recebido.should eql('000000000034400')
27
+ pagamento.juros_mora.should eql('000000000000009')
28
+ pagamento.outros_recebimento.should eql('000000000000005')
29
+ pagamento.sequencial.should eql('00001')
30
+
31
+ # Dados que não consegui extrair dos registros T e U
32
+ #pagamento.convenio.should eql('')
33
+ #pagamento.tipo_cobranca.should eql('')
34
+ #pagamento.tipo_cobranca_anterior.should eql('')
35
+ #pagamento.natureza_recebimento.should eql('')
36
+ #pagamento.carteira_variacao.should eql('7')
37
+ #pagamento.iof.should eql('')
38
+ #pagamento.comando.should eql('')
39
+ #pagamento.data_liquidacao.should eql('')
40
+ #pagamento.especie_documento.should eql('')
41
+ #pagamento.valor_tarifa.should eql('')
42
+ #pagamento.juros_desconto.should eql('')
43
+ #pagamento.abatimento_nao_aproveitado.should eql('')
44
+ #pagamento.valor_lancamento.should eql('')
45
+ #pagamento.indicativo_lancamento.should eql('')
46
+ #pagamento.indicador_valor.should eql('')
47
+ #pagamento.valor_ajuste.should eql('')
48
+ end
49
+ end
50
+
51
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brcobranca
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
+ - 1
8
9
  - 0
9
- - 0
10
- version: 3.0.0
10
+ version: 3.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kivanio Barbosa
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-14 00:00:00 -04:00
19
- default_executable:
18
+ date: 2012-04-20 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: rghost
@@ -24,14 +23,13 @@ dependencies:
24
23
  requirement: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
26
25
  requirements:
27
- - - ">="
26
+ - - ~>
28
27
  - !ruby/object:Gem::Version
29
- hash: 49
28
+ hash: 27
30
29
  segments:
31
30
  - 0
32
31
  - 8
33
- - 7
34
- version: 0.8.7
32
+ version: "0.8"
35
33
  type: :runtime
36
34
  version_requirements: *id001
37
35
  - !ruby/object:Gem::Dependency
@@ -40,13 +38,13 @@ dependencies:
40
38
  requirement: &id002 !ruby/object:Gem::Requirement
41
39
  none: false
42
40
  requirements:
43
- - - ">="
41
+ - - ~>
44
42
  - !ruby/object:Gem::Version
45
- hash: 27
43
+ hash: 25
46
44
  segments:
47
45
  - 0
48
- - 8
49
- version: "0.8"
46
+ - 9
47
+ version: "0.9"
50
48
  type: :runtime
51
49
  version_requirements: *id002
52
50
  - !ruby/object:Gem::Dependency
@@ -71,14 +69,12 @@ dependencies:
71
69
  requirement: &id004 !ruby/object:Gem::Requirement
72
70
  none: false
73
71
  requirements:
74
- - - ">="
72
+ - - ~>
75
73
  - !ruby/object:Gem::Version
76
- hash: 7
74
+ hash: 5
77
75
  segments:
78
76
  - 3
79
- - 0
80
- - 0
81
- version: 3.0.0
77
+ version: "3"
82
78
  type: :runtime
83
79
  version_requirements: *id004
84
80
  description: "Gem para emiss\xC3\xA3o de bloquetos de cobran\xC3\xA7a de bancos brasileiros."
@@ -108,6 +104,7 @@ files:
108
104
  - lib/brcobranca/arquivos/logos/hsbc.jpg
109
105
  - lib/brcobranca/arquivos/logos/itau.jpg
110
106
  - lib/brcobranca/arquivos/logos/real.jpg
107
+ - lib/brcobranca/arquivos/logos/sicredi.jpg
111
108
  - lib/brcobranca/arquivos/logos/unibanco.jpg
112
109
  - lib/brcobranca/arquivos/templates/modelo_generico.eps
113
110
  - lib/brcobranca/boleto/banco_brasil.rb
@@ -117,6 +114,7 @@ files:
117
114
  - lib/brcobranca/boleto/hsbc.rb
118
115
  - lib/brcobranca/boleto/itau.rb
119
116
  - lib/brcobranca/boleto/real.rb
117
+ - lib/brcobranca/boleto/sicredi.rb
120
118
  - lib/brcobranca/boleto/template/base.rb
121
119
  - lib/brcobranca/boleto/template/rghost.rb
122
120
  - lib/brcobranca/boleto/unibanco.rb
@@ -127,13 +125,16 @@ files:
127
125
  - lib/brcobranca/limpeza.rb
128
126
  - lib/brcobranca/retorno/base.rb
129
127
  - lib/brcobranca/retorno/retorno_cbr643.rb
128
+ - lib/brcobranca/retorno/retorno_cnab240.rb
130
129
  - lib/brcobranca/version.rb
131
130
  - spec/arquivos/CBR64310.RET
131
+ - spec/arquivos/CNAB240.RET
132
132
  - spec/brcobranca/banco_bradesco_spec.rb
133
133
  - spec/brcobranca/banco_brasil_spec.rb
134
134
  - spec/brcobranca/banco_caixa_spec.rb
135
135
  - spec/brcobranca/banco_hsbc_spec.rb
136
136
  - spec/brcobranca/banco_real_spec.rb
137
+ - spec/brcobranca/banco_sicredi_spec.rb
137
138
  - spec/brcobranca/banco_unibanco_spec.rb
138
139
  - spec/brcobranca/base_spec.rb
139
140
  - spec/brcobranca/boletos_em_lote_spec.rb
@@ -141,10 +142,10 @@ files:
141
142
  - spec/brcobranca/currency_spec.rb
142
143
  - spec/brcobranca/itau_spec.rb
143
144
  - spec/brcobranca/retorno_cbr643_spec.rb
145
+ - spec/brcobranca/retorno_cnab_240_spec.rb
144
146
  - spec/brcobranca/rghost_spec.rb
145
147
  - spec/brcobranca_spec.rb
146
148
  - spec/spec_helper.rb
147
- has_rdoc: true
148
149
  homepage: http://rubygems.org/gems/brcobranca
149
150
  licenses: []
150
151
 
@@ -174,17 +175,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
175
  requirements:
175
176
  - "GhostScript > 8.0, para gear PDF e c\xC3\xB3digo de Barras"
176
177
  rubyforge_project: brcobranca
177
- rubygems_version: 1.5.2
178
+ rubygems_version: 1.8.11
178
179
  signing_key:
179
180
  specification_version: 3
180
181
  summary: "Gem que permite trabalhar com bloquetos de cobran\xC3\xA7a para bancos brasileiros."
181
182
  test_files:
182
183
  - spec/arquivos/CBR64310.RET
184
+ - spec/arquivos/CNAB240.RET
183
185
  - spec/brcobranca/banco_bradesco_spec.rb
184
186
  - spec/brcobranca/banco_brasil_spec.rb
185
187
  - spec/brcobranca/banco_caixa_spec.rb
186
188
  - spec/brcobranca/banco_hsbc_spec.rb
187
189
  - spec/brcobranca/banco_real_spec.rb
190
+ - spec/brcobranca/banco_sicredi_spec.rb
188
191
  - spec/brcobranca/banco_unibanco_spec.rb
189
192
  - spec/brcobranca/base_spec.rb
190
193
  - spec/brcobranca/boletos_em_lote_spec.rb
@@ -192,6 +195,7 @@ test_files:
192
195
  - spec/brcobranca/currency_spec.rb
193
196
  - spec/brcobranca/itau_spec.rb
194
197
  - spec/brcobranca/retorno_cbr643_spec.rb
198
+ - spec/brcobranca/retorno_cnab_240_spec.rb
195
199
  - spec/brcobranca/rghost_spec.rb
196
200
  - spec/brcobranca_spec.rb
197
201
  - spec/spec_helper.rb