brcobranca 8.0.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-gemset +1 -1
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +5 -3
  5. data/CHANGELOG.md +9 -0
  6. data/Gemfile +2 -2
  7. data/README.md +24 -12
  8. data/brcobranca.gemspec +0 -2
  9. data/lib/brcobranca.rb +43 -26
  10. data/lib/brcobranca/arquivos/logos/bancobrasilia.eps +0 -0
  11. data/lib/brcobranca/arquivos/logos/bancobrasilia_carne.eps +0 -0
  12. data/lib/brcobranca/arquivos/logos/cecred.eps +427 -0
  13. data/lib/brcobranca/arquivos/logos/cecred_carne.eps +427 -0
  14. data/lib/brcobranca/arquivos/logos/credisis.eps +5402 -0
  15. data/lib/brcobranca/arquivos/logos/credisis_carne.eps +5410 -0
  16. data/lib/brcobranca/arquivos/templates/modelo_generico.eps +0 -0
  17. data/lib/brcobranca/boleto/banco_brasil.rb +21 -21
  18. data/lib/brcobranca/boleto/banco_brasilia.rb +96 -0
  19. data/lib/brcobranca/boleto/banco_nordeste.rb +4 -6
  20. data/lib/brcobranca/boleto/banestes.rb +7 -7
  21. data/lib/brcobranca/boleto/banrisul.rb +5 -5
  22. data/lib/brcobranca/boleto/base.rb +28 -22
  23. data/lib/brcobranca/boleto/bradesco.rb +6 -6
  24. data/lib/brcobranca/boleto/caixa.rb +11 -18
  25. data/lib/brcobranca/boleto/cecred.rb +86 -0
  26. data/lib/brcobranca/boleto/credisis.rb +124 -0
  27. data/lib/brcobranca/boleto/hsbc.rb +10 -27
  28. data/lib/brcobranca/boleto/itau.rb +9 -10
  29. data/lib/brcobranca/boleto/santander.rb +5 -6
  30. data/lib/brcobranca/boleto/sicoob.rb +5 -5
  31. data/lib/brcobranca/boleto/sicredi.rb +7 -7
  32. data/lib/brcobranca/boleto/template/rghost.rb +127 -80
  33. data/lib/brcobranca/boleto/template/rghost_carne.rb +9 -9
  34. data/lib/brcobranca/boleto/unicred.rb +126 -4
  35. data/lib/brcobranca/calculo_data.rb +3 -0
  36. data/lib/brcobranca/formatacao_string.rb +15 -5
  37. data/lib/brcobranca/remessa/base.rb +16 -9
  38. data/lib/brcobranca/remessa/cnab240/banco_brasil.rb +14 -13
  39. data/lib/brcobranca/remessa/cnab240/base.rb +252 -119
  40. data/lib/brcobranca/remessa/cnab240/base_correspondente.rb +299 -0
  41. data/lib/brcobranca/remessa/cnab240/caixa.rb +61 -7
  42. data/lib/brcobranca/remessa/cnab240/cecred.rb +151 -0
  43. data/lib/brcobranca/remessa/cnab240/sicoob.rb +109 -123
  44. data/lib/brcobranca/remessa/cnab240/sicoob_banco_brasil.rb +94 -0
  45. data/lib/brcobranca/remessa/cnab240/sicredi.rb +177 -0
  46. data/lib/brcobranca/remessa/cnab240/unicred.rb +9 -0
  47. data/lib/brcobranca/remessa/cnab400/banco_brasil.rb +14 -0
  48. data/lib/brcobranca/remessa/cnab400/banco_brasilia.rb +166 -0
  49. data/lib/brcobranca/remessa/cnab400/banco_nordeste.rb +4 -6
  50. data/lib/brcobranca/remessa/cnab400/banrisul.rb +155 -0
  51. data/lib/brcobranca/remessa/cnab400/base.rb +4 -4
  52. data/lib/brcobranca/remessa/cnab400/bradesco.rb +7 -8
  53. data/lib/brcobranca/remessa/cnab400/citibank.rb +3 -4
  54. data/lib/brcobranca/remessa/cnab400/credisis.rb +128 -0
  55. data/lib/brcobranca/remessa/cnab400/itau.rb +23 -6
  56. data/lib/brcobranca/remessa/cnab400/santander.rb +80 -65
  57. data/lib/brcobranca/remessa/cnab400/sicoob.rb +2 -2
  58. data/lib/brcobranca/remessa/cnab400/unicred.rb +143 -0
  59. data/lib/brcobranca/remessa/pagamento.rb +50 -14
  60. data/lib/brcobranca/retorno/base.rb +4 -4
  61. data/lib/brcobranca/retorno/cnab240/base.rb +11 -8
  62. data/lib/brcobranca/retorno/cnab240/caixa.rb +4 -0
  63. data/lib/brcobranca/retorno/cnab240/cecred.rb +102 -0
  64. data/lib/brcobranca/retorno/cnab240/santander.rb +35 -12
  65. data/lib/brcobranca/retorno/cnab240/sicoob.rb +8 -4
  66. data/lib/brcobranca/retorno/cnab240/sicredi.rb +79 -0
  67. data/lib/brcobranca/retorno/cnab400/banco_brasil.rb +127 -0
  68. data/lib/brcobranca/retorno/cnab400/banco_brasilia.rb +89 -0
  69. data/lib/brcobranca/retorno/cnab400/banco_nordeste.rb +112 -0
  70. data/lib/brcobranca/retorno/cnab400/banrisul.rb +42 -0
  71. data/lib/brcobranca/retorno/cnab400/base.rb +18 -7
  72. data/lib/brcobranca/retorno/cnab400/bradesco.rb +9 -3
  73. data/lib/brcobranca/retorno/cnab400/credisis.rb +115 -0
  74. data/lib/brcobranca/retorno/cnab400/itau.rb +10 -4
  75. data/lib/brcobranca/retorno/cnab400/santander.rb +57 -0
  76. data/lib/brcobranca/retorno/cnab400/unicred.rb +118 -0
  77. data/lib/brcobranca/retorno/retorno_cnab240.rb +7 -3
  78. data/lib/brcobranca/retorno/retorno_cnab400.rb +6 -77
  79. data/lib/brcobranca/util/date.rb +20 -0
  80. data/lib/brcobranca/util/errors.rb +76 -0
  81. data/lib/brcobranca/validations.rb +232 -0
  82. data/lib/brcobranca/version.rb +1 -1
  83. data/spec/arquivos/CNAB240CECRED.RET +10 -0
  84. data/spec/arquivos/CNAB240SANTANDER.RET +8 -26
  85. data/spec/arquivos/CNAB240SICREDI.CRT +8 -0
  86. data/spec/arquivos/CNAB400BANCOBRASILIA.RET +3 -0
  87. data/spec/arquivos/CNAB400BANCONORDESTE.RET +3 -0
  88. data/spec/arquivos/CNAB400BANRISUL.RET +3 -0
  89. data/spec/arquivos/CNAB400CREDISIS.RET +3 -0
  90. data/spec/arquivos/CNAB400SANTANDER.RET +54 -0
  91. data/spec/arquivos/CNAB400UNICRED.RET +3 -0
  92. data/spec/brcobranca/base_spec.rb +6 -4
  93. data/spec/brcobranca/boleto/banco_brasil_spec.rb +22 -22
  94. data/spec/brcobranca/boleto/banco_brasilia_spec.rb +134 -0
  95. data/spec/brcobranca/boleto/banco_nordeste_spec.rb +19 -19
  96. data/spec/brcobranca/boleto/banestes_spec.rb +19 -19
  97. data/spec/brcobranca/boleto/banrisul_spec.rb +14 -14
  98. data/spec/brcobranca/boleto/bradesco_spec.rb +13 -13
  99. data/spec/brcobranca/boleto/caixa_spec.rb +7 -7
  100. data/spec/brcobranca/boleto/cecred_spec.rb +147 -0
  101. data/spec/brcobranca/boleto/credisis_spec.rb +155 -0
  102. data/spec/brcobranca/boleto/hsbc_spec.rb +17 -37
  103. data/spec/brcobranca/boleto/itau_spec.rb +16 -16
  104. data/spec/brcobranca/boleto/santander_spec.rb +11 -11
  105. data/spec/brcobranca/boleto/sicoob_spec.rb +17 -17
  106. data/spec/brcobranca/boleto/sicredi_spec.rb +13 -13
  107. data/spec/brcobranca/boleto/unicred_spec.rb +10 -10
  108. data/spec/brcobranca/boletos_em_lote_spec.rb +1 -1
  109. data/spec/brcobranca/formatacao_string_spec.rb +1 -1
  110. data/spec/brcobranca/remessa/cnab240/banco_brasil_spec.rb +10 -18
  111. data/spec/brcobranca/remessa/cnab240/caixa_spec.rb +39 -38
  112. data/spec/brcobranca/remessa/cnab240/cecred_spec.rb +164 -0
  113. data/spec/brcobranca/remessa/cnab240/sicoob_banco_brasil_spec.rb +268 -0
  114. data/spec/brcobranca/remessa/cnab240/sicoob_spec.rb +58 -39
  115. data/spec/brcobranca/remessa/cnab240/sicredi_spec.rb +201 -0
  116. data/spec/brcobranca/remessa/cnab240/unicred_spec.rb +193 -0
  117. data/spec/brcobranca/remessa/cnab400/banco_brasilia_spec.rb +183 -0
  118. data/spec/brcobranca/remessa/cnab400/banco_nordeste_spec.rb +4 -2
  119. data/spec/brcobranca/remessa/cnab400/banrisul_spec.rb +190 -0
  120. data/spec/brcobranca/remessa/cnab400/base_spec.rb +1 -1
  121. data/spec/brcobranca/remessa/cnab400/bradesco_spec.rb +16 -11
  122. data/spec/brcobranca/remessa/cnab400/citibank_spec.rb +11 -11
  123. data/spec/brcobranca/remessa/cnab400/credisis_spec.rb +188 -0
  124. data/spec/brcobranca/remessa/cnab400/itau_spec.rb +25 -12
  125. data/spec/brcobranca/remessa/cnab400/santander_spec.rb +35 -36
  126. data/spec/brcobranca/remessa/cnab400/sicoob_spec.rb +37 -0
  127. data/spec/brcobranca/remessa/cnab400/unicred_spec.rb +185 -0
  128. data/spec/brcobranca/remessa/pagamento_spec.rb +45 -27
  129. data/spec/brcobranca/retorno/cnab240/base_spec.rb +7 -8
  130. data/spec/brcobranca/retorno/cnab240/cecred_spec.rb +50 -0
  131. data/spec/brcobranca/retorno/cnab240/santander_spec.rb +35 -18
  132. data/spec/brcobranca/retorno/cnab240/sicoob_spec.rb +20 -19
  133. data/spec/brcobranca/retorno/cnab240/sicredi_spec.rb +31 -0
  134. data/spec/brcobranca/retorno/cnab400/banco_brasilia_spec.rb +36 -0
  135. data/spec/brcobranca/retorno/cnab400/banco_nordeste_spec.rb +39 -0
  136. data/spec/brcobranca/retorno/cnab400/banrisul_spec.rb +41 -0
  137. data/spec/brcobranca/retorno/cnab400/base_spec.rb +34 -13
  138. data/spec/brcobranca/retorno/cnab400/bradesco_spec.rb +4 -4
  139. data/spec/brcobranca/retorno/cnab400/credisis_spec.rb +25 -0
  140. data/spec/brcobranca/retorno/cnab400/itau_spec.rb +4 -4
  141. data/spec/brcobranca/retorno/cnab400/santander_spec.rb +39 -0
  142. data/spec/brcobranca/retorno/cnab400/unicred_spec.rb +42 -0
  143. data/spec/brcobranca/retorno/retorno_cnab400_spec.rb +1 -1
  144. data/spec/brcobranca/retorno/retorno_cnab_240_spec.rb +1 -1
  145. data/spec/brcobranca/rghost_spec.rb +1 -1
  146. data/spec/fixtures/remessa/remessa-banco-brasil-cnab400.rem +1 -1
  147. data/spec/fixtures/remessa/remessa-banco-brasilia-cnab400.rem +3 -0
  148. data/spec/fixtures/remessa/remessa-banco-nordeste-cnab400.rem +1 -1
  149. data/spec/fixtures/remessa/remessa-banco_brasil-cnab240.rem +5 -4
  150. data/spec/fixtures/remessa/remessa-bancoob-cnab240.rem +5 -4
  151. data/spec/fixtures/remessa/remessa-banrisul-cnab400.rem +3 -0
  152. data/spec/fixtures/remessa/remessa-bradesco-cnab400.rem +1 -1
  153. data/spec/fixtures/remessa/remessa-caixa-cnab240.rem +6 -5
  154. data/spec/fixtures/remessa/remessa-cecred-cnab240.rem +7 -0
  155. data/spec/fixtures/remessa/remessa-citibank-cnab400.rem +1 -1
  156. data/spec/fixtures/remessa/remessa-credisis-cnab400.rem +3 -0
  157. data/spec/fixtures/remessa/remessa-itau-cnab400.rem +3 -2
  158. data/spec/fixtures/remessa/remessa-santander-cnab400.rem +2 -2
  159. data/spec/fixtures/remessa/remessa-sicoob-correspondente-bb-cnab240.rem +4 -0
  160. data/spec/fixtures/remessa/remessa-sicredi-cnab240.rem +7 -0
  161. data/spec/fixtures/remessa/remessa-unicred-cnab240.rem +7 -0
  162. data/spec/fixtures/remessa/remessa-unicred-cnab400.rem +3 -0
  163. data/spec/support/shared_examples/busca_logotipo.rb +0 -2
  164. data/spec/support/shared_examples/cnab240.rb +92 -28
  165. data/spec/support/shared_examples/cnab400.rb +60 -14
  166. data/spec/support/shared_examples/formatos_validos.rb +6 -6
  167. metadata +103 -31
