|
1 | 1 | <?php
|
| 2 | + |
2 | 3 | namespace Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco;
|
3 | 4 |
|
4 | 5 | use Eduardokum\LaravelBoleto\CalculoDV;
|
@@ -125,6 +126,13 @@ public function __construct(array $params = [])
|
125 | 126 | */
|
126 | 127 | protected $variacaoCarteira;
|
127 | 128 |
|
| 129 | + /** |
| 130 | + * Tipo de cobrança |
| 131 | + * |
| 132 | + * @var string |
| 133 | + */ |
| 134 | + protected $tipoCobranca = self::TIPO_COBRANCA_SIMPLES; |
| 135 | + |
128 | 136 | /**
|
129 | 137 | * @return mixed
|
130 | 138 | */
|
@@ -189,6 +197,30 @@ public function setVariacaoCarteira($variacaoCarteira)
|
189 | 197 | return $this;
|
190 | 198 | }
|
191 | 199 |
|
| 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 | + |
192 | 224 | /**
|
193 | 225 | * @return $this
|
194 | 226 | * @throws \Exception
|
@@ -250,7 +282,7 @@ public function addBoleto(BoletoContract $boleto)
|
250 | 282 | $this->add(92, 94, Util::formatCnab('9', $this->getVariacaoCarteira(), 3));
|
251 | 283 | $this->add(95, 95, '0');
|
252 | 284 | $this->add(96, 101, '000000');
|
253 |
| - $this->add(102, 106, ''); |
| 285 | + $this->add(102, 106, Util::formatCnab('X', $this->getTipoCobranca(), 5)); |
254 | 286 | $this->add(107, 108, $this->getCarteiraNumero());
|
255 | 287 | $this->add(109, 110, self::OCORRENCIA_REMESSA); // REGISTRO
|
256 | 288 | if ($boleto->getStatus() == $boleto::STATUS_BAIXA) {
|
|
0 commit comments