br_boleto 2.2.6 → 2.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/.travis.yml +0 -0
- data/Gemfile.lock +1 -1
- data/README.markdown +0 -0
- data/br_boleto.gemspec +0 -0
- data/lib/br_boleto.rb +0 -0
- data/lib/br_boleto/association/have_conta.rb +0 -0
- data/lib/br_boleto/association/have_pagador.rb +0 -0
- data/lib/br_boleto/boleto/banco_brasil.rb +0 -0
- data/lib/br_boleto/boleto/base.rb +0 -0
- data/lib/br_boleto/boleto/bradesco.rb +0 -0
- data/lib/br_boleto/boleto/caixa.rb +0 -0
- data/lib/br_boleto/boleto/cecred.rb +0 -0
- data/lib/br_boleto/boleto/itau.rb +0 -0
- data/lib/br_boleto/boleto/santander.rb +0 -0
- data/lib/br_boleto/boleto/sicredi.rb +8 -8
- data/lib/br_boleto/boleto/unicred.rb +0 -0
- data/lib/br_boleto/conta/banco_brasil.rb +0 -0
- data/lib/br_boleto/conta/base.rb +0 -0
- data/lib/br_boleto/conta/bradesco.rb +0 -0
- data/lib/br_boleto/conta/caixa.rb +0 -0
- data/lib/br_boleto/conta/cecred.rb +0 -0
- data/lib/br_boleto/conta/itau.rb +0 -0
- data/lib/br_boleto/conta/santander.rb +0 -0
- data/lib/br_boleto/conta/sicoob.rb +0 -0
- data/lib/br_boleto/conta/sicredi.rb +0 -0
- data/lib/br_boleto/conta/unicred.rb +0 -0
- data/lib/br_boleto/helper/default_codes.rb +0 -0
- data/lib/br_boleto/pagador.rb +0 -0
- data/lib/br_boleto/remessa/base.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/banco_brasil.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/base.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/bradesco.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/caixa.rb +10 -10
- data/lib/br_boleto/remessa/cnab240/cecred.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/helper/segmento_p.rb +1 -1
- data/lib/br_boleto/remessa/cnab240/helper/segmento_q.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/helper/segmento_r.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/helper/segmento_s.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/itau.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/santander.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/sicoob.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/sicredi.rb +0 -0
- data/lib/br_boleto/remessa/cnab240/unicred.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/banco_brasil.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/base.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/bradesco.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/caixa.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/helper/detalhe.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/itau.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/santander.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/sicoob.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/sicredi.rb +0 -0
- data/lib/br_boleto/remessa/cnab400/unicred.rb +0 -0
- data/lib/br_boleto/remessa/pagamento.rb +0 -0
- data/lib/br_boleto/retorno/base.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/banco_brasil.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/base.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/bradesco.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/caixa.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/cecred.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/itau.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/santander.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/sicoob.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/sicredi.rb +0 -0
- data/lib/br_boleto/retorno/cnab240/unicred.rb +0 -0
- data/lib/br_boleto/retorno/cnab400/banco_brasil.rb +0 -0
- data/lib/br_boleto/retorno/cnab400/base.rb +0 -0
- data/lib/br_boleto/retorno/cnab400/bradesco.rb +0 -0
- data/lib/br_boleto/retorno/cnab400/caixa.rb +0 -0
- data/lib/br_boleto/retorno/cnab400/itau.rb +0 -0
- data/lib/br_boleto/retorno/cnab400/santander.rb +0 -0
- data/lib/br_boleto/retorno/cnab400/sicoob.rb +0 -0
- data/lib/br_boleto/retorno/cnab400/sicredi.rb +0 -0
- data/lib/br_boleto/retorno/cnab400/unicred.rb +0 -0
- data/lib/br_boleto/retorno/pagamento.rb +0 -0
- data/lib/br_boleto/version.rb +1 -1
- data/lib/config/locales/br-boleto-en.yml +0 -0
- data/lib/config/locales/br-boleto-pt-BR.yml +0 -0
- data/test/br_boleto/association/have_pagador_test.rb +0 -0
- data/test/br_boleto/boleto/banco_brasil_test.rb +0 -0
- data/test/br_boleto/boleto/base_test.rb +0 -0
- data/test/br_boleto/boleto/bradesco_test.rb +0 -0
- data/test/br_boleto/boleto/caixa_test.rb +0 -0
- data/test/br_boleto/boleto/cecred_test.rb +0 -0
- data/test/br_boleto/boleto/itau_test.rb +0 -0
- data/test/br_boleto/boleto/santander_test.rb +0 -0
- data/test/br_boleto/boleto/sicredi_test.rb +20 -19
- data/test/br_boleto/boleto/unicred_test.rb +0 -0
- data/test/br_boleto/conta/banco_brasil_test.rb +0 -0
- data/test/br_boleto/conta/base_test.rb +0 -0
- data/test/br_boleto/conta/bradesco_test.rb +0 -0
- data/test/br_boleto/conta/caixa_test.rb +0 -0
- data/test/br_boleto/conta/cecred_test.rb +0 -0
- data/test/br_boleto/conta/itau_test.rb +0 -0
- data/test/br_boleto/conta/santantader_test.rb +0 -0
- data/test/br_boleto/conta/sicoob_test.rb +0 -0
- data/test/br_boleto/conta/sicredi_test.rb +0 -0
- data/test/br_boleto/conta/unicred_test.rb +0 -0
- data/test/br_boleto/pagador_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/banco_brasil_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/base_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/bradesco_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/caixa_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/cecred_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/helper/segmento_p_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/helper/segmento_q_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/helper/segmento_r_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/helper/segmento_s_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/itau_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/santander_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/sicoob_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/sicredi_test.rb +0 -0
- data/test/br_boleto/remessa/cnab240/unicred_test.rb +0 -0
- data/test/br_boleto/remessa/cnab400/banco_brasil_test.rb +0 -0
- data/test/br_boleto/remessa/cnab400/base_test.rb +0 -0
- data/test/br_boleto/remessa/cnab400/bradesco_test.rb +0 -0
- data/test/br_boleto/remessa/cnab400/caixa_test.rb +0 -0
- data/test/br_boleto/remessa/cnab400/itau_test.rb +0 -0
- data/test/br_boleto/remessa/cnab400/santander_test.rb +0 -0
- data/test/br_boleto/remessa/cnab400/sicoob_test.rb +0 -0
- data/test/br_boleto/remessa/cnab400/sicredi_test.rb +0 -0
- data/test/br_boleto/remessa/cnab400/unicred_test.rb +0 -0
- data/test/br_boleto/remessa/pagamento_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/banco_brasil_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/base_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/bradesco_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/caixa_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/cecred_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/itau_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/santander_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/sicoob_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/sicredi_test.rb +0 -0
- data/test/br_boleto/retorno/cnab240/unicred_test.rb +0 -0
- data/test/br_boleto/retorno/cnab400/banco_brasil_test.rb +0 -0
- data/test/br_boleto/retorno/cnab400/bradesco_test.rb +0 -0
- data/test/br_boleto/retorno/cnab400/caixa_test.rb +0 -0
- data/test/br_boleto/retorno/cnab400/itau_test.rb +0 -0
- data/test/br_boleto/retorno/cnab400/santander_test.rb +0 -0
- data/test/br_boleto/retorno/cnab400/sicoob_test.rb +0 -0
- data/test/br_boleto/retorno/cnab400/sicredi_test.rb +0 -0
- data/test/br_boleto/retorno/cnab400/unicred.rb +0 -0
- data/test/br_boleto/retorno/pagamento_test.rb +0 -0
- data/test/factories/boleto/boleto_banco_brasil.rb +0 -0
- data/test/factories/boleto/boleto_bradesco.rb +0 -0
- data/test/factories/boleto/boleto_cecred.rb +0 -0
- data/test/factories/boleto/boleto_itau.rb +0 -0
- data/test/factories/boleto/boleto_santander.rb +0 -0
- data/test/factories/boleto/boleto_sicredi.rb +0 -0
- data/test/factories/boleto/boleto_unicred.rb +0 -0
- data/test/factories/conta/banco_brasil.rb +0 -0
- data/test/factories/conta/bradesco.rb +0 -0
- data/test/factories/conta/caixa.rb +0 -0
- data/test/factories/conta/cecred.rb +0 -0
- data/test/factories/conta/itau.rb +0 -0
- data/test/factories/conta/santander.rb +0 -0
- data/test/factories/conta/sicoob.rb +0 -0
- data/test/factories/conta/sicredi.rb +0 -0
- data/test/factories/conta/unicred.rb +0 -0
- data/test/factories/remessa/cnab240/banco_brasil.rb +0 -0
- data/test/factories/remessa/cnab240/bradesco.rb +0 -0
- data/test/factories/remessa/cnab240/cecred.rb +0 -0
- data/test/factories/remessa/cnab240/itau.rb +0 -0
- data/test/factories/remessa/cnab240/santander.rb +0 -0
- data/test/factories/remessa/cnab240/sicredi.rb +0 -0
- data/test/factories/remessa/cnab240/unicred.rb +0 -0
- data/test/factories/remessa/cnab400/banco_brasil.rb +0 -0
- data/test/factories/remessa/cnab400/bradesco.rb +0 -0
- data/test/factories/remessa/cnab400/caixa.rb +0 -0
- data/test/factories/remessa/cnab400/itau.rb +0 -0
- data/test/factories/remessa/cnab400/santander.rb +0 -0
- data/test/factories/remessa/cnab400/sicredi.rb +0 -0
- data/test/factories/remessa/cnab400/unicred.rb +0 -0
- data/test/factories/remessa/pagamento.rb +0 -0
- data/test/fixtures/remessa/cnab240/caixa.rem +0 -0
- data/test/fixtures/remessa/cnab240/cecred.rem +0 -0
- data/test/fixtures/remessa/cnab240/sicoob.rem +0 -0
- data/test/fixtures/remessa/cnab240/unicred.rem +0 -0
- data/test/fixtures/retorno/cnab240/banco_brasil.ret +0 -0
- data/test/fixtures/retorno/cnab240/cecred.ret +0 -0
- data/test/fixtures/retorno/cnab240/santander.ret +0 -0
- data/test/fixtures/retorno/cnab400/bradesco.ret +0 -0
- data/test/fixtures/retorno/cnab400/itau.ret +0 -0
- data/test/fixtures/retorno/cnab400/sicredi.ret +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97056635dc15ec4dde8c1e9f0f5c116d203aadac
|
4
|
+
data.tar.gz: c1a7c5bd2d102fffd9f39fc68cff2567af049f49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ef21118966545500461bc133c629cabccdd7a0744c8e2dbd45b3ffca5b1dd2d4739d45086973f8274da5e45318ef68fdb018ab55d66ece901ee3f5eca977a83
|
7
|
+
data.tar.gz: 3a4339be039db281e3a8f5b32f65b28cf27cf35582c3ae7d7b58f6d70544c45bac8b9be3f305e97ab1b93349e35b216ddeb19cf6d0a542ea33fc9dd39e178000
|
data/.gitignore
CHANGED
File without changes
|
data/.travis.yml
CHANGED
File without changes
|
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
File without changes
|
data/br_boleto.gemspec
CHANGED
File without changes
|
data/lib/br_boleto.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
module BrBoleto
|
3
3
|
module Boleto
|
4
|
-
|
4
|
+
|
5
5
|
class Sicredi < Base
|
6
6
|
|
7
7
|
def conta_class
|
@@ -16,14 +16,14 @@ module BrBoleto
|
|
16
16
|
def valid_carteira_inclusion
|
17
17
|
%w[1 3]
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
# Tamanho máximo para o codigo_cedente/Convênio
|
21
|
-
def valid_convenio_maximum
|
21
|
+
def valid_convenio_maximum
|
22
22
|
5
|
23
|
-
end
|
23
|
+
end
|
24
24
|
|
25
25
|
# Tamanho máximo de uma conta corrente no Banco Sicredi
|
26
|
-
def valid_conta_corrente_maximum
|
26
|
+
def valid_conta_corrente_maximum
|
27
27
|
5
|
28
28
|
end
|
29
29
|
|
@@ -52,7 +52,7 @@ module BrBoleto
|
|
52
52
|
"#{ano}/#{conta.byte_id}#{numero_documento}-#{digito_verificador_nosso_numero}"
|
53
53
|
end
|
54
54
|
def digito_verificador_nosso_numero
|
55
|
-
BrBoleto::Calculos::Modulo11FatorDe2a9RestoZero.new("#{conta.agencia}#{conta.posto}#{conta.
|
55
|
+
BrBoleto::Calculos::Modulo11FatorDe2a9RestoZero.new("#{conta.agencia}#{conta.posto}#{conta.codigo_cedente}#{ano}#{conta.byte_id}#{numero_documento}")
|
56
56
|
end
|
57
57
|
def ano
|
58
58
|
data_documento.strftime('%y')
|
@@ -80,8 +80,8 @@ module BrBoleto
|
|
80
80
|
campo_livre << "#{nosso_numero_codigo_de_barras}"
|
81
81
|
campo_livre << "#{conta.agencia}"
|
82
82
|
campo_livre << "#{conta.posto}"
|
83
|
-
campo_livre << "#{conta.
|
84
|
-
campo_livre << "#{valor_expresso}"
|
83
|
+
campo_livre << "#{conta.codigo_cedente}"
|
84
|
+
campo_livre << "#{valor_expresso}"
|
85
85
|
campo_livre << "0"
|
86
86
|
campo_livre << "#{codigo_dv(campo_livre)}"
|
87
87
|
campo_livre
|
File without changes
|
File without changes
|
data/lib/br_boleto/conta/base.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/br_boleto/conta/itau.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/br_boleto/pagador.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -79,13 +79,13 @@ module BrBoleto
|
|
79
79
|
# Modalidade carteira 02 41 - 42
|
80
80
|
# nosso_numero 15 43 - 57
|
81
81
|
#
|
82
|
-
# TOTAL = 34 posições
|
82
|
+
# TOTAL = 34 posições
|
83
83
|
#
|
84
84
|
def complemento_p(pagamento)
|
85
85
|
complemento = "#{conta.convenio}".adjust_size_to(6, '0', :right)
|
86
86
|
complemento << ''.rjust(11, '0')
|
87
87
|
complemento << "#{conta.carteira}".adjust_size_to(conta.valid_carteira_length, '2', :right)
|
88
|
-
complemento << pagamento.nosso_numero.adjust_size_to(15, '0', :right)
|
88
|
+
complemento << pagamento.nosso_numero.adjust_size_to(15, '0', :right) # Sem a carteira e sem o DV
|
89
89
|
complemento
|
90
90
|
end
|
91
91
|
|
@@ -95,7 +95,7 @@ module BrBoleto
|
|
95
95
|
# Nr Doc. cobrança 11 63 - 73
|
96
96
|
# Uso da CAIXA 04 74 - 77
|
97
97
|
#
|
98
|
-
# TOTAL = 15 posições
|
98
|
+
# TOTAL = 15 posições
|
99
99
|
#
|
100
100
|
def segmento_p_numero_do_documento(pagamento)
|
101
101
|
complemento = "#{pagamento.numero_documento}".adjust_size_to(11, '0', :right)
|
@@ -106,13 +106,13 @@ module BrBoleto
|
|
106
106
|
# Digito verificador da agência
|
107
107
|
# Segundo a documentação nessa posição vai o valor '0'
|
108
108
|
#
|
109
|
-
# TOTAL = 01 posição
|
109
|
+
# TOTAL = 01 posição
|
110
110
|
#
|
111
111
|
def segmento_p_posicao_106_a_106
|
112
112
|
'0'
|
113
113
|
end
|
114
114
|
|
115
|
-
# Identificação do Título na Empresa
|
115
|
+
# Identificação do Título na Empresa
|
116
116
|
# Campo destinado para uso da Empresa Cedente para identificação do Título.
|
117
117
|
# Informar o Número do Documento - Seu Número (mesmo das posições 63-73 do Segmento P)
|
118
118
|
#
|
@@ -122,7 +122,7 @@ module BrBoleto
|
|
122
122
|
"#{pagamento.numero_documento}".adjust_size_to(25, '0', :right)
|
123
123
|
end
|
124
124
|
|
125
|
-
# Código para Baixa/Devolução
|
125
|
+
# Código para Baixa/Devolução
|
126
126
|
# 1 posição
|
127
127
|
#
|
128
128
|
def segmento_p_posicao_224_a_224
|
@@ -133,9 +133,9 @@ module BrBoleto
|
|
133
133
|
# Deve ser 3 espaços em branco
|
134
134
|
# 3 posições
|
135
135
|
def segmento_q_posicao_210_a_212
|
136
|
-
''.rjust(3, ' ')
|
136
|
+
''.rjust(3, ' ')
|
137
137
|
end
|
138
|
-
|
138
|
+
|
139
139
|
def segmento_s_posicao_019_a_020_tipo_impressao_1_ou_2(pagamento)
|
140
140
|
'00'
|
141
141
|
end
|
@@ -152,9 +152,9 @@ module BrBoleto
|
|
152
152
|
# Val. Tot Cobr. Caucionada 17 53 - 69 > VALORES UTILIZADOS APENAS PARA ARQUIVO DE RETORNO
|
153
153
|
# Qtd. cobr. Descontada 06 70 - 75 /
|
154
154
|
# Val. Tot Cobr. Descontada 17 76 - 92 _/
|
155
|
-
# Uso FEBRABAN 148 93 - 240
|
155
|
+
# Uso FEBRABAN 148 93 - 240
|
156
156
|
#
|
157
|
-
# TOTAL = 217 posições
|
157
|
+
# TOTAL = 217 posições
|
158
158
|
#
|
159
159
|
def complemento_trailer_lote(lote, nr_lote)
|
160
160
|
complemento = ''
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/br_boleto/version.rb
CHANGED
@@ -2,7 +2,7 @@ module BrBoleto
|
|
2
2
|
module Version
|
3
3
|
MAJOR = 2 #inclui alterações de API e pode quebrar compatibilidade com versões anteriores
|
4
4
|
MINOR = 2 #inclui novas funcionalidades, sem quebrar APIs existentes
|
5
|
-
PATCH =
|
5
|
+
PATCH = 7 #corrige bugs ou traz melhorias em implementações já existentes
|
6
6
|
CURRENT = "#{MAJOR}.#{MINOR}.#{PATCH}"
|
7
7
|
end
|
8
8
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,11 +3,11 @@ require 'test_helper'
|
|
3
3
|
|
4
4
|
describe BrBoleto::Boleto::Sicredi do
|
5
5
|
subject { FactoryGirl.build(:boleto_sicredi, conta: conta) }
|
6
|
-
let(:conta) { FactoryGirl.build(:conta_sicredi) }
|
7
|
-
|
6
|
+
let(:conta) { FactoryGirl.build(:conta_sicredi) }
|
7
|
+
|
8
8
|
context "on validations" do
|
9
9
|
it { must validate_length_of(:numero_documento).is_at_most(5).with_message(:custom_length_maximum) }
|
10
|
-
|
10
|
+
|
11
11
|
context '#conta.carteira' do
|
12
12
|
it { subject.valid_carteira_inclusion.must_equal ['1','3'] }
|
13
13
|
it "validação da carteira da conta" do
|
@@ -21,7 +21,7 @@ describe BrBoleto::Boleto::Sicredi do
|
|
21
21
|
describe '#conta.convenio / codigo_cedente' do
|
22
22
|
it { subject.valid_convenio_maximum.must_equal 5 }
|
23
23
|
it { subject.valid_convenio_required.must_equal true }
|
24
|
-
|
24
|
+
|
25
25
|
it "validação obrigatoriedade do codigo_cedente da conta" do
|
26
26
|
subject.conta.codigo_cedente = ''
|
27
27
|
conta_must_be_msg_error(:convenio, :blank)
|
@@ -49,8 +49,8 @@ describe BrBoleto::Boleto::Sicredi do
|
|
49
49
|
describe "#digito_verificador_nosso_numero" do
|
50
50
|
it "deve utilizar o Modulo11FatorDe2a9RestoZero para calcular o digito passando a agencia, posto, conta_corrente, ano, byte_id e numero_documento" do
|
51
51
|
subject.stubs(:ano).returns('16')
|
52
|
-
subject.assign_attributes(conta: {agencia: '4697', posto: '02', conta_corrente: '55825', byte_id: '3'}, numero_documento: '77445')
|
53
|
-
BrBoleto::Calculos::Modulo11FatorDe2a9RestoZero.expects(:new).with("
|
52
|
+
subject.assign_attributes(conta: {agencia: '4697', posto: '02', conta_corrente: '55825', codigo_cedente: '9886', byte_id: '3'}, numero_documento: '77445')
|
53
|
+
BrBoleto::Calculos::Modulo11FatorDe2a9RestoZero.expects(:new).with("4697020988616377445").returns('8')
|
54
54
|
|
55
55
|
subject.digito_verificador_nosso_numero.must_equal '8'
|
56
56
|
end
|
@@ -59,7 +59,7 @@ describe BrBoleto::Boleto::Sicredi do
|
|
59
59
|
describe "#nosso_numero" do
|
60
60
|
subject { FactoryGirl.build(:boleto_sicredi, numero_documento: '68315') }
|
61
61
|
|
62
|
-
it "deve retornar o numero do documento com o digito_verificador_nosso_numero" do
|
62
|
+
it "deve retornar o numero do documento com o digito_verificador_nosso_numero" do
|
63
63
|
subject.stubs(:ano).returns('15')
|
64
64
|
subject.conta.byte_id = '7'
|
65
65
|
subject.numero_documento = '3646'
|
@@ -69,11 +69,12 @@ describe BrBoleto::Boleto::Sicredi do
|
|
69
69
|
end
|
70
70
|
|
71
71
|
describe "#codigo_de_barras_do_banco" do
|
72
|
-
subject do
|
72
|
+
subject do
|
73
73
|
FactoryGirl.build(:boleto_sicredi, conta: {
|
74
74
|
carteira: '3',
|
75
75
|
codigo_carteira: '1',
|
76
76
|
agencia: '7832',
|
77
|
+
codigo_cedente: '9649',
|
77
78
|
conta_corrente: '668',
|
78
79
|
posto: '22',
|
79
80
|
},
|
@@ -92,11 +93,11 @@ describe BrBoleto::Boleto::Sicredi do
|
|
92
93
|
result[2..10].must_equal '152003952' # Nosso número com o DV
|
93
94
|
result[11..14].must_equal '7832' # Agência
|
94
95
|
result[15..16].must_equal '22' # Posto
|
95
|
-
result[17..21].must_equal '
|
96
|
-
result[22].must_equal '1'
|
97
|
-
result[23].must_equal '0'
|
98
|
-
result[24].must_equal '
|
99
|
-
subject.codigo_de_barras_do_banco.must_equal '
|
96
|
+
result[17..21].must_equal '09649' # Cód. Cedente
|
97
|
+
result[22].must_equal '1'
|
98
|
+
result[23].must_equal '0'
|
99
|
+
result[24].must_equal '3' # DV Campo Livre
|
100
|
+
subject.codigo_de_barras_do_banco.must_equal '3115200395278322209649103'
|
100
101
|
end
|
101
102
|
end
|
102
103
|
|
@@ -116,12 +117,12 @@ describe BrBoleto::Boleto::Sicredi do
|
|
116
117
|
end
|
117
118
|
end
|
118
119
|
|
119
|
-
it { subject.codigo_de_barras.must_equal '
|
120
|
-
it { subject.linha_digitavel.must_equal '74891.11620 10010.
|
120
|
+
it { subject.codigo_de_barras.must_equal '74897816800093015781116210010030696682819108' }
|
121
|
+
it { subject.linha_digitavel.must_equal '74891.11620 10010.030699 66828.191081 7 81680009301578' }
|
121
122
|
|
122
123
|
it "codigo de barras de um boleto de exemplo" do
|
123
|
-
subject.conta.agencia = 3069
|
124
|
-
subject.conta.posto = 66
|
124
|
+
subject.conta.agencia = 3069
|
125
|
+
subject.conta.posto = 66
|
125
126
|
subject.conta.codigo_cedente = 82819 # Para o sicredi é o código do cliente
|
126
127
|
subject.conta.codigo_cedente_dv = 0 # Para o sicredi é o código do cliente
|
127
128
|
subject.conta.carteira = '1'
|
@@ -130,8 +131,8 @@ describe BrBoleto::Boleto::Sicredi do
|
|
130
131
|
subject.valor_documento = 408.50
|
131
132
|
subject.data_vencimento = Date.parse('2016-09-01')
|
132
133
|
|
133
|
-
subject.linha_digitavel.must_equal '74891.11620 15679.
|
134
|
-
subject.codigo_de_barras.must_equal '
|
134
|
+
subject.linha_digitavel.must_equal '74891.11620 15679.230696 66828.191065 2 69040000040850'
|
135
|
+
subject.codigo_de_barras.must_equal '74892690400000408501116215679230696682819106'
|
135
136
|
end
|
136
137
|
end
|
137
138
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: br_boleto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno M. Mergen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -352,7 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
352
352
|
version: '0'
|
353
353
|
requirements: []
|
354
354
|
rubyforge_project:
|
355
|
-
rubygems_version: 2.
|
355
|
+
rubygems_version: 2.5.1
|
356
356
|
signing_key:
|
357
357
|
specification_version: 4
|
358
358
|
summary: Emissão de Boletos Bancários em Ruby
|