Skip to content

Commit

Permalink
Merge pull request #206 from mypharmabr/develop
Browse files Browse the repository at this point in the history
Ajustes Santander
  • Loading branch information
eduardokum authored Sep 22, 2017
2 parents 5e4fd0c + dc53f42 commit ceb2790
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions src/Boleto/Banco/Santander.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,51 @@ public function __construct(array $params = [])
public $variaveis_adicionais = [
'esconde_uso_banco' => true,
];

/**
* Código do cliente.
*
* @var int
*/
protected $codigoCliente;

/**
* Retorna o campo Agência/Beneficiário do boleto
*
* @return string
*/
public function getAgenciaCodigoBeneficiario()
{
$agencia = $this->getAgenciaDv() !== null ? $this->getAgencia() . '-' . $this->getAgenciaDv() : $this->getAgencia();
$codigoCliente = $this->getCodigoCliente();

return $agencia . ' / ' . $codigoCliente;
}

/**
* Retorna o código do cliente.
*
* @return int
*/
public function getCodigoCliente()
{
return $this->codigoCliente;
}

/**
* Define o código do cliente.
*
* @param int $codigoCliente
*
* @return AbstractBoleto
*/
public function setCodigoCliente($codigoCliente)
{
$this->codigoCliente = $codigoCliente;

return $this;
}

/**
* Define o código da carteira (Com ou sem registro)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Cnab/Remessa/Cnab400/Banco/Santander.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function addBoleto(BoletoContract $boleto)
$this->add(4, 17, Util::formatCnab('9L', $this->getBeneficiario()->getDocumento(), 14));
$this->add(18, 37, Util::formatCnab('9', $this->getCodigoTransmissao(), 20));
$this->add(38, 62, Util::formatCnab('X', $boleto->getNumeroControle(), 25)); // numero de controle
$this->add(63, 70, Util::numberFormatGeral($boleto->getNossoNumero(), 8));
$this->add(63, 70, substr(Util::onlyNumbers($boleto->getNossoNumero()), -8));
$this->add(71, 76, '000000');
$this->add(77, 77, '');
$this->add(78, 78, ($boleto->getMulta() > 0 ? '4' : '0'));
Expand Down

0 comments on commit ceb2790

Please sign in to comment.