Skip to content

Commit

Permalink
PAPI-2402 Ajuste calculo fator vencimento
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassmarin committed Dec 5, 2024
1 parent 37d5892 commit d1d2cac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/OpenBoleto/BoletoAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1474,13 +1474,18 @@ protected function getValorZeroFill()
* Retorna o número de dias de 07/10/1997 até a data de vencimento do boleto
* Ou 0000 caso não tenha data de vencimento (contra-apresentação)
*
* @see https://download.itau.com.br/bankline/layout_cobranca_400bytes_cnab_itau.pdf Anexo 6
* @return string
*/
protected function getFatorVencimento()
{
if (!$this->getContraApresentacao()) {
$date = new DateTime('1997-10-07');
return $date->diff($this->getDataVencimento())->days;
$days = $date->diff($this->getDataVencimento())->days;
if ($days > 9999) {
$days -= 9000;
}
return $days;
} else {
return '0000';
}
Expand Down

0 comments on commit d1d2cac

Please sign in to comment.