br_boleto 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.markdown +23 -17
  4. data/lib/br_boleto.rb +2 -0
  5. data/lib/br_boleto/boleto/banco_brasil.rb +24 -15
  6. data/lib/br_boleto/boleto/santander.rb +8 -2
  7. data/lib/br_boleto/conta/banco_brasil.rb +254 -56
  8. data/lib/br_boleto/conta/bradesco.rb +229 -27
  9. data/lib/br_boleto/conta/caixa.rb +208 -4
  10. data/lib/br_boleto/conta/cecred.rb +29 -0
  11. data/lib/br_boleto/conta/itau.rb +482 -87
  12. data/lib/br_boleto/conta/santander.rb +224 -97
  13. data/lib/br_boleto/conta/sicoob.rb +39 -24
  14. data/lib/br_boleto/conta/sicredi.rb +169 -64
  15. data/lib/br_boleto/conta/unicred.rb +16 -13
  16. data/lib/br_boleto/helper/default_codes.rb +2123 -54
  17. data/lib/br_boleto/remessa/cnab240/banco_brasil.rb +12 -6
  18. data/lib/br_boleto/remessa/cnab240/bradesco.rb +1 -1
  19. data/lib/br_boleto/remessa/cnab240/helper/segmento_p.rb +1 -1
  20. data/lib/br_boleto/remessa/cnab240/itau.rb +20 -3
  21. data/lib/br_boleto/remessa/cnab240/santander.rb +25 -24
  22. data/lib/br_boleto/remessa/cnab400/caixa.rb +197 -0
  23. data/lib/br_boleto/remessa/cnab400/santander.rb +32 -27
  24. data/lib/br_boleto/retorno/base.rb +24 -0
  25. data/lib/br_boleto/retorno/cnab240/base.rb +6 -2
  26. data/lib/br_boleto/retorno/cnab240/santander.rb +5 -1
  27. data/lib/br_boleto/retorno/cnab400/banco_brasil.rb +3 -1
  28. data/lib/br_boleto/retorno/cnab400/base.rb +2 -1
  29. data/lib/br_boleto/retorno/cnab400/bradesco.rb +6 -0
  30. data/lib/br_boleto/retorno/cnab400/caixa.rb +49 -0
  31. data/lib/br_boleto/retorno/cnab400/itau.rb +5 -1
  32. data/lib/br_boleto/retorno/cnab400/santander.rb +5 -1
  33. data/lib/br_boleto/retorno/cnab400/sicoob.rb +1 -0
  34. data/lib/br_boleto/retorno/cnab400/sicredi.rb +6 -0
  35. data/lib/br_boleto/retorno/pagamento.rb +50 -4
  36. data/lib/br_boleto/version.rb +1 -1
  37. data/test/br_boleto/boleto/santander_test.rb +1 -1
  38. data/test/br_boleto/boleto/sicredi_test.rb +1 -0
  39. data/test/br_boleto/conta/banco_brasil_test.rb +157 -0
  40. data/test/br_boleto/conta/base_test.rb +8 -8
  41. data/test/br_boleto/conta/bradesco_test.rb +165 -0
  42. data/test/br_boleto/conta/caixa_test.rb +159 -1
  43. data/test/br_boleto/conta/cecred_test.rb +22 -0
  44. data/test/br_boleto/conta/itau_test.rb +346 -3
  45. data/test/br_boleto/conta/santantader_test.rb +123 -10
  46. data/test/br_boleto/conta/sicoob_test.rb +8 -0
  47. data/test/br_boleto/conta/sicredi_test.rb +79 -0
  48. data/test/br_boleto/conta/unicred_test.rb +7 -7
  49. data/test/br_boleto/remessa/cnab240/itau_test.rb +1 -1
  50. data/test/br_boleto/remessa/cnab400/caixa_test.rb +184 -0
  51. data/test/br_boleto/remessa/cnab400/santander_test.rb +30 -17
  52. data/test/br_boleto/retorno/cnab240/banco_brasil_test.rb +30 -6
  53. data/test/br_boleto/retorno/cnab240/base_test.rb +25 -5
  54. data/test/br_boleto/retorno/cnab240/bradesco_test.rb +25 -5
  55. data/test/br_boleto/retorno/cnab240/caixa_test.rb +25 -5
  56. data/test/br_boleto/retorno/cnab240/cecred_test.rb +15 -3
  57. data/test/br_boleto/retorno/cnab240/itau_test.rb +25 -5
  58. data/test/br_boleto/retorno/cnab240/santander_test.rb +30 -6
  59. data/test/br_boleto/retorno/cnab240/sicoob_test.rb +25 -5
  60. data/test/br_boleto/retorno/cnab240/sicredi_test.rb +25 -5
  61. data/test/br_boleto/retorno/cnab240/unicred_test.rb +25 -5
  62. data/test/br_boleto/retorno/cnab400/bradesco_test.rb +30 -6
  63. data/test/br_boleto/retorno/cnab400/caixa_test.rb +7 -0
  64. data/test/br_boleto/retorno/cnab400/itau_test.rb +14 -4
  65. data/test/br_boleto/retorno/cnab400/sicoob_test.rb +25 -5
  66. data/test/br_boleto/retorno/cnab400/sicredi_test.rb +10 -2
  67. data/test/br_boleto/retorno/cnab400/unicred.rb +30 -6
  68. data/test/br_boleto/retorno/pagamento_test.rb +49 -1
  69. data/test/factories/remessa/cnab400/caixa.rb +8 -0
  70. data/test/fixtures/retorno/cnab240/santander.ret +1 -1
  71. metadata +10 -2
@@ -738,14 +738,14 @@ describe BrBoleto::Remessa::Base do
738
738
  it { subject.get_codigo_desconto('55').must_equal '55' }
739
739
  end
740
740
  describe "#get_codigo_protesto" do
741
- it { subject.get_codigo_protesto('1').must_equal '1' } # Protestar Dias Corridos
742
- it { subject.get_codigo_protesto('2').must_equal '2' } # Protestar Dias Úteis
743
- it { subject.get_codigo_protesto('3').must_equal '3' } # Não Protesta
744
- it { subject.get_codigo_protesto('4').must_equal '4' } # Protestar Fim Falimentar - Dias Úteis
745
- it { subject.get_codigo_protesto('5').must_equal '5' } # Protestar Fim Falimentar - Dias Corridos
746
- it { subject.get_codigo_protesto('8').must_equal '8' } # Negativação sem Protesto
747
- it { subject.get_codigo_protesto('9').must_equal '9' } # Cancelamento Protesto Automático
748
- it { subject.get_codigo_protesto('55').must_equal '55' }
741
+ it { subject.get_codigo_protesto('1', 240).must_equal '1' } # Protestar Dias Corridos
742
+ it { subject.get_codigo_protesto('2', 240).must_equal '2' } # Protestar Dias Úteis
743
+ it { subject.get_codigo_protesto('3', 240).must_equal '3' } # Não Protesta
744
+ it { subject.get_codigo_protesto('4', 240).must_equal '4' } # Protestar Fim Falimentar - Dias Úteis
745
+ it { subject.get_codigo_protesto('5', 240).must_equal '5' } # Protestar Fim Falimentar - Dias Corridos
746
+ it { subject.get_codigo_protesto('8', 240).must_equal '8' } # Negativação sem Protesto
747
+ it { subject.get_codigo_protesto('9', 240).must_equal '9' } # Cancelamento Protesto Automático
748
+ it { subject.get_codigo_protesto('55', 240).must_equal '55' }
749
749
  end
750
750
  describe "#get_codigo_moeda_240" do
751
751
  it { subject.get_codigo_moeda('01', 240).must_equal '01' } # Reservado para Uso Futuro
@@ -139,4 +139,169 @@ describe BrBoleto::Conta::Bradesco do
139
139
  it { subject.get_codigo_movimento_remessa('34', 400).must_equal '69' } # Cancelamento do rateio de crédito.
140
140
  end
141
141
  end
