Skip to content

Commit

Permalink
Merge pull request #10 from DenysXavier/8--erro-no-campo-titulo-vl
Browse files Browse the repository at this point in the history
Fix: #8 Erro no Campo Titulo.VL
  • Loading branch information
DenysXavier authored Jul 17, 2017
2 parents 04bf181 + 2a95fdb commit 1979eaf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Titulo.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function exportarArray() {
$array["TITULO.DT-VENCTO"] = $this->getDataVencimento()->format($formatoDataPadrao);
$array["TITULO.DT-EMISSAO"] = $this->getDataEmissao()->format($formatoDataPadrao);
$array["TITULO.ESPECIE"] = $this->getEspecie();
$array["TITULO.VL-NOMINAL"] = $this->getValor();
$array["TITULO.VL-NOMINAL"] = number_format($this->getValor() * 100, 0, "", "");
$array["MENSAGEM"] = wordwrap($this->getMensagem(), 100, "\r\n");
return $array;
}
Expand Down
14 changes: 14 additions & 0 deletions tests/TituloTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,20 @@ public function oArrayExportadoDevePossuirAsMesmasChavesUtilizadasPeloWSdoBanco(
}
}

/**
* @author Denys Xavier <[email protected]>
* @test
*/
public function oValorMonetarioDaChaveTITULO_VL_NOMINALNaoPossuiVirgula() {
$valorNominal = 100.123;
$valorExportado = 10012;

$titulo = new Titulo($valorNominal);
$export = $titulo->exportarArray();

$this->assertEquals($valorExportado, $export["TITULO.VL-NOMINAL"]);
}

/**
* @author Denys Xavier <[email protected]>
* @test
Expand Down

0 comments on commit 1979eaf

Please sign in to comment.