@@ -2,5 +2,5 @@
2
2
  #
3
3
 
4
4
  module Brcobranca
5
- VERSION = '8.0.0'
5
+ VERSION = '9.0.0'
6
6
  end
@@ -0,0 +1,10 @@
1
+ 08500000 282991308000100 03039000000004898160RAZAO SOCIAL CECRED 21108201509361900000108500000
2
+ 08500011T01 045 2082991308000100 303900000403039000000004898160RAZAO SOCIAL 000000001108201500000000
3
+ 0850001300001T 0603039000000004898160000000000000083 10000000000000011308201500000000000020008503039000000000000000000000000000920039977830001182A MATERIAIS ELETRICOS 000000000000000000000017003
4
+ 0850001300002U 060000000000000000000000000000000000000000000000000000000000000000000000002000000000000002000000000000000000000000000000001008201510082015 00000000000000000000000 08500000000000000000000
5
+ 0850001300003T 0603039000000004898160000000000000116 10000000000000121308201500000000000020008503039000000000000000000000000000920039977830001182A MATERIAIS ELETRICOS 000000000000000000000017003
6
+ 0850001300004U 060000000000000000000000000000000000000000000000000000000000000000000000002000000000000002000000000000000000000000000000001008201510082015 00000000000000000000000 08500000000000000000000
7
+ 0850001300005T 0603039000000004898160000000000000123 10000000000000131308201500000000000020008503039000000000000000000000000000920039977830001182A MATERIAIS ELETRICOS 000000000000000000000017003
8
+ 0850001300006U 060000000000000000000000000000000000000000000000000000000000000000000000002000000000000002000000000000000000000000000000001008201510082015 00000000000000000000000 08500000000000000000000
9
+ 08500015 00000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
10
+ 08599999 000001000010000000
@@ -1,26 +1,8 @@
1
- 03300000 2013021784000186999991234567891 007125577 XPTAVARES S.A BANCO SANTANDER (BRASIL) S/A 228042016 000000040
2
- 03308241T01 040 2013021784000186007125577 999991234567891 XPTAVARES S.A 0000000028042016
3
-
4
-
5
- 0330824300001T 02999991234567891 00000000000012 0505201600000000000102503312340 001000033806987840XUNDA 12345678910000000000002610000000000
6
- 0330824300002U 020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002804201628042016000000000000000000000000000 000
7
-
8
- 0330824300003T 02999991234567891 00000000000022 0505201600000000010587703312340 002013021784000186XUNDA 12345678910000000000002610000000000
9
- 0330824300004U 020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002804201628042016000000000000000000000000000 000
10
-
11
- 0330824300005T 02999991234567891 00000000000032 2804201600000000000012603312340 002013021784000186XUNDA 12345678910000000000002610000000000
12
- 0330824300006U 020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002804201628042016000000000000000000000000000 000
13
-
14
- 0330824300007T 02999991234567891 00000000000042 2804201600000000000012703312340 001000033806987840XUNDA 12345678910000000000002610000000000
15
- 0330824300008U 020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002804201628042016000000000000000000000000000 000
16
-
17
- 0330824300009T 06999991234567891 00000000000042 2804201600000000000012700112340 001000033806987840XUNDA 12345678910000000000000000400000000
18
- 0330824300010U 060000000000000000000000000000000000000000000000000000000000000000000000001270000000000001270000000000000000000000000000002804201629042016000000000000000000000000000 000
19
-
20
- 0330824300011T 17999991234567891 00000002896471 2804201600000000000012600112340 002000000000000000 12345678910000000000006000400000000
21
- 0330824300012U 170000000000000000000000000000000000000000000000000000000000000000000000001260000000000001260000000000000000000000000000002804201629042016000000000000000000000000000 000
22
-
23
-
24
-
25
- 03308245 0000120000030000000000010702800000000000000000000000000000000000000000000000000000000000000000000000000001
26
- 03308249 000001000016
1
+ 03300000 2015680668000102316380130028625 007401949 CLIENTE BANCO SANTANDER (BRASIL) S/A 201042016 000034040
2
+ 03396921T01 040 2015680668000102007401949 316380130028625 CLIENTE 0000003401042016
3
+ 0339692300001T 02316380130028625 000000000140620000001406 0104201600000000000100003331638 002000009073504630FULANO SANTOS 01300286250000000000003920000000000
4
+ 0339692300002U 020000000000000000000000000000000000000000000000000000000000000000000000010000000000000010000000000000000000000000000000000104201601042016000000000000000000000000000 000
5
+ 0339692300003T 06316380130028625 000000000140620000001406 0104201600000000000100010422500 002000009073504630FULANO SANTOS 01300286250000000000000000400000000
6
+ 0339692300004U 060000000000000000000000000000000000000000000000000000000000000000000000010000000000000010000000000000000000000000000000000104201604042016000000000000000000000000000 000
7
+ 03396925 0000040000650000000000119047500000000000000000000000000000000000000000000000000000000000000000000000000043
8
+ 03396929 000001000008
@@ -0,0 +1,8 @@
1
+ 74800000 24059955200010204346 0039000000000041468 EMPRESALTDA ME SICREDI 20704201704095100000508101600
2
+ 74800011T01 040 201099955200010304346 0039000000000041468 NAIADE LTDA ME 000000030704201700000000
3
+ 7480001300001T 0200390 0000000041468 172000595 10000000000 13042017000000000000995000 8457 091000044952927838SURFISTAO MEDINA 0000000000000000000000000A4
4
+ 7480001300002U 0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006042017 000000000000000 00000000000000000000000
5
+ 7480001300003T 2800390 0000000041468 172000595 10000000000 13042017000000000000995000 8457 091000044952927838SURFISTAO MEDINA 000000000000000000000038005
6
+ 7480001300004U 280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000604201706042017 000000000000000 00000000000000000000000
7
+ 74800015 00000600000200000000000001990000000000000000000000000000000000000000000000000000000000000000000000
8
+ 74899999 000001000008000000
@@ -0,0 +1,3 @@
1
+ 02RETORNO01COBRANCA 00000000000279998886CONDOMINIO TESTE 070BRB 26072012 26072012 000001
2
+ 10000000000000000 00000000279998886 1078519070150279998886 00526072012 107851907015 2607201200000000264920700902300000000000000000000000000000000000000000000000000000000000000000000000000000000000000002649200000000029440000000000000 02607201200000000000000000000000000000000000000000000000000000 000002
3
+ 9201070 00000000000000000 00028000000552759 000030
@@ -0,0 +1,3 @@
1
+ 02RETORNO01COBRANCA 02170000056911 MARCIO FERREIRA ALMEIDA 004B.DO NORDESTE 19111401600BPI00003 000000 000001
2
+ 1021728474500012202170000056911 000001160000000000 I06191114 00000116 19111400000000175000040217 010000000000260000000000000000000000000000000000000000000000000000000000000000000000000017500000000000000000000000000000000011100000000000000000000000000000000000000000000000000000000 000002
3
+ 9201004 000000000000000002800000000003 000003
@@ -0,0 +1,3 @@
1
+ 02RETORNO01COBRANCA 00000000000004540691NOME DA EMPRESA 041BANRISUL 1505150160000000405 150515 000001
2
+ 102120958700001701102900015096 2283256350 106150515 0000000000000000003025051500000001450000411102 000000000016000000000000000000000000000000000000000000000000000000000000000000000000014500000000000000000000000000000 150515 0000000000 000002
3
+ 9201237 000000130000000036450000000405 00005000000202000000000000000000000000000000000000100000002000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000 000003
@@ -0,0 +1,3 @@
1
+ 02RETORNO01COBRANCA 6901 000403113 RAFHAEL ALAN ALVES PEREIRA 097CENTRALCRED 1006130000001 000001
2
+ 102034939980001000002 000403113 00005005001 00025559162709100000000004500 01101200000050050010040000 150515 00000000010000100000528679945FERNANDO REIS FREIR0000000044400 RUA DOS CAJUEIROS 67 URUPA 78960000JI PARANA RO CLIENTE ESPECIAL 05 000002
3
+ 9 000003
@@ -0,0 +1,54 @@
1
+ 02RETORNO01COBRANCA 073000035110 PLUTO ALTO ELENTAS LTDA ME 033BANCO SANTANDER20051301600BPI00025210513 000001
2
+ 10216733872000107073000035110 00000011 109000000114 I06200513 00000011 000000000000000400003318739 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000002
3
+ 10216733872000107073000035110 00000035 109000000353 I06200513 00000035 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000003
4
+ 10216733872000107073000035110 00000052 109000000528 I06200513 00000052 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000004
5
+ 10216733872000107073000035110 00000107 109000001070 I06200513 00000107 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000005
6
+ 10216733872000107073000035110 00000139 109000001393 I06200513 00000139 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000006
7
+ 10216733872000107073000035110 00000195 109000001955 I06200513 00000195 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000007
8
+ 10216733872000107073000035110 00000267 109000002672 I06200513 00000267 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000008
9
+ 10216733872000107073000035110 00000331 109000003316 I06200513 00000331 000000000000000400003304085 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000009
10
+ 10216733872000107073000035110 00000541 109000005410 I06200513 00000541 000000000000001050003317848 000000000021000000000000000000000000000000000000000000000000000000000000000000000000001029000000000000000000000000000 21051300000000000000000000000 B5000010
11
+ 10216733872000107073000035110 00000890 109000008901 I06200513 00000890 000000000000000400003318754 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000011
12
+ 10216733872000107073000035110 00000956 109000009560 I06200513 00000956 000000000000000750003317848 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000729000000000000000000000000000 21051300000000000000000000000 B5000012
13
+ 10216733872000107073000035110 00000975 109000009750 I06200513 00000975 000000000000000750003317848 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000729000000000000000000000000000 21051300000000000000000000000 B2000013
14
+ 10216733872000107073000035110 00001036 109000010360 I06200513 00001036 000000000000000210034178584 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000189000000000000000000000000000 21051300000000000000000000000 CP000014
15
+ 10216733872000107073000035110 00001052 109000010527 I06200513 00001052 000000000000000840003317848 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000819000000000000000000000000000 21051300000000000000000000000 B5000015
16
+ 10216733872000107073000035110 00001109 109000011095 I06200513 00001109 000000000000000460003336921 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000439000000000000000000000000000 21051300000000000000000000000 B5000016
17
+ 10216733872000107073000035110 00001123 109000011236 I06200513 00001123 000000000000000400003318754 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000017
18
+ 10216733872000107073000035110 00001206 109000012069 I06200513 00001206 000000000000000400003318754 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000018
19
+ 10216733872000107073000035110 00001324 109000013240 I06200513 00001324 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000019
20
+ 10216733872000107073000035110 00001351 109000013513 I06200513 00001351 000000000000000400023729371 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B2000020
21
+ 10216733872000107073000035110 00001372 109000013729 I06200513 00001372 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000021
22
+ 10216733872000107073000035110 00001373 109000013737 I06200513 00001373 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000022
23
+ 10216733872000107073000035110 00001380 109000013802 I06200513 00001380 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000023
24
+ 10216733872000107073000035110 00001458 109000014586 I06200513 00001458 000000000000000400000152480 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000024
25
+ 10216733872000107073000035110 00001498 109000014982 I06200513 00001498 000000000000000400034102899 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 AA000025
26
+ 10216733872000107073000035110 00001698 109000016987 I06200513 00001698 000000000000000191010415552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000 21051300000000000000000000000 B5000026
27
+ 10216733872000107073000035110 00002129 109000021292 I06200513 00002129 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000027
28
+ 10216733872000107073000035110 00002236 109000022365 I06200513 00002236 000000000000000400003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000028
29
+ 10216733872000107073000035110 00002260 109000022605 I06200513 00002260 000000000000000400003336921 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B2000029
30
+ 10216733872000107073000035110 00002274 109000022746 I06200513 00002274 000000000000000400034186686 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 CP000030
31
+ 10216733872000107073000035110 00002286 109000022860 I06200513 00002286 000000000000000400003336921 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000031
32
+ 10216733872000107073000035110 00002311 109000023116 I06200513 00002311 000000000000000400003318770 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000379000000000000000000000000000 21051300000000000000000000000 B5000032
33
+ 10216733872000107073000035110 00002586 109000025863 I06200513 00002586 000000000000000640003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000619000000000000000000000000000 21051300000000000000000000000 B5000033
34
+ 10216733872000107073000035110 00002597 109000025970 I06200513 00002597 000000000000000440000126385 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 B5000034
35
+ 10216733872000107073000035110 00002601 109000026010 I06200513 00002601 000000000000000440003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 B5000035
36
+ 10216733872000107073000035110 00002607 109000026077 I06200513 00002607 000000000000000440003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 B5000036
37
+ 10216733872000107073000035110 00002617 109000026176 I06200513 00002617 000000000000000440000148322 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 B1000037
38
+ 10216733872000107073000035110 00002627 109000026275 I06200513 00002627 000000000000000440000148298 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 B1000038
39
+ 10216733872000107073000035110 00002668 109000026689 I06200513 00002668 000000000000000440023729371 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 B3000039
40
+ 10216733872000107073000035110 00002674 109000026747 I06200513 00002674 000000000000000440003304085 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 B5000040
41
+ 10216733872000107073000035110 00002721 109000027216 I06200513 00002721 000000000000000440003315552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 B5000041
42
+ 10216733872000107073000035110 00003136 109000031366 I06200513 00003136 000000000000000487534148272 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000476700000000001020000000000000 21051300000000000000000000000 CP000042
43
+ 10216733872000107073000035110 00003238 109000032380 I06200513 00003238 000000000000003500000130478 000000000021000000000000000000000000000000000000000000000000000000000000000000000000003479000000000000000000000000000 21051300000000000000000000000 B2000043
44
+ 10216733872000107073000035110 00003344 109000033446 I06200513 00003344 000000000000000440000148298 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 B1000044
45
+ 10216733872000107073000035110 00003391 109000033917 I06200513 00003391 000000000000000440034186132 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000 21051300000000000000000000000 BL000045
46
+ 10216733872000107073000035110 00003456 109000034568 I06200513 00003456 000000000000000571534102899 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000562200000000001170000000000000 21051300000000000000000000000 CP000046
47
+ 10216733872000107073000035110 00003505 109000035052 I06200513 00003505 000000000000000457100148322 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000436100000000000000000000000000 21051300000000000000000000000 B1000047
48
+ 10216733872000107073000035110 00003925 109000039252 I06200513 00003925 000000000000000571034165466 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000561900000000001190000000000000 21051300000000000000000000000 CP000048
49
+ 10216733872000107073000035110 00004012 109000040128 I06200513 00004012 000000000000000500003330783 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000479000000000000000000000000000 21051300000000000000000000000 B5000049
50
+ 10216733872000107073000035110 00004019 109000040193 I06200513 00004019 000000000000000571510415552 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000550500000000000000000000000000 21051300000000000000000000000 B5000050
51
+ 10216733872000107073000035110 00004026 109000040268 I06200513 00004026 000000000000000500039913003 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000479000000000000000000000000000 21051300000000000000000000000 B3000051
52
+ 10216733872000107073000035110 27615123 157276151236 I06200513000000108927615123 100513000000000440034165466 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000428800000000000980000000000000 21051300000000000000000000000DIVA LOUZAMARA DO CASTO BLITTO CP000052
53
+ 10216733872000107073000035110 27714592 157277145922 I09200513000000206827714592 100513000000000400034177099 000000000021000000000000000000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000 00000000000000000000000MIRCALO TIADORO 000053
54
+ 9201341 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 0000003200000000148705 21/05S000250000005200000000268896 000054
@@ -0,0 +1,3 @@
1
+ 02RETORNO01COBRANCA 42056000156620925442CENTRAL DAS COOPERATIVAS DE CR001BANCO DO BRASIL0708131314759 000001
2
+ 100000000000000004205600015662092544221 3408928100000011600000116 506150515 00000000000010000001130515000000004440009042050010000000000160000000000000000000000000000000000000000000000000000000000000000000000000044400000000000000000000000000000001505150000000000000008920000000000000 0000000000000000000000000000000000000000000000000000000002
3
+ 9201001 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 000000000000000000000000000000 000016
@@ -18,7 +18,8 @@ RSpec.describe Brcobranca::Boleto::Base do
18
18
  agencia: '4042',