142
+
143
+ describe "#get_codigo_movimento_retorno" do
144
+ context "CÓDIGOS para o Bradesco" do
145
+ it { subject.get_codigo_movimento_retorno('73', 240).must_equal '73' } # Confirmação recebimento pedido de negativação
146
+ end
147
+ end
148
+
149
+ describe "#get_codigo_movimento_retorno" do
150
+ context "CÓDIGOS para o cnab 400 do Bradesco" do
151
+ it { subject.get_codigo_movimento_retorno('15', 400).must_equal '101' } # Liquidação em Cartório (sem motivo)
152
+ it { subject.get_codigo_movimento_retorno('24', 400).must_equal '106' } # Entrada rejeitada por CEP Irregular
153
+ it { subject.get_codigo_movimento_retorno('25', 400).must_equal '170' } # Confirmação Receb.Inst.de Protesto Falimentar
154
+ it { subject.get_codigo_movimento_retorno('27', 400).must_equal '100' } # Baixa Rejeitada
155
+ it { subject.get_codigo_movimento_retorno('32', 400).must_equal '26' } # Instrução Rejeitada
156
+ it { subject.get_codigo_movimento_retorno('33', 400).must_equal '27' } # Confirmação Pedido Alteração Outros Dados (sem motivo)
157
+ it { subject.get_codigo_movimento_retorno('40', 400).must_equal '171' } # Estorno de pagamento
158
+ it { subject.get_codigo_movimento_retorno('55', 400).must_equal '63' } # Sustado judicial
159
+ it { subject.get_codigo_movimento_retorno('68', 400).must_equal '33' } # Acerto dos dados do rateio de Crédito
160
+ it { subject.get_codigo_movimento_retorno('69', 400).must_equal '34' } # Cancelamento dos dados do rateio
161
+ end
162
+ end
163
+
164
+ describe "#get_codigo_motivo_ocorrencia" do
165
+ context "CÓDIGOS motivo ocorrencia A do Bradesco para CNAB 400" do
166
+ it { subject.get_codigo_motivo_ocorrencia('00', '02', 400).must_equal 'A00' } # Ocorrência aceita
167
+ it { subject.get_codigo_motivo_ocorrencia('03', '03', 400).must_equal 'A05' } # Código da ocorrência inválida
168
+ it { subject.get_codigo_motivo_ocorrencia('05', '26', 400).must_equal 'A208' } # Código de ocorrência não numérico
169
+ it { subject.get_codigo_motivo_ocorrencia('44', '30', 400).must_equal 'A209' } # Agência Beneficiário não prevista
170
+ it { subject.get_codigo_motivo_ocorrencia('65', '35', 400).must_equal 'A83' } # Limite excedido
171
+ it { subject.get_codigo_motivo_ocorrencia('66', '100', 400).must_equal 'A84' } # Número autorização inexistente
172
+ it { subject.get_codigo_motivo_ocorrencia('67', '26', 400).must_equal 'A68' } # Débito automático agendado
173
+ it { subject.get_codigo_motivo_ocorrencia('68', '30', 400).must_equal 'A69' } # Débito não agendado - erro nos dados de remessa
174
+ it { subject.get_codigo_motivo_ocorrencia('69', '02', 400).must_equal 'A70' } # Débito não agendado - Pagador não consta no cadastro de autorizante
175
+ it { subject.get_codigo_motivo_ocorrencia('70', '03', 400).must_equal 'A71' } # Débito não agendado - Beneficiário não autorizado pelo Pagador
176
+ it { subject.get_codigo_motivo_ocorrencia('71', '26', 400).must_equal 'A72' } # Débito não agendado - Beneficiário não participa da modalidade de déb.automático
177
+ it { subject.get_codigo_motivo_ocorrencia('72', '30', 400).must_equal 'A73' } # Débito não agendado - Código de moeda diferente de R$
178
+ it { subject.get_codigo_motivo_ocorrencia('73', '35', 400).must_equal 'A74' } # Débito não agendado - Data de vencimento inválida/vencida
179
+ it { subject.get_codigo_motivo_ocorrencia('74', '100', 400).must_equal 'A75' } # Débito não agendado - Conforme seu pedido, Título não registrado
180
+ it { subject.get_codigo_motivo_ocorrencia('75', '02', 400).must_equal 'A76' } # Débito não agendado - Tipo do número de inscrição do pagador debitado inválido
181
+ it { subject.get_codigo_motivo_ocorrencia('76', '03', 400).must_equal 'A103' } # Pagador Eletrônico DDA
182
+ it { subject.get_codigo_motivo_ocorrencia('83', '26', 400).must_equal 'A218' } # Cancelado pelo Pagador e Mantido Pendente, conforme negociação
183
+ it { subject.get_codigo_motivo_ocorrencia('84', '30', 400).must_equal 'A219' } # Cancelado pelo pagador e baixado, conforme negociação
184
+ it { subject.get_codigo_motivo_ocorrencia('88', '35', 400).must_equal 'A210' } # E-mail Pagador não lido no prazo 5 dias
185
+ it { subject.get_codigo_motivo_ocorrencia('89', '100', 400).must_equal 'A211' } # Email Pagador não enviado – título com débito automático
186
+ it { subject.get_codigo_motivo_ocorrencia('90', '26', 400).must_equal 'A212' } # Email pagador não enviado – título de cobrança sem registro
187
+ it { subject.get_codigo_motivo_ocorrencia('91', '30', 400).must_equal 'A213' } # E-mail pagador não recebido
188
+ it { subject.get_codigo_motivo_ocorrencia('94', '35', 400).must_equal 'A214' } # Título Penhorado – Instrução Não Liberada pela Agência
189
+ it { subject.get_codigo_motivo_ocorrencia('97', '03', 400).must_equal 'A215' } # Instrução não permitida título negativado
190
+ it { subject.get_codigo_motivo_ocorrencia('98', '100', 400).must_equal 'A216' } # Inclusão Bloqueada face a determinação Judicial
191
+ it { subject.get_codigo_motivo_ocorrencia('99', '30', 400).must_equal 'A217' } # Telefone beneficiário não informado / inconsistente
192
+ end
193
+
194
+ context "CÓDIGOS motivo ocorrencia B do Bradesco para CNAB 400" do
195
+ it { subject.get_codigo_motivo_ocorrencia('68', '28', 400).must_equal 'B16' } # Fornecimento de máquina FAX
196
+ it { subject.get_codigo_motivo_ocorrencia('81', '28', 400).must_equal 'B14' } # Tarifa reapresentação automática título
197
+ it { subject.get_codigo_motivo_ocorrencia('83', '28', 400).must_equal 'B15' } # Tarifa Rateio de Crédito
198
+ it { subject.get_codigo_motivo_ocorrencia('02', '28', 400).must_equal 'B31' } # Tarifa de permanência título cadastrado
199
+ it { subject.get_codigo_motivo_ocorrencia('12', '28', 400).must_equal 'B32' } # Tarifa de registro
200
+ it { subject.get_codigo_motivo_ocorrencia('13', '28', 400).must_equal 'B33' } # Tarifa título pago no Bradesco
201
+ it { subject.get_codigo_motivo_ocorrencia('14', '28', 400).must_equal 'B34' } # Tarifa título pago compensação
202
+ it { subject.get_codigo_motivo_ocorrencia('15', '28', 400).must_equal 'B35' } # Tarifa título baixado não pago
203
+ it { subject.get_codigo_motivo_ocorrencia('16', '28', 400).must_equal 'B36' } # Tarifa alteração de vencimento
204
+ it { subject.get_codigo_motivo_ocorrencia('17', '28', 400).must_equal 'B37' } # Tarifa concessão abatimento
205
+ it { subject.get_codigo_motivo_ocorrencia('18', '28', 400).must_equal 'B38' } # Tarifa cancelamento de abatimento
206
+ it { subject.get_codigo_motivo_ocorrencia('19', '28', 400).must_equal 'B39' } # Tarifa concessão desconto
207
+ it { subject.get_codigo_motivo_ocorrencia('20', '28', 400).must_equal 'B40' } # Tarifa cancelamento desconto
208
+ it { subject.get_codigo_motivo_ocorrencia('21', '28', 400).must_equal 'B41' } # Tarifa título pago cics
209
+ it { subject.get_codigo_motivo_ocorrencia('22', '28', 400).must_equal 'B42' } # Tarifa título pago Internet
210
+ it { subject.get_codigo_motivo_ocorrencia('23', '28', 400).must_equal 'B43' } # Tarifa título pago term. gerencial serviços
211
+ it { subject.get_codigo_motivo_ocorrencia('24', '28', 400).must_equal 'B44' } # Tarifa título pago Pág-Contas
212
+ it { subject.get_codigo_motivo_ocorrencia('25', '28', 400).must_equal 'B45' } # Tarifa título pago Fone Fácil
213
+ it { subject.get_codigo_motivo_ocorrencia('26', '28', 400).must_equal 'B46' } # Tarifa título Déb. Postagem
214
+ it { subject.get_codigo_motivo_ocorrencia('27', '28', 400).must_equal 'B47' } # Tarifa impressão de títulos pendentes
215
+ it { subject.get_codigo_motivo_ocorrencia('28', '28', 400).must_equal 'B48' } # Tarifa título pago BDN
216
+ it { subject.get_codigo_motivo_ocorrencia('29', '28', 400).must_equal 'B49' } # Tarifa título pago Term. Multi Função
217
+ it { subject.get_codigo_motivo_ocorrencia('30', '28', 400).must_equal 'B50' } # Impressão de títulos baixados
218
+ it { subject.get_codigo_motivo_ocorrencia('31', '28', 400).must_equal 'B51' } # Impressão de títulos pagos
219
+ it { subject.get_codigo_motivo_ocorrencia('32', '28', 400).must_equal 'B52' } # Tarifa título pago Pagfor
220
+ it { subject.get_codigo_motivo_ocorrencia('33', '28', 400).must_equal 'B53' } # Tarifa reg/pgto – guichê caixa
221
+ it { subject.get_codigo_motivo_ocorrencia('34', '28', 400).must_equal 'B54' } # Tarifa título pago retaguarda
222
+ it { subject.get_codigo_motivo_ocorrencia('35', '28', 400).must_equal 'B55' } # Tarifa título pago Subcentro
223
+ it { subject.get_codigo_motivo_ocorrencia('36', '28', 400).must_equal 'B56' } # Tarifa título pago Cartão de Crédito
224
+ it { subject.get_codigo_motivo_ocorrencia('37', '28', 400).must_equal 'B57' } # Tarifa título pago Comp Eletrônica
225
+ it { subject.get_codigo_motivo_ocorrencia('38', '28', 400).must_equal 'B58' } # Tarifa título Baix. Pg. Cartório
226
+ it { subject.get_codigo_motivo_ocorrencia('39', '28', 400).must_equal 'B59' } # Tarifa título baixado acerto BCO
227
+ it { subject.get_codigo_motivo_ocorrencia('40', '28', 400).must_equal 'B60' } # Baixa registro em duplicidade
228
+ it { subject.get_codigo_motivo_ocorrencia('41', '28', 400).must_equal 'B61' } # Tarifa título baixado decurso prazo
229
+ it { subject.get_codigo_motivo_ocorrencia('42', '28', 400).must_equal 'B62' } # Tarifa título baixado Judicialmente
230
+ it { subject.get_codigo_motivo_ocorrencia('43', '28', 400).must_equal 'B63' } # Tarifa título baixado via remessa
231
+ it { subject.get_codigo_motivo_ocorrencia('44', '28', 400).must_equal 'B64' } # Tarifa título baixado rastreamento
232
+ it { subject.get_codigo_motivo_ocorrencia('45', '28', 400).must_equal 'B65' } # Tarifa título baixado conf. Pedido
233
+ it { subject.get_codigo_motivo_ocorrencia('46', '28', 400).must_equal 'B66' } # Tarifa título baixado protestado
234
+ it { subject.get_codigo_motivo_ocorrencia('47', '28', 400).must_equal 'B67' } # Tarifa título baixado p/ devolução
235
+ it { subject.get_codigo_motivo_ocorrencia('48', '28', 400).must_equal 'B68' } # Tarifa título baixado franco pagto
236
+ it { subject.get_codigo_motivo_ocorrencia('49', '28', 400).must_equal 'B69' } # Tarifa título baixado SUST/RET/CARTÓRIO
237
+ it { subject.get_codigo_motivo_ocorrencia('50', '28', 400).must_equal 'B70' } # Tarifa título baixado SUS/SEM/REM/CARTÓRIO
238
+ it { subject.get_codigo_motivo_ocorrencia('51', '28', 400).must_equal 'B71' } # Tarifa título transferido desconto
239
+ it { subject.get_codigo_motivo_ocorrencia('52', '28', 400).must_equal 'B72' } # Cobrado baixa manual
240
+ it { subject.get_codigo_motivo_ocorrencia('53', '28', 400).must_equal 'B73' } # Baixa por acerto cliente
241
+ it { subject.get_codigo_motivo_ocorrencia('54', '28', 400).must_equal 'B74' } # Tarifa baixa por contabilidade
242
+ it { subject.get_codigo_motivo_ocorrencia('55', '28', 400).must_equal 'B75' } # Tr. tentativa cons deb aut
243
+ it { subject.get_codigo_motivo_ocorrencia('56', '28', 400).must_equal 'B76' } # Tr. credito online
244
+ it { subject.get_codigo_motivo_ocorrencia('57', '28', 400).must_equal 'B77' } # Tarifa reg/pagto Bradesco Expresso
245
+ it { subject.get_codigo_motivo_ocorrencia('58', '28', 400).must_equal 'B78' } # Tarifa emissão Papeleta
246
+ it { subject.get_codigo_motivo_ocorrencia('59', '28', 400).must_equal 'B79' } # Tarifa fornec papeleta semi preenchida
247
+ it { subject.get_codigo_motivo_ocorrencia('60', '28', 400).must_equal 'B80' } # Acondicionador de papeletas (RPB)S
248
+ it { subject.get_codigo_motivo_ocorrencia('61', '28', 400).must_equal 'B81' } # Acond. De papelatas (RPB)s PERSONAL
249
+ it { subject.get_codigo_motivo_ocorrencia('62', '28', 400).must_equal 'B82' } # Papeleta formulário branco
250
+ it { subject.get_codigo_motivo_ocorrencia('63', '28', 400).must_equal 'B83' } # Formulário A4 serrilhado
251
+ it { subject.get_codigo_motivo_ocorrencia('64', '28', 400).must_equal 'B84' } # Fornecimento de softwares transmiss
252
+ it { subject.get_codigo_motivo_ocorrencia('65', '28', 400).must_equal 'B85' } # Fornecimento de softwares consulta
253
+ it { subject.get_codigo_motivo_ocorrencia('66', '28', 400).must_equal 'B86' } # Fornecimento Micro Completo
254
+ it { subject.get_codigo_motivo_ocorrencia('67', '28', 400).must_equal 'B87' } # Fornecimento MODEN
255
+ it { subject.get_codigo_motivo_ocorrencia('69', '28', 400).must_equal 'B88' } # Fornecimento de máquinas óticas
256
+ it { subject.get_codigo_motivo_ocorrencia('70', '28', 400).must_equal 'B89' } # Fornecimento de Impressoras
257
+ it { subject.get_codigo_motivo_ocorrencia('71', '28', 400).must_equal 'B90' } # Reativação de título
258
+ it { subject.get_codigo_motivo_ocorrencia('72', '28', 400).must_equal 'B91' } # Alteração de produto negociado
259
+ it { subject.get_codigo_motivo_ocorrencia('73', '28', 400).must_equal 'B92' } # Tarifa emissão de contra recibo
260
+ it { subject.get_codigo_motivo_ocorrencia('74', '28', 400).must_equal 'B93' } # Tarifa emissão 2a via papeleta
261
+ it { subject.get_codigo_motivo_ocorrencia('75', '28', 400).must_equal 'B94' } # Tarifa regravação arquivo retorno
262
+ it { subject.get_codigo_motivo_ocorrencia('76', '28', 400).must_equal 'B95' } # Arq. Títulos a vencer mensal
263
+ it { subject.get_codigo_motivo_ocorrencia('77', '28', 400).must_equal 'B96' } # Listagem auxiliar de crédito
264
+ it { subject.get_codigo_motivo_ocorrencia('78', '28', 400).must_equal 'B97' } # Tarifa cadastro cartela instrução permanente
265
+ it { subject.get_codigo_motivo_ocorrencia('79', '28', 400).must_equal 'B98' } # Canalização de Crédito
266
+ it { subject.get_codigo_motivo_ocorrencia('80', '28', 400).must_equal 'B99' } # Cadastro de Mensagem Fixa
267
+ it { subject.get_codigo_motivo_ocorrencia('82', '28', 400).must_equal 'B100' } # Tarifa registro título déb. Automático
268
+ it { subject.get_codigo_motivo_ocorrencia('84', '28', 400).must_equal 'B101' } # Emissão papeleta sem valor
269
+ it { subject.get_codigo_motivo_ocorrencia('85', '28', 400).must_equal 'B102' } # Sem uso
270
+ it { subject.get_codigo_motivo_ocorrencia('86', '28', 400).must_equal 'B103' } # Cadastro de reembolso de diferença
271
+ it { subject.get_codigo_motivo_ocorrencia('87', '28', 400).must_equal 'B104' } # Relatório fluxo de pagto
272
+ it { subject.get_codigo_motivo_ocorrencia('88', '28', 400).must_equal 'B105' } # Emissão Extrato mov. Carteira
273
+ it { subject.get_codigo_motivo_ocorrencia('89', '28', 400).must_equal 'B106' } # Mensagem campo local de pagto
274
+ it { subject.get_codigo_motivo_ocorrencia('90', '28', 400).must_equal 'B107' } # Cadastro Concessionária serv. Publ.
275
+ it { subject.get_codigo_motivo_ocorrencia('91', '28', 400).must_equal 'B108' } # Classif. Extrato Conta Corrente
276
+ it { subject.get_codigo_motivo_ocorrencia('92', '28', 400).must_equal 'B109' } # Contabilidade especial
277
+ it { subject.get_codigo_motivo_ocorrencia('93', '28', 400).must_equal 'B110' } # Realimentação pagto
278
+ it { subject.get_codigo_motivo_ocorrencia('94', '28', 400).must_equal 'B111' } # Repasse de Créditos
279
+ it { subject.get_codigo_motivo_ocorrencia('96', '28', 400).must_equal 'B112' } # Tarifa reg. Pagto outras mídias
280
+ it { subject.get_codigo_motivo_ocorrencia('97', '28', 400).must_equal 'B113' } # Tarifa Reg/Pagto – Net Empresa
281
+ it { subject.get_codigo_motivo_ocorrencia('98', '28', 400).must_equal 'B114' } # Tarifa título pago vencido
282
+ it { subject.get_codigo_motivo_ocorrencia('99', '28', 400).must_equal 'B115' } # TR Tít. Baixado por decurso prazo
283
+ it { subject.get_codigo_motivo_ocorrencia('100', '28', 400).must_equal 'B116' } # Arquivo Retorno Antecipado
284
+ it { subject.get_codigo_motivo_ocorrencia('101', '28', 400).must_equal 'B117' } # Arq retorno Hora/Hora
285
+ it { subject.get_codigo_motivo_ocorrencia('102', '28', 400).must_equal 'B118' } # TR. Agendamento Déb Aut
286
+ it { subject.get_codigo_motivo_ocorrencia('105', '28', 400).must_equal 'B119' } # TR. Agendamento rat. Crédito
287
+ it { subject.get_codigo_motivo_ocorrencia('106', '28', 400).must_equal 'B120' } # TR Emissão aviso rateio
288
+ it { subject.get_codigo_motivo_ocorrencia('107', '28', 400).must_equal 'B121' } # Extrato de protesto
289
+ end
290
+
291
+ context "CÓDIGOS motivo ocorrencia C do Bradesco para CNAB 400" do
292
+ it { subject.get_codigo_motivo_ocorrencia('00', '10', 400).must_equal 'C00' } # Baixado Conforme Instruções da Agência
293
+ it { subject.get_codigo_motivo_ocorrencia('16', '10', 400).must_equal 'C16' } # Título Baixado pelo Banco por decurso Prazo
294
+ it { subject.get_codigo_motivo_ocorrencia('17', '10', 400).must_equal 'C17' } # Titulo Baixado Transferido Carteira
295
+ it { subject.get_codigo_motivo_ocorrencia('20', '10', 400).must_equal 'C20' } # Titulo Baixado e Transferido para Desconto
296
+ it { subject.get_codigo_motivo_ocorrencia('00', '06', 400).must_equal 'C35' } # Título pago com dinheiro
297
+ it { subject.get_codigo_motivo_ocorrencia('15', '09', 400).must_equal 'C36' } # Título pago com cheque
298
+ it { subject.get_codigo_motivo_ocorrencia('10', '17', 400).must_equal 'C10' } # Baixa Comandada pelo cliente
299
+ it { subject.get_codigo_motivo_ocorrencia('42', '06', 400).must_equal 'C42' } # Rateio não efetuado, cód. Calculo 2 (VLR. Registro) e v (NOVO)
300
+ end
301
+
302
+ context "CÓDIGOS motivo ocorrencia C do Bradesco para CNAB 400" do
303
+ it { subject.get_codigo_motivo_ocorrencia('78', '29', 400).must_equal 'D78' } # Pagador alega que faturamento e indevido
304
+ it { subject.get_codigo_motivo_ocorrencia('95', '29', 400).must_equal 'D95' } # Pagador aceita/reconhece o faturamento
305
+ end
306
+ end
142
307
  end
