Skip to content

Commit

Permalink
Merge pull request #636 from XFreitas/develop
Browse files Browse the repository at this point in the history
Develop - Get e set tipo de cobrança BB
  • Loading branch information
eduardokum authored Oct 4, 2021
2 parents e1af5f1 + c20ccd6 commit 88fd74a
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/Cnab/Remessa/Cnab400/Banco/Bb.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco;

use Eduardokum\LaravelBoleto\CalculoDV;
Expand Down Expand Up @@ -125,6 +126,13 @@ public function __construct(array $params = [])
*/
protected $variacaoCarteira;

/**
* Tipo de cobrança
*
* @var string
*/
protected $tipoCobranca = self::TIPO_COBRANCA_SIMPLES;

/**
* @return mixed
*/
Expand Down Expand Up @@ -189,6 +197,30 @@ public function setVariacaoCarteira($variacaoCarteira)
return $this;
}

/**
* Retorna tipo de cobrança
*
* @return string
*/
public function getTipoCobranca()
{
return $this->tipoCobranca;
}

/**
* Define tipo de cobrança
*
* @param string $tipoCobranca
*
* @return Bb
*/
public function setTipoCobranca($tipoCobranca)
{
$this->tipoCobranca = $tipoCobranca;

return $this;
}

/**
* @return $this
* @throws \Exception
Expand Down Expand Up @@ -250,7 +282,7 @@ public function addBoleto(BoletoContract $boleto)
$this->add(92, 94, Util::formatCnab('9', $this->getVariacaoCarteira(), 3));
$this->add(95, 95, '0');
$this->add(96, 101, '000000');
$this->add(102, 106, '');
$this->add(102, 106, Util::formatCnab('X', $this->getTipoCobranca(), 5));
$this->add(107, 108, $this->getCarteiraNumero());
$this->add(109, 110, self::OCORRENCIA_REMESSA); // REGISTRO
if ($boleto->getStatus() == $boleto::STATUS_BAIXA) {
Expand Down

0 comments on commit 88fd74a

Please sign in to comment.