19
19
  conta_corrente: '61900',
20
20
  convenio: 12_387_989,
21
- numero_documento: '777700168'
21
+ nosso_numero: '777700168',
22
+ documento_numero: '9999999'
22
23
  }
23
24
  end
24
25
 
@@ -27,7 +28,7 @@ RSpec.describe Brcobranca::Boleto::Base do
27
28
  expect(boleto_novo.especie_documento).to eql('DM')
28
29
  expect(boleto_novo.especie).to eql('R$')
29
30
  expect(boleto_novo.moeda).to eql('9')
30
- expect(boleto_novo.data_documento).to eql(Date.current)
31
+ expect(boleto_novo.data_processamento).to eql(Date.current)
31
32
  expect(boleto_novo.data_vencimento).to eql(Date.current)
32
33
  expect(boleto_novo.aceite).to eql('S')
33
34
  expect(boleto_novo.quantidade).to be(1)
@@ -42,7 +43,7 @@ RSpec.describe Brcobranca::Boleto::Base do
42
43
  expect(boleto_novo.especie_documento).to eql('DM')
43
44
  expect(boleto_novo.especie).to eql('R$')
44
45
  expect(boleto_novo.moeda).to eql('9')
45
- expect(boleto_novo.data_documento).to eql(Date.current)
46
+ expect(boleto_novo.data_processamento).to eql(Date.current)
46
47
  expect(boleto_novo.data_vencimento).to eql(Date.current)
47
48
  expect(boleto_novo.aceite).to eql('S')
48
49
  expect(boleto_novo.quantidade).to be(1)
@@ -56,7 +57,8 @@ RSpec.describe Brcobranca::Boleto::Base do
56
57
  expect(boleto_novo.conta_corrente).to eql('0061900')
57
58
  expect(boleto_novo.agencia).to eql('4042')
58
59
  expect(boleto_novo.convenio).to be(12_387_989)
59
- expect(boleto_novo.numero_documento).to eql('777700168')
60
+ expect(boleto_novo.nosso_numero).to eql('777700168')
61
+ expect(boleto_novo.documento_numero).to eql('9999999')
60
62
  expect(boleto_novo.valid?).to be_truthy
61
63
  end
62
64
 
@@ -14,7 +14,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
14
14
  agencia: '4042',
15
15
  conta_corrente: '61900',
16
16
  convenio: 12_387_989,
17
- numero_documento: '777700168'
17
+ nosso_numero: '777700168'
18
18
  }
19
19
  end
20
20
 
@@ -24,7 +24,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
24
24
  expect(boleto_novo.especie_documento).to eql('DM')
25
25
  expect(boleto_novo.especie).to eql('R$')
26
26
  expect(boleto_novo.moeda).to eql('9')
27
- expect(boleto_novo.data_documento).to eql(Date.current)
27
+ expect(boleto_novo.data_processamento).to eql(Date.current)
28
28
  expect(boleto_novo.data_vencimento).to eql(Date.current)
