Skip to content

Commit

Permalink
detalhe ajuste merge
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardokum committed Aug 17, 2021
1 parent 4ce57fb commit 2aacaac
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/Cnab/Remessa/Cnab240/Banco/Sicredi.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected function segmentoP(BoletoContract $boleto)
$this->add(119, 126, $boleto->getJurosApos() == 0 ? '00000000' :
$boleto->getDataVencimentoApos()->format('dmY'));
$this->add(127, 141, Util::formatCnab('9', $boleto->getMoraDia(), 15, 2)); //Valor da mora/dia ou Taxa mensal
$this->add(142, 142, '1'); // '1' = Valor Fixo Até a Data Informada
$this->add(142, 142, $boleto->getDesconto() > 0 ? '1' : '0');
$this->add(143, 150, $boleto->getDesconto() > 0 ? $boleto->getDataDesconto()->format('dmY') : '00000000');
$this->add(151, 165, Util::formatCnab('9', $boleto->getDesconto(), 15, 2));
$this->add(166, 180, Util::formatCnab('9', 0, 15, 2));
Expand Down
35 changes: 18 additions & 17 deletions src/Cnab/Retorno/Cnab240/Detalhe.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php

namespace Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab240;

Expand All @@ -6,12 +7,11 @@
use Eduardokum\LaravelBoleto\Contracts\Pessoa as PessoaContract;
use Eduardokum\LaravelBoleto\MagicTrait;
use Eduardokum\LaravelBoleto\Util;



use Exception;

class Detalhe implements DetalheContract
{

use MagicTrait;

/**
Expand Down Expand Up @@ -139,7 +139,7 @@ public function hasOcorrencia()
{
$ocorrencias = func_get_args();

if (count($ocorrencias) == 0 && !empty($this->getOcorrencia())) {
if (count($ocorrencias) == 0 && ! empty($this->getOcorrencia())) {
return true;
}

Expand Down Expand Up @@ -299,7 +299,7 @@ public function getDataVencimento($format = 'd/m/Y')
}

/**
* @param $dataVencimento
* @param $dataVencimento
*
* @param string $format
*
Expand All @@ -325,7 +325,7 @@ public function getDataCredito($format = 'd/m/Y')
}

/**
* @param $dataCredito
* @param $dataCredito
*
* @param string $format
*
Expand All @@ -351,7 +351,7 @@ public function getDataOcorrencia($format = 'd/m/Y')
}

/**
* @param $dataOcorrencia
* @param $dataOcorrencia
*
* @param string $format
*
Expand Down Expand Up @@ -553,7 +553,7 @@ public function getValorOutrosCreditos()
}

/**
* @param string $valorTarifa
* @param string $valorOutrosCreditos
*
* @return $this
*/
Expand All @@ -576,11 +576,12 @@ public function getPagador()
* @param $pagador
*
* @return $this
* @throws \Exception
* @throws Exception
*/
public function setPagador($pagador)
{
Util::addPessoa($this->pagador, $pagador);

return $this;
}

Expand Down Expand Up @@ -631,24 +632,24 @@ public function getError()
public function setError($error)
{
$this->ocorrenciaTipo = self::OCORRENCIA_ERRO;
$this->error = $error;
$this->error = $error;

return $this;
}

/**
* @return string
*/
/**
* @return string
*/
public function getRejeicao()
{
return $this->rejeicao;
}

/**
* @param string $ocorrenciaTipo
*
* @return Detalhe
*/
* @param string $rejeicao
*
* @return Detalhe
*/
public function setRejeicao($rejeicao)
{
$this->rejeicao = $rejeicao;
Expand Down
53 changes: 28 additions & 25 deletions src/Cnab/Retorno/Cnab400/Detalhe.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab400;

use Carbon\Carbon;
Expand All @@ -7,6 +8,7 @@

class Detalhe implements DetalheContract
{

use MagicTrait;

/**
Expand Down Expand Up @@ -104,7 +106,7 @@ public function getCarteira()
}

/**
* @param string $nossoNumero
* @param string $carteira
*
* @return Detalhe
*/
Expand Down Expand Up @@ -189,6 +191,7 @@ public function getCodigoLiquidacao()
* Setter for codigoLiquidacao
*
* @param string $codigoLiquidacao
*
* @return Detalhe
*/
public function setCodigoLiquidacao($codigoLiquidacao)
Expand All @@ -205,7 +208,7 @@ public function hasOcorrencia()
{
$ocorrencias = func_get_args();

if (count($ocorrencias) == 0 && !empty($this->getOcorrencia())) {
if (count($ocorrencias) == 0 && ! empty($this->getOcorrencia())) {
return true;
}

Expand Down Expand Up @@ -288,8 +291,8 @@ public function setOcorrenciaTipo($ocorrenciaTipo)
public function getDataOcorrencia($format = 'd/m/Y')
{
return $this->dataOcorrencia instanceof Carbon
? $format === false ? $this->dataOcorrencia : $this->dataOcorrencia->format($format)
: null;
? $format === false ? $this->dataOcorrencia : $this->dataOcorrencia->format($format)
: null;
}

/**
Expand All @@ -304,25 +307,25 @@ public function setDataOcorrencia($dataOcorrencia, $format = 'dmy')
return $this;
}

/**
* @return string
*/
public function getRejeicao()
{
return $this->rejeicao;
}
/**
* @return string
*/
public function getRejeicao()
{
return $this->rejeicao;
}

/**
* @param string $ocorrenciaTipo
*
* @return Detalhe
*/
public function setRejeicao($rejeicao)
{
$this->rejeicao = $rejeicao;
/**
* @param string $rejeicao
*
* @return Detalhe
*/
public function setRejeicao($rejeicao)
{
$this->rejeicao = $rejeicao;

return $this;
}
return $this;
}

/**
* @param string $format
Expand All @@ -332,8 +335,8 @@ public function setRejeicao($rejeicao)
public function getDataVencimento($format = 'd/m/Y')
{
return $this->dataVencimento instanceof Carbon
? $format === false ? $this->dataVencimento : $this->dataVencimento->format($format)
: null;
? $format === false ? $this->dataVencimento : $this->dataVencimento->format($format)
: null;
}

/**
Expand All @@ -356,8 +359,8 @@ public function setDataVencimento($dataVencimento, $format = 'dmy')
public function getDataCredito($format = 'd/m/Y')
{
return $this->dataCredito instanceof Carbon
? $format === false ? $this->dataCredito : $this->dataCredito->format($format)
: null;
? $format === false ? $this->dataCredito : $this->dataCredito->format($format)
: null;
}

/**
Expand Down

0 comments on commit 2aacaac

Please sign in to comment.