brcobranca 9.2.4 → 10.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +86 -26
- data/HISTORY.md +71 -0
- data/README.md +52 -54
- data/Rakefile +4 -4
- data/lib/brcobranca/arquivos/logos/ailos.eps +412 -0
- data/lib/brcobranca/arquivos/logos/ailos_carne.eps +412 -0
- data/lib/brcobranca/arquivos/logos/safra.eps +0 -0
- data/lib/brcobranca/arquivos/logos/safra_carne.eps +0 -0
- data/lib/brcobranca/arquivos/templates/modelo_generico2.eps +9967 -0
- data/lib/brcobranca/boleto/{cecred.rb → ailos.rb} +7 -5
- data/lib/brcobranca/boleto/banco_brasil.rb +14 -6
- data/lib/brcobranca/boleto/banco_brasilia.rb +5 -5
- data/lib/brcobranca/boleto/banco_nordeste.rb +4 -3
- data/lib/brcobranca/boleto/banestes.rb +4 -3
- data/lib/brcobranca/boleto/banrisul.rb +4 -3
- data/lib/brcobranca/boleto/base.rb +14 -7
- data/lib/brcobranca/boleto/bradesco.rb +4 -3
- data/lib/brcobranca/boleto/caixa.rb +10 -8
- data/lib/brcobranca/boleto/citibank.rb +9 -8
- data/lib/brcobranca/boleto/credisis.rb +6 -4
- data/lib/brcobranca/boleto/hsbc.rb +8 -6
- data/lib/brcobranca/boleto/itau.rb +5 -5
- data/lib/brcobranca/boleto/safra.rb +4 -4
- data/lib/brcobranca/boleto/santander.rb +4 -2
- data/lib/brcobranca/boleto/sicoob.rb +4 -3
- data/lib/brcobranca/boleto/sicredi.rb +6 -3
- data/lib/brcobranca/boleto/template/base.rb +6 -3
- data/lib/brcobranca/boleto/template/rghost.rb +18 -13
- data/lib/brcobranca/boleto/template/rghost2.rb +255 -0
- data/lib/brcobranca/boleto/template/rghost_bolepix.rb +279 -0
- data/lib/brcobranca/boleto/template/rghost_carne.rb +18 -12
- data/lib/brcobranca/boleto/unicred.rb +61 -103
- data/lib/brcobranca/calculo.rb +14 -9
- data/lib/brcobranca/calculo_data.rb +6 -5
- data/lib/brcobranca/currency.rb +10 -10
- data/lib/brcobranca/formatacao.rb +2 -1
- data/lib/brcobranca/formatacao_string.rb +7 -6
- data/lib/brcobranca/limpeza.rb +3 -3
- data/lib/brcobranca/remessa/base.rb +7 -10
- data/lib/brcobranca/remessa/cnab240/{cecred.rb → ailos.rb} +18 -15
- data/lib/brcobranca/remessa/cnab240/banco_brasil.rb +14 -11
- data/lib/brcobranca/remessa/cnab240/base.rb +56 -39
- data/lib/brcobranca/remessa/cnab240/base_correspondente.rb +25 -17
- data/lib/brcobranca/remessa/cnab240/caixa.rb +21 -13
- data/lib/brcobranca/remessa/cnab240/sicoob.rb +33 -30
- data/lib/brcobranca/remessa/cnab240/sicoob_banco_brasil.rb +14 -7
- data/lib/brcobranca/remessa/cnab240/sicredi.rb +28 -22
- data/lib/brcobranca/remessa/cnab240/unicred.rb +2 -1
- data/lib/brcobranca/remessa/cnab400/banco_brasil.rb +9 -9
- data/lib/brcobranca/remessa/cnab400/banco_brasilia.rb +29 -28
- data/lib/brcobranca/remessa/cnab400/banco_nordeste.rb +11 -10
- data/lib/brcobranca/remessa/cnab400/banrisul.rb +13 -10
- data/lib/brcobranca/remessa/cnab400/base.rb +22 -9
- data/lib/brcobranca/remessa/cnab400/bradesco.rb +30 -5
- data/lib/brcobranca/remessa/cnab400/citibank.rb +6 -5
- data/lib/brcobranca/remessa/cnab400/credisis.rb +7 -5
- data/lib/brcobranca/remessa/cnab400/itau.rb +9 -6
- data/lib/brcobranca/remessa/cnab400/santander.rb +17 -15
- data/lib/brcobranca/remessa/cnab400/sicoob.rb +8 -11
- data/lib/brcobranca/remessa/cnab400/unicred.rb +185 -69
- data/lib/brcobranca/remessa/pagamento.rb +54 -20
- data/lib/brcobranca/retorno/base.rb +5 -43
- data/lib/brcobranca/retorno/cnab240/{cecred.rb → ailos.rb} +12 -10
- data/lib/brcobranca/retorno/cnab240/base.rb +8 -9
- data/lib/brcobranca/retorno/cnab240/caixa.rb +4 -5
- data/lib/brcobranca/retorno/cnab240/santander.rb +12 -8
- data/lib/brcobranca/retorno/cnab240/sicoob.rb +11 -9
- data/lib/brcobranca/retorno/cnab240/sicredi.rb +12 -9
- data/lib/brcobranca/retorno/cnab400/banco_brasil.rb +6 -3
- data/lib/brcobranca/retorno/cnab400/banco_brasilia.rb +2 -1
- data/lib/brcobranca/retorno/cnab400/banco_nordeste.rb +2 -1
- data/lib/brcobranca/retorno/cnab400/banrisul.rb +1 -1
- data/lib/brcobranca/retorno/cnab400/base.rb +13 -12
- data/lib/brcobranca/retorno/cnab400/bradesco.rb +4 -4
- data/lib/brcobranca/retorno/cnab400/credisis.rb +2 -1
- data/lib/brcobranca/retorno/cnab400/itau.rb +6 -5
- data/lib/brcobranca/retorno/cnab400/santander.rb +8 -7
- data/lib/brcobranca/retorno/cnab400/unicred.rb +63 -58
- data/lib/brcobranca/retorno/retorno_cbr643.rb +1 -2
- data/lib/brcobranca/retorno/retorno_cnab240.rb +11 -9
- data/lib/brcobranca/retorno/retorno_cnab400.rb +6 -5
- data/lib/brcobranca/util/date.rb +2 -1
- data/lib/brcobranca/util/empresa.rb +2 -1
- data/lib/brcobranca/util/errors.rb +31 -31
- data/lib/brcobranca/validations.rb +127 -151
- data/lib/brcobranca/version.rb +2 -3
- data/lib/brcobranca.rb +7 -5
- metadata +40 -248
- data/spec/arquivos/CBR64310.RET +0 -28
- data/spec/arquivos/CNAB240.RET +0 -74
- data/spec/arquivos/CNAB240CECRED.RET +0 -10
- data/spec/arquivos/CNAB240SANTANDER.RET +0 -8
- data/spec/arquivos/CNAB240SICOOB.RET +0 -10
- data/spec/arquivos/CNAB240SICREDI.CRT +0 -8
- data/spec/arquivos/CNAB400.RET +0 -54
- data/spec/arquivos/CNAB400BANCOBRASILIA.RET +0 -3
- data/spec/arquivos/CNAB400BANCONORDESTE.RET +0 -3
- data/spec/arquivos/CNAB400BANRISUL.RET +0 -3
- data/spec/arquivos/CNAB400BRADESCO.RET +0 -8
- data/spec/arquivos/CNAB400CREDISIS.RET +0 -3
- data/spec/arquivos/CNAB400ITAU.RET +0 -54
- data/spec/arquivos/CNAB400SANTANDER.RET +0 -54
- data/spec/arquivos/CNAB400UNICRED.RET +0 -3
- data/spec/brcobranca/base_spec.rb +0 -170
- data/spec/brcobranca/boleto/banco_brasil_spec.rb +0 -334
- data/spec/brcobranca/boleto/banco_brasilia_spec.rb +0 -152
- data/spec/brcobranca/boleto/banco_nordeste_spec.rb +0 -161
- data/spec/brcobranca/boleto/banestes_spec.rb +0 -194
- data/spec/brcobranca/boleto/banrisul_spec.rb +0 -182
- data/spec/brcobranca/boleto/bradesco_spec.rb +0 -211
- data/spec/brcobranca/boleto/caixa_spec.rb +0 -161
- data/spec/brcobranca/boleto/cecred_spec.rb +0 -147
- data/spec/brcobranca/boleto/citibank_spec.rb +0 -196
- data/spec/brcobranca/boleto/credisis_spec.rb +0 -159
- data/spec/brcobranca/boleto/hsbc_spec.rb +0 -172
- data/spec/brcobranca/boleto/itau_spec.rb +0 -262
- data/spec/brcobranca/boleto/safra_spec.rb +0 -172
- data/spec/brcobranca/boleto/santander_spec.rb +0 -143
- data/spec/brcobranca/boleto/sicoob_spec.rb +0 -193
- data/spec/brcobranca/boleto/sicredi_spec.rb +0 -190
- data/spec/brcobranca/boleto/unicred_spec.rb +0 -149
- data/spec/brcobranca/boletos_em_lote_spec.rb +0 -38
- data/spec/brcobranca/calculo_data_spec.rb +0 -33
- data/spec/brcobranca/calculo_spec.rb +0 -185
- data/spec/brcobranca/currency_spec.rb +0 -79
- data/spec/brcobranca/formatacao_spec.rb +0 -46
- data/spec/brcobranca/formatacao_string_spec.rb +0 -25
- data/spec/brcobranca/limpeza_spec.rb +0 -10
- data/spec/brcobranca/remessa/base_spec.rb +0 -67
- data/spec/brcobranca/remessa/cnab240/banco_brasil_spec.rb +0 -217
- data/spec/brcobranca/remessa/cnab240/base_spec.rb +0 -91
- data/spec/brcobranca/remessa/cnab240/caixa_spec.rb +0 -163
- data/spec/brcobranca/remessa/cnab240/cecred_spec.rb +0 -164
- data/spec/brcobranca/remessa/cnab240/sicoob_banco_brasil_spec.rb +0 -268
- data/spec/brcobranca/remessa/cnab240/sicoob_spec.rb +0 -198
- data/spec/brcobranca/remessa/cnab240/sicredi_spec.rb +0 -201
- data/spec/brcobranca/remessa/cnab240/unicred_spec.rb +0 -193
- data/spec/brcobranca/remessa/cnab400/banco_brasil_spec.rb +0 -187
- data/spec/brcobranca/remessa/cnab400/banco_brasilia_spec.rb +0 -183
- data/spec/brcobranca/remessa/cnab400/banco_nordeste_spec.rb +0 -187
- data/spec/brcobranca/remessa/cnab400/banrisul_spec.rb +0 -190
- data/spec/brcobranca/remessa/cnab400/base_spec.rb +0 -53
- data/spec/brcobranca/remessa/cnab400/bradesco_spec.rb +0 -201
- data/spec/brcobranca/remessa/cnab400/citibank_spec.rb +0 -126
- data/spec/brcobranca/remessa/cnab400/credisis_spec.rb +0 -188
- data/spec/brcobranca/remessa/cnab400/itau_spec.rb +0 -190
- data/spec/brcobranca/remessa/cnab400/santander_spec.rb +0 -152
- data/spec/brcobranca/remessa/cnab400/sicoob_spec.rb +0 -217
- data/spec/brcobranca/remessa/cnab400/unicred_spec.rb +0 -185
- data/spec/brcobranca/remessa/pagamento_spec.rb +0 -227
- data/spec/brcobranca/retorno/cnab240/base_spec.rb +0 -23
- data/spec/brcobranca/retorno/cnab240/cecred_spec.rb +0 -50
- data/spec/brcobranca/retorno/cnab240/santander_spec.rb +0 -50
- data/spec/brcobranca/retorno/cnab240/sicoob_spec.rb +0 -50
- data/spec/brcobranca/retorno/cnab240/sicredi_spec.rb +0 -31
- data/spec/brcobranca/retorno/cnab400/banco_brasilia_spec.rb +0 -36
- data/spec/brcobranca/retorno/cnab400/banco_nordeste_spec.rb +0 -39
- data/spec/brcobranca/retorno/cnab400/banrisul_spec.rb +0 -41
- data/spec/brcobranca/retorno/cnab400/base_spec.rb +0 -57
- data/spec/brcobranca/retorno/cnab400/bradesco_spec.rb +0 -58
- data/spec/brcobranca/retorno/cnab400/credisis_spec.rb +0 -25
- data/spec/brcobranca/retorno/cnab400/itau_spec.rb +0 -58
- data/spec/brcobranca/retorno/cnab400/santander_spec.rb +0 -39
- data/spec/brcobranca/retorno/cnab400/unicred_spec.rb +0 -42
- data/spec/brcobranca/retorno/retorno_cbr643_spec.rb +0 -69
- data/spec/brcobranca/retorno/retorno_cnab400_spec.rb +0 -57
- data/spec/brcobranca/retorno/retorno_cnab_240_spec.rb +0 -52
- data/spec/brcobranca/rghost_spec.rb +0 -29
- data/spec/brcobranca/util/empresa_spec.rb +0 -36
- data/spec/brcobranca_spec.rb +0 -34
- data/spec/fixtures/remessa/remessa-banco-brasil-cnab400.rem +0 -3
- data/spec/fixtures/remessa/remessa-banco-brasilia-cnab400.rem +0 -3
- data/spec/fixtures/remessa/remessa-banco-nordeste-cnab400.rem +0 -3
- data/spec/fixtures/remessa/remessa-banco_brasil-cnab240.rem +0 -7
- data/spec/fixtures/remessa/remessa-bancoob-cnab240.rem +0 -7
- data/spec/fixtures/remessa/remessa-banrisul-cnab400.rem +0 -3
- data/spec/fixtures/remessa/remessa-bradesco-cnab400.rem +0 -3
- data/spec/fixtures/remessa/remessa-caixa-cnab240.rem +0 -7
- data/spec/fixtures/remessa/remessa-cecred-cnab240.rem +0 -7
- data/spec/fixtures/remessa/remessa-citibank-cnab400.rem +0 -3
- data/spec/fixtures/remessa/remessa-credisis-cnab400.rem +0 -3
- data/spec/fixtures/remessa/remessa-itau-cnab400.rem +0 -4
- data/spec/fixtures/remessa/remessa-santander-cnab400.rem +0 -3
- data/spec/fixtures/remessa/remessa-sicoob-cnab400.rem +0 -3
- data/spec/fixtures/remessa/remessa-sicoob-correspondente-bb-cnab240.rem +0 -4
- data/spec/fixtures/remessa/remessa-sicredi-cnab240.rem +0 -7
- data/spec/fixtures/remessa/remessa-unicred-cnab240.rem +0 -7
- data/spec/fixtures/remessa/remessa-unicred-cnab400.rem +0 -3
- data/spec/spec.opts +0 -8
- data/spec/spec_helper.rb +0 -38
- data/spec/support/remessa_helpers.rb +0 -13
- data/spec/support/shared_examples/busca_logotipo.rb +0 -15
- data/spec/support/shared_examples/cnab240.rb +0 -259
- data/spec/support/shared_examples/cnab400.rb +0 -180
- data/spec/support/shared_examples/formatos_validos.rb +0 -36
@@ -1,57 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe Brcobranca::Retorno::RetornoCnab400 do
|
5
|
-
before do
|
6
|
-
@arquivo = File.join(File.dirname(__FILE__), '..', '..', 'arquivos', 'CNAB400.RET')
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'Ignora primeira linha que é header' do
|
10
|
-
pagamentos = described_class.load_lines(@arquivo)
|
11
|
-
pagamento = pagamentos.first
|
12
|
-
expect(pagamento.sequencial).to eql('000002')
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'Transforma arquivo de retorno em objetos de retorno retornando somente as linhas de pagamentos de títulos sem registro' do
|
16
|
-
pagamentos = described_class.load_lines(@arquivo)
|
17
|
-
expect(pagamentos.size).to eq(53) # deve ignorar a primeira linha que é header
|
18
|
-
pagamento = pagamentos.first
|
19
|
-
expect(pagamento.agencia_com_dv).to eql('0730')
|
20
|
-
expect(pagamento.cedente_com_dv).to eql('035110')
|
21
|
-
expect(pagamento.nosso_numero).to eql('00000011')
|
22
|
-
expect(pagamento.carteira_variacao).to eql('109')
|
23
|
-
expect(pagamento.carteira).to eql('I')
|
24
|
-
expect(pagamento.data_vencimento).to eql('000000')
|
25
|
-
expect(pagamento.valor_titulo).to eql('0000000004000')
|
26
|
-
expect(pagamento.banco_recebedor).to eql('104')
|
27
|
-
expect(pagamento.agencia_recebedora_com_dv).to eql('18739')
|
28
|
-
expect(pagamento.especie_documento).to eql('')
|
29
|
-
expect(pagamento.valor_tarifa).to eql('0000000000210')
|
30
|
-
expect(pagamento.iof).to eql('0000000000000')
|
31
|
-
expect(pagamento.valor_abatimento).to eql('0000000000000')
|
32
|
-
expect(pagamento.desconto).to eql('0000000000000')
|
33
|
-
expect(pagamento.valor_recebido).to eql('0000000003790')
|
34
|
-
expect(pagamento.juros_mora).to eql('0000000000000')
|
35
|
-
expect(pagamento.outros_recebimento).to eql('0000000000000')
|
36
|
-
expect(pagamento.data_credito).to eql('210513')
|
37
|
-
expect(pagamento.motivo_ocorrencia).to eql([])
|
38
|
-
expect(pagamento.sequencial).to eql('000002')
|
39
|
-
|
40
|
-
# Campos da classe base que não encontrei a relação com CNAB400
|
41
|
-
# parse.field :tipo_cobranca,80..80
|
42
|
-
# parse.field :tipo_cobranca_anterior,81..81
|
43
|
-
# parse.field :natureza_recebimento,86..87
|
44
|
-
# parse.field :convenio,31..37
|
45
|
-
# parse.field :comando,108..109
|
46
|
-
# parse.field :juros_desconto,201..213
|
47
|
-
# parse.field :iof_desconto,214..226
|
48
|
-
# parse.field :desconto_concedito,240..252
|
49
|
-
# parse.field :outras_despesas,279..291
|
50
|
-
# parse.field :abatimento_nao_aproveitado,292..304
|
51
|
-
# parse.field :data_liquidacao,295..300
|
52
|
-
# parse.field :valor_lancamento,305..317
|
53
|
-
# parse.field :indicativo_lancamento,318..318
|
54
|
-
# parse.field :indicador_valor,319..319
|
55
|
-
# parse.field :valor_ajuste,320..331
|
56
|
-
end
|
57
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe Brcobranca::Retorno::RetornoCnab240 do
|
5
|
-
before 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 = described_class.load_lines(@arquivo)
|
11
|
-
expect(pagamentos.size).to eq(35)
|
12
|
-
pagamento = pagamentos.first
|
13
|
-
expect(pagamento.agencia_com_dv).to eql('012345')
|
14
|
-
expect(pagamento.cedente_com_dv).to eql('0000000054321')
|
15
|
-
expect(pagamento.nosso_numero).to eql('00020673')
|
16
|
-
expect(pagamento.carteira).to eql('7')
|
17
|
-
expect(pagamento.data_vencimento).to eql('00000000')
|
18
|
-
expect(pagamento.valor_titulo).to eql('000000000034400')
|
19
|
-
expect(pagamento.banco_recebedor).to eql('001')
|
20
|
-
expect(pagamento.agencia_recebedora_com_dv).to eql('020850')
|
21
|
-
# expect(pagamento.data_ocorrencia).to eql('02012012')
|
22
|
-
expect(pagamento.data_credito).to eql('02012012')
|
23
|
-
expect(pagamento.outras_despesas).to eql('000000000000004')
|
24
|
-
expect(pagamento.iof_desconto).to eql('000000000000003')
|
25
|
-
expect(pagamento.valor_abatimento).to eql('000000000000002')
|
26
|
-
expect(pagamento.desconto_concedito).to eql('000000000000001')
|
27
|
-
expect(pagamento.valor_recebido).to eql('000000000034400')
|
28
|
-
expect(pagamento.juros_mora).to eql('000000000000009')
|
29
|
-
expect(pagamento.outros_recebimento).to eql('000000000000005')
|
30
|
-
expect(pagamento.sequencial).to eql('00001')
|
31
|
-
expect(pagamento.valor_tarifa).to eql('000000000000103')
|
32
|
-
expect(pagamento.motivo_ocorrencia).to eql(['03'])
|
33
|
-
|
34
|
-
# Dados que não consegui extrair dos registros T e U
|
35
|
-
# pagamento.convenio.should eql('')
|
36
|
-
# pagamento.tipo_cobranca.should eql('')
|
37
|
-
# pagamento.tipo_cobranca_anterior.should eql('')
|
38
|
-
# pagamento.natureza_recebimento.should eql('')
|
39
|
-
# pagamento.carteira_variacao.should eql('7')
|
40
|
-
# pagamento.iof.should eql('')
|
41
|
-
# pagamento.comando.should eql('')
|
42
|
-
# pagamento.data_liquidacao.should eql('')
|
43
|
-
# pagamento.especie_documento.should eql('')
|
44
|
-
# pagamento.valor_tarifa.should eql('')
|
45
|
-
# pagamento.juros_desconto.should eql('')
|
46
|
-
# pagamento.abatimento_nao_aproveitado.should eql('')
|
47
|
-
# pagamento.valor_lancamento.should eql('')
|
48
|
-
# pagamento.indicativo_lancamento.should eql('')
|
49
|
-
# pagamento.indicador_valor.should eql('')
|
50
|
-
# pagamento.valor_ajuste.should eql('')
|
51
|
-
end
|
52
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe 'RGhost' do
|
6
|
-
before do
|
7
|
-
@valid_attributes = {
|
8
|
-
valor: 0.0,
|
9
|
-
cedente: 'Kivanio Barbosa',
|
10
|
-
documento_cedente: '12345678912',
|
11
|
-
sacado: 'Claudio Pozzebom',
|
12
|
-
sacado_documento: '12345678900',
|
13
|
-
agencia: '4042',
|
14
|
-
conta_corrente: '61900',
|
15
|
-
convenio: 12_387_989,
|
16
|
-
nosso_numero: '777700168'
|
17
|
-
}
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'Testar se RGhost e GhostScript estão instalados' do
|
21
|
-
# RGhost::Config.config_platform
|
22
|
-
expect(File.exist?(RGhost::Config::GS[:path])).to be_truthy
|
23
|
-
expect(File.executable?(RGhost::Config::GS[:path])).to be_truthy
|
24
|
-
s = `#{RGhost::Config::GS[:path]} -v`
|
25
|
-
expect(s).to match(/^GPL Ghostscript/)
|
26
|
-
s = `#{RGhost::Config::GS[:path]} --version`
|
27
|
-
expect(s).to match(/[8-9]\.[0-9]/)
|
28
|
-
end
|
29
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
|
4
|
-
require 'spec_helper'
|
5
|
-
|
6
|
-
RSpec.describe Brcobranca::Util::Empresa do
|
7
|
-
context 'com zero' do
|
8
|
-
it 'CPF returns 01' do
|
9
|
-
['179.461.278-55', '17946127855', 17_946_127_855].each do |documento|
|
10
|
-
expect(described_class.new(documento, true).tipo).to eq('01')
|
11
|
-
expect(described_class.new(documento).tipo).to eq('01')
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'CNPJ returns 02' do
|
16
|
-
['25.716.376/0001-28', '25716376000128', 25_716_376_000_128].each do |documento|
|
17
|
-
expect(described_class.new(documento, true).tipo).to eq('02')
|
18
|
-
expect(described_class.new(documento).tipo).to eq('02')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
context 'sem zero' do
|
24
|
-
it 'CPF returns 1' do
|
25
|
-
['179.461.278-55', '17946127855', 17_946_127_855].each do |documento|
|
26
|
-
expect(described_class.new(documento, false).tipo).to eq('1')
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'CNPJ returns 2' do
|
31
|
-
['25.716.376/0001-28', '25716376000128', 25_716_376_000_128].each do |documento|
|
32
|
-
expect(described_class.new(documento, false).tipo).to eq('2')
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
data/spec/brcobranca_spec.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
|
4
|
-
require 'spec_helper'
|
5
|
-
|
6
|
-
RSpec.describe 'Brcobranca' do
|
7
|
-
describe 'gerador' do
|
8
|
-
context 'rghost' do
|
9
|
-
before { Brcobranca.configuration.gerador = :rghost }
|
10
|
-
|
11
|
-
it { expect(Brcobranca.configuration.gerador).to be(:rghost) }
|
12
|
-
end
|
13
|
-
|
14
|
-
context 'prawn' do
|
15
|
-
before { Brcobranca.configuration.gerador = :prawn }
|
16
|
-
|
17
|
-
it { expect(Brcobranca.configuration.gerador).to be(:prawn) }
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe 'formato' do
|
22
|
-
context 'pdf' do
|
23
|
-
before { Brcobranca.configuration.formato = :pdf }
|
24
|
-
|
25
|
-
it { expect(Brcobranca.configuration.formato).to be(:pdf) }
|
26
|
-
end
|
27
|
-
|
28
|
-
context 'gif' do
|
29
|
-
before { Brcobranca.configuration.formato = :gif }
|
30
|
-
|
31
|
-
it { expect(Brcobranca.configuration.formato).to be(:gif) }
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,3 +0,0 @@
|
|
1
|
-
01REMESSA01COBRANCA 12343000012343000000SOCIEDADE BRASILEIRA DE ZOOLOG001BANCODOBRASIL 1407150000001 7654321 000001
|
2
|
-
70100012345678910123430000123431234567 123456700000001230000 123000000004DSC1201000000012314071500000000199900010000 01N140715000000000000000000000000000000000000000000000000000000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA J RUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS12345678SANTA RITA DE CSP 00 000002
|
3
|
-
9 000003
|
@@ -1,3 +0,0 @@
|
|
1
|
-
DCB001075083000049020150714161515000002
|
2
|
-
01083000049000012345678901PABLO DIEGO JOSE FRANCISCO DE PAULARUA RIO GRANDE DO SUL SAO PAULO MINSANTA RITA DE CSP12345678100000000069692140720152100020700083 14072015000000000199902000123070380000000000000000000000000000000000000000000000000000000000000000000SOCIEDADE BRASILEIRA DE ZOOLOGIA LTDA
|
3
|
-
9 000003
|
@@ -1,3 +0,0 @@
|
|
1
|
-
01REMESSA01COBRANCA 12340012345671 SOCIEDADE BRASILEIRA DE ZOOLOG004B.DO NORDESTE 140715 000001
|
2
|
-
1 1234001234567100 6969 0000123600000000000000000000000000000 401000000000014071500000000199900040000 01N140715000000000000000000000000000000000000000000000000000000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS12345678SANTA RITA DE CSP 990000002
|
3
|
-
9 000003
|
@@ -1,7 +0,0 @@
|
|
1
|
-
00100000 100012345678901001234567001412123 0123430000000123455 SOCIEDADE BRASILEIRA DE ZOOLOGBANCO DO BRASIL SA 114072015161515000000083000000000000000000000000000000000000000000000
|
2
|
-
00100011R01 042 1000012345678901001234567001412123 0123430000000123455 SOCIEDADE BRASILEIRA DE ZOOLOG 000000001407201500000000
|
3
|
-
0010001300001P 010123430000000123455 12345670000000123 71 000000000000069691407201500000000001999000000 02N14072015300000000000000000000000000000000000000000000000000000000000000000000000000000 69693000000090000000000
|
4
|
-
0010001300002Q 011000012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS QU12345678SANTA RITA DE CSP0000000000000000 000
|
5
|
-
0010001300003R 01000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000 000000000000 0
|
6
|
-
00100015 0000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
7
|
-
00199999 000001000007
|
@@ -1,7 +0,0 @@
|
|
1
|
-
75600000 274576177000177 0432730000000036668 SOCIEDADE BRASILEIRA DE ZOOLOGSICOOB 11407201516151500000008100000
|
2
|
-
75600011R01 040 2074576177000177 0432730000000036668 SOCIEDADE BRASILEIRA DE ZOOLOG 000000001407201500000000
|
3
|
-
7560001300001P 010432730000000036668 000042971501014 10 220000000000069691407201500000000000500000000 02N14072015000000000000000000000000000000000000000000000000000000000000000000000000000000 69691000 090000000000
|
4
|
-
7560001300002Q 011000082136760505PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS QU12345678SANTA RITA DE CRJ0000000000000000 000
|
5
|
-
7560001300003R 01000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000 000000000000 0
|
6
|
-
75600015 00000500000100000000000005000000000000000000000000000000000000000000000000000000000000000000000000
|
7
|
-
75699999 000001000007000000
|
@@ -1,3 +0,0 @@
|
|
1
|
-
01REMESSA 1102900015046 SOCIEDADE BRASILEIRA DE ZOOLOG041BANRISUL 140715 000001
|
2
|
-
1 1102900015046 1 2283256351 1011 1407150000000019990041 08N1407151800 0000000000000000000000000000000000000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA RUA RIO GRANDE DO SUL SAO PAULO MINAS CA 0200012345678SANTA RITA DE CSP0000 000000000000000 000002
|
3
|
-
9 0000000019990 000003
|
@@ -1,3 +0,0 @@
|
|
1
|
-
01REMESSA01COBRANCA 00000000000000000123SOCIEDADE BRASILEIRA DE ZOOLOG237BRADESCO 140715 MX0000001 000001
|
2
|
-
10000000000000000000000112345123456716969 0002020000000000123P00000000002N 2 011 14071500000000199900000000001N140715000000000000000000000000000000000000000000000000000000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SU SANTA RITA DE CSP 12345678 000002
|
3
|
-
9 000003
|
@@ -1,7 +0,0 @@
|
|
1
|
-
10400000 1000123456789010000000000000000000012345112345600000000SOCIEDADE BRASILEIRA DE ZOOLOGCAIXA ECONOMICA FEDERAL 11407201516151500000105000000 REMESSA-PRODUCAO 1234
|
2
|
-
10400011R0100030 10000123456789011234560000000000000012345112345600000000SOCIEDADE BRASILEIRA DE ZOOLOG 000000011407201500000000
|
3
|
-
1040001300001P 0112345112345600000000000140000000000001231122000000006969 1407201500000000001999000000099N1407201511507201500000000000000000000000000000000000000000000000000000000000000000000000000006969 3001120090000000000
|
4
|
-
1040001300002Q 011000012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS QU12345678SANTA RITA DE CSP0000000000000000 000
|
5
|
-
1040001300003R 01000000000000000000000000000000000000000000000000215072015000000000000000
|
6
|
-
10400015 000005000000000000000000000000000000000000000000000000000000000000000000000
|
7
|
-
10499999 000001000007
|
@@ -1,7 +0,0 @@
|
|
1
|
-
08500000 100012345678901123456 1234510000012345679 SOCIEDADE BRASILEIRA DE ZOOLOGCECRED 11407201516151500000108700000
|
2
|
-
08500011R01 045 1000012345678901123456 1234510000012345679 SOCIEDADE BRASILEIRA DE ZOOLOG 000000011407201500000000
|
3
|
-
0850001300001P 011234510000012345679 12345679000000123 101220000000000069691407201500000000001999000000002N140720153000000000000000000000000000000000000000000000000000000000000000000000000000006969 3002 090000000000
|
4
|
-
0850001300002Q 011000012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS QU12345678SANTA RITA DE CSP0000000000000000 000
|
5
|
-
0850001300003R 01000000000000000000000000000000000000000000000000214072015000000000000200 0000000000000000 000000000000 0
|
6
|
-
08500015 00000500000100000000000019990000000000000000000000000000000000000000000000000000000000000000000000
|
7
|
-
08599999 000001000007
|
@@ -1,3 +0,0 @@
|
|
1
|
-
01REMESSA01COBRANCA 17777751042700080112SOCIEDADE BRASILEIRA DE ZOOLOG745CITIBANK 140715 01600BPI000001
|
2
|
-
10100012345678910177777510427000801126969 01000000000123 0000000000000000000000000101000000000014071500000000199907450000007N140715000000000000000000000000000000000000000000000000000000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS12345678SANTA RITA DE CSP 9000002
|
3
|
-
9 000003
|
@@ -1,3 +0,0 @@
|
|
1
|
-
01REMESSA01COBRANCA 0001 000000027 SOCIEDADE BRASILEIRA DE ZOOLOG097CENTRALCRED 1407150000003 000001
|
2
|
-
102123456789012340001 000000027 6969 00027000123 00000000001407150000000019990 140715 080000020000 00000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINASSAO JOSE DOS QU12345678SANTA RITA DE CSP 06 000002
|
3
|
-
9 000003
|
@@ -1,4 +0,0 @@
|
|
1
|
-
01REMESSA01COBRANCA 123400123451 SOCIEDADE BRASILEIRA DE ZOOLOG341BANCO ITAU SA 140715 000001
|
2
|
-
10100012345678910123400123451 00006969 000001230000000000000123 I01000000000014071500000000199903410000099N140715000000000000000000000000000000000000000000000000000000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE RUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS12345678SANTA RITA DE CSP 00000003 000002
|
3
|
-
21140720150000000000200 000003
|
4
|
-
9 000004
|
@@ -1,3 +0,0 @@
|
|
1
|
-
01REMESSA01COBRANCA 17777751042700080112SOCIEDADE BRASILEIRA DE ZOOLOG033SANTANDER 1407150000000000000000 058000001
|
2
|
-
10100012345678910177777510427000801126969 00000123000000 40200000000000000000 000000101000000000014071500000000199900330000001N140715060000000000008000000000000000000000000000000000000000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS12345678SANTA RITA DE CSP I78 06 000002
|
3
|
-
9000003000000001999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003
|
@@ -1,3 +0,0 @@
|
|
1
|
-
01REMESSA01COBRANCA 43273123456789 SOCIEDADE BRASILEIRA DE ZOOLOG756BANCOOBCED 1407150000001 000001
|
2
|
-
1010001234567891043273123456781000000 0000000001230100 0000000000000000 201010000000000140715000000001999075643273010140715000000000000000020000000000000000000000000000000000000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINASSAO JOSE DOS QU12345678SANTA RITA DE CSP 00 000002
|
3
|
-
9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003
|
@@ -1,4 +0,0 @@
|
|
1
|
-
75600001R0000000 4327123456712345678900 SOCIEDADE BRASILEIRA DE ZOOLOG 000000011407201500000000000
|
2
|
-
0000000300001P 01 123456789012345679022 00000000123456714072015000000000005000000000N 14072015100000000000000000000000000000000000000000000000 000000000000000 00000000900000000000
|
3
|
-
0000000300002Q 010100082136760505PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS QU12345678SANTA RITA DE CSP0100012345678901ISABEL CRISTINA LEOPOLDINA ALGUSTA MIGUE
|
4
|
-
00000005 00000100000000000005000000000
|
@@ -1,7 +0,0 @@
|
|
1
|
-
74800000 274576177000177 00165 0000000006238 SOCIEDADE BRASILEIRA DE ZOOLOGSICREDI 11407200716151500000008101600
|
2
|
-
74800011R01 040 2074576177000177 00165 0000000006238 SOCIEDADE BRASILEIRA DE ZOOLOG 000000001407200700000000
|
3
|
-
7480001300001P 0100165 0000000006238 072000031 111220000000000069691407200700000000000500000000 03N14072007115072007000000000000000100000000000000000000000000000000000000000000000000000 69693001060090000000000
|
4
|
-
7480001300002Q 011000082136760505PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS QU12345678SANTA RITA DE CRJ0000000000000000 000
|
5
|
-
7480001300003R 01000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000 000000000000 0
|
6
|
-
74800015 00000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
7
|
-
74899999 000001000007000000
|
@@ -1,7 +0,0 @@
|
|
1
|
-
74800000 274576177000177 00165 0000000006238 SOCIEDADE BRASILEIRA DE ZOOLOGSICREDI 11407200716151500000008101600
|
2
|
-
74800011R01 040 2074576177000177 00165 0000000006238 SOCIEDADE BRASILEIRA DE ZOOLOG 000000001407200700000000
|
3
|
-
7480001300001P 0100165 0000000006238 072000031 111220000000000069691407200700000000000500000000 03N14072007300000000000000000000000100000000000000000000000000000000000000000000000000000 69693001060090000000000
|
4
|
-
7480001300002Q 011000082136760505PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS QU12345678SANTA RITA DE CRJ0000000000000000 000
|
5
|
-
7480001300003R 01000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000 000000000000 0
|
6
|
-
74800015 00000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
7
|
-
74899999 000001000007000000
|
@@ -1,3 +0,0 @@
|
|
1
|
-
01REMESSA01COBRANCA 12345678901234567890SOCIEDADE BRASILEIRA DE ZOOLOG748UNICRED 140715 000001
|
2
|
-
10100012345678910123456789012345678906969 072000031 301000000000014071500000000199907480000001N140715000000000000000000000000000000000000000000000000000000000000000100012345678901PABLO DIEGO JOSE FRANCISCO DE PAULA JUANRUA RIO GRANDE DO SUL SAO PAULO MINAS CASAO JOSE DOS12345678SANTA RITA DE CSP 009000002
|
3
|
-
9 000003
|
data/spec/spec.opts
DELETED
data/spec/spec_helper.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
|
4
|
-
require 'coveralls'
|
5
|
-
Coveralls.wear!
|
6
|
-
|
7
|
-
SimpleCov.start
|
8
|
-
|
9
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
10
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
11
|
-
require 'rspec'
|
12
|
-
require 'timecop'
|
13
|
-
require 'pry'
|
14
|
-
require 'tempfile'
|
15
|
-
require 'brcobranca'
|
16
|
-
require 'rghost'
|
17
|
-
|
18
|
-
# Requires supporting files with custom matchers and macros, etc,
|
19
|
-
# in ./support/ and its subdirectories.
|
20
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
21
|
-
|
22
|
-
RSpec.configure do |config|
|
23
|
-
config.disable_monkey_patching!
|
24
|
-
config.order = :random
|
25
|
-
Kernel.srand config.seed
|
26
|
-
config.filter_run focus: true
|
27
|
-
config.run_all_when_everything_filtered = true
|
28
|
-
config.expect_with :rspec do |expectations|
|
29
|
-
expectations.syntax = :expect
|
30
|
-
end
|
31
|
-
config.mock_with :rspec do |mocks|
|
32
|
-
mocks.syntax = :expect
|
33
|
-
mocks.verify_partial_doubles = true
|
34
|
-
end
|
35
|
-
config.default_formatter = 'doc' if config.files_to_run.one?
|
36
|
-
end
|
37
|
-
|
38
|
-
RGhost::Config.config_platform
|
@@ -1,13 +0,0 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
module RemessaHelpers
|
4
|
-
def read_remessa(name, body = nil)
|
5
|
-
filename = File.join(File.dirname(__FILE__), '..', 'fixtures', 'remessa', name)
|
6
|
-
File.open(filename, 'w') { |f| f.write(body) } unless File.exist?(filename)
|
7
|
-
File.read(filename)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
RSpec.configure do |config|
|
12
|
-
config.include RemessaHelpers
|
13
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
shared_examples_for 'busca_logotipo' do
|
3
|
-
it 'para layout padrão' do
|
4
|
-
boleto_novo = described_class.new
|
5
|
-
expect(File.exist?(boleto_novo.logotipo)).to be_truthy
|
6
|
-
expect(File.stat(boleto_novo.logotipo).zero?).to be_falsey
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'para layout de carnê' do
|
10
|
-
Brcobranca.configuration.gerador = :rghost_carne
|
11
|
-
boleto_novo = described_class.new
|
12
|
-
expect(File.exist?(boleto_novo.logotipo)).to be_truthy
|
13
|
-
expect(File.stat(boleto_novo.logotipo).zero?).to be_falsey
|
14
|
-
end
|
15
|
-
end
|