Skip to content

Commit 88fd74a

Browse files
authored
Merge pull request #636 from XFreitas/develop
Develop - Get e set tipo de cobrança BB
2 parents e1af5f1 + c20ccd6 commit 88fd74a

File tree

1 file changed

+33
-1
lines changed
  • src/Cnab/Remessa/Cnab400/Banco

1 file changed

+33
-1
lines changed

src/Cnab/Remessa/Cnab400/Banco/Bb.php

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco;
34

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

129+
/**
130+
* Tipo de cobrança
131+
*
132+
* @var string
133+
*/
134+
protected $tipoCobranca = self::TIPO_COBRANCA_SIMPLES;
135+
128136
/**
129137
* @return mixed
130138
*/
@@ -189,6 +197,30 @@ public function setVariacaoCarteira($variacaoCarteira)
189197
return $this;
190198
}
191199

200+
/**
201+
* Retorna tipo de cobrança
202+
*
203+
* @return string
204+
*/
205+
public function getTipoCobranca()
206+
{
207+
return $this->tipoCobranca;
208+
}
209+
210+
/**
211+
* Define tipo de cobrança
212+
*
213+
* @param string $tipoCobranca
214+
*
215+
* @return Bb
216+
*/
217+
public function setTipoCobranca($tipoCobranca)
218+
{
219+
$this->tipoCobranca = $tipoCobranca;
220+
221+
return $this;
222+
}
223+
192224
/**
193225
* @return $this
194226
* @throws \Exception
@@ -250,7 +282,7 @@ public function addBoleto(BoletoContract $boleto)
250282
$this->add(92, 94, Util::formatCnab('9', $this->getVariacaoCarteira(), 3));
251283
$this->add(95, 95, '0');
252284
$this->add(96, 101, '000000');
253-
$this->add(102, 106, '');
285+
$this->add(102, 106, Util::formatCnab('X', $this->getTipoCobranca(), 5));
254286
$this->add(107, 108, $this->getCarteiraNumero());
255287
$this->add(109, 110, self::OCORRENCIA_REMESSA); // REGISTRO
256288
if ($boleto->getStatus() == $boleto::STATUS_BAIXA) {

0 commit comments

Comments
 (0)