29
29
  expect(boleto_novo.aceite).to eql('S')
30
30
  expect(boleto_novo.quantidade).to be(1)
@@ -41,7 +41,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
41
41
  expect(boleto_novo.especie_documento).to eql('DM')
42
42
  expect(boleto_novo.especie).to eql('R$')
43
43
  expect(boleto_novo.moeda).to eql('9')
44
- expect(boleto_novo.data_documento).to eql(Date.current)
44
+ expect(boleto_novo.data_processamento).to eql(Date.current)
45
45
  expect(boleto_novo.data_vencimento).to eql(Date.current)
46
46
  expect(boleto_novo.aceite).to eql('S')
47
47
  expect(boleto_novo.quantidade).to be(1)
@@ -55,7 +55,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
55
55
  expect(boleto_novo.conta_corrente).to eql('00061900')
56
56
  expect(boleto_novo.agencia).to eql('4042')
57
57
  expect(boleto_novo.convenio).to be(12_387_989)
58
- expect(boleto_novo.numero_documento).to eql('777700168')
58
+ expect(boleto_novo.nosso_numero).to eql('777700168')
59
59
  expect(boleto_novo.carteira).to eql('18')
60
60
  expect(boleto_novo.codigo_servico).to be_falsey
61
61
  end
@@ -73,7 +73,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
73
73
  expect(boleto_novo.nosso_numero_dv).to be(7)
74
74
 
75
75
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-02')
76
- @valid_attributes[:numero_documento] = '7700168'
76
+ @valid_attributes[:nosso_numero] = '7700168'
77
77
  boleto_novo = described_class.new(@valid_attributes)
78
78
 
79
79
  expect(boleto_novo.codigo_barras_segunda_parte).to eql('0000001238798900770016818')
@@ -88,7 +88,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
88
88
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
89
89
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-03')
90
90
  @valid_attributes[:convenio] = 1_238_798
91
- @valid_attributes[:numero_documento] = '7777700168'
91
+ @valid_attributes[:nosso_numero] = '7777700168'
92
92
  boleto_novo = described_class.new(@valid_attributes)
93
93
 
94
94
  expect(boleto_novo.codigo_barras_segunda_parte).to eql('0000001238798777770016818')
@@ -100,7 +100,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
100
100
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
101
101
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-03')
102
102
  @valid_attributes[:convenio] = 1_238_798
103
- @valid_attributes[:numero_documento] = '7777700168'
103
+ @valid_attributes[:nosso_numero] = '7777700168'
104
104
  boleto_novo = described_class.new(@valid_attributes)
105
105
 
106
106
  expect(boleto_novo.codigo_barras_segunda_parte).to eql('0000001238798777770016818')
@@ -112,7 +112,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
112
112
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
113
113
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-01')
114
114
  @valid_attributes[:convenio] = 1_238_798
115
- @valid_attributes[:numero_documento] = '7777700168'
115
+ @valid_attributes[:nosso_numero] = '7777700168'
116
116
  boleto_novo = described_class.new(@valid_attributes)
