br_boleto 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +1 -1
- data/Gemfile.lock +2 -2
- data/br_boleto.gemspec +2 -3
- data/lib/br_boleto/association/have_conta.rb +27 -25
- data/lib/br_boleto/association/have_pagador.rb +2 -0
- data/lib/br_boleto/boleto/base.rb +0 -4
- data/lib/br_boleto/boleto/bradesco.rb +80 -0
- data/lib/br_boleto/boleto/caixa.rb +10 -12
- data/lib/br_boleto/boleto/cecred.rb +76 -0
- data/lib/br_boleto/boleto/itau.rb +114 -0
- data/lib/br_boleto/boleto/sicredi.rb +101 -0
- data/lib/br_boleto/boleto/unicred.rb +21 -0
- data/lib/br_boleto/conta/base.rb +28 -3
- data/lib/br_boleto/conta/bradesco.rb +120 -0
- data/lib/br_boleto/conta/caixa.rb +22 -12
- data/lib/br_boleto/conta/cecred.rb +67 -0
- data/lib/br_boleto/conta/itau.rb +199 -0
- data/lib/br_boleto/conta/sicoob.rb +40 -11
- data/lib/br_boleto/conta/sicredi.rb +171 -0
- data/lib/br_boleto/conta/unicred.rb +38 -0
- data/lib/br_boleto/helper/default_codes.rb +535 -26
- data/lib/br_boleto/pagador.rb +4 -0
- data/lib/br_boleto/remessa/base.rb +2 -0
- data/lib/br_boleto/remessa/cnab240/base.rb +21 -6
- data/lib/br_boleto/remessa/cnab240/bradesco.rb +141 -0
- data/lib/br_boleto/remessa/cnab240/caixa.rb +8 -1
- data/lib/br_boleto/remessa/cnab240/cecred.rb +169 -0
- data/lib/br_boleto/remessa/cnab240/helper/segmento_p.rb +29 -21
- data/lib/br_boleto/remessa/cnab240/helper/segmento_q.rb +4 -3
- data/lib/br_boleto/remessa/cnab240/helper/segmento_r.rb +5 -5
- data/lib/br_boleto/remessa/cnab240/helper/segmento_s.rb +4 -3
- data/lib/br_boleto/remessa/cnab240/itau.rb +186 -0
- data/lib/br_boleto/remessa/cnab240/sicoob.rb +4 -16
- data/lib/br_boleto/remessa/cnab240/sicredi.rb +205 -0
- data/lib/br_boleto/remessa/cnab240/unicred.rb +40 -0
- data/lib/br_boleto/remessa/cnab400/bradesco.rb +235 -0
- data/lib/br_boleto/remessa/cnab400/helper/detalhe.rb +6 -5
- data/lib/br_boleto/remessa/cnab400/itau.rb +190 -0
- data/lib/br_boleto/remessa/cnab400/sicoob.rb +3 -3
- data/lib/br_boleto/remessa/cnab400/sicredi.rb +276 -0
- data/lib/br_boleto/remessa/cnab400/unicred.rb +62 -0
- data/lib/br_boleto/remessa/pagamento.rb +93 -43
- data/lib/br_boleto/retorno/cnab240/base.rb +13 -12
- data/lib/br_boleto/retorno/cnab240/bradesco.rb +10 -0
- data/lib/br_boleto/retorno/cnab240/caixa.rb +2 -3
- data/lib/br_boleto/retorno/cnab240/cecred.rb +10 -0
- data/lib/br_boleto/retorno/cnab240/itau.rb +24 -0
- data/lib/br_boleto/retorno/cnab240/sicredi.rb +10 -0
- data/lib/br_boleto/retorno/cnab240/unicred.rb +10 -0
- data/lib/br_boleto/retorno/cnab400/bradesco.rb +42 -0
- data/lib/br_boleto/retorno/cnab400/itau.rb +43 -0
- data/lib/br_boleto/retorno/cnab400/sicoob.rb +2 -2
- data/lib/br_boleto/retorno/cnab400/sicredi.rb +43 -0
- data/lib/br_boleto/retorno/cnab400/unicred.rb +10 -0
- data/lib/br_boleto/retorno/pagamento.rb +18 -4
- data/lib/br_boleto/version.rb +2 -2
- data/lib/br_boleto.rb +28 -0
- data/lib/config/locales/br-boleto-en.yml +1 -0
- data/lib/config/locales/br-boleto-pt-BR.yml +1 -0
- data/test/br_boleto/association/have_pagador_test.rb +24 -0
- data/test/br_boleto/boleto/bradesco_test.rb +125 -0
- data/test/br_boleto/boleto/caixa_test.rb +18 -18
- data/test/br_boleto/boleto/cecred_test.rb +115 -0
- data/test/br_boleto/boleto/itau_test.rb +160 -0
- data/test/br_boleto/boleto/sicredi_test.rb +136 -0
- data/test/br_boleto/boleto/unicred_test.rb +128 -0
- data/test/br_boleto/conta/base_test.rb +298 -3
- data/test/br_boleto/conta/bradesco_test.rb +142 -0
- data/test/br_boleto/conta/caixa_test.rb +7 -6
- data/test/br_boleto/conta/cecred_test.rb +119 -0
- data/test/br_boleto/conta/itau_test.rb +189 -0
- data/test/br_boleto/conta/sicoob_test.rb +32 -2
- data/test/br_boleto/conta/sicredi_test.rb +180 -0
- data/test/br_boleto/conta/unicred_test.rb +154 -0
- data/test/br_boleto/pagador_test.rb +22 -2
- data/test/br_boleto/remessa/cnab240/base_test.rb +24 -12
- data/test/br_boleto/remessa/cnab240/bradesco_test.rb +196 -0
- data/test/br_boleto/remessa/cnab240/caixa_test.rb +51 -0
- data/test/br_boleto/remessa/cnab240/cecred_test.rb +242 -0
- data/test/br_boleto/remessa/cnab240/helper/segmento_p_test.rb +78 -71
- data/test/br_boleto/remessa/cnab240/helper/segmento_q_test.rb +4 -3
- data/test/br_boleto/remessa/cnab240/helper/segmento_r_test.rb +10 -18
- data/test/br_boleto/remessa/cnab240/helper/segmento_s_test.rb +6 -5
- data/test/br_boleto/remessa/cnab240/itau_test.rb +201 -0
- data/test/br_boleto/remessa/cnab240/sicoob_test.rb +1 -58
- data/test/br_boleto/remessa/cnab240/sicredi_test.rb +207 -0
- data/test/br_boleto/remessa/cnab240/unicred_test.rb +250 -0
- data/test/br_boleto/remessa/cnab400/base_test.rb +4 -4
- data/test/br_boleto/remessa/cnab400/bradesco_test.rb +164 -0
- data/test/br_boleto/remessa/cnab400/itau_test.rb +173 -0
- data/test/br_boleto/remessa/cnab400/sicoob_test.rb +2 -2
- data/test/br_boleto/remessa/cnab400/sicredi_test.rb +241 -0
- data/test/br_boleto/remessa/cnab400/unicred_test.rb +169 -0
- data/test/br_boleto/retorno/cnab240/base_test.rb +20 -10
- data/test/br_boleto/retorno/cnab240/bradesco_test.rb +228 -0
- data/test/br_boleto/retorno/cnab240/caixa_test.rb +20 -10
- data/test/br_boleto/retorno/cnab240/cecred_test.rb +228 -0
- data/test/br_boleto/retorno/cnab240/itau_test.rb +228 -0
- data/test/br_boleto/retorno/cnab240/sicoob_test.rb +20 -10
- data/test/br_boleto/retorno/cnab240/sicredi_test.rb +228 -0
- data/test/br_boleto/retorno/cnab240/unicred_test.rb +228 -0
- data/test/br_boleto/retorno/cnab400/bradesco_test.rb +255 -0
- data/test/br_boleto/retorno/cnab400/itau_test.rb +96 -0
- data/test/br_boleto/retorno/cnab400/sicoob_test.rb +10 -5
- data/test/br_boleto/retorno/cnab400/sicredi_test.rb +7 -0
- data/test/br_boleto/retorno/cnab400/unicred.rb +255 -0
- data/test/br_boleto/retorno/pagamento_test.rb +7 -0
- data/test/factories/boleto/boleto_bradesco.rb +18 -0
- data/test/factories/boleto/boleto_cecred.rb +18 -0
- data/test/factories/boleto/boleto_itau.rb +18 -0
- data/test/factories/boleto/boleto_sicredi.rb +18 -0
- data/test/factories/boleto/boleto_unicred.rb +18 -0
- data/test/factories/conta/bradesco.rb +16 -0
- data/test/factories/conta/caixa.rb +2 -1
- data/test/factories/conta/cecred.rb +15 -0
- data/test/factories/conta/itau.rb +15 -0
- data/test/factories/conta/sicoob.rb +2 -1
- data/test/factories/conta/sicredi.rb +15 -0
- data/test/factories/conta/unicred.rb +15 -0
- data/test/factories/remessa/cnab240/bradesco.rb +9 -0
- data/test/factories/remessa/cnab240/cecred.rb +9 -0
- data/test/factories/remessa/cnab240/itau.rb +9 -0
- data/test/factories/remessa/cnab240/sicredi.rb +9 -0
- data/test/factories/remessa/cnab240/unicred.rb +9 -0
- data/test/factories/remessa/cnab400/bradesco.rb +8 -0
- data/test/factories/remessa/cnab400/itau.rb +8 -0
- data/test/factories/remessa/cnab400/sicredi.rb +8 -0
- data/test/factories/remessa/cnab400/unicred.rb +8 -0
- data/test/fixtures/remessa/cnab240/caixa.rem +8 -0
- data/test/fixtures/remessa/cnab240/cecred.rem +8 -0
- data/test/fixtures/remessa/cnab240/sicoob.rem +8 -8
- data/test/fixtures/remessa/cnab240/unicred.rem +7 -0
- data/test/fixtures/retorno/cnab400/bradesco.ret +8 -0
- data/test/fixtures/retorno/cnab400/itau.ret +54 -0
- metadata +138 -3
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
describe BrBoleto::Retorno::Cnab400::Unicred do
|
|
4
|
+
subject { BrBoleto::Retorno::Cnab400::Unicred.new(file) }
|
|
5
|
+
let(:file) { open_fixture('retorno/cnab400/bradesco.ret') }
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
it "Deve carregar 6 pagamentos" do
|
|
9
|
+
subject.pagamentos.size.must_equal 6
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
describe 'deve setar as informações corretas para os pagamentos' do
|
|
13
|
+
it "valores para o pagamento 1" do
|
|
14
|
+
pagamento = subject.pagamentos[0]
|
|
15
|
+
pagamento.agencia_sem_dv.must_equal "01467"
|
|
16
|
+
pagamento.numero_conta_com_dv.must_equal "0019669"
|
|
17
|
+
pagamento.numero_conta_dv.must_equal "9"
|
|
18
|
+
pagamento.numero_conta.must_equal "001966"
|
|
19
|
+
pagamento.nosso_numero.must_equal "000000000303"
|
|
20
|
+
pagamento.carteira.must_equal "09"
|
|
21
|
+
pagamento.numero_documento.must_equal "0030"
|
|
22
|
+
pagamento.data_vencimento.must_equal Date.parse('25/05/2015')
|
|
23
|
+
pagamento.valor_titulo.must_equal 1450.0
|
|
24
|
+
pagamento.banco_recebedor.must_equal "237"
|
|
25
|
+
pagamento.agencia_recebedora_com_dv.must_equal "04157"
|
|
26
|
+
pagamento.sacado_documento.must_equal "12095870000170"
|
|
27
|
+
pagamento.valor_tarifa.must_equal 1.60
|
|
28
|
+
pagamento.valor_juros_multa.must_equal 0.0
|
|
29
|
+
pagamento.valor_desconto.must_equal 0.0
|
|
30
|
+
pagamento.valor_abatimento.must_equal 0.0
|
|
31
|
+
pagamento.valor_iof.must_equal 0.0
|
|
32
|
+
pagamento.valor_pago.must_equal 1450.0
|
|
33
|
+
pagamento.valor_liquido.must_equal 1450.0
|
|
34
|
+
pagamento.valor_outras_despesas.must_equal 0.0
|
|
35
|
+
pagamento.valor_outros_creditos.must_equal 0.0
|
|
36
|
+
pagamento.data_ocorrencia.must_equal Date.parse('15/05/2015')
|
|
37
|
+
pagamento.data_credito.must_equal Date.parse('15/05/2015')
|
|
38
|
+
pagamento.data_ocorrencia_sacado.must_equal Date.parse('15/05/2015')
|
|
39
|
+
pagamento.valor_ocorrencia_sacado.must_equal 1450.0
|
|
40
|
+
pagamento.especie_titulo.must_equal ''
|
|
41
|
+
pagamento.codigo_ocorrencia_sacado.must_be_nil
|
|
42
|
+
pagamento.dv_conta_e_agencia.must_be_nil
|
|
43
|
+
pagamento.identificacao_titulo_empresa.must_be_nil
|
|
44
|
+
pagamento.codigo_moeda.must_be_nil
|
|
45
|
+
pagamento.sacado_tipo_documento.must_be_nil
|
|
46
|
+
pagamento.sacado_nome.must_be_nil
|
|
47
|
+
pagamento.numero_contrato.must_be_nil
|
|
48
|
+
pagamento.motivo_ocorrencia.must_be_nil
|
|
49
|
+
pagamento.complemento_ocorrencia_sacado.must_be_nil
|
|
50
|
+
pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
|
|
51
|
+
pagamento.nosso_numero_banco_correspondente.must_be_nil
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
it "valores para o pagamento 2" do
|
|
55
|
+
pagamento = subject.pagamentos[1]
|
|
56
|
+
pagamento.agencia_sem_dv.must_equal "01467"
|
|
57
|
+
pagamento.numero_conta_com_dv.must_equal "0019669"
|
|
58
|
+
pagamento.numero_conta_dv.must_equal "9"
|
|
59
|
+
pagamento.numero_conta.must_equal "001966"
|
|
60
|
+
pagamento.nosso_numero.must_equal "51350000004P"
|
|
61
|
+
pagamento.carteira.must_equal "09"
|
|
62
|
+
pagamento.numero_documento.must_equal "1146"
|
|
63
|
+
pagamento.data_vencimento.must_equal Date.parse('25/05/2015')
|
|
64
|
+
pagamento.valor_titulo.must_equal 180.0
|
|
65
|
+
pagamento.banco_recebedor.must_equal "237"
|
|
66
|
+
pagamento.agencia_recebedora_com_dv.must_equal "04157"
|
|
67
|
+
pagamento.sacado_documento.must_equal "12095870000170"
|
|
68
|
+
pagamento.valor_tarifa.must_equal 1.60
|
|
69
|
+
pagamento.valor_juros_multa.must_equal 0.0
|
|
70
|
+
pagamento.valor_desconto.must_equal 0.0
|
|
71
|
+
pagamento.valor_abatimento.must_equal 0.0
|
|
72
|
+
pagamento.valor_iof.must_equal 0.0
|
|
73
|
+
pagamento.valor_pago.must_equal 0.0
|
|
74
|
+
pagamento.valor_liquido.must_equal 0.0
|
|
75
|
+
pagamento.valor_outras_despesas.must_equal 0.0
|
|
76
|
+
pagamento.valor_outros_creditos.must_equal 0.0
|
|
77
|
+
pagamento.data_ocorrencia.must_equal Date.parse('15/05/2015')
|
|
78
|
+
pagamento.data_ocorrencia_sacado.must_equal Date.parse('15/05/2015')
|
|
79
|
+
pagamento.valor_ocorrencia_sacado.must_equal 0.0
|
|
80
|
+
pagamento.especie_titulo.must_equal ''
|
|
81
|
+
pagamento.codigo_ocorrencia_sacado.must_be_nil
|
|
82
|
+
pagamento.dv_conta_e_agencia.must_be_nil
|
|
83
|
+
pagamento.identificacao_titulo_empresa.must_be_nil
|
|
84
|
+
pagamento.codigo_moeda.must_be_nil
|
|
85
|
+
pagamento.sacado_tipo_documento.must_be_nil
|
|
86
|
+
pagamento.sacado_nome.must_be_nil
|
|
87
|
+
pagamento.numero_contrato.must_be_nil
|
|
88
|
+
pagamento.motivo_ocorrencia.must_be_nil
|
|
89
|
+
pagamento.complemento_ocorrencia_sacado.must_be_nil
|
|
90
|
+
pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
|
|
91
|
+
pagamento.nosso_numero_banco_correspondente.must_be_nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
it "valores para o pagamento 3" do
|
|
95
|
+
pagamento = subject.pagamentos[2]
|
|
96
|
+
pagamento.agencia_sem_dv.must_equal "01467"
|
|
97
|
+
pagamento.numero_conta_com_dv.must_equal "0019669"
|
|
98
|
+
pagamento.numero_conta_dv.must_equal "9"
|
|
99
|
+
pagamento.numero_conta.must_equal "001966"
|
|
100
|
+
pagamento.nosso_numero.must_equal "513500000074"
|
|
101
|
+
pagamento.carteira.must_equal "09"
|
|
102
|
+
pagamento.numero_documento.must_equal "1142"
|
|
103
|
+
pagamento.data_vencimento.must_equal Date.parse('25/05/2015')
|
|
104
|
+
pagamento.valor_titulo.must_equal 720.0
|
|
105
|
+
pagamento.banco_recebedor.must_equal "237"
|
|
106
|
+
pagamento.agencia_recebedora_com_dv.must_equal "04157"
|
|
107
|
+
pagamento.sacado_documento.must_equal "12095870000170"
|
|
108
|
+
pagamento.valor_tarifa.must_equal 1.60
|
|
109
|
+
pagamento.valor_juros_multa.must_equal 0.0
|
|
110
|
+
pagamento.valor_desconto.must_equal 0.0
|
|
111
|
+
pagamento.valor_abatimento.must_equal 0.0
|
|
112
|
+
pagamento.valor_iof.must_equal 0.0
|
|
113
|
+
pagamento.valor_pago.must_equal 0.0
|
|
114
|
+
pagamento.valor_liquido.must_equal 0.0
|
|
115
|
+
pagamento.valor_outras_despesas.must_equal 0.0
|
|
116
|
+
pagamento.valor_outros_creditos.must_equal 0.0
|
|
117
|
+
pagamento.data_ocorrencia.must_equal Date.parse('15/05/2015')
|
|
118
|
+
pagamento.data_ocorrencia_sacado.must_equal Date.parse('15/05/2015')
|
|
119
|
+
pagamento.valor_ocorrencia_sacado.must_equal 0.0
|
|
120
|
+
pagamento.especie_titulo.must_equal ''
|
|
121
|
+
pagamento.codigo_ocorrencia_sacado.must_be_nil
|
|
122
|
+
pagamento.dv_conta_e_agencia.must_be_nil
|
|
123
|
+
pagamento.identificacao_titulo_empresa.must_be_nil
|
|
124
|
+
pagamento.codigo_moeda.must_be_nil
|
|
125
|
+
pagamento.sacado_tipo_documento.must_be_nil
|
|
126
|
+
pagamento.sacado_nome.must_be_nil
|
|
127
|
+
pagamento.numero_contrato.must_be_nil
|
|
128
|
+
pagamento.motivo_ocorrencia.must_be_nil
|
|
129
|
+
pagamento.complemento_ocorrencia_sacado.must_be_nil
|
|
130
|
+
pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
|
|
131
|
+
pagamento.nosso_numero_banco_correspondente.must_be_nil
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
it "valores para o pagamento 4" do
|
|
135
|
+
pagamento = subject.pagamentos[3]
|
|
136
|
+
pagamento.agencia_sem_dv.must_equal "01467"
|
|
137
|
+
pagamento.numero_conta_com_dv.must_equal "0019669"
|
|
138
|
+
pagamento.numero_conta_dv.must_equal "9"
|
|
139
|
+
pagamento.numero_conta.must_equal "001966"
|
|
140
|
+
pagamento.nosso_numero.must_equal "513500000090"
|
|
141
|
+
pagamento.carteira.must_equal "09"
|
|
142
|
+
pagamento.numero_documento.must_equal "1145"
|
|
143
|
+
pagamento.data_vencimento.must_equal Date.parse('12/06/2015')
|
|
144
|
+
pagamento.valor_titulo.must_equal 200.0
|
|
145
|
+
pagamento.banco_recebedor.must_equal "237"
|
|
146
|
+
pagamento.agencia_recebedora_com_dv.must_equal "04157"
|
|
147
|
+
pagamento.sacado_documento.must_equal "12095870000170"
|
|
148
|
+
pagamento.valor_tarifa.must_equal 1.60
|
|
149
|
+
pagamento.valor_juros_multa.must_equal 0.0
|
|
150
|
+
pagamento.valor_desconto.must_equal 0.0
|
|
151
|
+
pagamento.valor_abatimento.must_equal 0.0
|
|
152
|
+
pagamento.valor_iof.must_equal 0.0
|
|
153
|
+
pagamento.valor_pago.must_equal 0.0
|
|
154
|
+
pagamento.valor_liquido.must_equal 0.0
|
|
155
|
+
pagamento.valor_outras_despesas.must_equal 0.0
|
|
156
|
+
pagamento.valor_outros_creditos.must_equal 0.0
|
|
157
|
+
pagamento.data_ocorrencia.must_equal Date.parse('15/05/2015')
|
|
158
|
+
pagamento.data_ocorrencia_sacado.must_equal Date.parse('15/05/2015')
|
|
159
|
+
pagamento.valor_ocorrencia_sacado.must_equal 0.0
|
|
160
|
+
pagamento.especie_titulo.must_equal ''
|
|
161
|
+
pagamento.codigo_ocorrencia_sacado.must_be_nil
|
|
162
|
+
pagamento.dv_conta_e_agencia.must_be_nil
|
|
163
|
+
pagamento.identificacao_titulo_empresa.must_be_nil
|
|
164
|
+
pagamento.codigo_moeda.must_be_nil
|
|
165
|
+
pagamento.sacado_tipo_documento.must_be_nil
|
|
166
|
+
pagamento.sacado_nome.must_be_nil
|
|
167
|
+
pagamento.numero_contrato.must_be_nil
|
|
168
|
+
pagamento.motivo_ocorrencia.must_be_nil
|
|
169
|
+
pagamento.complemento_ocorrencia_sacado.must_be_nil
|
|
170
|
+
pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
|
|
171
|
+
pagamento.nosso_numero_banco_correspondente.must_be_nil
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
it "valores para o pagamento 5" do
|
|
175
|
+
pagamento = subject.pagamentos[4]
|
|
176
|
+
pagamento.agencia_sem_dv.must_equal "01467"
|
|
177
|
+
pagamento.numero_conta_com_dv.must_equal "0019669"
|
|
178
|
+
pagamento.numero_conta_dv.must_equal "9"
|
|
179
|
+
pagamento.numero_conta.must_equal "001966"
|
|
180
|
+
pagamento.nosso_numero.must_equal "513500000112"
|
|
181
|
+
pagamento.carteira.must_equal "09"
|
|
182
|
+
pagamento.numero_documento.must_equal "1144"
|
|
183
|
+
pagamento.data_vencimento.must_equal Date.parse('25/05/2015')
|
|
184
|
+
pagamento.valor_titulo.must_equal 180.0
|
|
185
|
+
pagamento.banco_recebedor.must_equal "237"
|
|
186
|
+
pagamento.agencia_recebedora_com_dv.must_equal "04157"
|
|
187
|
+
pagamento.sacado_documento.must_equal "12095870000170"
|
|
188
|
+
pagamento.valor_tarifa.must_equal 1.60
|
|
189
|
+
pagamento.valor_juros_multa.must_equal 0.0
|
|
190
|
+
pagamento.valor_desconto.must_equal 0.0
|
|
191
|
+
pagamento.valor_abatimento.must_equal 0.0
|
|
192
|
+
pagamento.valor_iof.must_equal 0.0
|
|
193
|
+
pagamento.valor_pago.must_equal 0.0
|
|
194
|
+
pagamento.valor_liquido.must_equal 0.0
|
|
195
|
+
pagamento.valor_outras_despesas.must_equal 0.0
|
|
196
|
+
pagamento.valor_outros_creditos.must_equal 0.0
|
|
197
|
+
pagamento.data_ocorrencia.must_equal Date.parse('15/05/2015')
|
|
198
|
+
pagamento.data_ocorrencia_sacado.must_equal Date.parse('15/05/2015')
|
|
199
|
+
pagamento.valor_ocorrencia_sacado.must_equal 0.0
|
|
200
|
+
pagamento.especie_titulo.must_equal ''
|
|
201
|
+
pagamento.codigo_ocorrencia_sacado.must_be_nil
|
|
202
|
+
pagamento.dv_conta_e_agencia.must_be_nil
|
|
203
|
+
pagamento.identificacao_titulo_empresa.must_be_nil
|
|
204
|
+
pagamento.codigo_moeda.must_be_nil
|
|
205
|
+
pagamento.sacado_tipo_documento.must_be_nil
|
|
206
|
+
pagamento.sacado_nome.must_be_nil
|
|
207
|
+
pagamento.numero_contrato.must_be_nil
|
|
208
|
+
pagamento.motivo_ocorrencia.must_be_nil
|
|
209
|
+
pagamento.complemento_ocorrencia_sacado.must_be_nil
|
|
210
|
+
pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
|
|
211
|
+
pagamento.nosso_numero_banco_correspondente.must_be_nil
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
it "valores para o pagamento 6" do
|
|
215
|
+
pagamento = subject.pagamentos[5]
|
|
216
|
+
pagamento.agencia_sem_dv.must_equal "01467"
|
|
217
|
+
pagamento.numero_conta_com_dv.must_equal "0019669"
|
|
218
|
+
pagamento.numero_conta_dv.must_equal "9"
|
|
219
|
+
pagamento.numero_conta.must_equal "001966"
|
|
220
|
+
pagamento.nosso_numero.must_equal "509800000028"
|
|
221
|
+
pagamento.carteira.must_equal "09"
|
|
222
|
+
pagamento.numero_documento.must_equal "1053"
|
|
223
|
+
pagamento.data_vencimento.must_equal Date.parse('06/05/2015')
|
|
224
|
+
pagamento.valor_titulo.must_equal 200.0
|
|
225
|
+
pagamento.banco_recebedor.must_equal "237"
|
|
226
|
+
pagamento.agencia_recebedora_com_dv.must_equal "00000"
|
|
227
|
+
pagamento.sacado_documento.must_equal "12095870000170"
|
|
228
|
+
pagamento.valor_tarifa.must_equal 0.0
|
|
229
|
+
pagamento.valor_juros_multa.must_equal 0.0
|
|
230
|
+
pagamento.valor_desconto.must_equal 0.0
|
|
231
|
+
pagamento.valor_abatimento.must_equal 0.0
|
|
232
|
+
pagamento.valor_iof.must_equal 0.0
|
|
233
|
+
pagamento.valor_pago.must_equal 0.0
|
|
234
|
+
pagamento.valor_liquido.must_equal 0.0
|
|
235
|
+
pagamento.valor_outras_despesas.must_equal 0.0
|
|
236
|
+
pagamento.valor_outros_creditos.must_equal 0.0
|
|
237
|
+
pagamento.data_ocorrencia.must_equal Date.parse('15/05/2015')
|
|
238
|
+
pagamento.data_ocorrencia_sacado.must_equal Date.parse('15/05/2015')
|
|
239
|
+
pagamento.valor_ocorrencia_sacado.must_equal 0.0
|
|
240
|
+
pagamento.especie_titulo.must_equal ''
|
|
241
|
+
pagamento.codigo_ocorrencia_sacado.must_be_nil
|
|
242
|
+
pagamento.dv_conta_e_agencia.must_be_nil
|
|
243
|
+
pagamento.identificacao_titulo_empresa.must_be_nil
|
|
244
|
+
pagamento.codigo_moeda.must_be_nil
|
|
245
|
+
pagamento.sacado_tipo_documento.must_be_nil
|
|
246
|
+
pagamento.sacado_nome.must_be_nil
|
|
247
|
+
pagamento.numero_contrato.must_be_nil
|
|
248
|
+
pagamento.motivo_ocorrencia.must_be_nil
|
|
249
|
+
pagamento.complemento_ocorrencia_sacado.must_be_nil
|
|
250
|
+
pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
|
|
251
|
+
pagamento.nosso_numero_banco_correspondente.must_be_nil
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
end
|
|
255
|
+
end
|
|
@@ -175,5 +175,12 @@ describe BrBoleto::Retorno::Pagamento do
|
|
|
175
175
|
subject.valor_titulo.must_equal 7_745.67
|
|
176
176
|
end
|
|
177
177
|
end
|
|
178
|
+
describe "#numero_conta_com_dv" do
|
|
179
|
+
it "deve converter o valor numero_conta concatenado com o numero_conta_dv" do
|
|
180
|
+
subject.numero_conta = '12345'
|
|
181
|
+
subject.numero_conta_dv = '0'
|
|
182
|
+
subject.numero_conta_com_dv.must_equal '123450'
|
|
183
|
+
end
|
|
184
|
+
end
|
|
178
185
|
end
|
|
179
186
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :boleto_bradesco, class: BrBoleto::Boleto::Bradesco do
|
|
5
|
+
conta { FactoryGirl.build(:conta_bradesco) }
|
|
6
|
+
pagador { FactoryGirl.build(:pagador) }
|
|
7
|
+
numero_documento '458'
|
|
8
|
+
data_vencimento { Date.tomorrow }
|
|
9
|
+
data_documento { Date.current }
|
|
10
|
+
valor_documento 750.27
|
|
11
|
+
instrucoes1 'instrucoes1'
|
|
12
|
+
instrucoes2 'instrucoes2'
|
|
13
|
+
instrucoes3 'instrucoes3'
|
|
14
|
+
instrucoes4 'instrucoes4'
|
|
15
|
+
instrucoes5 'instrucoes5'
|
|
16
|
+
instrucoes6 'instrucoes6'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :boleto_cecred, class: BrBoleto::Boleto::Cecred do
|
|
5
|
+
conta { FactoryGirl.build(:conta_cecred) }
|
|
6
|
+
pagador { FactoryGirl.build(:pagador) }
|
|
7
|
+
numero_documento '875'
|
|
8
|
+
data_vencimento { Date.tomorrow }
|
|
9
|
+
data_documento { Date.current }
|
|
10
|
+
valor_documento 50.12
|
|
11
|
+
instrucoes1 'instrucoes1'
|
|
12
|
+
instrucoes2 'instrucoes2'
|
|
13
|
+
instrucoes3 'instrucoes3'
|
|
14
|
+
instrucoes4 'instrucoes4'
|
|
15
|
+
instrucoes5 'instrucoes5'
|
|
16
|
+
instrucoes6 'instrucoes6'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :boleto_itau, class: BrBoleto::Boleto::Itau do
|
|
5
|
+
conta { FactoryGirl.build(:conta_itau) }
|
|
6
|
+
pagador { FactoryGirl.build(:pagador) }
|
|
7
|
+
numero_documento '712'
|
|
8
|
+
data_vencimento { Date.tomorrow }
|
|
9
|
+
data_documento { Date.current }
|
|
10
|
+
valor_documento 10.15
|
|
11
|
+
instrucoes1 'instrucoes1'
|
|
12
|
+
instrucoes2 'instrucoes2'
|
|
13
|
+
instrucoes3 'instrucoes3'
|
|
14
|
+
instrucoes4 'instrucoes4'
|
|
15
|
+
instrucoes5 'instrucoes5'
|
|
16
|
+
instrucoes6 'instrucoes6'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :boleto_sicredi, class: BrBoleto::Boleto::Sicredi do
|
|
5
|
+
conta { FactoryGirl.build(:conta_sicredi) }
|
|
6
|
+
pagador { FactoryGirl.build(:pagador) }
|
|
7
|
+
numero_documento '228'
|
|
8
|
+
data_vencimento { Date.tomorrow }
|
|
9
|
+
data_documento { Date.current }
|
|
10
|
+
valor_documento 457.27
|
|
11
|
+
instrucoes1 'instrucoes1'
|
|
12
|
+
instrucoes2 'instrucoes2'
|
|
13
|
+
instrucoes3 'instrucoes3'
|
|
14
|
+
instrucoes4 'instrucoes4'
|
|
15
|
+
instrucoes5 'instrucoes5'
|
|
16
|
+
instrucoes6 'instrucoes6'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :boleto_unicred, class: BrBoleto::Boleto::Unicred do
|
|
5
|
+
conta { FactoryGirl.build(:conta_unicred) }
|
|
6
|
+
pagador { FactoryGirl.build(:pagador) }
|
|
7
|
+
numero_documento '458'
|
|
8
|
+
data_vencimento { Date.tomorrow }
|
|
9
|
+
data_documento { Date.current }
|
|
10
|
+
valor_documento 750.27
|
|
11
|
+
instrucoes1 'instrucoes1'
|
|
12
|
+
instrucoes2 'instrucoes2'
|
|
13
|
+
instrucoes3 'instrucoes3'
|
|
14
|
+
instrucoes4 'instrucoes4'
|
|
15
|
+
instrucoes5 'instrucoes5'
|
|
16
|
+
instrucoes6 'instrucoes6'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :conta_bradesco, class: BrBoleto::Conta::Bradesco do
|
|
5
|
+
codigo_cedente '9090144'
|
|
6
|
+
conta_corrente '89755'
|
|
7
|
+
conta_corrente_dv '8'
|
|
8
|
+
agencia '4697'
|
|
9
|
+
carteira '21'
|
|
10
|
+
# codigo_carteira '1'
|
|
11
|
+
razao_social 'Razao Social emitente'
|
|
12
|
+
cpf_cnpj '98137264000196' # Gerado pelo gerador de cnpj
|
|
13
|
+
endereco 'Rua nome da rua, 9999'
|
|
14
|
+
codigo_empresa '1234'
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -7,7 +7,8 @@ FactoryGirl.define do
|
|
|
7
7
|
conta_corrente_dv '0'
|
|
8
8
|
agencia '0341'
|
|
9
9
|
carteira '1'
|
|
10
|
-
modalidade '14'
|
|
10
|
+
modalidade '14'
|
|
11
|
+
# codigo_carteira '1'
|
|
11
12
|
razao_social 'Razao Social emitente'
|
|
12
13
|
cpf_cnpj '98137264000196' # Gerado pelo gerador de cnpj
|
|
13
14
|
endereco 'Rua nome da rua, 9999'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :conta_cecred, class: BrBoleto::Conta::Cecred do
|
|
5
|
+
codigo_cedente '909014'
|
|
6
|
+
conta_corrente '8975599'
|
|
7
|
+
conta_corrente_dv '8'
|
|
8
|
+
agencia '4697'
|
|
9
|
+
carteira '1'
|
|
10
|
+
razao_social 'Razao Social emitente'
|
|
11
|
+
cpf_cnpj '98137264000196' # Gerado pelo gerador de cnpj
|
|
12
|
+
endereco 'Rua nome da rua, 9999'
|
|
13
|
+
codigo_empresa '1234'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :conta_itau, class: BrBoleto::Conta::Itau do
|
|
5
|
+
codigo_cedente '90904'
|
|
6
|
+
conta_corrente '89755'
|
|
7
|
+
conta_corrente_dv '8'
|
|
8
|
+
agencia '4697'
|
|
9
|
+
carteira '109'
|
|
10
|
+
razao_social 'Razao Social emitente'
|
|
11
|
+
cpf_cnpj '98137264000196' # Gerado pelo gerador de cnpj
|
|
12
|
+
endereco 'Rua nome da rua, 9999'
|
|
13
|
+
codigo_empresa '1234'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -8,7 +8,8 @@ FactoryGirl.define do
|
|
|
8
8
|
conta_corrente_dv '7'
|
|
9
9
|
agencia '3069'
|
|
10
10
|
carteira '1'
|
|
11
|
-
modalidade '02'
|
|
11
|
+
modalidade '02'
|
|
12
|
+
# codigo_carteira '1'
|
|
12
13
|
razao_social 'Razao Social emitente'
|
|
13
14
|
cpf_cnpj '98137264000196' # Gerado pelo gerador de cnpj
|
|
14
15
|
endereco 'Rua nome da rua, 9999'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :conta_sicredi, class: BrBoleto::Conta::Sicredi do
|
|
5
|
+
codigo_cedente '90901'
|
|
6
|
+
conta_corrente '89755'
|
|
7
|
+
agencia '4697'
|
|
8
|
+
posto '02'
|
|
9
|
+
carteira '1'
|
|
10
|
+
razao_social 'Razao Social emitente'
|
|
11
|
+
cpf_cnpj '98137264000196' # Gerado pelo gerador de cnpj
|
|
12
|
+
endereco 'Rua nome da rua, 9999'
|
|
13
|
+
codigo_empresa '1234'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :conta_unicred, class: BrBoleto::Conta::Unicred do
|
|
5
|
+
codigo_cedente '9090144'
|
|
6
|
+
conta_corrente '89755'
|
|
7
|
+
conta_corrente_dv '8'
|
|
8
|
+
agencia '4697'
|
|
9
|
+
carteira '09'
|
|
10
|
+
razao_social 'Razao Social emitente'
|
|
11
|
+
cpf_cnpj '98137264000196' # Gerado pelo gerador de cnpj
|
|
12
|
+
endereco 'Rua nome da rua, 9999'
|
|
13
|
+
codigo_empresa '1234'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
10400000 2334864510001300000000000000000000007506082819600000000EMPRESA EMITENTE CAIXA ECONOMICA FEDERAL 1141120160931470000010500000000000000000000000000000000000000000000000000
|
|
2
|
+
10400011R0100030 20334864510001308281960000000000000007506082819600000000EMPRESA EMITENTE 000000011411201600000000
|
|
3
|
+
1040001300001P 0107506082819600000000000141400000000000001022200000000002 1411201600000000000100000000002N1411201631611201600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023000000090000000000
|
|
4
|
+
1040001300002Q 011000078793321112BENJAMIN FRANCISCO MARCOS VINICIUS FERNARUA PRINCIPAL S/N 881 CENTRO 79210972ANASTACIO MS0000000000000000
|
|
5
|
+
1040001300003R 01000000000000000000000000000000000000000000000000315112016000000000000000 0000000000000000 000000000000 0
|
|
6
|
+
1040001300004S 01100 00
|
|
7
|
+
10400015 000006000000000000000000000000000000000000000000000000000000000000000000000
|
|
8
|
+
10499999 000001000008000000
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
08500000 233486451000130828196 0750610000013548433 EMPRESA EMITENTE CECRED 10811201609314700000108700000
|
|
2
|
+
08500011R01 045 2033486451000130828196 0750610000013548433 EMPRESA EMITENTE 000000010811201600000000
|
|
3
|
+
0850001300001P 010750610000013548433 09142444000000001 111220000000000000011512201600000000000100000000 02N08112016317122016000000000000000000000000000000000000000000000000000000000000000000000 3002 090000000000
|
|
4
|
+
0850001300002Q 011000078793321112BENJAMIN FRANCISCO MARCOS VINICIUS FERNARUA PRINCIPAL S/N 881 CENTRO 79210972ANASTACIO MS0000000000000000 000
|
|
5
|
+
0850001300003R 01000000000000000000000000000000000000000000000000316122016000000000000000 0000000000000000 000000000000 0
|
|
6
|
+
0850001300004S 01101 01
|
|
7
|
+
08500015 0000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
8
|
+
08599999 000001000008000000
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
75600000 233486451000130 0304060000000548430 EMPRESA EMITENTE SICOOB 10609201609435200001108100000
|
|
2
|
-
75600011R01 040 2033486451000130 0304060000000548430 EMPRESA EMITENTE 000000110609201600000000
|
|
3
|
-
7560001300001P 010304060000000548430 000015780401014 10 220000000001578040609201600000000001478900000 02N06092016107092016000000000000025000000000000000000000000000000000000000000000000000000 1000000090000000000
|
|
4
|
-
7560001300002Q 011000078793321112BENJAMIN FRANCISCO MARCOS VINICIUS FERNARUA PRINCIPAL S/N 881 CENTRO 79210972ANASTACIO MS0000000000000000 000
|
|
5
|
-
7560001300003R 01000000000000000000000000000000000000000000000000207092016000000000000200 0000000000000000 000000000000 0
|
|
6
|
-
7560001300004S 01101 01
|
|
7
|
-
75600015 00000600000100000000000014789000000000000000000000000000000000000000000000000000000000000000000000
|
|
8
|
-
75699999 000001000008000000
|
|
1
|
+
75600000 233486451000130 0304060000000548430 EMPRESA EMITENTE SICOOB 10609201609435200001108100000
|
|
2
|
+
75600011R01 040 2033486451000130 0304060000000548430 EMPRESA EMITENTE 000000110609201600000000
|
|
3
|
+
7560001300001P 010304060000000548430 000015780401014 10 220000000001578040609201600000000001478900000 02N06092016107092016000000000000025000000000000000000000000000000000000000000000000000000 1000000090000000000
|
|
4
|
+
7560001300002Q 011000078793321112BENJAMIN FRANCISCO MARCOS VINICIUS FERNARUA PRINCIPAL S/N 881 CENTRO 79210972ANASTACIO MS0000000000000000 000
|
|
5
|
+
7560001300003R 01000000000000000000000000000000000000000000000000207092016000000000000200 0000000000000000 000000000000 0
|
|
6
|
+
7560001300004S 01101 01
|
|
7
|
+
75600015 00000600000100000000000014789000000000000000000000000000000000000000000000000000000000000000000000
|
|
8
|
+
75699999 000001000008000000
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
23700000 233486451000130000000000000000828190750600000013548439 EMPRESA EMITENTE BRADESCO 110112016092745000001082000000000000000000000000000000000000000000000
|
|
2
|
+
23700011R0100041 2033486451000130000000000000000828190750600000013548439 EMPRESA EMITENTE 000000011011201600000000
|
|
3
|
+
2370001300001P 010750600000013548439 000000000011 112220000000000000011312201600000000000500000000 02N10112016315122016000000000000000000000000000000000000000000000000000000000000000000000 3000000090000000000
|
|
4
|
+
2370001300002Q 011000078793321112BENJAMIN FRANCISCO MARCOS VINICIUS FERNARUA PRINCIPAL S/N 881 CENTRO 79210972ANASTACIO MS2033486451000130EMPRESA EMITENTE 000
|
|
5
|
+
2370001300003R 01000000000000000000000000000000000000000000000000314122016000000000000000 0000000000000000 000000000000 0
|
|
6
|
+
23700015 0000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
7
|
+
23799999 000001000007000000
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
02RETORNO01COBRANCA 00000000000004540691NOME DA EMPRESA 237BRADESCO 1505150160000000405 150515 000001
|
|
2
|
+
102120958700001700000009014670019669P 0000000000000000030300000000000000000000000009021505150030 00000000000000000030250515000000014500023704157 000000000016000000000000000000000000000000000000000000000000000000000000000000000000014500000000000000000000000000000 150515 0000000000 000002
|
|
3
|
+
102120958700001700000009014670019669P 0000000051350000004P00000000000000000000000009021505151146 0000000051350000004P250515000000001800023704157 000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000 000003
|
|
4
|
+
102120958700001700000009014670019669P 0000000051350000007400000000000000000000000009021505151142 00000000513500000074250515000000007200023704157 000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000 000004
|
|
5
|
+
102120958700001700000009014670019669P 0000000051350000009000000000000000000000000009021505151145 00000000513500000090120615000000002000023704157 000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000 000005
|
|
6
|
+
102120958700001700000009014670019669P 0000000051350000011200000000000000000000000009021505151144 00000000513500000112250515000000001800023704157 000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000 000006
|
|
7
|
+
102120958700001700000009014670019669P 0000000050980000002800000000000000000000000009101505151053 00000000509800000028060515000000002000023700000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000 000007
|
|
8
|
+
9201237 000000180000000086450000000405 00005000000202000000000000000000000000000000000000100000002000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000 000008
|