Ticket Generation with Bopepo

1

I have a system that generates an accounts receivable, and I'm trying to implement the generation of bank boletos, my teacher Advisor has indicated me the tool 'Bopepo' Jrmum. I inserted it into my system and was able to generate a sample ticket, but I want to pass the information to the ticket per parameter as the user types it. Has anyone used this tool or know how to do it? I await reply, Thank you.

 final Titulo crieOsDadosDoNovoTitulo(Titulo titulo) {

    /*
     * DADOS BÁSICOS.
     */
    titulo.setNumeroDoDocumento("12345");
    titulo.setNossoNumero("00234569812345");
    titulo.setDigitoDoNossoNumero("5");
    titulo.setValor(BigDecimal.valueOf(0.23));

    // Para informar a data de maneira simples você pode utilizar as 
    // classes utilitárias do JRimum. Abaixo temos alguns exemplos:
    // (1) titulo.setDataDoVencimento(  DateFormat.DDMMYYYY_B.parse("11/03/2011")  );
    // (2) titulo.setDataDoVencimento(  Dates.parse("11/03/2011", "dd/MM/yyyy")  );     
    titulo.setDataDoDocumento(new Date());
    titulo.setDataDoVencimento(new Date());

    titulo.setTipoDeDocumento(TipoDeTitulo.DM_DUPLICATA_MERCANTIL);
    titulo.setAceite(Aceite.A);
    titulo.setDesconto(new BigDecimal(0.05));
    titulo.setDeducao(BigDecimal.ZERO);
    titulo.setMora(BigDecimal.ZERO);
    titulo.setAcrecimo(BigDecimal.ZERO);
    titulo.setValorCobrado(BigDecimal.ZERO);

    return titulo;
}
    
asked by anonymous 16.09.2016 / 20:48

1 answer

0

Good evening, Leandro.

I created a transport class (in which I collect the data that I need to issue in the DB) and from it and some more information I issue the ticket.

Bopepo's ticket issuance has a few trick-offs that you'll discover in the tests (since the documentation is not enough). For example: 1) CPF or CNPJ do Sacado has to be valid (often I do not have this information). 2) The instructions have to be filled even if with empty string (""). 3) DV of checking account and billet have to be provided separately). Etc.

Tomorrow morning, I'll clean the code and post it for you to take a look at.

It was not difficult to get out of the air and issue a ticket, albeit with fake data.

    
19.09.2016 / 03:36