117
117
 
118
118
  expect(boleto_novo.codigo_barras_segunda_parte).to eql('0000001238798777770016818')
@@ -126,7 +126,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
126
126
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
127
127
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-01')
128
128
  @valid_attributes[:convenio] = 123_879
129
- @valid_attributes[:numero_documento] = '1234'
129
+ @valid_attributes[:nosso_numero] = '1234'
130
130
  boleto_novo = described_class.new(@valid_attributes)
131
131
 
132
132
  expect(boleto_novo.conta_corrente_dv).to be(0)
@@ -140,7 +140,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
140
140
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
141
141
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-01')
142
142
  @valid_attributes[:convenio] = 123_879
143
- @valid_attributes[:numero_documento] = '1234567899'
143
+ @valid_attributes[:nosso_numero] = '1234567899'
144
144
  @valid_attributes[:carteira] = '16'
145
145
  @valid_attributes[:codigo_servico] = true
146
146
  boleto_novo = described_class.new(@valid_attributes)
@@ -156,7 +156,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
156
156
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
157
157
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-01')
158
158
  @valid_attributes[:convenio] = 123_879
159
- @valid_attributes[:numero_documento] = '1234567899'
159
+ @valid_attributes[:nosso_numero] = '1234567899'
160
160
  @valid_attributes[:carteira] = '18'
161
161
  @valid_attributes[:codigo_servico] = true
162
162
  boleto_novo = described_class.new(@valid_attributes)
@@ -172,7 +172,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
172
172
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
173
173
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-01')
174
174
  @valid_attributes[:convenio] = 123_879
175
- @valid_attributes[:numero_documento] = '1234567899'
175
+ @valid_attributes[:nosso_numero] = '1234567899'
176
176
  @valid_attributes[:carteira] = '17'
177
177
  @valid_attributes[:codigo_servico] = true
178
178
  boleto_novo = described_class.new(@valid_attributes)
@@ -187,7 +187,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
187
187
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
188
188
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-01')
189
189
  @valid_attributes[:convenio] = 1238
190
- @valid_attributes[:numero_documento] = '123456'
190
+ @valid_attributes[:nosso_numero] = '123456'
191
191
  @valid_attributes[:codigo_servico] = true
192
192
  boleto_novo = described_class.new(@valid_attributes)
193
193
 
@@ -208,7 +208,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
208
208
  agencia: '3174',
209
209
  conta_corrente: '00011672',
210
210
  convenio: 1_474_166,
211
- numero_documento: '0000000328',
211
+ nosso_numero: '0000000328',
212
212
  carteira: '17',
213
213
  data_documento: Date.parse('2016-07-05'),
214
214
  data_vencimento: Date.parse('2016-07-05')
@@ -259,22 +259,22 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
259
259
 
260
260
  it 'Montar nosso_numero_boleto' do
261
261
  boleto_novo = described_class.new(@valid_attributes)
262
- boleto_novo.numero_documento = '4042'
262
+ boleto_novo.nosso_numero = '4042'
263
263
  expect(boleto_novo.nosso_numero_boleto).to eql('12387989000004042')
264
264
  expect(boleto_novo.nosso_numero_dv).to be(4)
265
- boleto_novo.numero_documento = '61900'
265
+ boleto_novo.nosso_numero = '61900'
266
266
  expect(boleto_novo.nosso_numero_boleto).to eql('12387989000061900')
267
267
  expect(boleto_novo.nosso_numero_dv).to be(7)
268
- boleto_novo.numero_documento = '0719'
268
+ boleto_novo.nosso_numero = '0719'
269
269
  expect(boleto_novo.nosso_numero_boleto).to eql('12387989000000719')
270
270
  expect(boleto_novo.nosso_numero_dv).to be(2)
271
- boleto_novo.numero_documento = 4042
271
+ boleto_novo.nosso_numero = 4042
272
272
  expect(boleto_novo.nosso_numero_boleto).to eql('12387989000004042')
273
273
  expect(boleto_novo.nosso_numero_dv).to be(4)
274
- boleto_novo.numero_documento = 61_900
274
+ boleto_novo.nosso_numero = 61_900
275
275
  expect(boleto_novo.nosso_numero_boleto).to eql('12387989000061900')
276
276
  expect(boleto_novo.nosso_numero_dv).to be(7)
277
- boleto_novo.numero_documento = 719
277
+ boleto_novo.nosso_numero = 719
278
278
  expect(boleto_novo.nosso_numero_boleto).to eql('12387989000000719')
279
279
  expect(boleto_novo.nosso_numero_dv).to be(2)
280
280
  end
@@ -299,7 +299,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
299
299
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
300
300
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-03')
301
301
  @valid_attributes[:convenio] = 1_238_798
302
- @valid_attributes[:numero_documento] = '7777700168'
302
+ @valid_attributes[:nosso_numero] = '7777700168'
303
303
  boleto_novo = described_class.new(@valid_attributes)
304
304
  %w(pdf jpg tif png).each do |format|
305
305
  file_body = boleto_novo.send("to_#{format}".to_sym)
@@ -318,7 +318,7 @@ RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
318
318
  @valid_attributes[:data_documento] = Date.parse('2008-02-01')
319
319
  @valid_attributes[:data_vencimento] = Date.parse('2008-02-03')
320
320
  @valid_attributes[:convenio] = 1_238_798
321
- @valid_attributes[:numero_documento] = '7777700168'
321
+ @valid_attributes[:nosso_numero] = '7777700168'
322
322
  boleto_novo = described_class.new(@valid_attributes)
323
323
  %w(pdf jpg tif png).each do |format|
324
324
  file_body = boleto_novo.to(format)