@@ -151,5 +151,163 @@ describe BrBoleto::Conta::Caixa do
151
151
  end
152
152
  end
153
153
 
154
-
154
+ describe "#get_codigo_movimento_retorno" do
155
+ context "CÓDIGOS para o Caixa" do
156
+ it { subject.get_codigo_movimento_retorno('01', 240).must_equal '01' } # Solicitação de Impressão de Títulos Confirmada
157
+ it { subject.get_codigo_movimento_retorno('35', 240).must_equal '135' } # Confirmação de Inclusão Banco de Sacado
158
+ it { subject.get_codigo_movimento_retorno('36', 240).must_equal '136' } # Confirmação de Alteração Banco de Sacado
159
+ it { subject.get_codigo_movimento_retorno('37', 240).must_equal '137' } # Confirmação de Exclusão Banco de Sacado
160
+ it { subject.get_codigo_movimento_retorno('38', 240).must_equal '138' } # Emissão de Bloquetos de Banco de Sacado
161
+ it { subject.get_codigo_movimento_retorno('39', 240).must_equal '139' } # Manutenção de Sacado Rejeitada
162
+ it { subject.get_codigo_movimento_retorno('40', 240).must_equal '140' } # Entrada de Título via Banco de Sacado Rejeitada
163
+ it { subject.get_codigo_movimento_retorno('41', 240).must_equal '141' } # Manutenção de Banco de Sacado Rejeitada
164
+ it { subject.get_codigo_movimento_retorno('44', 240).must_equal '144' } # Estorno de Baixa / Liquidação
165
+ it { subject.get_codigo_movimento_retorno('45', 240).must_equal '145' } # Alteração de Dados
166
+ end
167
+ end
168
+
169
+ describe "#get_codigo_motivo_ocorrencia" do
170
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A para CNAB 240" do
171
+ it { subject.get_codigo_motivo_ocorrencia('11', '02', 240).must_equal 'A115' } # Data de Geração Inválida
172
+ it { subject.get_codigo_motivo_ocorrencia('64', '03', 240).must_equal 'A116' } # Entrada Inválida para Cobrança Caucionada
173
+ it { subject.get_codigo_motivo_ocorrencia('65', '26', 240).must_equal 'A117' } # CEP do Pagador não encontrado
174
+ it { subject.get_codigo_motivo_ocorrencia('66', '30', 240).must_equal 'A118' } # Agencia Cobradora não encontrada
175
+ it { subject.get_codigo_motivo_ocorrencia('67', '02', 240).must_equal 'A119' } # Agencia Beneficiário não encontrada
176
+ it { subject.get_codigo_motivo_ocorrencia('68', '03', 240).must_equal 'A120' } # Movimentação inválida para título
177
+ it { subject.get_codigo_motivo_ocorrencia('69', '26', 240).must_equal 'A121' } # Alteração de dados inválida
178
+ it { subject.get_codigo_motivo_ocorrencia('70', '02', 240).must_equal 'A122' } # Apelido do cliente não cadastrado
179
+ it { subject.get_codigo_motivo_ocorrencia('71', '03', 240).must_equal 'A123' } # Erro na composição do arquivo
180
+ it { subject.get_codigo_motivo_ocorrencia('72', '26', 240).must_equal 'A124' } # Lote de serviço inválido
181
+ it { subject.get_codigo_motivo_ocorrencia('73', '30', 240).must_equal 'A105' } # Código do Beneficiário inválido
182
+ it { subject.get_codigo_motivo_ocorrencia('74', '02', 240).must_equal 'A125' } # Beneficiário não pertencente a Cobrança Eletrônica
183
+ it { subject.get_codigo_motivo_ocorrencia('75', '03', 240).must_equal 'A126' } # Nome da Empresa inválido
184
+ it { subject.get_codigo_motivo_ocorrencia('76', '26', 240).must_equal 'A127' } # Nome do Banco inválido
185
+ it { subject.get_codigo_motivo_ocorrencia('77', '30', 240).must_equal 'A128' } # Código da Remessa inválido
186
+ it { subject.get_codigo_motivo_ocorrencia('78', '02', 240).must_equal 'A129' } # Data/Hora Geração do arquivo inválida
187
+ it { subject.get_codigo_motivo_ocorrencia('79', '03', 240).must_equal 'A130' } # Número Sequencial do arquivo inválido
188
+ it { subject.get_codigo_motivo_ocorrencia('80', '26', 240).must_equal 'A131' } # Versão do Lay out do arquivo inválido
189
+ it { subject.get_codigo_motivo_ocorrencia('81', '30', 240).must_equal 'A132' } # Literal REMESSA-TESTE - Válido só p/ fase testes
190
+ it { subject.get_codigo_motivo_ocorrencia('82', '02', 240).must_equal 'A133' } # Literal REMESSA-TESTE - Obrigatório p/ fase testes
191
+ it { subject.get_codigo_motivo_ocorrencia('83', '03', 240).must_equal 'A134' } # Tp Número Inscrição Empresa inválido
192
+ it { subject.get_codigo_motivo_ocorrencia('84', '26', 240).must_equal 'A135' } # Tipo de Operação inválido
193
+ it { subject.get_codigo_motivo_ocorrencia('85', '02', 240).must_equal 'A136' } # Tipo de serviço inválido
194
+ it { subject.get_codigo_motivo_ocorrencia('86', '03', 240).must_equal 'A137' } # Forma de lançamento inválido
195
+ it { subject.get_codigo_motivo_ocorrencia('87', '26', 240).must_equal 'A138' } # Número da remessa inválido
196
+ it { subject.get_codigo_motivo_ocorrencia('88', '30', 240).must_equal 'A139' } # Número da remessa menor/igual remessa anterior
197
+ it { subject.get_codigo_motivo_ocorrencia('89', '02', 240).must_equal 'A140' } # Lote de serviço divergente
198
+ it { subject.get_codigo_motivo_ocorrencia('90', '03', 240).must_equal 'A141' } # Número sequencial do registro inválido
199
+ it { subject.get_codigo_motivo_ocorrencia('91', '26', 240).must_equal 'A142' } # Erro seq de segmento do registro detalhe
200
+ it { subject.get_codigo_motivo_ocorrencia('92', '30', 240).must_equal 'A143' } # Cod movto divergente entre grupo de segm
201
+ it { subject.get_codigo_motivo_ocorrencia('93', '02', 240).must_equal 'A144' } # Qtde registros no lote inválido
202
+ it { subject.get_codigo_motivo_ocorrencia('94', '03', 240).must_equal 'A145' } # Qtde registros no lote divergente
203
+ it { subject.get_codigo_motivo_ocorrencia('95', '26', 240).must_equal 'A146' } # Qtde lotes no arquivo inválido
204
+ it { subject.get_codigo_motivo_ocorrencia('96', '30', 240).must_equal 'A147' } # Qtde lotes no arquivo divergente
205
+ it { subject.get_codigo_motivo_ocorrencia('97', '02', 240).must_equal 'A148' } # Qtde registros no arquivo inválido
206
+ it { subject.get_codigo_motivo_ocorrencia('98', '03', 240).must_equal 'A149' } # Qtde registros no arquivo divergente
207
+ it { subject.get_codigo_motivo_ocorrencia('99', '26', 240).must_equal 'A150' } # Código de DDD inválido
208
+ end
209
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência B para CNAB 240" do
210
+ it { subject.get_codigo_motivo_ocorrencia('12', '28', 240).must_equal 'B21' } # Redisponibilização de Arquivo Retorno Eletrônico
211
+ it { subject.get_codigo_motivo_ocorrencia('15', '28', 240).must_equal 'B22' } # Banco de Pagadores
212
+ it { subject.get_codigo_motivo_ocorrencia('17', '28', 240).must_equal 'B23' } # Entrega Aviso Disp Boleto via e-amail ao pagador (s/ emissão Boleto)
213
+ it { subject.get_codigo_motivo_ocorrencia('18', '28', 240).must_equal 'B24' } # Emissão de Boleto Pré-impresso CAIXA matricial
214
+ it { subject.get_codigo_motivo_ocorrencia('19', '28', 240).must_equal 'B25' } # Emissão de Boleto Pré-impresso CAIXA A4
215
+ it { subject.get_codigo_motivo_ocorrencia('20', '28', 240).must_equal 'B26' } # Emissão de Boleto Padrão CAIXA
216
+ it { subject.get_codigo_motivo_ocorrencia('21', '28', 240).must_equal 'B27' } # Emissão de Boleto/Carnê
217
+ it { subject.get_codigo_motivo_ocorrencia('31', '28', 240).must_equal 'B28' } # Emissão de Aviso de Vencido
218
+ it { subject.get_codigo_motivo_ocorrencia('42', '28', 240).must_equal 'B29' } # Alteração cadastral de dados do título - sem emissão de aviso
219
+ it { subject.get_codigo_motivo_ocorrencia('45', '28', 240).must_equal 'B30' } # Emissão de 2a via de Boleto Cobrança Registrada
220
+ end
221
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência C para CNAB 240" do
222
+ it { subject.get_codigo_motivo_ocorrencia('02', '06', 240).must_equal 'C100' } # Casa Lotérica
223
+ it { subject.get_codigo_motivo_ocorrencia('03', '09', 240).must_equal 'C101' } # Agências CAIXA
224
+ it { subject.get_codigo_motivo_ocorrencia('07', '17', 240).must_equal 'C102' } # Correspondente Bancário
225
+ end
226
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência C para CNAB 240 com Código 08" do
227
+ it { subject.get_codigo_motivo_ocorrencia('01', '08', 240).must_equal 'C35' } # Liquidação em Dinheiro
228
+ it { subject.get_codigo_motivo_ocorrencia('02', '08', 240).must_equal 'C36' } # Liquidação em Cheque
229
+ end
230
+
231
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A para CNAB 400" do
232
+ it { subject.get_codigo_motivo_ocorrencia('01', '02', 400).must_equal 'A220' } # Movimento sem Beneficiário Correspondente
233
+ it { subject.get_codigo_motivo_ocorrencia('02', '03', 400).must_equal 'A221' } # Movimento sem Título Correspondente
234
+ it { subject.get_codigo_motivo_ocorrencia('08', '26', 400).must_equal 'A222' } # Movimento para título já com movimentação no dia
235
+ it { subject.get_codigo_motivo_ocorrencia('09', '30', 400).must_equal 'A223' } # Nosso Número não pertence ao Beneficiário
236
+ it { subject.get_codigo_motivo_ocorrencia('10', '30', 400).must_equal 'A224' } # Inclusão de título já existente na base
237
+ it { subject.get_codigo_motivo_ocorrencia('12', '26', 400).must_equal 'A225' } # Movimento duplicado
238
+ it { subject.get_codigo_motivo_ocorrencia('13', '03', 400).must_equal 'A116' } # Entrada Inválida para Cobrança Caucionada (Beneficiário não possui conta Caução)
239
+ it { subject.get_codigo_motivo_ocorrencia('20', '02', 400).must_equal 'A117' } # CEP do Pagador não encontrado (não foi possível a determinação da Agência Cobradora para o título)
240
+ it { subject.get_codigo_motivo_ocorrencia('21', '02', 400).must_equal 'A118' } # Agência cobradora não encontrada (agência designada para cobradora não cadastrada no sistema)
241
+ it { subject.get_codigo_motivo_ocorrencia('22', '03', 400).must_equal 'A119' } # Agência Beneficiário não encontrada (Agência do Beneficiário não cadastrada no sistema)
242
+ it { subject.get_codigo_motivo_ocorrencia('45', '26', 400).must_equal 'A226' } # Data de Vencimento com prazo superior ao limite
243
+ it { subject.get_codigo_motivo_ocorrencia('49', '30', 400).must_equal 'A227' } # Movimento inválido para título Baixado/Liquidado
244
+ it { subject.get_codigo_motivo_ocorrencia('50', '02', 400).must_equal 'A228' } # Movimento inválido para título enviado a Cartório
245
+ it { subject.get_codigo_motivo_ocorrencia('54', '03', 400).must_equal 'A229' } # Faixa de CEP da Agência Cobradora não abrange CEP do Pagador
246
+ it { subject.get_codigo_motivo_ocorrencia('55', '26', 400).must_equal 'A230' } # Título já com opção de Devolução
247
+ it { subject.get_codigo_motivo_ocorrencia('56', '30', 400).must_equal 'A231' } # Processo de Protesto em andamento
248
+ it { subject.get_codigo_motivo_ocorrencia('57', '26', 400).must_equal 'A232' } # Título já com opção de Protesto
249
+ it { subject.get_codigo_motivo_ocorrencia('58', '03', 400).must_equal 'A233' } # Processo de devolução em andamento
250
+ it { subject.get_codigo_motivo_ocorrencia('59', '30', 400).must_equal 'A234' } # Novo prazo p/ Protesto/Devolução inválido
251
+ it { subject.get_codigo_motivo_ocorrencia('76', '02', 400).must_equal 'A235' } # Alteração do prazo de protesto inválida
252
+ it { subject.get_codigo_motivo_ocorrencia('77', '03', 400).must_equal 'A236' } # Alteração do prazo de devolução inválida
253
+ it { subject.get_codigo_motivo_ocorrencia('81', '26', 400).must_equal 'A237' } # CEP do Pagador inválido
254
+ it { subject.get_codigo_motivo_ocorrencia('82', '02', 400).must_equal 'A238' } # CNPJ/CPF do Pagador inválido (dígito não confere)
255
+ it { subject.get_codigo_motivo_ocorrencia('83', '30', 400).must_equal 'A86' } # Número do Documento (seu número) inválido
256
+ it { subject.get_codigo_motivo_ocorrencia('84', '02', 400).must_equal 'A239' } # Protesto inválido para título sem Número do documento (seu número)
257
+
258
+ end
259
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência C para CNAB 400" do
260
+ it { subject.get_codigo_motivo_ocorrencia('002', '06', 400).must_equal 'C100' } # Unidade Lotérica
261
+ it { subject.get_codigo_motivo_ocorrencia('003', '09', 400).must_equal 'C101' } # Agências CAIXA
262
+ it { subject.get_codigo_motivo_ocorrencia('004', '101', 400).must_equal 'C04' } # Compensação Eletrônica
263
+ it { subject.get_codigo_motivo_ocorrencia('006', '151', 400).must_equal 'C06' } # Internet Banking
264
+ it { subject.get_codigo_motivo_ocorrencia('007', '152', 400).must_equal 'C102' } # Correspondente CAIXA aqui
265
+ it { subject.get_codigo_motivo_ocorrencia('008', '06', 400).must_equal 'C08' } # Em Cartório
266
+ it { subject.get_codigo_motivo_ocorrencia('009', '09', 400).must_equal 'C09' } # Comandada Banco
267
+ it { subject.get_codigo_motivo_ocorrencia('010', '101', 400).must_equal 'C10' } # Comandada Cliente via Arquivo
268
+ it { subject.get_codigo_motivo_ocorrencia('011', '151', 400).must_equal 'C11' } # Comandada Cliente On-line
269
+ end
270
+ end
271
+
272
+ describe "#get_codigo_movimento_retorno" do
273
+ context "CÓDIGOS para o cnab 400 da Caixa" do
274
+ it { subject.get_codigo_movimento_retorno('01', 400).must_equal '02' } # Entrada Confirmada
275
+ it { subject.get_codigo_movimento_retorno('02', 400).must_equal '09' } # Baixa Manual Confirmada
276
+ it { subject.get_codigo_movimento_retorno('03', 400).must_equal '12' } # Abatimento Concedido
277
+ it { subject.get_codigo_movimento_retorno('04', 400).must_equal '13' } # Abatimento Cancelado
278
+ it { subject.get_codigo_movimento_retorno('05', 400).must_equal '14' } # Vencimento Alterado
279
+ it { subject.get_codigo_movimento_retorno('06', 400).must_equal '146' } # Uso da Empresa Alterado
280
+ it { subject.get_codigo_movimento_retorno('08', 400).must_equal '147' } # Prazo de Devolução Alterado
281
+ it { subject.get_codigo_movimento_retorno('09', 400).must_equal '27' } # Alteração Confirmada
282
+ it { subject.get_codigo_movimento_retorno('10', 400).must_equal '148' } # Alteração com reemissão de Boleto Confirmada
283
+ it { subject.get_codigo_movimento_retorno('11', 400).must_equal '149' } # Alteração da opção de Protesto para Devolução Confirmada
284
+ it { subject.get_codigo_movimento_retorno('12', 400).must_equal '150' } # Alteração da opção de Devolução para Protesto Confirmada
285
+ it { subject.get_codigo_movimento_retorno('20', 400).must_equal '11' } # Em Ser
286
+ it { subject.get_codigo_movimento_retorno('21', 400).must_equal '06' } # Liquidação
287
+ it { subject.get_codigo_movimento_retorno('22', 400).must_equal '101' } # Liquidação em Cartório
288
+ it { subject.get_codigo_movimento_retorno('23', 400).must_equal '151' } # Baixa por Devolução
289
+ it { subject.get_codigo_movimento_retorno('25', 400).must_equal '152' } # Baixa por Protesto
290
+ it { subject.get_codigo_movimento_retorno('26', 400).must_equal '23' } # Título enviado para Cartório
291
+ it { subject.get_codigo_movimento_retorno('27', 400).must_equal '20' } # Sustação de Protesto
292
+ it { subject.get_codigo_movimento_retorno('28', 400).must_equal '153' } # Estorno de Protesto
293
+ it { subject.get_codigo_movimento_retorno('29', 400).must_equal '154' } # Estorno de Sustação de Protesto
294
+ it { subject.get_codigo_movimento_retorno('30', 400).must_equal '61' } # Alteração de Título
295
+ it { subject.get_codigo_movimento_retorno('31', 400).must_equal '108' } # Tarifa sobre Título Vencido
296
+ it { subject.get_codigo_movimento_retorno('32', 400).must_equal '155' } # Outras Tarifas de Alteração
297
+ it { subject.get_codigo_movimento_retorno('33', 400).must_equal '144' } # Estorno de Baixa / Liquidação
298
+ it { subject.get_codigo_movimento_retorno('34', 400).must_equal '156' } # Tarifas Diversas
299
+ end
300
+ end
301
+
302
+ describe "#get_codigo_protesto" do
303
+ context "CÓDIGOS para o Caixa" do
304
+ it { subject.get_codigo_protesto('3', 400).must_equal '2' } # Devolver (Não Protestar)
305
+ end
306
+ end
307
+
308
+ describe "#get_codigo_moeda" do
309
+ context "CÓDIGOS para o Caixa" do
310
+ it { subject.get_codigo_moeda('09', 400).must_equal '1' } # Real
311
+ end
312
+ end
155
313
  end
