From 75e1add96234829caa54be73b1030c84957c7b08 Mon Sep 17 00:00:00 2001 From: Denys Xavier Date: Mon, 17 Jul 2017 17:06:29 -0300 Subject: [PATCH 1/2] =?UTF-8?q?Adicionado=20teste=20para=20verificar=20o?= =?UTF-8?q?=20valor=20nominal=20do=20t=C3=ADtulo=20na=20exporta=C3=A7?= =?UTF-8?q?=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/TituloTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/TituloTest.php b/tests/TituloTest.php index e1281c9..aa1e328 100644 --- a/tests/TituloTest.php +++ b/tests/TituloTest.php @@ -160,6 +160,20 @@ public function oArrayExportadoDevePossuirAsMesmasChavesUtilizadasPeloWSdoBanco( } } + /** + * @author Denys Xavier + * @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 * @test From 2a95fdb780556a18e589d070043cce5347265449 Mon Sep 17 00:00:00 2001 From: Denys Xavier Date: Mon, 17 Jul 2017 17:07:40 -0300 Subject: [PATCH 2/2] =?UTF-8?q?Valor=20nominal=20do=20t=C3=ADtulo=20corrig?= =?UTF-8?q?ido=20durante=20a=20exporta=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Titulo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Titulo.php b/src/Titulo.php index 3b10271..49eda26 100644 --- a/src/Titulo.php +++ b/src/Titulo.php @@ -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; }