@@ -0,0 +1,134 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ RSpec.describe Brcobranca::Boleto::BancoBrasilia do #:nodoc:[all]
5
+ before do
6
+ @valid_attributes = {
7
+ valor: 10.00,
8
+ cedente: 'PREFEITURA MUNICIPAL DE VILHENA',
9
+ documento_cedente: '04092706000181',
10
+ sacado: 'João Paulo Barbosa',
11
+ sacado_documento: '77777777777',
12
+ agencia: '082',
13
+ conta_corrente: '0000528',
14
+ convenio: '0000528',
15
+ nosso_numero: '000001'
16
+ }
17
+ end
18
+
19
+ it 'Criar nova instância com atributos padrões' do
20
+ boleto_novo = described_class.new
21
+ expect(boleto_novo.banco).to eql('070')
22
+ expect(boleto_novo.especie_documento).to eql('DM')
23
+ expect(boleto_novo.especie).to eql('R$')
24
+ expect(boleto_novo.moeda).to eql('9')
25
+ expect(boleto_novo.data_processamento).to eql(Date.current)
26
+ expect(boleto_novo.data_vencimento).to eql(Date.current)
27
+ expect(boleto_novo.aceite).to eql('S')
28
+ expect(boleto_novo.quantidade).to eql(1)
29
+ expect(boleto_novo.valor).to eql(0.0)
30
+ expect(boleto_novo.valor_documento).to eql(0.0)
31
+ expect(boleto_novo.local_pagamento).to eql('PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO')
32
+ expect(boleto_novo.codigo_servico).to be_falsey
33
+ expect(boleto_novo.carteira).to eql('2')
34
+ end
35
+
36
+ it 'Criar nova instancia com atributos válidos' do
37
+ boleto_novo = described_class.new @valid_attributes
38
+ @valid_attributes.keys.each do |key|
39
+ expect(boleto_novo.send(key)).to eql(@valid_attributes[key])
40
+ end
41
+ expect(boleto_novo).to be_valid
42
+ end
43
+
44
+ it 'Gerar o dígito verificador do convênio' do
45
+ boleto_novo = described_class.new @valid_attributes
46
+ expect(boleto_novo.convenio_dv).not_to be_nil
47
+ expect(boleto_novo.convenio_dv).to eq('2')
48
+ end
49
+
50
+ it 'Gerar o código de barras' do
51
+ @valid_attributes[:data_documento] = Date.parse('2015-04-30')
52
+ @valid_attributes[:data_vencimento] = Date.parse('2015-04-30')
53
+
54
+ boleto_novo = described_class.new @valid_attributes
55
+
56
+ expect { boleto_novo.codigo_barras }.not_to raise_error
57
+ expect(boleto_novo.codigo_barras_segunda_parte).not_to be_blank
58
+ expect(boleto_novo.codigo_barras_segunda_parte).to eql('0000820000528200000107013')
59
+ expect(boleto_novo.codigo_barras.linha_digitavel).to eql('07090.00087 20000.528206 00001.070135 9 64140000001000')
60
+ end
61
+
62
+ it 'Não permitir gerar boleto com atributos inválidos' do
63
+ boleto_novo = described_class.new
64
+ expect { boleto_novo.codigo_barras }.to raise_error(Brcobranca::BoletoInvalido)
65
+ end
66
+
67
+ it 'Tamanho do número da agência deve ser de 3 dígitos' do
68
+ boleto_novo = described_class.new @valid_attributes.merge(agencia: "80")
69
+ expect(boleto_novo.agencia).to eq('080')
70
+
71
+ boleto_novo = described_class.new @valid_attributes.merge(agencia: "0080")
72
+ expect(boleto_novo.agencia).to eq('080')
73
+ end
74
+
75
+ it 'Tamanho do número de convênio deve ser de 7 dígitos' do
76
+ boleto_novo = described_class.new @valid_attributes.merge(convenio: '12345678')
77
+ expect(boleto_novo).not_to be_valid
78
+ end
79
+
80
+ it 'Número do convênio deve ser preenchido com zeros à esquerda quando menor que 7 dígitos' do
81
+ boleto_novo = described_class.new @valid_attributes.merge(convenio: '12345')
82
+ expect(boleto_novo.convenio).to eq('0012345')
83
+ expect(boleto_novo).to be_valid
84
+ end
85
+
86
+ it 'Tamanho da carteira deve ser de 1 dígitos' do
87
+ boleto_novo = described_class.new @valid_attributes.merge(carteira: '145')
88
+ expect(boleto_novo).not_to be_valid
89
+
90
+ boleto_novo = described_class.new @valid_attributes.merge(carteira: '24')
91
+ expect(boleto_novo).not_to be_valid
92
+ end
93
+
94
+ it 'Tamanho do número documento deve ser de 6 dígitos' do
95
+ boleto_novo = described_class.new @valid_attributes.merge(nosso_numero: '1234567')
96
+ expect(boleto_novo).not_to be_valid
97
+ end
98
+
99
+ it 'Número do documento deve ser preenchido com zeros à esquerda quando menor que 6 dígitos' do
100
+ boleto_novo = described_class.new @valid_attributes.merge(nosso_numero: '1')
101
+ expect(boleto_novo.nosso_numero).to eq('000001')
102
+ expect(boleto_novo).to be_valid
103
+ end
104
+
105
+ it 'Montar nosso_numero_boleto' do
106
+ boleto_novo = described_class.new @valid_attributes
107
+ expect(boleto_novo.nosso_numero_boleto).to eq('200000000001-0')
108
+ end
109
+
110
+ it 'Montar agencia_conta_boleto' do
111
+ boleto_novo = described_class.new(@valid_attributes)
112
+
113
+ expect(boleto_novo.agencia_conta_boleto).to eql('082/0000528-2')
114
+
115
+ boleto_novo.convenio = '123456'
116
+ expect(boleto_novo.agencia_conta_boleto).to eql('082/0123456-0')
117
+
118
+ boleto_novo.agencia = '030'
119
+ boleto_novo.convenio = '654321'
120
+ expect(boleto_novo.agencia_conta_boleto).to eql('030/0654321-9')
121
+ end
122
+
123
+ describe 'Busca logotipo do banco' do
124
+ it_behaves_like 'busca_logotipo'
125
+ end
126
+
127
+ describe 'Formato do boleto' do
128
+ before do
129
+ @valid_attributes[:nosso_numero] = '000168'
130
+ end
131
+
132
+ it_behaves_like 'formatos_validos'
133
+ end
134
+ end