Eduardokum\LaravelBoleto\Boleto\Banco\Banrisul::getCampoLivre PHP Method

getCampoLivre() protected method

Método para gerar o código da posição de 20 a 44
protected getCampoLivre ( ) : string
return string
    protected function getCampoLivre()
    {
        if ($this->campoLivre) {
            return $this->campoLivre;
        }
        // Carteira     => 20 - 20 | Valor: 1(Com registro) ou 2(Sem registro)
        $this->campoLivre = '2';
        // Constante    => 21 - 21 | Valor: 1(Constante)
        $this->campoLivre .= '1';
        // Agencia      => 22 a 25 | Valor: dinâmico(0000) ´4´
        $this->campoLivre .= Util::numberFormatGeral($this->getAgencia(), 4);
        // Cod. Cedente => 26 a 32 | Valor: dinâmico(0000000) ´7´
        $this->campoLivre .= $this->getConta();
        // Nosso numero => 33 a 40 | Valor: dinâmico(00000000) ´8´
        $this->campoLivre .= Util::numberFormatGeral($this->getNumeroDocumento(), 8);
        // Constante    => 41 - 42 | Valor: 40(Constante)
        $this->campoLivre .= '40';
        // Duplo digito => 43 - 44 | Valor: calculado(00) ´2´
        $this->campoLivre .= $this->duploDigitoBanrisul(Util::onlyNumbers($this->campoLivre));
        return $this->campoLivre;
    }