You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@JacquesMarques para dar esse erro você está com algum campo fora do tamanho permitido.
Só não sei dizer qual é.
Tem que ir testando cada um com tamanho menor.
Olá, está dando um erro ao tentar gerar um boleto para o banco Santander em PDF:
Brcobranca::BoletoInvalido (errors.attributes.base.too_long): app/controllers/financial_controller.rb:73:in generate_billet
Não consigo saber o que está causando esse erro, mas quando tento gerar para o banco Itaú ou Bradesco funciona perfeitamente.
Estou fazendo isso para gerar os boletos:
`@boleto = case title.codigo_portador
when 341
Brcobranca::Boleto::Itau.new
when 237
Brcobranca::Boleto::Bradesco.new
when 33
Brcobranca::Boleto::Santander.new
end
@boleto.cedente = title.razao_empresa
@boleto.documento_cedente = title.cnpj_empresa
@boleto.sacado = title.razao_entidade
@boleto.especie = 'DMI'
@boleto.sacado_documento = title.cnpj_entidade
@boleto.sacado_endereco = "#{entity.desc_logradouro} #{entity.nome_bairro} #{entity.cidade}/#{entity.estado} CEP: #{entity.codg_cep}"
@boleto.valor = title.valor
@boleto.agencia = title.numero_agencia
@boleto.conta_corrente = title.numero_conta.to_i
@boleto.carteira = title.numero_carteira
@boleto.convenio = title.numero_conta.to_i
@boleto.documento_numero = title.numero_documento
@boleto.nosso_numero = title.nosso_numero[0..7].to_i
@boleto.data_vencimento = title.data_vencimento
@boleto.data_documento = title.data_emissao
instructions = divide_text(title.instrucao_boleto, [40,40,40,40,40,40])
@boleto.instrucao1 = instructions[0]
@boleto.instrucao2 = instructions[1] if instructions[1].present?
@boleto.instrucao3 = instructions[2] if instructions[2].present?
@boleto.instrucao4 = instructions[3] if instructions[3].present?
@boleto.instrucao5 = instructions[4] if instructions[4].present?
@boleto.instrucao6 = instructions[5] if instructions[5].present?
@boleto.cedente_endereco = title.endereco_empresa
@boleto.avalista = title.razao_sacador
@boleto.avalista_documento = title.cnpj_sacador
Alguma ideia do que pode estar causando esse erro?
Obrigado.
The text was updated successfully, but these errors were encountered: