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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.markdown +23 -17
- data/lib/br_boleto.rb +2 -0
- data/lib/br_boleto/boleto/banco_brasil.rb +24 -15
- data/lib/br_boleto/boleto/santander.rb +8 -2
- data/lib/br_boleto/conta/banco_brasil.rb +254 -56
- data/lib/br_boleto/conta/bradesco.rb +229 -27
- data/lib/br_boleto/conta/caixa.rb +208 -4
- data/lib/br_boleto/conta/cecred.rb +29 -0
- data/lib/br_boleto/conta/itau.rb +482 -87
- data/lib/br_boleto/conta/santander.rb +224 -97
- data/lib/br_boleto/conta/sicoob.rb +39 -24
- data/lib/br_boleto/conta/sicredi.rb +169 -64
- data/lib/br_boleto/conta/unicred.rb +16 -13
- data/lib/br_boleto/helper/default_codes.rb +2123 -54
- data/lib/br_boleto/remessa/cnab240/banco_brasil.rb +12 -6
- data/lib/br_boleto/remessa/cnab240/bradesco.rb +1 -1
- data/lib/br_boleto/remessa/cnab240/helper/segmento_p.rb +1 -1
- data/lib/br_boleto/remessa/cnab240/itau.rb +20 -3
- data/lib/br_boleto/remessa/cnab240/santander.rb +25 -24
- data/lib/br_boleto/remessa/cnab400/caixa.rb +197 -0
- data/lib/br_boleto/remessa/cnab400/santander.rb +32 -27
- data/lib/br_boleto/retorno/base.rb +24 -0
- data/lib/br_boleto/retorno/cnab240/base.rb +6 -2
- data/lib/br_boleto/retorno/cnab240/santander.rb +5 -1
- data/lib/br_boleto/retorno/cnab400/banco_brasil.rb +3 -1
- data/lib/br_boleto/retorno/cnab400/base.rb +2 -1
- data/lib/br_boleto/retorno/cnab400/bradesco.rb +6 -0
- data/lib/br_boleto/retorno/cnab400/caixa.rb +49 -0
- data/lib/br_boleto/retorno/cnab400/itau.rb +5 -1
- data/lib/br_boleto/retorno/cnab400/santander.rb +5 -1
- data/lib/br_boleto/retorno/cnab400/sicoob.rb +1 -0
- data/lib/br_boleto/retorno/cnab400/sicredi.rb +6 -0
- data/lib/br_boleto/retorno/pagamento.rb +50 -4
- data/lib/br_boleto/version.rb +1 -1
- data/test/br_boleto/boleto/santander_test.rb +1 -1
- data/test/br_boleto/boleto/sicredi_test.rb +1 -0
- data/test/br_boleto/conta/banco_brasil_test.rb +157 -0
- data/test/br_boleto/conta/base_test.rb +8 -8
- data/test/br_boleto/conta/bradesco_test.rb +165 -0
- data/test/br_boleto/conta/caixa_test.rb +159 -1
- data/test/br_boleto/conta/cecred_test.rb +22 -0
- data/test/br_boleto/conta/itau_test.rb +346 -3
- data/test/br_boleto/conta/santantader_test.rb +123 -10
- data/test/br_boleto/conta/sicoob_test.rb +8 -0
- data/test/br_boleto/conta/sicredi_test.rb +79 -0
- data/test/br_boleto/conta/unicred_test.rb +7 -7
- data/test/br_boleto/remessa/cnab240/itau_test.rb +1 -1
- data/test/br_boleto/remessa/cnab400/caixa_test.rb +184 -0
- data/test/br_boleto/remessa/cnab400/santander_test.rb +30 -17
- data/test/br_boleto/retorno/cnab240/banco_brasil_test.rb +30 -6
- data/test/br_boleto/retorno/cnab240/base_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/bradesco_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/caixa_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/cecred_test.rb +15 -3
- data/test/br_boleto/retorno/cnab240/itau_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/santander_test.rb +30 -6
- data/test/br_boleto/retorno/cnab240/sicoob_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/sicredi_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/unicred_test.rb +25 -5
- data/test/br_boleto/retorno/cnab400/bradesco_test.rb +30 -6
- data/test/br_boleto/retorno/cnab400/caixa_test.rb +7 -0
- data/test/br_boleto/retorno/cnab400/itau_test.rb +14 -4
- data/test/br_boleto/retorno/cnab400/sicoob_test.rb +25 -5
- data/test/br_boleto/retorno/cnab400/sicredi_test.rb +10 -2
- data/test/br_boleto/retorno/cnab400/unicred.rb +30 -6
- data/test/br_boleto/retorno/pagamento_test.rb +49 -1
- data/test/factories/remessa/cnab400/caixa.rb +8 -0
- data/test/fixtures/retorno/cnab240/santander.ret +1 -1
- metadata +10 -2
@@ -193,23 +193,24 @@ describe BrBoleto::Conta::Santander do
|
|
193
193
|
end
|
194
194
|
|
195
195
|
describe "#get_tipo_cobranca" do
|
196
|
-
context "CÓDIGOS para o cnab
|
197
|
-
it { subject.get_tipo_cobranca('1',
|
198
|
-
it { subject.get_tipo_cobranca('
|
199
|
-
it { subject.get_tipo_cobranca('
|
200
|
-
it { subject.get_tipo_cobranca('
|
201
|
-
it { subject.get_tipo_cobranca('
|
202
|
-
it { subject.get_tipo_cobranca('6', 400).must_equal '6' } # CAUCIONADA RAPIDA
|
196
|
+
context "CÓDIGOS para o cnab 240 do Santander" do
|
197
|
+
it { subject.get_tipo_cobranca('1', 240).must_equal '5' } # Cobrança Simples (Rápida com Registro)
|
198
|
+
it { subject.get_tipo_cobranca('3', 240).must_equal '3' } # Cobrança Caucionada (Eletrônica com Registro e Convencional com Registro)
|
199
|
+
it { subject.get_tipo_cobranca('4', 240).must_equal '4' } # Cobrança Descontada (Eletrônica com Registro)
|
200
|
+
it { subject.get_tipo_cobranca('6', 240).must_equal '6' } # Cobrança Caucionada (Rápida com Registro)
|
201
|
+
it { subject.get_tipo_cobranca('7', 240).must_equal '1' } # Cobrança Simples (Sem Registro / Eletrônica com Registro)
|
203
202
|
end
|
204
203
|
|
205
|
-
context "CÓDIGOS para o cnab
|
206
|
-
it { subject.get_tipo_cobranca('
|
204
|
+
context "CÓDIGOS para o cnab 400 do Santander" do
|
205
|
+
it { subject.get_tipo_cobranca('7', 400).must_equal '4' } # Cobrança Sem Registro
|
206
|
+
it { subject.get_tipo_cobranca('4', 400).must_equal '7' } # Cobrança Descontada
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
210
|
describe "#get_codigo_protesto" do
|
211
211
|
context "CÓDIGOS para o Santander" do
|
212
|
-
it { subject.get_codigo_protesto('
|
212
|
+
it { subject.get_codigo_protesto('3', 240).must_equal '0' } # Não Protestar
|
213
|
+
it { subject.get_codigo_protesto('99', 240).must_equal '3' } # Utilizar perfil cedente
|
213
214
|
end
|
214
215
|
end
|
215
216
|
|
@@ -219,4 +220,116 @@ describe BrBoleto::Conta::Santander do
|
|
219
220
|
end
|
220
221
|
end
|
221
222
|
|
223
|
+
describe "#get_codigo_movimento_retorno" do
|
224
|
+
context "CÓDIGOS para o Santander CNAB 400" do
|
225
|
+
it { subject.get_codigo_movimento_retorno('01', 400).must_equal '104' } # título não existe
|
226
|
+
it { subject.get_codigo_movimento_retorno('07', 400).must_equal '102' } # liquidação por conta
|
227
|
+
it { subject.get_codigo_movimento_retorno('08', 400).must_equal '103' } # liquidação por saldo
|
228
|
+
it { subject.get_codigo_movimento_retorno('15', 400).must_equal '23' } # Enviado para Cartório
|
229
|
+
it { subject.get_codigo_movimento_retorno('16', 400).must_equal '25' } # tít. já baixado/liquidado
|
230
|
+
it { subject.get_codigo_movimento_retorno('17', 400).must_equal '101' } # liquidado em cartório
|
231
|
+
it { subject.get_codigo_movimento_retorno('21', 400).must_equal '23' } # Entrada em Cartório
|
232
|
+
it { subject.get_codigo_movimento_retorno('22', 400).must_equal '24' } # Retirado de cartório
|
233
|
+
it { subject.get_codigo_movimento_retorno('24', 400).must_equal '235' } # Custas de Cartório
|
234
|
+
it { subject.get_codigo_movimento_retorno('25', 400).must_equal '19' } # Protestar Título
|
235
|
+
it { subject.get_codigo_movimento_retorno('26', 400).must_equal '20' } # Sustar Protestonhado a Protesto: Identifica o recebimento da instrução de protesto
|
236
|
+
end
|
237
|
+
end
|
238
|
+
describe "#get_codigo_motivo_ocorrencia" do
|
239
|
+
context "CÓDIGOS motivo ocorrência A para o Santander CNAB 400" do
|
240
|
+
it { subject.get_codigo_motivo_ocorrencia('01', '02', 400).must_equal 'A01' } # Código do banco inválido
|
241
|
+
|
242
|
+
it { subject.get_codigo_motivo_ocorrencia('001', '02', 400).must_equal 'A08' } # NOSSO NUMERO NAO NUMERICO
|
243
|
+
it { subject.get_codigo_motivo_ocorrencia('002', '03', 400).must_equal 'A33' } # VALOR DO ABATIMENTO NAO NUMERICO
|
244
|
+
it { subject.get_codigo_motivo_ocorrencia('003', '26', 400).must_equal 'A16' } # DATA VENCIMENTO NAO NUMERICA
|
245
|
+
it { subject.get_codigo_motivo_ocorrencia('005', '30', 400).must_equal 'A10' } # CODIGO DA CARTEIRA NAO NUMERICO
|
246
|
+
it { subject.get_codigo_motivo_ocorrencia('006', '02', 400).must_equal 'A10' } # CODIGO DA CARTEIRA INVALIDO
|
247
|
+
it { subject.get_codigo_motivo_ocorrencia('007', '03', 400).must_equal 'A21' } # ESPECIE DO DOCUMENTO INVALIDA
|
248
|
+
it { subject.get_codigo_motivo_ocorrencia('010', '26', 400).must_equal 'A278' } # CODIGO PRIMEIRA INSTRUCAO NAO NUMERICA
|
249
|
+
it { subject.get_codigo_motivo_ocorrencia('011', '30', 400).must_equal 'A280' } # CODIGO SEGUNDA INSTRUCAO NAO NUMERICA
|
250
|
+
it { subject.get_codigo_motivo_ocorrencia('013', '02', 400).must_equal 'A20' } # VALOR DO TITULO NAO NUMERICO
|
251
|
+
it { subject.get_codigo_motivo_ocorrencia('014', '03', 400).must_equal 'A27' } # VALOR DE MORA NAO NUMERICO
|
252
|
+
it { subject.get_codigo_motivo_ocorrencia('015', '26', 400).must_equal 'A24' } # DATA EMISSAO NAO NUMERICA
|
253
|
+
it { subject.get_codigo_motivo_ocorrencia('016', '30', 400).must_equal 'A16' } # DATA DE VENCIMENTO INVALIDA
|
254
|
+
it { subject.get_codigo_motivo_ocorrencia('017', '02', 400).must_equal 'A61' } # CODIGO DA AGENCIA COBRADORA NAO NUMERICA
|
255
|
+
it { subject.get_codigo_motivo_ocorrencia('019', '03', 400).must_equal 'A48' } # NUMERO DO CEP NAO NUMERICO
|
256
|
+
it { subject.get_codigo_motivo_ocorrencia('020', '26', 400).must_equal 'A46' } # TIPO INSCRICAO NAO NUMERICO
|
257
|
+
it { subject.get_codigo_motivo_ocorrencia('021', '30', 400).must_equal 'A46' } # NUMERO DO CGC OU CPF NAO NUMERICO
|
258
|
+
it { subject.get_codigo_motivo_ocorrencia('022', '02', 400).must_equal 'A244' } # CODIGO OCORRENCIA INVALIDO
|
259
|
+
it { subject.get_codigo_motivo_ocorrencia('023', '03', 400).must_equal 'A08' } # NOSSO NUMERO INV.P/MODALIDADE
|
260
|
+
it { subject.get_codigo_motivo_ocorrencia('025', '26', 400).must_equal 'A28' } # VALOR DESCONTO NAO NUMERICO
|
261
|
+
it { subject.get_codigo_motivo_ocorrencia('029', '30', 400).must_equal 'A27' } # VALOR DE MORA INVALIDO
|
262
|
+
it { subject.get_codigo_motivo_ocorrencia('030', '02', 400).must_equal 'A256' } # DT VENC MENOR DE 15 DIAS DA DT PROCES
|
263
|
+
it { subject.get_codigo_motivo_ocorrencia('039', '03', 400).must_equal 'A254' } # PERFIL NAO ACEITA TITULO EM BCO CORRESP
|
264
|
+
it { subject.get_codigo_motivo_ocorrencia('040', '26', 400).must_equal 'A255' } # COBR RAPIDA NAO ACEITA-SE BCO CORRESP
|
265
|
+
it { subject.get_codigo_motivo_ocorrencia('042', '30', 400).must_equal 'A07' } # CONTA COBRANCA INVALIDA
|
266
|
+
it { subject.get_codigo_motivo_ocorrencia('049', '02', 400).must_equal 'A86' } # SEU NUMERO NAO CONFERE COM O CARNE
|
267
|
+
it { subject.get_codigo_motivo_ocorrencia('052', '03', 400).must_equal 'A227' } # OCOR. NAO ACATADA,TITULO LIOUIDADO
|
268
|
+
it { subject.get_codigo_motivo_ocorrencia('053', '26', 400).must_equal 'A227' } # OCOR. NAO ACATADA, TITULO BAIXADO
|
269
|
+
it { subject.get_codigo_motivo_ocorrencia('057', '30', 400).must_equal 'A322' } # CEP DO SACADO INCORRETO
|
270
|
+
it { subject.get_codigo_motivo_ocorrencia('058', '02', 400).must_equal 'A06' } # CGC/CPF INCORRETO
|
271
|
+
it { subject.get_codigo_motivo_ocorrencia('063', '03', 400).must_equal 'A49' } # CEP NAO ENCONTRADO NA TABELA DE PRACAS
|
272
|
+
it { subject.get_codigo_motivo_ocorrencia('073', '26', 400).must_equal 'A34' } # ABATIMENTO MAIOR/IGUAL AO VALOR TITULO
|
273
|
+
it { subject.get_codigo_motivo_ocorrencia('074', '30', 400).must_equal 'A29' } # PRIM. DESCONTO MAIOR/IGUAL VALOR TITULO
|
274
|
+
it { subject.get_codigo_motivo_ocorrencia('075', '02', 400).must_equal 'A29' } # SEG. DESCONTO MAIOR/IGUAL VALOR TITULO
|
275
|
+
it { subject.get_codigo_motivo_ocorrencia('076', '03', 400).must_equal 'A29' } # TERC. DESCONTO MAIOR/IGUAL VALOR TITULO
|
276
|
+
it { subject.get_codigo_motivo_ocorrencia('086', '26', 400).must_equal 'A80' } # DATA SEGUNDO DESCONTO INVALIDA
|
277
|
+
it { subject.get_codigo_motivo_ocorrencia('087', '30', 400).must_equal 'A80' } # DATA TERCEIRO DESCONTO INVALIDA
|
278
|
+
it { subject.get_codigo_motivo_ocorrencia('091', '02', 400).must_equal 'A31' } # JA EXISTE CONCESSAO DE DESCONTO
|
279
|
+
it { subject.get_codigo_motivo_ocorrencia('092', '03', 400).must_equal 'A09' } # NOSSO NUMERO JA CADASTRADO
|
280
|
+
it { subject.get_codigo_motivo_ocorrencia('093', '26', 400).must_equal 'A20' } # VALOR DO TITULO NAO INFORMADO
|
281
|
+
it { subject.get_codigo_motivo_ocorrencia('098', '30', 400).must_equal 'A24' } # DATA EMISSAO INVALIDA
|
282
|
+
it { subject.get_codigo_motivo_ocorrencia('100', '02', 400).must_equal 'A17' } # DATA EMISSAO MAIOR OUE A DATA VENCIMENTO
|
283
|
+
it { subject.get_codigo_motivo_ocorrencia('104', '03', 400).must_equal 'A52' } # UNIDADE DA FEDERACAO NAO INFORMADA
|
284
|
+
it { subject.get_codigo_motivo_ocorrencia('106', '26', 400).must_equal 'A06' } # CGCICPF NAO INFORMADO
|
285
|
+
it { subject.get_codigo_motivo_ocorrencia('107', '30', 400).must_equal 'A52' } # UNIDADE DA FEDERACAO INCORRETA 00108 DIGITO CGC/CPF INCORRETO
|
286
|
+
it { subject.get_codigo_motivo_ocorrencia('110', '02', 400).must_equal 'A80' } # DATA PRIMEIRO DESCONTO INVALIDA
|
287
|
+
it { subject.get_codigo_motivo_ocorrencia('111', '02', 400).must_equal 'A80' } # DATA DESCONTO NAO NUMERICA
|
288
|
+
it { subject.get_codigo_motivo_ocorrencia('112', '03', 400).must_equal 'A28' } # VALOR DESCONTO NAO INFORMADO
|
289
|
+
it { subject.get_codigo_motivo_ocorrencia('113', '26', 400).must_equal 'A28' } # VALOR DESCONTO INVALIDO
|
290
|
+
it { subject.get_codigo_motivo_ocorrencia('114', '30', 400).must_equal 'A33' } # VALOR ABATIMENTO NAO INFORMADO
|
291
|
+
it { subject.get_codigo_motivo_ocorrencia('115', '02', 400).must_equal 'A34' } # VALOR ABATIMENTO MAIOR VALOR TITULO
|
292
|
+
it { subject.get_codigo_motivo_ocorrencia('116', '03', 400).must_equal 'A58' } # DATA MULTA NAO NUMERICA
|
293
|
+
it { subject.get_codigo_motivo_ocorrencia('117', '26', 400).must_equal 'A29' } # VALOR DESCONTO MAIOR VALOR TITULO
|
294
|
+
it { subject.get_codigo_motivo_ocorrencia('118', '30', 400).must_equal 'A58' } # DATA MULTA NAO INFORMADA
|
295
|
+
it { subject.get_codigo_motivo_ocorrencia('120', '02', 400).must_equal 'A59' } # PERCENTUAL MULTA NAO NUMERICO
|
296
|
+
it { subject.get_codigo_motivo_ocorrencia('121', '03', 400).must_equal 'A59' } # PERCENTUAL MULTA NAO INFORMADO
|
297
|
+
it { subject.get_codigo_motivo_ocorrencia('122', '26', 400).must_equal 'A32' } # VALOR IOF MAIOR OUE VALOR TITULO
|
298
|
+
it { subject.get_codigo_motivo_ocorrencia('123', '30', 400).must_equal 'A322' } # CEP DO SACADO NAO NUMERICO
|
299
|
+
it { subject.get_codigo_motivo_ocorrencia('124', '02', 400).must_equal 'A48' } # CEP SACADO NAO ENCONTRADO
|
300
|
+
it { subject.get_codigo_motivo_ocorrencia('129', '03', 400).must_equal 'A21' } # ESPEC DE DOCUMENTO NAO NUMERICA
|
301
|
+
it { subject.get_codigo_motivo_ocorrencia('130', '26', 400).must_equal 'A11' } # FORMA DE CADASTRAMENTO NAO NUMERICA
|
302
|
+
it { subject.get_codigo_motivo_ocorrencia('131', '30', 400).must_equal 'A11' } # FORMA DE CADASTRAMENTO INVALIDA
|
303
|
+
it { subject.get_codigo_motivo_ocorrencia('132', '02', 400).must_equal 'A11' } # FORMA CADAST. 2 INVALIDA PARA CARTEIRA 3
|
304
|
+
it { subject.get_codigo_motivo_ocorrencia('133', '03', 400).must_equal 'A11' } # FORMA CADAST. 2 INVALIDA PARA CARTEIRA 4
|
305
|
+
it { subject.get_codigo_motivo_ocorrencia('134', '26', 400).must_equal 'A05' } # CODIGO DO MOV. REMESSA NAO NUMERICO
|
306
|
+
it { subject.get_codigo_motivo_ocorrencia('135', '30', 400).must_equal 'A05' } # CODIGO DO MOV. REMESSA INVALIDO
|
307
|
+
it { subject.get_codigo_motivo_ocorrencia('139', '02', 400).must_equal 'A02' } # TIPO DE REGISTRO INVALIDO
|
308
|
+
it { subject.get_codigo_motivo_ocorrencia('140', '03', 400).must_equal 'A03' } # COD. SEOUEC.DO REG. DETALHE INVALIDO
|
309
|
+
it { subject.get_codigo_motivo_ocorrencia('142', '26', 400).must_equal 'A07' } # NUM.AG.CEDENTE/DIG.NAO NUMERICO
|
310
|
+
it { subject.get_codigo_motivo_ocorrencia('143', '30', 400).must_equal 'A07' } # NUM. CONTA CEDENTE/DIG. NAO NUMERICO
|
311
|
+
it { subject.get_codigo_motivo_ocorrencia('144', '02', 400).must_equal 'A12' } # TIPO DE DOCUMENTO NAO NUMERICO
|
312
|
+
it { subject.get_codigo_motivo_ocorrencia('145', '03', 400).must_equal 'A12' } # TIPO DE DOCUMENTO INVALIDO
|
313
|
+
it { subject.get_codigo_motivo_ocorrencia('149', '26', 400).must_equal 'A26' } # CODIGO DE MORA INVALIDO
|
314
|
+
it { subject.get_codigo_motivo_ocorrencia('150', '30', 400).must_equal 'A26' } # CODIGO DE MORA NAO NUMERICO
|
315
|
+
it { subject.get_codigo_motivo_ocorrencia('151', '02', 400).must_equal 'A27' } # VL.MORA IGUAL A ZEROS P. COD.MORA 1
|
316
|
+
it { subject.get_codigo_motivo_ocorrencia('152', '03', 400).must_equal 'A27' } # VL. TAXA MORA IGUAL A ZEROS P.COD MORA 2
|
317
|
+
it { subject.get_codigo_motivo_ocorrencia('153', '26', 400).must_equal 'A27' } # VL. MORA DIFERENTE DE ZEROS P.COD.MORA 3
|
318
|
+
it { subject.get_codigo_motivo_ocorrencia('154', '30', 400).must_equal 'A27' } # VL. MORA NAO NUMERICO P. COD MORA 2
|
319
|
+
it { subject.get_codigo_motivo_ocorrencia('155', '02', 400).must_equal 'A27' } # VL. MORA INVALIDO P. COD.MORA 4
|
320
|
+
it { subject.get_codigo_motivo_ocorrencia('160', '03', 400).must_equal 'A319' } # BAIRRO DO SACADO NAO INFORMADO
|
321
|
+
it { subject.get_codigo_motivo_ocorrencia('161', '26', 400).must_equal 'A53' } # TIPO INSC.CPF/CGC SACADOR/AVAL.NAO NUM.
|
322
|
+
it { subject.get_codigo_motivo_ocorrencia('170', '30', 400).must_equal 'A11' } # FORMA DE CADASTRAMENTO 2 INV.P.CART.5
|
323
|
+
it { subject.get_codigo_motivo_ocorrencia('199', '02', 400).must_equal 'A53' } # TIPO INSC.CGC/CPF SACADOR.AVAL.INVAL.
|
324
|
+
it { subject.get_codigo_motivo_ocorrencia('200', '03', 400).must_equal 'A53' } # NUM.INSC.(CGC)SACADOR/AVAL.NAO NUMERICO
|
325
|
+
it { subject.get_codigo_motivo_ocorrencia('212', '26', 400).must_equal 'A79' } # DATA DO JUROS DE MORA NAO NUMERICO (D3P)
|
326
|
+
it { subject.get_codigo_motivo_ocorrencia('242', '30', 400).must_equal 'A57' } # COD. DA MULTA NAO NUMERICO (D3R)
|
327
|
+
it { subject.get_codigo_motivo_ocorrencia('243', '02', 400).must_equal 'A57' } # COD. MULTA INVALIDO (D3R)
|
328
|
+
it { subject.get_codigo_motivo_ocorrencia('244', '03', 400).must_equal 'A59' } # VALOR DA MULTA NAO NUMERICO (D3R)
|
329
|
+
it { subject.get_codigo_motivo_ocorrencia('245', '26', 400).must_equal 'A58' } # DATA DA MULTA NAO NUMERICO (D3R)
|
330
|
+
it { subject.get_codigo_motivo_ocorrencia('258', '30', 400).must_equal 'A27' } # VL.MORA NAO NUMERICO P.COD=4(D3P)
|
331
|
+
it { subject.get_codigo_motivo_ocorrencia('263', '02', 400).must_equal 'A278' } # INSTRUCAO PARA TITULO NAO REGISTRADO
|
332
|
+
it { subject.get_codigo_motivo_ocorrencia('264', '03', 400).must_equal 'A23' } # CODIGO DE ACEITE (A/N) INVALIDO.
|
333
|
+
end
|
334
|
+
end
|
222
335
|
end
|
@@ -171,4 +171,12 @@ describe BrBoleto::Conta::Sicoob do
|
|
171
171
|
subject.default_codigo_multa.must_equal '0'
|
172
172
|
end
|
173
173
|
end
|
174
|
+
|
175
|
+
describe "#get_codigo_movimento_retorno" do
|
176
|
+
context "CÓDIGOS para o cnab 400 do SICOOB" do
|
177
|
+
it { subject.get_codigo_movimento_retorno('05', 400).must_equal '17' } # Liquidação Sem Registro: Identifica a liquidação de título da modalidade "SEM REGISTRO";
|
178
|
+
it { subject.get_codigo_movimento_retorno('15', 400).must_equal '101' } # Liquidação em Cartório: Identifica as liquidações dos títulos ocorridas em cartórios de protesto;
|
179
|
+
it { subject.get_codigo_movimento_retorno('23', 400).must_equal '19' } # Encaminhado a Protesto: Identifica o recebimento da instrução de protesto
|
180
|
+
end
|
181
|
+
end
|
174
182
|
end
|
@@ -177,4 +177,83 @@ describe BrBoleto::Conta::Sicredi do
|
|
177
177
|
it { subject.get_codigo_desconto('7').must_equal '7' } # Cancelamento de Desconto
|
178
178
|
end
|
179
179
|
|
180
|
+
describe "#get_codigo_movimento_retorno" do
|
181
|
+
context "CÓDIGOS para o Sicredi" do
|
182
|
+
it { subject.get_codigo_movimento_retorno('36', 240).must_equal '100' } # Baixa Rejeitada
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
describe "#get_codigo_motivo_ocorrencia" do
|
187
|
+
context "CÓDIGOS motivo ocorrência D para o Sicredi CNAB 240" do
|
188
|
+
it { subject.get_codigo_motivo_ocorrencia('01', '27', 240).must_equal 'D01' } # Alteração de carteira
|
189
|
+
end
|
190
|
+
context "CÓDIGOS motivo ocorrência A para o Sicredi CNAB 400" do
|
191
|
+
it { subject.get_codigo_motivo_ocorrencia('01', '02', 400).must_equal 'A01' } # Código do banco inválido
|
192
|
+
it { subject.get_codigo_motivo_ocorrencia('02', '03', 400).must_equal 'A02' } # Código do registro detalhe inválido
|
193
|
+
it { subject.get_codigo_motivo_ocorrencia('03', '26', 400).must_equal 'A05' } # Código da ocorrência inválido
|
194
|
+
it { subject.get_codigo_motivo_ocorrencia('04', '30', 400).must_equal 'A04' } # Código de ocorrência não permitida para a carteira
|
195
|
+
it { subject.get_codigo_motivo_ocorrencia('05', '02', 400).must_equal 'A05' } # Código de ocorrência não numérico
|
196
|
+
it { subject.get_codigo_motivo_ocorrencia('07', '03', 400).must_equal 'A07' } # Cooperativa/agência/conta/dígito inválidos
|
197
|
+
it { subject.get_codigo_motivo_ocorrencia('08', '26', 400).must_equal 'A08' } # Nosso número inválido
|
198
|
+
it { subject.get_codigo_motivo_ocorrencia('09', '30', 400).must_equal 'A09' } # Nosso número duplicado
|
199
|
+
it { subject.get_codigo_motivo_ocorrencia('10', '02', 400).must_equal 'A10' } # Carteira inválida
|
200
|
+
it { subject.get_codigo_motivo_ocorrencia('15', '03', 400).must_equal 'A07' } # Cooperativa/carteira/agência/conta/nosso número inválidos
|
201
|
+
it { subject.get_codigo_motivo_ocorrencia('16', '26', 400).must_equal 'A16' } # Data de vencimento inválida
|
202
|
+
it { subject.get_codigo_motivo_ocorrencia('17', '30', 400).must_equal 'A17' } # Data de vencimento anterior à data de emissão
|
203
|
+
it { subject.get_codigo_motivo_ocorrencia('18', '02', 400).must_equal 'A18' } # Vencimento fora do prazo de operação
|
204
|
+
it { subject.get_codigo_motivo_ocorrencia('20', '03', 400).must_equal 'A20' } # Valor do título inválido
|
205
|
+
it { subject.get_codigo_motivo_ocorrencia('21', '26', 400).must_equal 'A21' } # Espécie do título inválida
|
206
|
+
it { subject.get_codigo_motivo_ocorrencia('22', '30', 400).must_equal 'A22' } # Espécie não permitida para a carteira
|
207
|
+
it { subject.get_codigo_motivo_ocorrencia('24', '02', 400).must_equal 'A24' } # Data de emissão inválida
|
208
|
+
it { subject.get_codigo_motivo_ocorrencia('29', '03', 400).must_equal 'A29' } # Valor do desconto maior/igual ao valor do título
|
209
|
+
it { subject.get_codigo_motivo_ocorrencia('31', '26', 400).must_equal 'A31' } # Concessão de desconto - existe desconto anterior
|
210
|
+
it { subject.get_codigo_motivo_ocorrencia('33', '30', 400).must_equal 'A33' } # Valor do abatimento inválido
|
211
|
+
it { subject.get_codigo_motivo_ocorrencia('34', '02', 400).must_equal 'A34' } # Valor do abatimento maior/igual ao valor do título
|
212
|
+
it { subject.get_codigo_motivo_ocorrencia('36', '03', 400).must_equal 'A36' } # Concessão de abatimento - existe abatimento anterior
|
213
|
+
it { subject.get_codigo_motivo_ocorrencia('38', '26', 400).must_equal 'A38' } # Prazo para protesto inválido
|
214
|
+
it { subject.get_codigo_motivo_ocorrencia('39', '30', 400).must_equal 'A39' } # Pedido para protesto não permitido para o título
|
215
|
+
it { subject.get_codigo_motivo_ocorrencia('40', '02', 400).must_equal 'A40' } # Título com ordem de protesto emitida
|
216
|
+
it { subject.get_codigo_motivo_ocorrencia('41', '03', 400).must_equal 'A41' } # Pedido cancelamento/sustação sem instrução de protesto
|
217
|
+
it { subject.get_codigo_motivo_ocorrencia('44', '26', 400).must_equal 'A209' } # Cooperativa de crédito/agência beneficiária não prevista
|
218
|
+
it { subject.get_codigo_motivo_ocorrencia('45', '30', 400).must_equal 'A45' } # Nome do pagador inválido
|
219
|
+
it { subject.get_codigo_motivo_ocorrencia('46', '02', 400).must_equal 'A46' } # Tipo/número de inscrição do pagador inválidos
|
220
|
+
it { subject.get_codigo_motivo_ocorrencia('47', '03', 400).must_equal 'A47' } # Endereço do pagador não informado
|
221
|
+
it { subject.get_codigo_motivo_ocorrencia('48', '26', 400).must_equal 'A48' } # CEP irregular
|
222
|
+
it { subject.get_codigo_motivo_ocorrencia('49', '30', 400).must_equal 'A46' } # Número de Inscrição do pagador/avalista inválido
|
223
|
+
it { subject.get_codigo_motivo_ocorrencia('50', '02', 400).must_equal 'A54' } # Pagador/avalista não informado
|
224
|
+
it { subject.get_codigo_motivo_ocorrencia('60', '03', 400).must_equal 'A60' } # Movimento para título não cadastrado
|
225
|
+
it { subject.get_codigo_motivo_ocorrencia('63', '26', 400).must_equal 'A63' } # Entrada para título já cadastrado
|
226
|
+
it { subject.get_codigo_motivo_ocorrencia('A6', '30', 400).must_equal 'A244' } # Data da instrução/ocorrência inválida
|
227
|
+
it { subject.get_codigo_motivo_ocorrencia('B4', '02', 400).must_equal 'A44' } # Tipo de moeda inválido
|
228
|
+
it { subject.get_codigo_motivo_ocorrencia('B5', '03', 400).must_equal 'A28' } # Tipo de desconto/juros inválido
|
229
|
+
it { subject.get_codigo_motivo_ocorrencia('B7', '26', 400).must_equal 'A86' } # Seu número inválido
|
230
|
+
it { subject.get_codigo_motivo_ocorrencia('B8', '30', 400).must_equal 'A59' } # Percentual de multa inválido
|
231
|
+
it { subject.get_codigo_motivo_ocorrencia('B9', '02', 400).must_equal 'A27' } # Valor ou percentual de juros inválido
|
232
|
+
it { subject.get_codigo_motivo_ocorrencia('C2', '03', 400).must_equal 'A23' } # Aceite do título inválido
|
233
|
+
it { subject.get_codigo_motivo_ocorrencia('C6', '26', 400).must_equal 'A325' } # Título já liquidado
|
234
|
+
it { subject.get_codigo_motivo_ocorrencia('C7', '30', 400).must_equal 'A325' } # Título já baixado
|
235
|
+
it { subject.get_codigo_motivo_ocorrencia('H4', '02', 400).must_equal 'D01' } # Alteração de carteira
|
236
|
+
end
|
237
|
+
context "CÓDIGOS motivo ocorrência B para o Sicredi CNAB 400" do
|
238
|
+
it { subject.get_codigo_motivo_ocorrencia('03', '28', 400).must_equal 'B03'} # Tarifa de sustação
|
239
|
+
it { subject.get_codigo_motivo_ocorrencia('04', '28', 400).must_equal 'B04'} # Tarifa de protesto
|
240
|
+
it { subject.get_codigo_motivo_ocorrencia('08', '28', 400).must_equal 'B08'} # Tarifa de custas de protesto
|
241
|
+
it { subject.get_codigo_motivo_ocorrencia('A9', '28', 400).must_equal 'B02'} # Tarifa de manutenção de título vencido
|
242
|
+
it { subject.get_codigo_motivo_ocorrencia('B1', '28', 400).must_equal 'B122'} # Tarifa de baixa da carteira
|
243
|
+
it { subject.get_codigo_motivo_ocorrencia('B3', '28', 400).must_equal 'B123'} # Tarifa de registro de entrada do título
|
244
|
+
it { subject.get_codigo_motivo_ocorrencia('F5', '28', 400).must_equal 'B124'} # Tarifa de entrada na rede Sicredi
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
describe "#get_codigo_movimento_retorno" do
|
249
|
+
context "CÓDIGOS para o cnab 400 do Sicredi" do
|
250
|
+
it { subject.get_codigo_movimento_retorno('15', 400).must_equal '101' } # Liquidação em cartório
|
251
|
+
it { subject.get_codigo_movimento_retorno('24', 400).must_equal '106' } # Entrada rejeitada por CEP irregular
|
252
|
+
it { subject.get_codigo_movimento_retorno('27', 400).must_equal '100' } # Baixa rejeitada
|
253
|
+
it { subject.get_codigo_movimento_retorno('32', 400).must_equal '26' } # Instrução rejeitada
|
254
|
+
it { subject.get_codigo_movimento_retorno('33', 400).must_equal '27' } # Confirmação de pedido de alteração de outros dados
|
255
|
+
it { subject.get_codigo_movimento_retorno('34', 400).must_equal '24' } # Retirado de cartório e manutenção em carteira
|
256
|
+
it { subject.get_codigo_movimento_retorno('35', 400).must_equal '105' } # Aceite do pagador
|
257
|
+
end
|
258
|
+
end
|
180
259
|
end
|
@@ -142,13 +142,13 @@ describe BrBoleto::Conta::Unicred do
|
|
142
142
|
|
143
143
|
describe "#get_codigo_protesto" do
|
144
144
|
context "CÓDIGOS para o cnab 240 do Unicred" do
|
145
|
-
it { subject.get_codigo_protesto('1').must_equal '1' } # Protestar Dias Corridos
|
146
|
-
it { subject.get_codigo_protesto('2').must_equal '1' } # Protestar Dias Úteis
|
147
|
-
it { subject.get_codigo_protesto('3').must_equal '3' } # Não Protesta
|
148
|
-
it { subject.get_codigo_protesto('4').must_equal '1' } # Protestar Fim Falimentar - Dias Úteis
|
149
|
-
it { subject.get_codigo_protesto('5').must_equal '1' } # Protestar Fim Falimentar - Dias Corridos
|
150
|
-
it { subject.get_codigo_protesto('8').must_equal '3' } # Negativação sem Protesto
|
151
|
-
it { subject.get_codigo_protesto('9').must_equal '3' } # Cancelamento Protesto Automático
|
145
|
+
it { subject.get_codigo_protesto('1', 240).must_equal '1' } # Protestar Dias Corridos
|
146
|
+
it { subject.get_codigo_protesto('2', 240).must_equal '1' } # Protestar Dias Úteis
|
147
|
+
it { subject.get_codigo_protesto('3', 240).must_equal '3' } # Não Protesta
|
148
|
+
it { subject.get_codigo_protesto('4', 240).must_equal '1' } # Protestar Fim Falimentar - Dias Úteis
|
149
|
+
it { subject.get_codigo_protesto('5', 240).must_equal '1' } # Protestar Fim Falimentar - Dias Corridos
|
150
|
+
it { subject.get_codigo_protesto('8', 240).must_equal '3' } # Negativação sem Protesto
|
151
|
+
it { subject.get_codigo_protesto('9', 240).must_equal '3' } # Cancelamento Protesto Automático
|
152
152
|
end
|
153
153
|
end
|
154
154
|
end
|
@@ -191,7 +191,7 @@ describe BrBoleto::Remessa::Cnab240::Itau do
|
|
191
191
|
end
|
192
192
|
|
193
193
|
it "2 - Segunda parte = 8 posições todas preenchidas com zeros (Nr. do aviso de lançamento do crédito referente aos títulos de cobrança)" do
|
194
|
-
subject.complemento_trailer_lote(lote, 5)[92..99].must_equal ('
|
194
|
+
subject.complemento_trailer_lote(lote, 5)[92..99].must_equal (' ' * 8)
|
195
195
|
end
|
196
196
|
|
197
197
|
it "3 - Terceira parte = EXCLUSIVO FEBRABAN com 117 posicoes em branco" do
|
@@ -0,0 +1,184 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
describe BrBoleto::Remessa::Cnab400::Caixa do
|
4
|
+
subject { FactoryGirl.build(:remessa_cnab400_caixa, pagamentos: pagamento, conta: conta) }
|
5
|
+
let(:pagamento) { FactoryGirl.build(:remessa_pagamento, pagador: pagador) }
|
6
|
+
let(:conta) { FactoryGirl.build(:conta_caixa) }
|
7
|
+
let(:pagador) { FactoryGirl.build(:pagador) }
|
8
|
+
|
9
|
+
it "deve ter a class para a conta do Caixa" do
|
10
|
+
BrBoleto::Remessa::Cnab400::Caixa.new.conta_class.must_equal BrBoleto::Conta::Caixa
|
11
|
+
end
|
12
|
+
|
13
|
+
it "deve herdar de Cnab400::Base" do
|
14
|
+
subject.class.superclass.must_equal BrBoleto::Remessa::Cnab400::Base
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '#informacoes_da_conta' do
|
18
|
+
it "deve retornar com 20 caracteres" do
|
19
|
+
subject.informacoes_da_conta(:header).size.must_equal 20
|
20
|
+
end
|
21
|
+
it "deve trazer as informações em suas posições quando o parametro for :header" do
|
22
|
+
conta.agencia = 1234
|
23
|
+
conta.convenio = 89755
|
24
|
+
conta.carteira = 21
|
25
|
+
result = subject.informacoes_da_conta(:header)
|
26
|
+
|
27
|
+
result[0..3].must_equal '1234' # Agência
|
28
|
+
result[4..9].must_equal '089755' # Convênio
|
29
|
+
result[10..19].must_equal (' ' * 10) # Brancos
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe '#complemento_registro' do
|
34
|
+
it "deve retornar o sequencial da remessa com 5 posições e mais 389 brancos" do
|
35
|
+
subject.sequencial_remessa = 4758
|
36
|
+
|
37
|
+
subject.complemento_registro[0..288].must_equal ''.rjust(289)
|
38
|
+
subject.complemento_registro[289..393].must_equal '04758'
|
39
|
+
|
40
|
+
subject.complemento_registro.size.must_equal 294
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "#detalhe_posicao_028_058" do
|
45
|
+
it "deve retornar com 31 caracteres" do
|
46
|
+
subject.detalhe_posicao_028_058(pagamento).size.must_equal 31
|
47
|
+
end
|
48
|
+
it "deve trazer as informações em suas posições corretas" do
|
49
|
+
pagamento.assign_attributes(emissao_boleto: 1)
|
50
|
+
pagamento.assign_attributes(distribuicao_boleto: 2)
|
51
|
+
pagamento.numero_documento = '255'
|
52
|
+
conta.carteira = '99'
|
53
|
+
|
54
|
+
result = subject.detalhe_posicao_028_058(pagamento)
|
55
|
+
|
56
|
+
result[0].must_equal '1' # Identificação da Emissão do Boleto
|
57
|
+
result[1].must_equal '2' # ID Entrega/Distribuição do Boleto
|
58
|
+
result[2..3].must_equal '00' # Comissão de Permanência (Informar '00')
|
59
|
+
result[4..28].must_equal '255'.rjust(25, '0') # Número do Documento
|
60
|
+
result[29..30].must_equal '99' # Carteira
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe "#dados_do_pagamento" do
|
65
|
+
it "deve retornar com 18 caracteres" do
|
66
|
+
subject.dados_do_pagamento(pagamento).size.must_equal 18
|
67
|
+
end
|
68
|
+
it "deve trazer as informações em suas posições corretas" do
|
69
|
+
pagamento.numero_documento = '255'
|
70
|
+
|
71
|
+
result = subject.dados_do_pagamento(pagamento)
|
72
|
+
|
73
|
+
result[0..14].must_equal '255'.rjust(15, '0') # Número do Documento
|
74
|
+
result[15..17].must_equal (' ' * 3) # Brancos
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '#detalhe_posicao_077_108' do
|
79
|
+
it "deve ter o tamanho de 32 digitos" do
|
80
|
+
subject.detalhe_posicao_077_108(pagamento, '1').size.must_equal 32
|
81
|
+
end
|
82
|
+
it "deve conter as informações nas posições corretas" do
|
83
|
+
conta.codigo_carteira = '5'
|
84
|
+
result = subject.detalhe_posicao_077_108(pagamento, '1')
|
85
|
+
|
86
|
+
result[0..29].must_equal (' ' * 30) # Brancos
|
87
|
+
result[30..31].must_equal '05' # Código da Carteira
|
88
|
+
|
89
|
+
result.size.must_equal 32
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
describe '#informacoes_do_pagamento' do
|
94
|
+
it "deve ter o tamanho de 40 digitos" do
|
95
|
+
subject.informacoes_do_pagamento(pagamento, 1).size.must_equal 40
|
96
|
+
end
|
97
|
+
it "deve conter as informações nas posições corretas" do
|
98
|
+
conta.agencia = 4587
|
99
|
+
conta.agencia_dv = 45 # Vai retornar apenas o 4
|
100
|
+
pagamento.assign_attributes(codigo_protesto: 2)
|
101
|
+
pagamento.data_vencimento = Date.parse('05/08/2029')
|
102
|
+
pagamento.valor_documento = 47.56
|
103
|
+
pagamento.especie_titulo = "12"
|
104
|
+
pagamento.aceite = true
|
105
|
+
pagamento.data_emissao = Date.parse('15/09/2017')
|
106
|
+
result = subject.informacoes_do_pagamento(pagamento, 4)
|
107
|
+
result.size.must_equal 40
|
108
|
+
|
109
|
+
result[00..05].must_equal '050829' # "Data Vencimento: Formato DDMMAA Normal ""DDMMAA"" A vista = ""888888"" Contra Apresentação = ""999999"""
|
110
|
+
result[06..18].must_equal '0000000004756' # Valor do Titulo
|
111
|
+
result[19..21].must_equal '104' # Número Banco
|
112
|
+
result[22..26].must_equal "00000" # 000000 ou Agencia
|
113
|
+
result[27..28].must_equal "02" # Espécie do Título
|
114
|
+
result[ 29 ].must_equal "N" # dentificação (Sempre 'N')
|
115
|
+
result[30..35].must_equal '150917' # Data de Emissão do Título: formato ddmmaa
|
116
|
+
result[36..37].must_equal '02' # Primeira instrução codificada
|
117
|
+
result[38..39].must_equal '00' # Segunda instrução
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe '#detalhe_multas_e_juros_do_pagamento' do
|
122
|
+
it "deve ter o tamanho de 58 digitos" do
|
123
|
+
subject.detalhe_multas_e_juros_do_pagamento(pagamento, 2).size.must_equal 58
|
124
|
+
end
|
125
|
+
it "deve conter as informações nas posições corretas" do
|
126
|
+
pagamento.valor_mora = '0.39'
|
127
|
+
pagamento.valor_iof = '2.7'
|
128
|
+
pagamento.data_desconto = Date.parse('21/03/2018')
|
129
|
+
pagamento.valor_desconto = 4.3
|
130
|
+
pagamento.valor_abatimento = 56.47
|
131
|
+
|
132
|
+
result = subject.detalhe_multas_e_juros_do_pagamento(pagamento, 4)
|
133
|
+
result.size.must_equal 58
|
134
|
+
|
135
|
+
result[00..12].must_equal '0000000000039'
|
136
|
+
result[13..18].must_equal "210318"
|
137
|
+
result[19..31].must_equal '0000000000430'
|
138
|
+
result[32..44].must_equal '0000000000270'
|
139
|
+
result[45..57].must_equal '0000000005647'
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
describe '#informacoes_do_sacado' do
|
144
|
+
it "deve ter o tamanho de 176 digitos" do
|
145
|
+
subject.informacoes_do_sacado(pagamento, 2).size.must_equal 176
|
146
|
+
end
|
147
|
+
it "deve conter as informações nas posições corretas" do
|
148
|
+
pagador.cpf_cnpj = '12345678901'
|
149
|
+
pagador.nome = 'nome pagador'
|
150
|
+
pagador.endereco = 'rua do pagador'
|
151
|
+
pagador.bairro = 'bairro do pagador'
|
152
|
+
pagador.cidade = 'Chapecó'
|
153
|
+
pagador.uf = 'SC'
|
154
|
+
pagador.cep = '89885-001'
|
155
|
+
pagador.nome_avalista = 'Avalista'
|
156
|
+
|
157
|
+
pagamento.data_multa = Date.parse('28/12/2020')
|
158
|
+
pagamento.valor_multa = 150.3
|
159
|
+
pagamento.codigo_moeda = '0'
|
160
|
+
pagamento.assign_attributes(dias_protesto: 30)
|
161
|
+
|
162
|
+
result = subject.informacoes_do_sacado(pagamento, 2)
|
163
|
+
result.size.must_equal 176
|
164
|
+
|
165
|
+
result[00..01].must_equal "01" # Tipo de Inscrição do Pagador: "01" = CPF / "02" = CNPJ
|
166
|
+
result[02..15].must_equal '00012345678901' # Número do CNPJ ou CPF do Pagador
|
167
|
+
result[16..55].must_equal 'nome pagador'.adjust_size_to(40) # Nome do Pagador
|
168
|
+
|
169
|
+
result[56..95].must_equal 'rua do pagador'.adjust_size_to(40) # Endereço do Pagador
|
170
|
+
result[96..107].must_equal 'bairro do pagador'.adjust_size_to(12) # Bairro do Pagador
|
171
|
+
result[108..115].must_equal '89885001' # CEP do Pagador
|
172
|
+
result[116..130].must_equal 'Chapecó'.adjust_size_to(15) # Cidade do Pagador
|
173
|
+
result[131..132].must_equal 'SC'.adjust_size_to(2) # UF do Pagador
|
174
|
+
|
175
|
+
result[133..138].must_equal '281220'.adjust_size_to(6) # Data Multa
|
176
|
+
result[139..148].must_equal '15030'.rjust(10, '0') # Valor Multa
|
177
|
+
result[149..170].must_equal 'Avalista'.adjust_size_to(22) # Nome Sacador/Avalista
|
178
|
+
|
179
|
+
result[171..172].must_equal '00' # 3a instrução
|
180
|
+
result[173..174].must_equal '30' # Dias para protesto
|
181
|
+
result[175].must_equal '0' # Código da Moeda
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|