@@ -116,4 +116,26 @@ describe BrBoleto::Conta::Cecred do
116
116
  subject.conta_corrente_dv.must_equal 5
117
117
  end
118
118
  end
119
+
120
+ describe "#get_codigo_movimento_retorno" do
121
+ context "CÓDIGOS para o Cecred" do
122
+ it { subject.get_codigo_movimento_retorno('76', 240).must_equal '76' } # Liquidação de boleto cooperativa emite e expede
123
+ it { subject.get_codigo_movimento_retorno('77', 240).must_equal '77' } # Liquidação de boleto após baixa ou não registrado cooperativa emite e expede
124
+ it { subject.get_codigo_movimento_retorno('91', 240).must_equal '91' } # Título em aberto não enviado ao pagador
125
+ it { subject.get_codigo_movimento_retorno('92', 240).must_equal '92' } # Inconsistência Negativação Serasa
126
+ it { subject.get_codigo_movimento_retorno('93', 240).must_equal '93' } # Inclusão Negativação via Serasa
127
+ it { subject.get_codigo_movimento_retorno('94', 240).must_equal '94' } # Exclusão Negativação Serasa
128
+ end
129
+ end
130
+
131
+ describe "#get_codigo_motivo_ocorrencia" do
132
+ context "CÓDIGOS para o Cecred CNAB 240" do
133
+ it { subject.get_codigo_motivo_ocorrencia('P1', '91', 240).must_equal 'A114' } # Enviado Cooperativa Emite e Expede
134
+ it { subject.get_codigo_motivo_ocorrencia('S1', '93', 240).must_equal 'D02' } # Sempre que a solicitação (inclusão ou exclusão) for efetuada com sucesso
135
+ it { subject.get_codigo_motivo_ocorrencia('S2', '94', 240).must_equal 'D03' } # Sempre que a solicitação for integrada na Serasa com sucesso
136
+ it { subject.get_codigo_motivo_ocorrencia('S3', '94', 240).must_equal 'D04' } # Sempre que vier retorno da Serasa por decurso de prazo
137
+ it { subject.get_codigo_motivo_ocorrencia('S4', '93', 240).must_equal 'D05' } # Sempre que o documento for integrado na Serasa com sucesso, quando o UF for de São Paulo
138
+ it { subject.get_codigo_motivo_ocorrencia('S5', '93', 240).must_equal 'D06' } # Sempre quando houver ação judicial, restringindo a negativação do boleto.
139
+ end
140
+ end
119
141
  end
@@ -75,7 +75,7 @@ describe BrBoleto::Conta::Itau do
75
75
 
76
76
  describe "#nome_banco" do
77
77
  it "valor padrão para o nome_banco" do
78
- subject.nome_banco.must_equal 'ITAU'
78
+ subject.nome_banco.must_equal 'BANCO ITAU SA'
79
79
  end
80
80
  it "deve ser possível mudar o valor do nome do banco" do
81
81
  subject.nome_banco = 'MEU'
@@ -157,8 +157,8 @@ describe BrBoleto::Conta::Itau do
157
157
  end
158
158
 
159
159
  describe "#get_codigo_protesto" do
160
- it { subject.get_codigo_protesto('0').must_equal '0' } # Sem instrução
161
- it { subject.get_codigo_protesto('07').must_equal '07' } # Negativar (Dias Corridos)
160
+ it { subject.get_codigo_protesto('0', 240).must_equal '0' } # Sem instrução
161
+ it { subject.get_codigo_protesto('07', 240).must_equal '07' } # Negativar (Dias Corridos)
162
162
  end
163
163
 
164
164
  describe "#get_codigo_multa" do
@@ -186,4 +186,347 @@ describe BrBoleto::Conta::Itau do
186
186
  subject.get_codigo_carteira.must_equal 'I' # DEMAIS CARTEIRAS
187
187
  end
188
188
  end
