From 0ae8cfee83b0048d7e22b2cfe94c5cee226d8e3d Mon Sep 17 00:00:00 2001 From: JOAO PAULO FERNANDES DE ARAUJO Date: Thu, 25 Jul 2024 00:08:50 -0300 Subject: [PATCH 1/5] Update DacteOS.php mostrar as informacoes do Fisco Foi adicionado o campo ObsFisco para mostrar em USO EXCLUSIVO DO EMISSOR DO CT-E. --- src/CTe/DacteOS.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CTe/DacteOS.php b/src/CTe/DacteOS.php index ead567df..a67d5a96 100644 --- a/src/CTe/DacteOS.php +++ b/src/CTe/DacteOS.php @@ -47,6 +47,7 @@ class DacteOS extends DaCommon protected $veic; protected $ferrov; protected $Comp; + protected $ObsFisco; protected $infNF; protected $infNFe; protected $compl; @@ -130,6 +131,7 @@ private function loadDoc($xml) $this->chaveCTeRef = $this->getTagValue($this->infCteComp, "chave"); $this->vPrest = $this->dom->getElementsByTagName("vPrest")->item(0); $this->Comp = $this->dom->getElementsByTagName("Comp"); + $this->ObsFisco = $this->dom->getElementsByTagName("ObsFisco"); $this->infNF = $this->dom->getElementsByTagName("infNF"); $this->infNFe = $this->dom->getElementsByTagName("infNFe"); $this->infOutros = $this->dom->getElementsByTagName("infOutros"); @@ -144,8 +146,12 @@ private function loadDoc($xml) $vTrib = 0; } $textoAdic = number_format($vTrib, 2, ",", "."); + $textoObsFisco = ""; + foreach($this->ObsFisco as $obsFisco){ + $textoObsFisco .= $this->getTagValue($obsFisco, "xTexto").". "; + } $this->textoAdic = "o valor aproximado de tributos incidentes sobre o preço deste serviço é de R$" - .$textoAdic; + .$textoAdic.'. '.$textoObsFisco; $this->toma = $this->dom->getElementsByTagName("toma")->item(0); $this->enderToma = $this->getTagValue($this->toma, "enderToma"); //modal aquaviário From b82d4107a6ee4624cd82715ba1fee95886334ded Mon Sep 17 00:00:00 2001 From: Cleiton Date: Thu, 17 Oct 2024 13:29:43 -0300 Subject: [PATCH 2/5] Ajustes no DAMDFe para o modal aquaviario. --- src/MDFe/Damdfe.php | 114 ++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 58 deletions(-) diff --git a/src/MDFe/Damdfe.php b/src/MDFe/Damdfe.php index 219d43cf..3de49931 100644 --- a/src/MDFe/Damdfe.php +++ b/src/MDFe/Damdfe.php @@ -1038,73 +1038,71 @@ private function bodyMDFe($x, $y) $aFont = array('font' => $this->fontePadrao, 'size' => 8, 'style' => ''); $this->pdf->textBox($x1, $y, $x2 - 1, 8, $texto, $aFont, 'T', 'L', 0, '', false); } - $x1 = round($maxW / 2, 0) + 7; - $x2 = ($maxW / 6); $y = $yCabecalhoLinha; - $this->quantidadeChavesLayout = 21; - if ($this->orientacao == 'L') { - $x1 = 225; - $y = $yold - 5; - $this->quantidadeChavesLayout = 17; - } - $texto = 'Chaves de acesso'; + } + $x1 = round($maxW / 2, 0) + 7; + $x2 = ($maxW / 6); + $this->quantidadeChavesLayout = 21; + if ($this->orientacao == 'L') { + $x1 = 225; + $y = $yold - 5; + $this->quantidadeChavesLayout = 17; + } + $texto = 'Chaves de acesso'; + $aFont = array('font' => $this->fontePadrao, 'size' => 8, 'style' => ''); + $this->pdf->textBox($x1, $y, $x2, 8, $texto, $aFont, 'T', 'L', 0, '', false); + $y = $y + 2; + $chavesNFe = $this->dom->getElementsByTagName('infDoc')->item(0)->getElementsByTagName('chNFe'); + $chavesCTe = $this->dom->getElementsByTagName('infDoc')->item(0)->getElementsByTagName('chCTe'); + $chavesMDFe = $this->dom->getElementsByTagName('infDoc')->item(0)->getElementsByTagName('chMDFe'); + $chaves = []; + for ($i = 0; $i < $chavesNFe->length; $i++) { + $chaves[] = $chavesNFe->item($i)->nodeValue; + } + for ($i = 0; $i < $chavesCTe->length; $i++) { + $chaves[] = $chavesCTe->item($i)->nodeValue; + } + for ($i = 0; $i < $chavesMDFe->length; $i++) { + $chaves[] = $chavesMDFe->item($i)->nodeValue; + } + $this->chaves = array_slice($chaves, $this->quantidadeChavesLayout); + $contadorChaves = 0; + for ($i = 0; $i < $chavesNFe->length; $i++) { + $y += 4; + $texto = $chavesNFe->item($i)->nodeValue; $aFont = array('font' => $this->fontePadrao, 'size' => 8, 'style' => ''); - $this->pdf->textBox($x1, $y, $x2, 8, $texto, $aFont, 'T', 'L', 0, '', false); - $y = $y + 2; - $chavesNFe = $this->dom->getElementsByTagName('infDoc')->item(0)->getElementsByTagName('chNFe'); - $chavesCTe = $this->dom->getElementsByTagName('infDoc')->item(0)->getElementsByTagName('chCTe'); - $chavesMDFe = $this->dom->getElementsByTagName('infDoc')->item(0)->getElementsByTagName('chMDFe'); - $chaves = []; - for ($i = 0; $i < $chavesNFe->length; $i++) { - $chaves[] = $chavesNFe->item($i)->nodeValue; + $this->pdf->textBox($x1, $y, 70, 8, $texto, $aFont, 'T', 'L', 0, '', false); + $contadorChaves++; + if ($contadorChaves >= $this->quantidadeChavesLayout) { + $this->flagDocs = true; + break; } - for ($i = 0; $i < $chavesCTe->length; $i++) { - $chaves[] = $chavesCTe->item($i)->nodeValue; - } - for ($i = 0; $i < $chavesMDFe->length; $i++) { - $chaves[] = $chavesMDFe->item($i)->nodeValue; - } - $this->chaves = array_slice($chaves, $this->quantidadeChavesLayout); - $contadorChaves = 0; - for ($i = 0; $i < $chavesNFe->length; $i++) { - $y += 4; - $texto = $chavesNFe->item($i)->nodeValue; - $aFont = array('font' => $this->fontePadrao, 'size' => 8, 'style' => ''); - $this->pdf->textBox($x1, $y, 70, 8, $texto, $aFont, 'T', 'L', 0, '', false); - $contadorChaves++; - if ($contadorChaves >= $this->quantidadeChavesLayout) { - $this->flagDocs = true; - break; - } - } - for ($i = 0; $i < $chavesCTe->length; $i++) { - $y += 4; - $texto = $chavesCTe->item($i)->nodeValue; - $aFont = array('font' => $this->fontePadrao, 'size' => 8, 'style' => ''); - $this->pdf->textBox($x1, $y, 70, 8, $texto, $aFont, 'T', 'L', 0, '', false); - $contadorChaves++; - if ($contadorChaves >= $this->quantidadeChavesLayout) { - $this->flagDocs = true; - break; - } + } + for ($i = 0; $i < $chavesCTe->length; $i++) { + $y += 4; + $texto = $chavesCTe->item($i)->nodeValue; + $aFont = array('font' => $this->fontePadrao, 'size' => 8, 'style' => ''); + $this->pdf->textBox($x1, $y, 70, 8, $texto, $aFont, 'T', 'L', 0, '', false); + $contadorChaves++; + if ($contadorChaves >= $this->quantidadeChavesLayout) { + $this->flagDocs = true; + break; } - for ($i = 0; $i < $chavesMDFe->length; $i++) { - $y += 4; - $texto = $chavesMDFe->item($i)->nodeValue; - $aFont = array('font' => $this->fontePadrao, 'size' => 8, 'style' => ''); - $this->pdf->textBox($x1, $y, 70, 8, $texto, $aFont, 'T', 'L', 0, '', false); - $contadorChaves++; - if ($contadorChaves >= $this->quantidadeChavesLayout) { - $this->flagDocs = true; - break; - } + } + for ($i = 0; $i < $chavesMDFe->length; $i++) { + $y += 4; + $texto = $chavesMDFe->item($i)->nodeValue; + $aFont = array('font' => $this->fontePadrao, 'size' => 8, 'style' => ''); + $this->pdf->textBox($x1, $y, 70, 8, $texto, $aFont, 'T', 'L', 0, '', false); + $contadorChaves++; + if ($contadorChaves >= $this->quantidadeChavesLayout) { + $this->flagDocs = true; + break; } } - if ($this->aereo) { $altura = $y + 4; } - if ($this->aquav) { $x1 = $x; $x2 = $maxW; From 1c8f245cb9b37d2034a6ced21ddf5dd614db088b Mon Sep 17 00:00:00 2001 From: Cleiton Date: Thu, 17 Oct 2024 13:30:11 -0300 Subject: [PATCH 3/5] Ajustes na geracao da danfe etiqueta. --- src/NFe/DanfeEtiqueta.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NFe/DanfeEtiqueta.php b/src/NFe/DanfeEtiqueta.php index f62fee7e..22779d52 100644 --- a/src/NFe/DanfeEtiqueta.php +++ b/src/NFe/DanfeEtiqueta.php @@ -375,6 +375,7 @@ protected function bloco4($y) $destMun = $this->getTagValue($this->enderDest, "xMun"); $destUF = $this->getTagValue($this->enderDest, "UF"); $destFone = $this->getTagValue($this->enderDest, "fone"); + $destCep = $this->getTagValue($this->enderDest, "CEP"); if (strlen($destFone) > 0) { if (strlen($destFone) == 11) { $emitFone = $this->formatField($destFone, "(##) #####-####"); @@ -383,7 +384,7 @@ protected function bloco4($y) } } $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => '']; - $texto = $destLgr . ", " . $destNro; + $texto = "{$destLgr}, {$destNro} - CEP: {$destCep}"; $y += $this->pdf->textBox($this->margem + 5, $y, $this->wPrint, 3, $texto, $aFont, 'T', 'L', false, '', true); $texto = $destBairro; $y += $this->pdf->textBox($this->margem + 5, $y, $this->wPrint, 3, $texto, $aFont, 'T', 'L', false, '', true); From 1f01266cf78fb3cb61ffb87882ae98693116cb27 Mon Sep 17 00:00:00 2001 From: Gustavo Kennedy Renkel <98914036+gustavokennedy@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:36:33 -0300 Subject: [PATCH 4/5] =?UTF-8?q?Inclus=C3=A3o=20de=20t=C3=ADtulos=20no=20PD?= =?UTF-8?q?F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue 602 --- src/NFe/Danfe.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/NFe/Danfe.php b/src/NFe/Danfe.php index 77efa4d6..3fb53806 100644 --- a/src/NFe/Danfe.php +++ b/src/NFe/Danfe.php @@ -319,6 +319,13 @@ class Danfe extends DaCommon */ protected $obsshow = true; + protected $title = ''; + + public function setTitle($title) + { + $this->title = $title; + } + /** * __construct * @param string $xml Conteúdo XML da NF-e (com ou sem a tag nfeProc) @@ -491,6 +498,7 @@ protected function monta( $logo = '' ) { $this->pdf = ''; + $this->pdf->setTitle($this->title); $this->logomarca = $this->adjustImage($logo); //se a orientação estiver em branco utilizar o padrão estabelecido na NF if (empty($this->orientacao)) { From 836b2e8209f659ee5d8d8df6105e0733e1a27e64 Mon Sep 17 00:00:00 2001 From: roberto Date: Mon, 11 Nov 2024 16:16:32 -0300 Subject: [PATCH 5/5] Ajute do ultimo PR, que veio com um BUG --- src/NFe/Danfe.php | 3 ++- .../Traits/TraitDadosAdicionaisNfeOutras.php | 25 ------------------- src/NFe/Traits/TraitVeicProd.php | 8 ++++++ 3 files changed, 10 insertions(+), 26 deletions(-) delete mode 100644 src/NFe/Traits/TraitDadosAdicionaisNfeOutras.php create mode 100644 src/NFe/Traits/TraitVeicProd.php diff --git a/src/NFe/Danfe.php b/src/NFe/Danfe.php index 3fb53806..c9318ad0 100644 --- a/src/NFe/Danfe.php +++ b/src/NFe/Danfe.php @@ -498,7 +498,7 @@ protected function monta( $logo = '' ) { $this->pdf = ''; - $this->pdf->setTitle($this->title); + $this->logomarca = $this->adjustImage($logo); //se a orientação estiver em branco utilizar o padrão estabelecido na NF if (empty($this->orientacao)) { @@ -544,6 +544,7 @@ protected function monta( $this->pdf->setFillColor(255, 255, 255); // inicia o documento $this->pdf->open(); + $this->pdf->setTitle($this->title); // adiciona a primeira página $this->pdf->addPage($this->orientacao, $this->papel); $this->pdf->setLineWidth(0.1); diff --git a/src/NFe/Traits/TraitDadosAdicionaisNfeOutras.php b/src/NFe/Traits/TraitDadosAdicionaisNfeOutras.php deleted file mode 100644 index 296bf999..00000000 --- a/src/NFe/Traits/TraitDadosAdicionaisNfeOutras.php +++ /dev/null @@ -1,25 +0,0 @@ -orientacao}"; - return $this->$dados($infCpl, $infAdFisco); - } - - public function dadosAdicionaisOutrasP(string $infCpl = '', string $infAdFisco = ''): float - { - return 0; - } - - public function dadosAdicionaisOutrasL(string $infCpl = '', string $infAdFisco = ''): float - { - return 0; - } -} diff --git a/src/NFe/Traits/TraitVeicProd.php b/src/NFe/Traits/TraitVeicProd.php new file mode 100644 index 00000000..52d67f7b --- /dev/null +++ b/src/NFe/Traits/TraitVeicProd.php @@ -0,0 +1,8 @@ +