Skip to content

Commit

Permalink
Incluido nos calculos de ICMS e ICMS ST os valores do FCP nos totais.
Browse files Browse the repository at this point in the history
  • Loading branch information
icompsoftcleiton committed Nov 7, 2023
1 parent ce7881f commit d903650
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/NFe/Danfe.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ class Danfe extends DaCommon
protected $qtdeItensProc;
/*
* NF-e processada
*
*
* @var \DOMNode
*/
protected $nfeProc;
/*
* Grupo de detalhamento da forma de pagamento
*
*
* @var \DOMNode
*/
protected $detPag;
Expand Down Expand Up @@ -419,7 +419,7 @@ protected function calculoEspacoVericalDadosAdicionais()
// EXIBE EMAIL DO DESTINATÁRIO
if($this->exibirEmailDestinatario){
$this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
}
}

$this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco"))
? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco")
Expand Down Expand Up @@ -2237,14 +2237,24 @@ protected function pagamento($x, $y)
*/
protected function impostoHelper($x, $y, $w, $h, $titulo, $campoImposto)
{
$valorImposto = '0,00';
$the_field = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0);
$value = 0;
$value2 = 0;
$the_field = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0);
if (isset($the_field)) {
$the_value = $the_field->nodeValue;
if (!empty($the_value)) {
$valorImposto = number_format($the_value, 2, ",", ".");
$value = $the_field->nodeValue;
if ($campoImposto == 'vICMS') { // soma junto ao ICMS o FCP
$the_field_aux = $this->ICMSTot->getElementsByTagName('vFCP')->item(0);
if (isset($the_field_aux)) {
$value2 = $the_field_aux->nodeValue;
}
} else if ($campoImposto == 'vST') { // soma junto ao ICMS ST o FCP ST
$the_field_aux = $this->ICMSTot->getElementsByTagName('vFCPST')->item(0);
if (isset($the_field_aux)) {
$value2 = $the_field_aux->nodeValue;
}
}
}
$valorImposto = number_format($value + $value2, 2, ",", ".");

$fontTitulo = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
$fontValor = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
Expand Down

0 comments on commit d903650

Please sign in to comment.