189
+
190
+
191
+ describe "#get_codigo_movimento_retorno" do
192
+ context "CÓDIGOS para o Itau" do
193
+ it { subject.get_codigo_movimento_retorno('08', 240).must_equal '101' } # LIQUIDAÇÃO EM CARTÓRIO
194
+ it { subject.get_codigo_movimento_retorno('10', 240).must_equal '210' } # BAIXA POR TER SIDO LIQUIDADO
195
+ it { subject.get_codigo_movimento_retorno('15', 240).must_equal '100' } # BAIXAS REJEITADAS
196
+ it { subject.get_codigo_movimento_retorno('16', 240).must_equal '26' } # INSTRUÇÕES REJEITADAS
197
+ it { subject.get_codigo_movimento_retorno('17', 240).must_equal '30' } # ALTERAÇÃO/EXCLUSÃO DE DADOS REJEITADA
198
+ it { subject.get_codigo_movimento_retorno('18', 240).must_equal '218' } # COBRANÇA CONTRATUAL – INSTRUÇÕES/ALTERAÇÕES REJEITADAS/PENDENTES
199
+ it { subject.get_codigo_movimento_retorno('21', 240).must_equal '221' } # CONFIRMAÇÃO RECEBIMENTO DE INSTRUÇÃO DE NÃO PROTESTAR
200
+ it { subject.get_codigo_movimento_retorno('25', 240).must_equal '225' } # ALEGAÇÕES DO PAGADOR
201
+ it { subject.get_codigo_movimento_retorno('26', 240).must_equal '226' } # TARIFA DE AVISO DE COBRANÇA
202
+ it { subject.get_codigo_movimento_retorno('27', 240).must_equal '227' } # TARIFA DE EXTRATO POSIÇÃO (B40X)
203
+ it { subject.get_codigo_movimento_retorno('28', 240).must_equal '228' } # TARIFA DE RELAÇÃO DAS LIQUIDAÇÕES
204
+ it { subject.get_codigo_movimento_retorno('29', 240).must_equal '107' } # TARIFA DE MANUTENÇÃO DE TÍTULOS VENCIDOS
205
+ it { subject.get_codigo_movimento_retorno('30', 240).must_equal '28' } # DÉBITO MENSAL DE TARIFAS (PARA ENTRADAS E BAIXAS)
206
+ it { subject.get_codigo_movimento_retorno('32', 240).must_equal '25' } # BAIXA POR TER SIDO PROTESTADO
207
+ it { subject.get_codigo_movimento_retorno('33', 240).must_equal '233' } # CUSTAS DE PROTESTO
208
+ it { subject.get_codigo_movimento_retorno('34', 240).must_equal '234' } # CUSTAS DE SUSTAÇÃO
209
+ it { subject.get_codigo_movimento_retorno('35', 240).must_equal '235' } # CUSTAS DE CARTÓRIO DISTRIBUIDOR
210
+ it { subject.get_codigo_movimento_retorno('36', 240).must_equal '236' } # CUSTAS DE EDITAL
211
+ it { subject.get_codigo_movimento_retorno('37', 240).must_equal '237' } # TARIFA DE EMISSÃO DE BOLETO/TARIFA DE ENVIO DE DUPLICATA
212
+ it { subject.get_codigo_movimento_retorno('38', 240).must_equal '238' } # TARIFA DE INSTRUÇÃO
213
+ it { subject.get_codigo_movimento_retorno('39', 240).must_equal '239' } # TARIFA DE OCORRÊNCIAS
214
+ it { subject.get_codigo_movimento_retorno('40', 240).must_equal '240' } # TARIFA MENSAL DE EMISSÃO DE BOLETO/TARIFA MENSAL DE ENVIO DE DUPLICATA
215
+ it { subject.get_codigo_movimento_retorno('41', 240).must_equal '241' } # DÉBITO MENSAL DE TARIFAS – EXTRATO DE POSIÇÃO (B4EP/B4OX)
216
+ it { subject.get_codigo_movimento_retorno('42', 240).must_equal '242' } # DÉBITO MENSAL DE TARIFAS – OUTRAS INSTRUÇÕES
217
+ it { subject.get_codigo_movimento_retorno('43', 240).must_equal '243' } # DÉBITO MENSAL DE TARIFAS – MANUTENÇÃO DE TÍTULOS VENCIDOS
218
+ it { subject.get_codigo_movimento_retorno('44', 240).must_equal '244' } # DÉBITO MENSAL DE TARIFAS – OUTRAS OCORRÊNCIAS
219
+ it { subject.get_codigo_movimento_retorno('45', 240).must_equal '245' } # DÉBITO MENSAL DE TARIFAS – PROTESTO
220
+ it { subject.get_codigo_movimento_retorno('46', 240).must_equal '246' } # DÉBITO MENSAL DE TARIFAS – SUSTAÇÃO DE PROTESTO
221
+ it { subject.get_codigo_movimento_retorno('47', 240).must_equal '247' } # BAIXA COM TRANSFERÊNCIA PARA DESCONTO
222
+ it { subject.get_codigo_movimento_retorno('48', 240).must_equal '248' } # CUSTAS DE SUSTAÇÃO JUDICIAL
223
+ it { subject.get_codigo_movimento_retorno('51', 240).must_equal '251' } # TARIFA MENSAL REFERENTE A ENTRADAS BANCOS CORRESPONDENTES NA CARTEIRA
224
+ it { subject.get_codigo_movimento_retorno('52', 240).must_equal '252' } # TARIFA MENSAL BAIXAS NA CARTEIRA
225
+ it { subject.get_codigo_movimento_retorno('53', 240).must_equal '253' } # TARIFA MENSAL BAIXAS EM BANCOS CORRESPONDENTES NA CARTEIRA
226
+ it { subject.get_codigo_movimento_retorno('54', 240).must_equal '254' } # TARIFA MENSAL DE LIQUIDAÇÕES NA CARTEIRA
227
+ it { subject.get_codigo_movimento_retorno('55', 240).must_equal '255' } # TARIFA MENSAL DE LIQUIDAÇÕES EM BANCOS CORRESPONDENTES NA CARTEIRA
228
+ it { subject.get_codigo_movimento_retorno('56', 240).must_equal '256' } # CUSTAS DE IRREGULARIDADE
229
+ it { subject.get_codigo_movimento_retorno('57', 240).must_equal '257' } # INSTRUÇÃO CANCELADA
230
+ it { subject.get_codigo_movimento_retorno('60', 240).must_equal '260' } # ENTRADA REJEITADA CARNÊ
231
+ it { subject.get_codigo_movimento_retorno('61', 240).must_equal '261' } # TARIFA EMISSÃO AVISO DE MOVIMENTAÇÃO DE TÍTULOS (2154)
232
+ it { subject.get_codigo_movimento_retorno('62', 240).must_equal '262' } # DÉBITO MENSAL DE TARIFA – AVISO DE MOVIMENTAÇÃO DE TÍTULOS (2154)
233
+ it { subject.get_codigo_movimento_retorno('63', 240).must_equal '63' } # TÍTULO SUSTADO JUDICIALMENTE
234
+ it { subject.get_codigo_movimento_retorno('74', 240).must_equal '274' } # INSTRUÇÃO DE NEGATIVAÇÃO EXPRESSA REJEITADA
235
+ it { subject.get_codigo_movimento_retorno('75', 240).must_equal '275' } # CONFIRMA O RECEBIMENTO DE INSTRUÇÃO DE ENTRADA EM NEGATIVAÇÃO EXPRESSA
236
+ it { subject.get_codigo_movimento_retorno('77', 240).must_equal '277' } # CONFIRMA O RECEBIMENTO DE INSTRUÇÃO DE EXCLUSÃO DE ENTRADA EM NEGATIVAÇÃO EXPRESSA
237
+ it { subject.get_codigo_movimento_retorno('78', 240).must_equal '278' } # CONFIRMA O RECEBIMENTO DE INSTRUÇÃO DE CANCELAMENTO DA NEGATIVAÇÃO EXPRESSA
238
+ it { subject.get_codigo_movimento_retorno('79', 240).must_equal '279' } # NEGATIVAÇÃO EXPRESSA INFORMACIONAL
239
+ it { subject.get_codigo_movimento_retorno('80', 240).must_equal '280' } # CONFIRMAÇÃO DE ENTRADA EM NEGATIVAÇÃO EXPRESSA – TARIFA
240
+ it { subject.get_codigo_movimento_retorno('82', 240).must_equal '282' } # CONFIRMAÇÃO O CANCELAMENTO DE NEGATIVAÇÃO EXPRESSA - TARIFA
241
+ it { subject.get_codigo_movimento_retorno('83', 240).must_equal '283' } # CONFIRMAÇÃO DA EXCLUSÃO/CANCELAMENTO DA NEGATIVAÇÃO EXPRESSA POR LIQUIDAÇÃO - TARIFA
242
+ it { subject.get_codigo_movimento_retorno('85', 240).must_equal '285' } # TARIFA POR BOLETO (ATÉ 03 ENVIOS) COBRANÇA ATIVA ELETRÔNICA
243
+ it { subject.get_codigo_movimento_retorno('86', 240).must_equal '286' } # TARIFA EMAIL COBRANÇA ATIVA ELETRÔNICA
244
+ it { subject.get_codigo_movimento_retorno('87', 240).must_equal '287' } # TARIFA SMS COBRANÇA ATIVA ELETRÔNICA
245
+ it { subject.get_codigo_movimento_retorno('88', 240).must_equal '288' } # TARIFA MENSAL POR BOLETO (ATÉ 03 ENVIOS) COBRANÇA ATIVA ELETRÔNICA
246
+ it { subject.get_codigo_movimento_retorno('89', 240).must_equal '289' } # TARIFA MENSAL EMAIL COBRANÇA ATIVA ELETRÔNICA
247
+ it { subject.get_codigo_movimento_retorno('90', 240).must_equal '290' } # TARIFA MENSAL SMS COBRANÇA ATIVA ELETRÔNICA
248
+ it { subject.get_codigo_movimento_retorno('91', 240).must_equal '291' } # TARIFA MENSAL DE EXCLUSÃO DE ENTRADA EM NEGATIVAÇÃO EXPRESSA
249
+ it { subject.get_codigo_movimento_retorno('92', 240).must_equal '292' } # TARIFA MENSAL DE CANCELAMENTO DE NEGATIVAÇÃO EXPRESSA
250
+ it { subject.get_codigo_movimento_retorno('93', 240).must_equal '293' } # TARIFA MENSAL DE EXCLUSÃO/CANCELAMENTO DE NEGATIVAÇÃO EXPRESSA POR LIQUIDAÇÃO
251
+ it { subject.get_codigo_movimento_retorno('94', 240).must_equal '294' } # CONFIRMA RECEBIMENTO DE INSTRUÇÃO DE NÃO NEGATIVAR
252
+ end
253
+ end
254
+
255
+
256
+ describe "#get_codigo_motivo_ocorrencia" do
257
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A com codigo de movimento 03 para CNAB 240" do
258
+ it { subject.get_codigo_motivo_ocorrencia('03', '03', 240).must_equal 'A49' } # CEP INVÁLIDO OU NÃO FOI POSSÍVEL ATRIBUIR A AGÊNCIA PELO CEP
259
+ it { subject.get_codigo_motivo_ocorrencia('04', '03', 240).must_equal 'A52' } # SIGLA DO ESTADO INVÁLIDA
260
+ it { subject.get_codigo_motivo_ocorrencia('08', '03', 240).must_equal 'A45' } # NÃO INFORMADO OU DESLOCADO
261
+ it { subject.get_codigo_motivo_ocorrencia('09', '03', 240).must_equal 'A07' } # AGÊNCIA ENCERRADA
262
+ it { subject.get_codigo_motivo_ocorrencia('10', '03', 240).must_equal 'A47' } # NÃO INFORMADO OU DESLOCADO
263
+ it { subject.get_codigo_motivo_ocorrencia('11', '03', 240).must_equal 'A49' } # CEP NÃO NUMÉRICO
264
+ it { subject.get_codigo_motivo_ocorrencia('12', '03', 240).must_equal 'A54' } # NOME NÃO INFORMADO OU DESLOCADO (BANCOS CORRESPONDENTES)
265
+ it { subject.get_codigo_motivo_ocorrencia('13', '03', 240).must_equal 'A51' } # CEP INCOMPATÍVEL COM A SIGLA DO ESTADO
266
+ it { subject.get_codigo_motivo_ocorrencia('14', '03', 240).must_equal 'A08' } # NOSSO NÚMERO JÁ REGISTRADO NO CADASTRO DO BANCO OU FORA DA FAIXA
267
+ it { subject.get_codigo_motivo_ocorrencia('15', '03', 240).must_equal 'A09' } # NOSSO NÚMERO EM DUPLICIDADE NO MESMO MOVIMENTO
268
+ it { subject.get_codigo_motivo_ocorrencia('35', '03', 240).must_equal 'A32' } # IOF MAIOR QUE 5%
269
+ it { subject.get_codigo_motivo_ocorrencia('42', '03', 240).must_equal 'A08' } # NOSSO NÚMERO FORA DE FAIXA
270
+ it { subject.get_codigo_motivo_ocorrencia('60', '03', 240).must_equal 'A33' } # VALOR DO ABATIMENTO INVÁLIDO
271
+ it { subject.get_codigo_motivo_ocorrencia('62', '03', 240).must_equal 'A29' } # VALOR DO DESCONTO MAIOR QUE O VALOR DO TÍTULO
272
+ it { subject.get_codigo_motivo_ocorrencia('64', '03', 240).must_equal 'A24' } # DATA DE EMISSÃO DO TÍTULO INVÁLIDA (VENDOR)
273
+ it { subject.get_codigo_motivo_ocorrencia('66', '03', 240).must_equal 'A74' } # INVALIDA/FORA DE PRAZO DE OPERAÇÃO (MÍNIMO OU MÁXIMO)
274
+ it { subject.get_codigo_motivo_ocorrencia('67', '03', 240).must_equal 'A20' } # VALOR DO TÍTULO/QUANTIDADE DE MOEDA INVÁLIDO
275
+ it { subject.get_codigo_motivo_ocorrencia('68', '03', 240).must_equal 'A10' } # CARTEIRA INVÁLIDA OU NÃO CADASTRADA NO INTERCÂMBIO DA COBRANÇA
276
+ end
277
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A com codigo de movimento 26 para CNAB 240" do
278
+ it { subject.get_codigo_motivo_ocorrencia('09', '26', 240).must_equal 'A53' } # CNPJ/CPF DO SACADOR/AVALISTA INVÁLIDO
279
+ it { subject.get_codigo_motivo_ocorrencia('15', '26', 240).must_equal 'A54' } # CNPJ/CPF INFORMADO SEM NOME DO SACADOR/AVALISTA
280
+ it { subject.get_codigo_motivo_ocorrencia('19', '26', 240).must_equal 'A34' } # VALOR DO ABATIMENTO MAIOR QUE 90% DO VALOR DO TÍTULO
281
+ it { subject.get_codigo_motivo_ocorrencia('20', '26', 240).must_equal 'A41' } # EXISTE SUSTACAO DE PROTESTO PENDENTE PARA O TITULO
282
+ it { subject.get_codigo_motivo_ocorrencia('22', '26', 240).must_equal 'A106' } # TÍTULO BAIXADO OU LIQUIDADO
283
+ it { subject.get_codigo_motivo_ocorrencia('50', '26', 240).must_equal 'A24' } # DATA DE EMISSÃO DO TÍTULO INVÁLIDA
284
+ end
285
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A com codigo de movimento 30 para CNAB 240" do
286
+ it { subject.get_codigo_motivo_ocorrencia('11', '30', 240).must_equal 'A48' } # CEP INVÁLIDO
287
+ it { subject.get_codigo_motivo_ocorrencia('12', '30', 240).must_equal 'A53' } # NÚMERO INSCRIÇÃO INVÁLIDO DO SACADOR AVALISTA
288
+ it { subject.get_codigo_motivo_ocorrencia('13', '30', 240).must_equal 'A86' } # SEU NÚMERO COM O MESMO CONTEÚDO
289
+ it { subject.get_codigo_motivo_ocorrencia('67', '30', 240).must_equal 'A317' } # NOME INVÁLIDO DO SACADOR AVALISTA
290
+ it { subject.get_codigo_motivo_ocorrencia('72', '30', 240).must_equal 'A318' } # ENDEREÇO INVÁLIDO – SACADOR AVALISTA
291
+ it { subject.get_codigo_motivo_ocorrencia('73', '30', 240).must_equal 'A319' } # BAIRRO INVÁLIDO – SACADOR AVALISTA
292
+ it { subject.get_codigo_motivo_ocorrencia('74', '30', 240).must_equal 'A320' } # CIDADE INVÁLIDA – SACADOR AVALISTA
293
+ it { subject.get_codigo_motivo_ocorrencia('75', '30', 240).must_equal 'A321' } # SIGLA ESTADO INVÁLIDO – SACADOR AVALISTA
294
+ it { subject.get_codigo_motivo_ocorrencia('76', '30', 240).must_equal 'A322' } # CEP INVÁLIDO – SACADOR AVALISTA
295
+ end
296
+
297
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência C" do
298
+ it { subject.get_codigo_motivo_ocorrencia('AA', '06', 240).must_equal 'C32' } # CAIXA ELETRÔNICO ITAÚ
299
+ it { subject.get_codigo_motivo_ocorrencia('AC', '09', 240).must_equal 'C08' } # PAGAMENTO EM CARTÓRIO AUTOMATIZADO
300
+ it { subject.get_codigo_motivo_ocorrencia('AO', '17', 240).must_equal 'C135' } # ACERTO ONLINE
301
+ it { subject.get_codigo_motivo_ocorrencia('BC', '06', 240).must_equal 'C31' } # BANCOS CORRESPONDENTES
302
+ it { subject.get_codigo_motivo_ocorrencia('BF', '09', 240).must_equal 'C37' } # ITAÚ BANKFONE
303
+ it { subject.get_codigo_motivo_ocorrencia('BL', '17', 240).must_equal 'C33' } # ITAÚ BANKLINE
304
+ it { subject.get_codigo_motivo_ocorrencia('B0', '06', 240).must_equal 'C136' } # OUTROS BANCOS – RECEBIMENTO OFF-LINE
305
+ it { subject.get_codigo_motivo_ocorrencia('B1', '09', 240).must_equal 'C137' } # OUTROS BANCOS – PELO CÓDIGO DE BARRAS
306
+ it { subject.get_codigo_motivo_ocorrencia('B2', '17', 240).must_equal 'C138' } # OUTROS BANCOS – PELA LINHA DIGITÁVEL
307
+ it { subject.get_codigo_motivo_ocorrencia('B3', '06', 240).must_equal 'C139' } # OUTROS BANCOS – PELO AUTO ATENDIMENTO
308
+ it { subject.get_codigo_motivo_ocorrencia('B4', '09', 240).must_equal 'C140' } # OUTROS BANCOS – RECEBIMENTO EM CASA LOTÉRICA
309
+ it { subject.get_codigo_motivo_ocorrencia('B5', '17', 240).must_equal 'C141' } # OUTROS BANCOS – CORRESPONDENTE
310
+ it { subject.get_codigo_motivo_ocorrencia('B6', '06', 240).must_equal 'C142' } # OUTROS BANCOS – TELEFONE
311
+ it { subject.get_codigo_motivo_ocorrencia('B7', '09', 240).must_equal 'C143' } # OUTROS BANCOS – ARQUIVO ELETRÔNICO (PAGAMENTO EFETUADO POR MEIO DE TROCA DE ARQUIVOS)
312
+ it { subject.get_codigo_motivo_ocorrencia('CC', '17', 240).must_equal 'C36' } # AGÊNCIA ITAÚ – COM CHEQUE DE OUTRO BANCO ou (CHEQUE ITAÚ)
313
+ it { subject.get_codigo_motivo_ocorrencia('CI', '06', 240).must_equal 'C144' } # CORRESPONDENTE ITAÚ
314
+ it { subject.get_codigo_motivo_ocorrencia('CK', '09', 240).must_equal 'C145' } # SISPAG – SISTEMA DE CONTAS A PAGAR ITAÚ
315
+ it { subject.get_codigo_motivo_ocorrencia('CP', '17', 240).must_equal 'C146' } # AGÊNCIA ITAÚ – POR DÉBITO EM CONTA CORRENTE, CHEQUE ITAÚ* OU DINHEIRO
316
+ it { subject.get_codigo_motivo_ocorrencia('DG', '06', 240).must_equal 'C147' } # AGÊNCIA ITAÚ – CAPTURADO EM OFF-LINE
317
+ it { subject.get_codigo_motivo_ocorrencia('LC', '09', 240).must_equal 'C148' } # PAGAMENTO EM CARTÓRIO DE PROTESTO COM CHEQUE
318
+ it { subject.get_codigo_motivo_ocorrencia('EA', '17', 240).must_equal 'C03' } # TERMINAL DE CAIXA
319
+ it { subject.get_codigo_motivo_ocorrencia('Q0', '06', 240).must_equal 'C149' } # AGENDAMENTO – PAGAMENTO AGENDADO VIA BANKLINE OU OUTRO CANAL ELETRÔNICO E LIQUIDADO NA DATA INDICADA
320
+ it { subject.get_codigo_motivo_ocorrencia('RA', '09', 240).must_equal 'C150' } # DIGITAÇÃO – REALIMENTAÇÃO AUTOMÁTICA
321
+ it { subject.get_codigo_motivo_ocorrencia('ST', '17', 240).must_equal 'C151' } # PAGAMENTO VIA SELTEC
322
+ end
323
+
324
+
325
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A com codigo de movimento 02 para CNAB 400" do
326
+ it { subject.get_codigo_motivo_ocorrencia('01', '02', 400).must_equal 'A240' } # CEP SEM ATENDIMENTO DE PROTESTO NO MOMENTO
327
+ it { subject.get_codigo_motivo_ocorrencia('02', '02', 400).must_equal 'A241' } # ESTADO COM DETERMINAÇÃO LEGAL QUE IMPEDE A INSCRIÇÃO DE INADIMPLENTES
328
+ end
329
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A com codigo de movimento 03 para CNAB 400" do
330
+ it { subject.get_codigo_motivo_ocorrencia('03', '03', 400).must_equal 'A240' } # CEP SEM ATENDIMENTO DE PROTESTO NO MOMENTO
331
+ it { subject.get_codigo_motivo_ocorrencia('04', '03', 400).must_equal 'A52' } # SIGLA DO ESTADO INVÁLIDA
332
+ it { subject.get_codigo_motivo_ocorrencia('05', '03', 400).must_equal 'A241' } # DATA VENCIMENTO COM PRAZO DA OPERAÇÃO MENOR QUE PRAZO MÍNIMO OU MAIOR QUE O MÁXIMO
333
+ it { subject.get_codigo_motivo_ocorrencia('07', '03', 400).must_equal 'A242' } # VALOR DO TÍTULO MAIOR QUE 10.000.000,00
334
+ it { subject.get_codigo_motivo_ocorrencia('08', '03', 400).must_equal 'A45' } # OME DO PAGADOR NÃO INFORMADO OU DESLOCADO
335
+ it { subject.get_codigo_motivo_ocorrencia('09', '03', 400).must_equal 'A17' } # AGÊNCIA ENCERRADA
336
+ it { subject.get_codigo_motivo_ocorrencia('10', '03', 400).must_equal 'A47' } # LOGRADOURO NÃO INFORMADO OU DESLOCADO
337
+ it { subject.get_codigo_motivo_ocorrencia('11', '03', 400).must_equal 'A49' } # CEP NÃO NUMÉRICO OU CEP INVÁLIDO
338
+ it { subject.get_codigo_motivo_ocorrencia('12', '03', 400).must_equal 'A54' } # SACADOR / AVALISTA NOME NÃO INFORMADO OU DESLOCADO (BANCOS CORRESPONDENTES)
339
+ it { subject.get_codigo_motivo_ocorrencia('13', '03', 400).must_equal 'A51' } # CEP INCOMPATÍVEL COM A SIGLA DO ESTADO
340
+ it { subject.get_codigo_motivo_ocorrencia('14', '03', 400).must_equal 'A08' } # NOSSO NÚMERO JÁ REGISTRADO NO CADASTRO DO BANCO OU FORA DA FAIXA
341
+ it { subject.get_codigo_motivo_ocorrencia('15', '03', 400).must_equal 'A09' } # NOSSO NÚMERO EM DUPLICIDADE NO MESMO MOVIMENTO
342
+ it { subject.get_codigo_motivo_ocorrencia('18', '03', 400).must_equal 'A243' } # DATA DE ENTRADA INVÁLIDA PARA OPERAR COM ESTA CARTEIRA
343
+ it { subject.get_codigo_motivo_ocorrencia('19', '03', 400).must_equal 'A244' } # OCORRÊNCIA INVÁLIDA
344
+ it { subject.get_codigo_motivo_ocorrencia('21', '03', 400).must_equal 'A245' } # CARTEIRA NÃO ACEITA DEPOSITÁRIA CORRESPONDENTE ESTADO DA AGÊNCIA DIFERENTE DO ESTADO DO PAGADOR AG. COBRADORA NÃO CONSTA NO CADASTRO OU ENCERRANDO
345
+ it { subject.get_codigo_motivo_ocorrencia('22', '03', 400).must_equal 'A246' } # CARTEIRA NÃO PERMITIDA (NECESSÁRIO CADASTRAR FAIXA LIVRE)
346
+ it { subject.get_codigo_motivo_ocorrencia('26', '03', 400).must_equal 'A247' } # AGÊNCIA/CONTA NÃO LIBERADA PARA OPERAR COM COBRANÇA
347
+ it { subject.get_codigo_motivo_ocorrencia('27', '03', 400).must_equal 'A248' } # CNPJ DO BENEFICIÁRIO INAPTO DEVOLUÇÃO DE TÍTULO EM GARANTIA
348
+ it { subject.get_codigo_motivo_ocorrencia('29', '03', 400).must_equal 'A249' } # CATEGORIA DA CONTA INVÁLIDA
349
+ it { subject.get_codigo_motivo_ocorrencia('30', '03', 400).must_equal 'A250' } # ENTRADAS BLOQUEADAS, CONTA SUSPENSA EM COBRANÇA
350
+ it { subject.get_codigo_motivo_ocorrencia('31', '03', 400).must_equal 'A251' } # CONTA NÃO TEM PERMISSÃO PARA PROTESTAR (CONTATE SEU GERENTE)
351
+ it { subject.get_codigo_motivo_ocorrencia('35', '03', 400).must_equal 'A32' } # IOF MAIOR QUE 5%
352
+ it { subject.get_codigo_motivo_ocorrencia('36', '03', 400).must_equal 'A252' } # QUANTIDADE DE MOEDA INCOMPATÍVEL COM VALOR DO TÍTULO
353
+ it { subject.get_codigo_motivo_ocorrencia('37', '03', 400).must_equal 'A253' } # CNPJ/CPF DO PAGADOR NÃO NUMÉRICO OU IGUAL A ZEROS
354
+ it { subject.get_codigo_motivo_ocorrencia('42', '03', 400).must_equal 'A08' } # NOSSO NÚMERO FORA DE FAIXA
355
+ it { subject.get_codigo_motivo_ocorrencia('52', '03', 400).must_equal 'A254' } # EMPRESA NÃO ACEITA BANCO CORRESPONDENTE
356
+ it { subject.get_codigo_motivo_ocorrencia('53', '03', 400).must_equal 'A255' } # EMPRESA NÃO ACEITA BANCO CORRESPONDENTE - COBRANÇA MENSAGEM
357
+ it { subject.get_codigo_motivo_ocorrencia('54', '03', 400).must_equal 'A256' } # BANCO CORRESPONDENTE - TÍTULO COM VENCIMENTO INFERIOR A 15 DIAS
358
+ it { subject.get_codigo_motivo_ocorrencia('55', '03', 400).must_equal 'A257' } # CEP NÃO PERTENCE À DEPOSITÁRIA INFORMADA
359
+ it { subject.get_codigo_motivo_ocorrencia('56', '03', 400).must_equal 'A258' } # CORRESP VENCTO SUPERIOR A 180 DIAS DA DATA DE ENTRADA
360
+ it { subject.get_codigo_motivo_ocorrencia('57', '03', 400).must_equal 'A259' } # CEP SÓ DEPOSITÁRIA BCO DO BRASIL COM VENCTO INFERIOR A 8 DIAS
361
+ it { subject.get_codigo_motivo_ocorrencia('60', '03', 400).must_equal 'A33' } # VALOR DO ABATIMENTO INVÁLIDO
362
+ it { subject.get_codigo_motivo_ocorrencia('61', '03', 400).must_equal 'A260' } # JUROS DE MORA MAIOR QUE O PERMITIDO
363
+ it { subject.get_codigo_motivo_ocorrencia('62', '03', 400).must_equal 'A29' } # VALOR DO DESCONTO MAIOR QUE VALOR DO TÍTULO
364
+ it { subject.get_codigo_motivo_ocorrencia('63', '03', 400).must_equal 'A261' } # DESCONTO DE ANTECIPAÇÃO, VALOR DA IMPORTÂNCIA POR DIA DE DESCONTO (IDD) NÃO PERMITIDO
365
+ it { subject.get_codigo_motivo_ocorrencia('64', '03', 400).must_equal 'A24' } # DATA DE EMISSÃO DO TÍTULO INVÁLIDA
366
+ it { subject.get_codigo_motivo_ocorrencia('65', '03', 400).must_equal 'A262' } # TAXA INVÁLIDA (VENDOR)
367
+ it { subject.get_codigo_motivo_ocorrencia('66', '03', 400).must_equal 'A74' } # INVALIDA/FORA DE PRAZO DE OPERAÇÃO (MÍNIMO OU MÁXIMO)
368
+ it { subject.get_codigo_motivo_ocorrencia('67', '03', 400).must_equal 'A20' } # VALOR DO TÍTULO/QUANTIDADE DE MOEDA INVÁLIDO
369
+ it { subject.get_codigo_motivo_ocorrencia('68', '03', 400).must_equal 'A10' } # CARTEIRA INVÁLIDA OU NÃO CADASTRADA NO INTERCÂMBIO DA COBRANÇA
370
+ it { subject.get_codigo_motivo_ocorrencia('69', '03', 400).must_equal 'A263' } # CARTEIRA INVÁLIDA PARA TÍTULOS COM RATEIO DE CRÉDITO
371
+ it { subject.get_codigo_motivo_ocorrencia('70', '03', 400).must_equal 'A264' } # BENEFICIÁRIO NÃO CADASTRADO PARA FAZER RATEIO DE CRÉDITO
372
+ it { subject.get_codigo_motivo_ocorrencia('78', '03', 400).must_equal 'A265' } # DUPLICIDADE DE AGÊNCIA/CONTA BENEFICIÁRIA DO RATEIO DE CRÉDITO
373
+ it { subject.get_codigo_motivo_ocorrencia('80', '03', 400).must_equal 'A266' } # QUANTIDADE DE CONTAS BENEFICIÁRIAS DO RATEIO MAIOR DO QUE O PERMITIDO (MÁXIMO DE 30 CONTAS POR TÍTULO)
374
+ it { subject.get_codigo_motivo_ocorrencia('81', '03', 400).must_equal 'A267' } # CONTA PARA RATEIO DE CRÉDITO INVÁLIDA / NÃO PERTENCE AO ITAÚ
375
+ it { subject.get_codigo_motivo_ocorrencia('82', '03', 400).must_equal 'A268' } # DESCONTO/ABATIMENTO NÃO PERMITIDO PARA TÍTULOS COM RATEIO DE CRÉDITO
376
+ it { subject.get_codigo_motivo_ocorrencia('83', '03', 400).must_equal 'A269' } # VALOR DO TÍTULO MENOR QUE A SOMA DOS VALORES ESTIPULADOS PARA RATEIO
377
+ it { subject.get_codigo_motivo_ocorrencia('84', '03', 400).must_equal 'A270' } # AGÊNCIA/CONTA BENEFICIÁRIA DO RATEIO É A CENTRALIZADORA DE CRÉDITO DO BENEFICIÁRIO
378
+ it { subject.get_codigo_motivo_ocorrencia('85', '03', 400).must_equal 'A271' } # AGÊNCIA/CONTA DO BENEFICIÁRIO É CONTRATUAL / RATEIO DE CRÉDITO NÃO PERMITIDO
379
+ it { subject.get_codigo_motivo_ocorrencia('86', '03', 400).must_equal 'A272' } # CÓDIGO DO TIPO DE VALOR INVÁLIDO / NÃO PREVISTO PARA TÍTULOS COM RATEIO DE CRÉDITO
380
+ it { subject.get_codigo_motivo_ocorrencia('87', '03', 400).must_equal 'A273' } # REGISTRO TIPO 4 SEM INFORMAÇÃO DE AGÊNCIAS/CONTAS BENEFICIÁRIAS DO RATEIO
381
+ it { subject.get_codigo_motivo_ocorrencia('90', '03', 400).must_equal 'A274' } # COBRANÇA MENSAGEM - NÚMERO DA LINHA DA MENSAGEM INVÁLIDO OU QUANTIDADE DE LINHAS EXCEDIDAS
382
+ it { subject.get_codigo_motivo_ocorrencia('97', '03', 400).must_equal 'A275' } # COBRANÇA MENSAGEM SEM MENSAGEM (SÓ DE CAMPOS FIXOS), PORÉM COM REGISTRO DO TIPO 7 OU 8
383
+ it { subject.get_codigo_motivo_ocorrencia('98', '03', 400).must_equal 'A276' } # REGISTRO MENSAGEM SEM FLASH CADASTRADO OU FLASH INFORMADO DIFERENTE DO CADASTRADO
384
+ it { subject.get_codigo_motivo_ocorrencia('99', '03', 400).must_equal 'A277' } # CONTA DE COBRANÇA COM FLASH CADASTRADO E SEM REGISTRO DE MENSAGEM CORRESPONDENTE
385
+
386
+ end
387
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A com codigo de movimento 26 para CNAB 400" do
388
+ it { subject.get_codigo_motivo_ocorrencia('01', '26', 400).must_equal 'A278' } # INSTRUÇÃO/OCORRÊNCIA NÃO EXISTENTE
389
+ it { subject.get_codigo_motivo_ocorrencia('03', '26', 400).must_equal 'A251' } # CONTA NÃO TEM PERMISSÃO PARA PROTESTAR (CONTATE SEU GERENTE)
390
+ it { subject.get_codigo_motivo_ocorrencia('06', '26', 400).must_equal 'A279' } # NOSSO NÚMERO IGUAL A ZEROS
391
+ it { subject.get_codigo_motivo_ocorrencia('09', '26', 400).must_equal 'A53' } # CNPJ/CPF DO SACADOR/AVALISTA INVÁLIDO
392
+ it { subject.get_codigo_motivo_ocorrencia('10', '26', 400).must_equal 'A34' } # VALOR DO ABATIMENTO IGUAL OU MAIOR QUE O VALOR DO TÍTULO
393
+ it { subject.get_codigo_motivo_ocorrencia('11', '26', 400).must_equal 'A280' } # SEGUNDA INSTRUÇÃO/OCORRÊNCIA NÃO EXISTENTE
394
+ it { subject.get_codigo_motivo_ocorrencia('14', '26', 400).must_equal 'A281' } # REGISTRO EM DUPLICIDADE
395
+ it { subject.get_codigo_motivo_ocorrencia('15', '26', 400).must_equal 'A54' } # CNPJ/CPF INFORMADO SEM NOME DO SACADOR/AVALISTA
396
+ it { subject.get_codigo_motivo_ocorrencia('19', '26', 400).must_equal 'A34' } # VALOR DO ABATIMENTO MAIOR QUE 90% DO VALOR DO TÍTULO
397
+ it { subject.get_codigo_motivo_ocorrencia('20', '26', 400).must_equal 'A41' } # EXISTE SUSTACAO DE PROTESTO PENDENTE PARA O TITULO
398
+ it { subject.get_codigo_motivo_ocorrencia('21', '26', 400).must_equal 'A282' } # TÍTULO NÃO REGISTRADO NO SISTEMA
399
+ it { subject.get_codigo_motivo_ocorrencia('22', '26', 400).must_equal 'A106' } # TÍTULO BAIXADO OU LIQUIDADO
400
+ it { subject.get_codigo_motivo_ocorrencia('23', '26', 400).must_equal 'A283' } # INSTRUÇÃO NÃO ACEITA
401
+ it { subject.get_codigo_motivo_ocorrencia('24', '26', 400).must_equal 'A284' } # INSTRUÇÃO INCOMPATÍVEL – EXISTE INSTRUÇÃO DE PROTESTO PARA O TÍTULO
402
+ it { subject.get_codigo_motivo_ocorrencia('25', '26', 400).must_equal 'A285' } # INSTRUÇÃO INCOMPATÍVEL – NÃO EXISTE INSTRUÇÃO DE PROTESTO PARA O TÍTULO
403
+ it { subject.get_codigo_motivo_ocorrencia('26', '26', 400).must_equal 'A286' } # INSTRUÇÃO NÃO ACEITA POR JÁ TER SIDO EMITIDA A ORDEM DE PROTESTO AO CARTÓRIO
404
+ it { subject.get_codigo_motivo_ocorrencia('27', '26', 400).must_equal 'A287' } # INSTRUÇÃO NÃO ACEITA POR NÃO TER SIDO EMITIDA A ORDEM DE PROTESTO AO CARTÓRIO
405
+ it { subject.get_codigo_motivo_ocorrencia('28', '26', 400).must_equal 'A288' } # JÁ EXISTE UMA MESMA INSTRUÇÃO CADASTRADA ANTERIORMENTE PARA O TÍTULO
406
+ it { subject.get_codigo_motivo_ocorrencia('29', '26', 400).must_equal 'A289' } # VALOR LÍQUIDO + VALOR DO ABATIMENTO DIFERENTE DO VALOR DO TÍTULO REGISTRADO
407
+ it { subject.get_codigo_motivo_ocorrencia('30', '26', 400).must_equal 'A290' } # EXISTE UMA INSTRUÇÃO DE NÃO PROTESTAR ATIVA PARA O TÍTULO
408
+ it { subject.get_codigo_motivo_ocorrencia('31', '26', 400).must_equal 'A291' } # EXISTE UMA OCORRÊNCIA DO PAGADOR QUE BLOQUEIA A INSTRUÇÃO
409
+ it { subject.get_codigo_motivo_ocorrencia('32', '26', 400).must_equal 'A292' } # DEPOSITÁRIA DO TÍTULO = 9999 OU CARTEIRA NÃO ACEITA PROTESTO
410
+ it { subject.get_codigo_motivo_ocorrencia('33', '26', 400).must_equal 'A293' } # ALTERAÇÃO DE VENCIMENTO IGUAL À REGISTRADA NO SISTEMA OU QUE TORNA O TÍTULO VENCIDO
411
+ it { subject.get_codigo_motivo_ocorrencia('34', '26', 400).must_equal 'A294' } # INSTRUÇÃO DE EMISSÃO DE AVISO DE COBRANÇA PARA TÍTULO VENCIDO ANTES DO VENCIMENTO
412
+ it { subject.get_codigo_motivo_ocorrencia('35', '26', 400).must_equal 'A295' } # SOLICITAÇÃO DE CANCELAMENTO DE INSTRUÇÃO INEXISTENTE
413
+ it { subject.get_codigo_motivo_ocorrencia('36', '26', 400).must_equal 'A296' } # TÍTULO SOFRENDO ALTERAÇÃO DE CONTROLE (AGÊNCIA/CONTA/CARTEIRA/NOSSO NÚMERO)
414
+ it { subject.get_codigo_motivo_ocorrencia('37', '26', 400).must_equal 'A297' } # INSTRUÇÃO NÃO PERMITIDA PARA A CARTEIRA
415
+ it { subject.get_codigo_motivo_ocorrencia('38', '26', 400).must_equal 'A298' } # INSTRUÇÃO NÃO PERMITIDA PARA TÍTULO COM RATEIO DE CRÉDITO
416
+ it { subject.get_codigo_motivo_ocorrencia('40', '26', 400).must_equal 'A299' } # INSTRUÇÃO INCOMPATÍVEL – NÃO EXISTE INSTRUÇÃO DE NEGATIVAÇÃO EXPRESSA PARA O TÍTULO
417
+ it { subject.get_codigo_motivo_ocorrencia('41', '26', 400).must_equal 'A300' } # INSTRUÇÃO NÃO PERMITIDA – TÍTULO COM ENTRADA EM NEGATIVAÇÃO EXPRESSA
418
+ it { subject.get_codigo_motivo_ocorrencia('42', '26', 400).must_equal 'A301' } # INSTRUÇÃO NÃO PERMITIDA – TÍTULO COM NEGATIVAÇÃO EXPRESSA CONCLUÍDA
419
+ it { subject.get_codigo_motivo_ocorrencia('43', '26', 400).must_equal 'A302' } # PRAZO INVÁLIDO PARA NEGATIVAÇÃO EXPRESSA – MÍNIMO: 02 DIAS CORRIDOS APÓS O VENCIMENTO
420
+ it { subject.get_codigo_motivo_ocorrencia('45', '26', 400).must_equal 'A303' } # INSTRUÇÃO INCOMPATÍVEL PARA O MESMO TÍTULO NESTA DATA
421
+ it { subject.get_codigo_motivo_ocorrencia('47', '26', 400).must_equal 'A21' } # INSTRUÇÃO NÃO PERMITIDA – ESPÉCIE INVÁLIDA
422
+ it { subject.get_codigo_motivo_ocorrencia('48', '26', 400).must_equal 'A46' } # DADOS DO PAGADOR INVÁLIDOS ( CPF / CNPJ / NOME )
423
+ it { subject.get_codigo_motivo_ocorrencia('49', '26', 400).must_equal 'A47' } # DADOS DO ENDEREÇO DO PAGADOR INVÁLIDOS
424
+ it { subject.get_codigo_motivo_ocorrencia('50', '26', 400).must_equal 'A24' } # DATA DE EMISSÃO DO TÍTULO INVÁLIDA
425
+ it { subject.get_codigo_motivo_ocorrencia('51', '26', 400).must_equal 'A305' } # INSTRUÇÃO NÃO PERMITIDA – TÍTULO COM NEGATIVAÇÃO EXPRESSA AGENDADA
426
+ end
427
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A com codigo de movimento 30 para CNAB 400" do
428
+ it { subject.get_codigo_motivo_ocorrencia('02', '30', 400).must_equal 'A61' } # AGÊNCIA COBRADORA INVÁLIDA OU COM O MESMO CONTEÚDO
429
+ it { subject.get_codigo_motivo_ocorrencia('04', '30', 400).must_equal 'A52' } # SIGLA DO ESTADO INVÁLIDA
430
+ it { subject.get_codigo_motivo_ocorrencia('05', '30', 400).must_equal 'A16' } # DATA DE VENCIMENTO INVÁLIDA OU COM O MESMO CONTEÚDO
431
+ it { subject.get_codigo_motivo_ocorrencia('06', '30', 400).must_equal 'A306' } # VALOR DO TÍTULO COM OUTRA ALTERAÇÃO SIMULTÂNEA
432
+ it { subject.get_codigo_motivo_ocorrencia('08', '30', 400).must_equal 'A45' } # NOME DO PAGADOR COM O MESMO CONTEÚDO
433
+ it { subject.get_codigo_motivo_ocorrencia('09', '30', 400).must_equal 'A07' } # AGÊNCIA/CONTA INCORRETA
434
+ it { subject.get_codigo_motivo_ocorrencia('11', '30', 400).must_equal 'A48' } # CEP INVÁLIDO
435
+ it { subject.get_codigo_motivo_ocorrencia('12', '30', 400).must_equal 'A53' } # NÚMERO INSCRIÇÃO INVÁLIDO DO SACADOR AVALISTA
436
+ it { subject.get_codigo_motivo_ocorrencia('13', '30', 400).must_equal 'A86' } # SEU NÚMERO COM O MESMO CONTEÚDO
437
+ it { subject.get_codigo_motivo_ocorrencia('16', '30', 400).must_equal 'A307' } # ABATIMENTO/ALTERAÇÃO DO VALOR DO TÍTULO OU SOLICITAÇÃO DE BAIXA BLOQUEADA
438
+ it { subject.get_codigo_motivo_ocorrencia('20', '30', 400).must_equal 'A21' } # ESPÉCIE INVÁLIDA
439
+ it { subject.get_codigo_motivo_ocorrencia('21', '30', 400).must_equal 'A308' } # AGÊNCIA COBRADORA NÃO CONSTA NO CADASTRO DE DEPOSITÁRIA OU EM ENCERRAMENTO
440
+ it { subject.get_codigo_motivo_ocorrencia('23', '30', 400).must_equal 'A24' } # DATA DE EMISSÃO DO TÍTULO INVÁLIDA OU COM MESMO CONTEÚDO
441
+ it { subject.get_codigo_motivo_ocorrencia('41', '30', 400).must_equal 'A23' } # CAMPO ACEITE INVÁLIDO OU COM MESMO CONTEÚDO
442
+ it { subject.get_codigo_motivo_ocorrencia('42', '30', 400).must_equal 'A309' } # ALTERAÇÃO INVÁLIDA PARA TÍTULO VENCIDO
443
+ it { subject.get_codigo_motivo_ocorrencia('43', '30', 400).must_equal 'A310' } # ALTERAÇÃO BLOQUEADA – VENCIMENTO JÁ ALTERADO
444
+ it { subject.get_codigo_motivo_ocorrencia('53', '30', 400).must_equal 'A311' } # INSTRUÇÃO COM O MESMO CONTEÚDO
445
+ it { subject.get_codigo_motivo_ocorrencia('54', '30', 400).must_equal 'A312' } # DATA VENCIMENTO PARA BANCOS CORRESPONDENTES INFERIOR AO ACEITO PELO BANCO
446
+ it { subject.get_codigo_motivo_ocorrencia('55', '30', 400).must_equal 'A313' } # ALTERAÇÕES IGUAIS PARA O MESMO CONTROLE (AGÊNCIA/CONTA/CARTEIRA/NOSSO NÚMERO)
447
+ it { subject.get_codigo_motivo_ocorrencia('56', '30', 400).must_equal 'A06' } # CNPJ/CPF INVÁLIDO NÃO NUMÉRICO OU ZERADO
448
+ it { subject.get_codigo_motivo_ocorrencia('57', '30', 400).must_equal 'A314' } # PRAZO DE VENCIMENTO INFERIOR A 15 DIAS
449
+ it { subject.get_codigo_motivo_ocorrencia('60', '30', 400).must_equal 'A315' } # VALOR DE IOF – ALTERAÇÃO NÃO PERMITIDA PARA CARTEIRAS DE N.S. – MOEDA VARIÁVEL
450
+ it { subject.get_codigo_motivo_ocorrencia('61', '30', 400).must_equal 'A104' } # TÍTULO JÁ BAIXADO OU LIQUIDADO OU NÃO EXISTE TÍTULO CORRESPONDENTE NO SISTEMA
451
+ it { subject.get_codigo_motivo_ocorrencia('66', '30', 400).must_equal 'A316' } # ALTERAÇÃO NÃO PERMITIDA PARA CARTEIRAS DE NOTAS DE SEGUROS – MOEDA VARIÁVEL
452
+ it { subject.get_codigo_motivo_ocorrencia('67', '30', 400).must_equal 'A317' } # NOME INVÁLIDO DO SACADOR AVALISTA
453
+ it { subject.get_codigo_motivo_ocorrencia('72', '30', 400).must_equal 'A318' } # ENDEREÇO INVÁLIDO – SACADOR AVALISTA
454
+ it { subject.get_codigo_motivo_ocorrencia('73', '30', 400).must_equal 'A319' } # BAIRRO INVÁLIDO – SACADOR AVALISTA
455
+ it { subject.get_codigo_motivo_ocorrencia('74', '30', 400).must_equal 'A320' } # CIDADE INVÁLIDA – SACADOR AVALISTA
456
+ it { subject.get_codigo_motivo_ocorrencia('75', '30', 400).must_equal 'A321' } # SIGLA ESTADO INVÁLIDO – SACADOR AVALISTA
457
+ it { subject.get_codigo_motivo_ocorrencia('76', '30', 400).must_equal 'A322' } # CEP INVÁLIDO – SACADOR AVALISTA
458
+ it { subject.get_codigo_motivo_ocorrencia('81', '30', 400).must_equal 'A323' } # ALTERAÇÃO BLOQUEADA – TÍTULO COM NEGATIVAÇÃO EXPRESSA / PROTESTO
459
+ it { subject.get_codigo_motivo_ocorrencia('87', '30', 400).must_equal 'A324' } # ALTERAÇÃO BLOQUEADA – TÍTULO COM RATEIO DE CRÉDITO
460
+ end
461
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A com codigo de movimento 100 para CNAB 400" do
462
+ it { subject.get_codigo_motivo_ocorrencia('01', '100', 400).must_equal 'A10' } # CARTEIRA/No NÚMERO NÃO NUMÉRICO
463
+ it { subject.get_codigo_motivo_ocorrencia('04', '100', 400).must_equal 'A09' } # NOSSO NÚMERO EM DUPLICIDADE NO MESMO MOVIMENTO
464
+ it { subject.get_codigo_motivo_ocorrencia('05', '100', 400).must_equal 'A325' } # SOLICITAÇÃO DE BAIXA PARA TÍTULO JÁ BAIXADO OU LIQUIDADO
465
+ it { subject.get_codigo_motivo_ocorrencia('06', '100', 400).must_equal 'A326' } # SOLICITAÇÃO DE BAIXA PARA TÍTULO NÃO REGISTRADO NO SISTEMA
466
+ it { subject.get_codigo_motivo_ocorrencia('07', '100', 400).must_equal 'A327' } # COBRANÇA PRAZO CURTO – SOLICITAÇÃO DE BAIXA P/ TÍTULO NÃO REGISTRADO NO SISTEMA
467
+ it { subject.get_codigo_motivo_ocorrencia('08', '100', 400).must_equal 'A328' } # SOLICITAÇÃO DE BAIXA PARA TÍTULO EM FLOATING
468
+ it { subject.get_codigo_motivo_ocorrencia('10', '100', 400).must_equal 'A329' } # VALOR DO TITULO FAZ PARTE DE GARANTIA DE EMPRESTIMO
469
+ it { subject.get_codigo_motivo_ocorrencia('11', '100', 400).must_equal 'A330' } # PAGO ATRAVÉS DO SISPAG POR CRÉDITO EM C/C E NÃO BAIXADO
470
+ end
471
+ context "CÓDIGOS para oa Caixa com Motivo Ocorrência A com codigo de movimento 218 para CNAB 400" do
472
+ it { subject.get_codigo_motivo_ocorrencia('16', '218', 400).must_equal 'A307' } # ABATIMENTO/ALTERAÇÃO DO VALOR DO TÍTULO OU SOLICITAÇÃO DE BAIXA BLOQUEADOS
473
+ it { subject.get_codigo_motivo_ocorrencia('40', '218', 400).must_equal 'A331' } # NÃO APROVADA DEVIDO AO IMPACTO NA ELEGIBILIDADE DE GARANTIAS
474
+ it { subject.get_codigo_motivo_ocorrencia('41', '218', 400).must_equal 'A332' } # AUTOMATICAMENTE REJEITADA
475
+ it { subject.get_codigo_motivo_ocorrencia('42', '218', 400).must_equal 'A304' } # CONFIRMA RECEBIMENTO DE INSTRUÇÃO – PENDENTE DE ANÁLISE
476
+ end
477
+ end
478
+
479
+ describe "#get_codigo_ocorrencia_pagador" do
480
+ context "CÓDIGOS para o Itau, Ocorrência do Pagador" do
481
+ it { subject.get_codigo_ocorrencia_pagador('1313', 240).must_equal '0302' } # SOLICITA A PRORROGAÇÃO DO VENCIMENTO PARA:
482
+ it { subject.get_codigo_ocorrencia_pagador('1321', 240).must_equal '0503' } # SOLICITA A DISPENSA DOS JUROS DE MORA
483
+ it { subject.get_codigo_ocorrencia_pagador('1339', 240).must_equal '0101' } # NÃO RECEBEU A MERCADORIA
484
+ it { subject.get_codigo_ocorrencia_pagador('1347', 240).must_equal '0102' } # A MERCADORIA CHEGOU ATRASADA
485
+ it { subject.get_codigo_ocorrencia_pagador('1354', 240).must_equal '0103' } # A MERCADORIA CHEGOU AVARIADA
486
+ it { subject.get_codigo_ocorrencia_pagador('1362', 240).must_equal '0105' } # A MERCADORIA CHEGOU INCOMPLETA
487
+ it { subject.get_codigo_ocorrencia_pagador('1370', 240).must_equal '0104' } # A MERCADORIA NÃO CONFERE COM O PEDIDO
488
+ it { subject.get_codigo_ocorrencia_pagador('1388', 240).must_equal '0106' } # A MERCADORIA ESTÁ À DISPOSIÇÃO
489
+ it { subject.get_codigo_ocorrencia_pagador('1396', 240).must_equal '0107' } # DEVOLVEU A MERCADORIA
490
+ it { subject.get_codigo_ocorrencia_pagador('1404', 240).must_equal '0201' } # NÃO RECEBEU A FATURA
491
+ it { subject.get_codigo_ocorrencia_pagador('1412', 240).must_equal '0108' } # A FATURA ESTÁ EM DESACORDO COM A NOTA FISCAL
492
+ it { subject.get_codigo_ocorrencia_pagador('1420', 240).must_equal '0202' } # O PEDIDO DE COMPRA FOI CANCELADO
493
+ it { subject.get_codigo_ocorrencia_pagador('1438', 240).must_equal '0203' } # A DUPLICATA FOI CANCELADA
494
+ it { subject.get_codigo_ocorrencia_pagador('1446', 240).must_equal '0109' } # QUE NADA DEVE OU COMPROU
495
+ it { subject.get_codigo_ocorrencia_pagador('1453', 240).must_equal '0603' } # QUE MANTÉM ENTENDIMENTOS COM O SACADOR
496
+ it { subject.get_codigo_ocorrencia_pagador('1461', 240).must_equal '0304' } # QUE PAGARÁ O TÍTULO EM:
497
+ it { subject.get_codigo_ocorrencia_pagador('1479', 240).must_equal '0305' } # QUE PAGOU O TÍTULO DIRETAMENTE AO BENEFICIÁRIO EM:
498
+ it { subject.get_codigo_ocorrencia_pagador('1487', 240).must_equal '0306' } # QUE PAGARÁ O TÍTULO DIRETAMENTE AO BENEFICIÁRIO EM:
499
+ it { subject.get_codigo_ocorrencia_pagador('1495', 240).must_equal '0301' } # QUE O VENCIMENTO CORRETO É:
500
+ it { subject.get_codigo_ocorrencia_pagador('1503', 240).must_equal '0501' } # QUE TEM DESCONTO OU ABATIMENTO DE:
501
+ it { subject.get_codigo_ocorrencia_pagador('1719', 240).must_equal '0401' } # PAGADOR NÃO FOI LOCALIZADO; CONFIRMAR ENDEREÇO
502
+ it { subject.get_codigo_ocorrencia_pagador('1727', 240).must_equal '0601' } # PAGADOR ESTÁ EM REGIME DE CONCORDATA
503
+ it { subject.get_codigo_ocorrencia_pagador('1735', 240).must_equal '0602' } # PAGADOR ESTÁ EM REGIME DE FALÊNCIA
504
+ it { subject.get_codigo_ocorrencia_pagador('1750', 240).must_equal '0504' } # PAGADOR SE RECUSA A PAGAR JUROS BANCÁRIOS
505
+ it { subject.get_codigo_ocorrencia_pagador('1768', 240).must_equal '0505' } # PAGADOR SE RECUSA A PAGAR COMISSÃO DE PERMANÊNCIA
506
+ it { subject.get_codigo_ocorrencia_pagador('1776', 240).must_equal '1776' } # NÃO FOI POSSÍVEL A ENTREGA DO BOLETO AO PAGADOR
507
+ it { subject.get_codigo_ocorrencia_pagador('1784', 240).must_equal '1784' } # BOLETO NÃO ENTREGUE, MUDOU-SE/DESCONHECIDO
508
+ it { subject.get_codigo_ocorrencia_pagador('1792', 240).must_equal '1792' } # BOLETO NÃO ENTREGUE, CEP ERRADO/INCOMPLETO
509
+ it { subject.get_codigo_ocorrencia_pagador('1800', 240).must_equal '1800' } # BOLETO NÃO ENTREGUE, NÚMERO NÃO EXISTE/ENDEREÇO INCOMPLETO
510
+ it { subject.get_codigo_ocorrencia_pagador('1818', 240).must_equal '1818' } # BOLETO NÃO RETIRADO PELO PAGADOR. REENVIADO PELO CORREIO PARA CARTEIRAS COM EMISSÃO PELO BANCO
511
+ it { subject.get_codigo_ocorrencia_pagador('1826', 240).must_equal '1826' } # ENDEREÇO DE E-MAIL INVÁLIDO/COBRANÇA MENSAGEM. BOLETO ENVIADO PELO CORREIO
512
+ it { subject.get_codigo_ocorrencia_pagador('1834', 240).must_equal '1834' } # BOLETO DDA, DIVIDA RECONHECIDA PELO PAGADOR
513
+ it { subject.get_codigo_ocorrencia_pagador('1842', 240).must_equal '1842' } # BOLETO DDA, DIVIDA NÃO RECONHECIDA PELO PAGADOR
514
+ end
515
+ end
516
+
517
+ describe "#get_codigo_movimento_retorno" do
518
+ context "CÓDIGOS para o cnab 400 do Itau" do
519
+ it { subject.get_codigo_movimento_retorno('07', 400).must_equal '102' } # LIQUIDAÇÃO PARCIAL – COBRANÇA INTELIGENTE (B2B)
520
+ it { subject.get_codigo_movimento_retorno('24', 400).must_equal '20' } # INSTRUÇÃO DE PROTESTO REJEITADA / SUSTADA / PENDENTE (NOTA 20 – TABELA 7)
521
+ it { subject.get_codigo_movimento_retorno('25', 400).must_equal '29' } # ALEGAÇÕES DO PAGADOR (NOTA 20 – TABELA 6)
522
+ it { subject.get_codigo_movimento_retorno('59', 400).must_equal '259' } # BAIXA POR CRÉDITO EM C/C ATRAVÉS DO SISPAG
523
+ it { subject.get_codigo_movimento_retorno('64', 400).must_equal '264' } # ENTRADA CONFIRMADA COM RATEIO DE CRÉDITO
524
+ it { subject.get_codigo_movimento_retorno('65', 400).must_equal '265' } # PAGAMENTO COM CHEQUE – AGUARDANDO COMPENSAÇÃO
525
+ it { subject.get_codigo_movimento_retorno('69', 400).must_equal '44' } # CHEQUE DEVOLVIDO (NOTA 20 – TABELA 9)
526
+ it { subject.get_codigo_movimento_retorno('71', 400).must_equal '271' } # ENTRADA REGISTRADA, AGUARDANDO AVALIAÇÃO
527
+ it { subject.get_codigo_movimento_retorno('72', 400).must_equal '272' } # BAIXA POR CRÉDITO EM C/C ATRAVÉS DO SISPAG SEM TÍTULO CORRESPONDENTE
528
+ it { subject.get_codigo_movimento_retorno('73', 400).must_equal '273' } # CONFIRMAÇÃO DE ENTRADA NA COBRANÇA SIMPLES – ENTRADA NÃO ACEITA NA COBRANÇA CONTRATUAL
529
+ it { subject.get_codigo_movimento_retorno('76', 400).must_equal '45' } # CHEQUE COMPENSADO
530
+ end
531
+ end
189
532
  end