Skip to content

Commit

Permalink
Merge pull request #2 from Ewersonfc/master
Browse files Browse the repository at this point in the history
reply to function on PDF model, and change function helper to static …
  • Loading branch information
Matheus Hack committed May 28, 2018
2 parents 94013c3 + e904177 commit a58fa15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ItauBoleto/Factories/BoletoRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private function setJuros($data = [])
$juros = new JurosRequest();
$juros->data_juros = data_get($data, 'data', $juros->data_juros);
$juros->tipo_juros = data_get($data, 'tipo', $juros->tipo_juros);
$juros->valor_juros = data_get($data, 'valor', $juros->valor_juros);
$juros->valor_juros = Boleto::formatDecimal(data_get($data, 'valor', $juros->valor_juros),15, 2);
$juros->percentual_juros = Boleto::formatDecimal(data_get($data, 'percentual', $juros->percentual_juros),7, 5);

return Boleto::removeNullValue($juros);
Expand All @@ -221,7 +221,7 @@ private function setMulta($data = [])
$multa = new MultaRequest();
$multa->data_multa = data_get($data, 'data', $multa->data_multa);
$multa->tipo_multa = data_get($data, 'tipo', $multa->tipo_multa);
$multa->valor_multa = data_get($data, 'valor', $multa->valor_multa);
$multa->valor_multa = Boleto::formatDecimal(data_get($data, 'valor', $multa->valor_multa), 15, 2);
$multa->percentual_multa = Boleto::formatDecimal(data_get($data, 'percentual', $multa->percentual_multa),7, 5);

return Boleto::removeNullValue($multa);
Expand Down
2 changes: 1 addition & 1 deletion src/ItauBoleto/Helpers/Boleto.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static function removeNullValue($object)
* @param $cnpj
* @return string
*/
public function formatCnpj($cnpj) {
public static function formatCnpj($cnpj) {
$cnpj = trim($cnpj);
if(preg_match('/^[0-9]+$/', $cnpj)) {
$aux = str_split($cnpj);
Expand Down
4 changes: 2 additions & 2 deletions src/ItauBoleto/Services/ServiceBoleto.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ public function printPdf(array $boleto, $logoEmpresa, $cachePath)
]);

$dados = [
'nosso_numero' => $boleto['nossoNumero'],
'numero_documento' => $boleto['id'],
'nosso_numero' => substr($boleto['nossoNumero'], 0,8),
'numero_documento' => substr($boleto['id'], 0,8),
'data_vencimento' => Carbon::parse($boleto['dataVencimento'])->format('d/m/Y'),
'data_documento' => Carbon::parse($boleto['dataEmissao'])->format('d/m/Y'),
'data_processamento' => Carbon::parse($boleto['dataProcessamento'])->format('d/m/Y'),
Expand Down

0 comments on commit a58fa15

Please sign in to comment.