Passed
Push — master ( 84d27f...0f40a7 )
by Roberto
03:03 queued 10s
created
src/NFe/Danfe.php 1 patch
Spacing   +317 added lines, -318 removed lines patch added patch discarded remove patch
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
             $this->fontePadrao = $fonteDANFE;
356 356
         }
357 357
         //se for passado o xml
358
-        if (! empty($this->xml)) {
358
+        if (!empty($this->xml)) {
359 359
             $this->dom = new Dom();
360 360
             $this->dom->loadXML($this->xml);
361 361
             $this->nfeProc    = $this->dom->getElementsByTagName("nfeProc")->item(0);
@@ -511,10 +511,10 @@  discard block
 block discarded – undo
511 511
         //total inicial de paginas
512 512
         $totPag = 1;
513 513
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
514
-        $this->wPrint = $maxW-($margEsq*2);
514
+        $this->wPrint = $maxW - ($margEsq * 2);
515 515
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
516 516
         //superior e inferior
517
-        $this->hPrint = $maxH-$margSup-$margInf;
517
+        $this->hPrint = $maxH - $margSup - $margInf;
518 518
         // estabelece contagem de paginas
519 519
         $this->pdf->aliasNbPages();
520 520
         // fixa as margens
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
         }
553 553
         //calcular a altura necessária para os dados adicionais
554 554
         if ($this->orientacao == 'P') {
555
-            $this->wAdic = round($this->wPrint*0.66, 0);
555
+            $this->wAdic = round($this->wPrint * 0.66, 0);
556 556
         } else {
557
-            $this->wAdic = round(($this->wPrint-$this->wCanhoto)*0.5, 0);
557
+            $this->wAdic = round(($this->wPrint - $this->wCanhoto) * 0.5, 0);
558 558
         }
559 559
         $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
560 560
         $this->textoAdic = '';
@@ -566,8 +566,8 @@  discard block
 block discarded – undo
566 566
             $txRetxBairro = $this->getTagValue($this->retirada, "xBairro");
567 567
             $txRetxMun = $this->getTagValue($this->retirada, "xMun");
568 568
             $txRetUF = $this->getTagValue($this->retirada, "UF");
569
-            $this->textoAdic .= "LOCAL DE RETIRADA : ".
570
-                    $txRetCNPJ.
569
+            $this->textoAdic .= "LOCAL DE RETIRADA : " .
570
+                    $txRetCNPJ .
571 571
                     '-' .
572 572
                     $txRetxLgr .
573 573
                     ', ' .
@@ -594,8 +594,8 @@  discard block
 block discarded – undo
594 594
             if ($this->textoAdic != '') {
595 595
                 $this->textoAdic .= ". \r\n";
596 596
             }
597
-            $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl.
598
-               ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n";
597
+            $this->textoAdic .= "LOCAL DE ENTREGA : " . $txRetCNPJ . '-' . $txRetxLgr . ', ' . $txRetnro . ' ' . $txRetxCpl .
598
+               ' - ' . $txRetxBairro . ' ' . $txRetxMun . ' - ' . $txRetUF . "\r\n";
599 599
         }
600 600
         //informações adicionais
601 601
         $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
             if ($this->textoAdic != '') {
605 605
                 $this->textoAdic .= ". \r\n";
606 606
             }
607
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl")) ?
607
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl")) ?
608 608
                 'Inf. Contribuinte: ' .
609 609
                 $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl")) : '';
610 610
             $infPedido = $this->geraInformacoesDaTagCompra();
@@ -612,14 +612,14 @@  discard block
 block discarded – undo
612 612
                 $this->textoAdic .= $infPedido;
613 613
             }
614 614
             $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
615
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco")) ?
615
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco")) ?
616 616
                 "\r\n Inf. fisco: " .
617 617
                 $this->getTagValue($this->infAdic, "infAdFisco") : '';
618 618
             $obsCont = $this->infAdic->getElementsByTagName("obsCont");
619 619
             if (isset($obsCont)) {
620 620
                 foreach ($obsCont as $obs) {
621
-                    $campo =  $obsCont->item($i)->getAttribute("xCampo");
622
-                    $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) ?
621
+                    $campo = $obsCont->item($i)->getAttribute("xCampo");
622
+                    $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) ?
623 623
                         $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue : '';
624 624
                     $this->textoAdic .= "\r\n" . $campo . ':  ' . trim($xTexto);
625 625
                     $i++;
@@ -647,38 +647,38 @@  discard block
 block discarded – undo
647 647
         foreach ($alinhas as $linha) {
648 648
             $numlinhasdados += $this->pdf->getNumLines($linha, $this->wAdic, $fontProduto);
649 649
         }
650
-        $hdadosadic = round(($numlinhasdados+3) * $this->pdf->fontSize, 0);
650
+        $hdadosadic = round(($numlinhasdados + 3) * $this->pdf->fontSize, 0);
651 651
         if ($hdadosadic < 10) {
652 652
             $hdadosadic = 10;
653 653
         }
654 654
         //altura disponivel para os campos da DANFE
655
-        $hcabecalho = 47;//para cabeçalho
656
-        $hdestinatario = 25;//para destinatario
657
-        $hduplicatas = 12;//para cada grupo de 7 duplicatas
658
-        $himposto = 18;// para imposto
659
-        $htransporte = 25;// para transporte
660
-        $hissqn = 11;// para issqn
661
-        $hfooter = 5;// para rodape
662
-        $hCabecItens = 4;//cabeçalho dos itens
655
+        $hcabecalho = 47; //para cabeçalho
656
+        $hdestinatario = 25; //para destinatario
657
+        $hduplicatas = 12; //para cada grupo de 7 duplicatas
658
+        $himposto = 18; // para imposto
659
+        $htransporte = 25; // para transporte
660
+        $hissqn = 11; // para issqn
661
+        $hfooter = 5; // para rodape
662
+        $hCabecItens = 4; //cabeçalho dos itens
663 663
         //alturas disponiveis para os dados
664 664
         $hDispo1 = $this->hPrint - 10 - ($hcabecalho +
665 665
             $hdestinatario + ($linhasDup * $hduplicatas) + $himposto + $htransporte +
666 666
             ($linhaISSQN * $hissqn) + $hdadosadic + $hfooter + $hCabecItens +
667 667
             $this->sizeExtraTextoFatura());
668 668
         if ($this->orientacao == 'P') {
669
-            $hDispo1 -= 24 * $this->qCanhoto;//para canhoto
669
+            $hDispo1 -= 24 * $this->qCanhoto; //para canhoto
670 670
             $w = $this->wPrint;
671 671
         } else {
672
-            $hcanhoto = $this->hPrint;//para canhoto
672
+            $hcanhoto = $this->hPrint; //para canhoto
673 673
             $w = $this->wPrint - $this->wCanhoto;
674 674
         }
675
-        $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens)-4;
675
+        $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens) - 4;
676 676
         //Contagem da altura ocupada para impressão dos itens
677 677
         $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
678 678
         $i = 1;
679 679
         $numlinhas = 0;
680 680
         $hUsado = $hCabecItens;
681
-        $w2 = round($w*0.28, 0);
681
+        $w2 = round($w * 0.28, 0);
682 682
         $hDispo = $hDispo1;
683 683
         $totPag = 1;
684 684
         while ($i < $this->det->length) {
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
                 $hDispo = $hDispo2;
691 691
                 $hUsado = $hCabecItens;
692 692
                 // Remove canhoto para páginas secundárias em modo paisagem ('L')
693
-                $w2 = round($this->wPrint*0.28, 0);
693
+                $w2 = round($this->wPrint * 0.28, 0);
694 694
                 $i--; // decrementa para readicionar o item que não coube nessa pagina na outra.
695 695
             }
696 696
             $i++;
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
         //coloca o cabeçalho
715 715
         $y = $this->cabecalhoDANFE($x, $y, $pag, $totPag);
716 716
         //coloca os dados do destinatário
717
-        $y = $this->destinatarioDANFE($x, $y+1);
717
+        $y = $this->destinatarioDANFE($x, $y + 1);
718 718
         
719 719
         
720 720
         //Verifica as formas de pagamento da nota fiscal
@@ -728,29 +728,29 @@  discard block
 block discarded – undo
728 728
         }
729 729
         //caso tenha boleto imprimir fatura
730 730
         if ($this->dup->length > 0) {
731
-            $y = $this->faturaDANFE($x, $y+1);
731
+            $y = $this->faturaDANFE($x, $y + 1);
732 732
         } else {
733 733
             //Se somente tiver a forma de pagamento sem pagamento ou outros não imprimir nada
734
-            if (count($formaPag)=='1' && (isset($formaPag[90]) || isset($formaPag[99]))) {
734
+            if (count($formaPag) == '1' && (isset($formaPag[90]) || isset($formaPag[99]))) {
735 735
                 $y = $y;
736 736
             } else {
737 737
                 //caso tenha mais de uma forma de pagamento ou seja diferente de boleto exibe a
738 738
                 //forma de pagamento e o valor
739
-                $y = $this->pagamentoDANFE($x, $y+1);
739
+                $y = $this->pagamentoDANFE($x, $y + 1);
740 740
             }
741 741
         }
742 742
         //coloca os dados dos impostos e totais da NFe
743
-        $y = $this->impostoDANFE($x, $y+1);
743
+        $y = $this->impostoDANFE($x, $y + 1);
744 744
         //coloca os dados do trasnporte
745
-        $y = $this->transporteDANFE($x, $y+1);
745
+        $y = $this->transporteDANFE($x, $y + 1);
746 746
         //itens da DANFE
747 747
         $nInicial = 0;
748 748
 
749
-        $y = $this->itensDANFE($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens);
749
+        $y = $this->itensDANFE($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens);
750 750
 
751 751
         //coloca os dados do ISSQN
752 752
         if ($linhaISSQN == 1) {
753
-            $y = $this->issqnDANFE($x, $y+4);
753
+            $y = $this->issqnDANFE($x, $y + 4);
754 754
         } else {
755 755
             $y += 4;
756 756
         }
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
         $y = $this->dadosAdicionaisDANFE($x, $y, $hdadosadic);
759 759
         //coloca o rodapé da página
760 760
         if ($this->orientacao == 'P') {
761
-            $this->rodape($xInic, $y-1);
761
+            $this->rodape($xInic, $y - 1);
762 762
         } else {
763 763
             $this->rodape($xInic, $this->hPrint + 1);
764 764
         }
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
             //coloca o cabeçalho na página adicional
780 780
             $y = $this->cabecalhoDANFE($x, $y, $n, $totPag);
781 781
             //coloca os itens na página adicional
782
-            $y = $this->itensDANFE($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens);
782
+            $y = $this->itensDANFE($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens);
783 783
             //coloca o rodapé da página
784 784
             if ($this->orientacao == 'P') {
785 785
                 $this->rodape($xInic, $y + 4);
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
             }
793 793
         }
794 794
         //retorna o ID na NFe
795
-        if ($classPdf!==false) {
795
+        if ($classPdf !== false) {
796 796
             $aR = [
797 797
                 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")),
798 798
                 'classe_PDF'=>$this->pdf
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
         if ($startPos === false) {
827 827
             return $cdata;
828 828
         }
829
-        for ($x=$len; $x>0; $x--) {
829
+        for ($x = $len; $x > 0; $x--) {
830 830
             if (substr($cdata, $x, 1) == '>') {
831 831
                 $endPos = $x;
832 832
                 break;
@@ -837,15 +837,15 @@  discard block
 block discarded – undo
837 837
         } else {
838 838
             $parte1 = '';
839 839
         }
840
-        $parte2 = substr($cdata, $startPos, $endPos-$startPos+1);
840
+        $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1);
841 841
         if ($endPos < $len) {
842 842
             $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1);
843 843
         } else {
844 844
             $parte3 = '';
845 845
         }
846
-        $texto = trim($parte1).' '.trim($parte3);
846
+        $texto = trim($parte1) . ' ' . trim($parte3);
847 847
         if (strpos($parte2, '<CDATA>') === false) {
848
-            $cdata = '<CDATA>'.$parte2.'</CDATA>';
848
+            $cdata = '<CDATA>' . $parte2 . '</CDATA>';
849 849
         } else {
850 850
             $cdata = $parte2;
851 851
         }
@@ -919,15 +919,15 @@  discard block
 block discarded – undo
919 919
         //grupo CADATA infCpl
920 920
         $t = $dom->getElementsByTagName('transmissor')->item(0);
921 921
         $r = $dom->getElementsByTagName('receptor')->item(0);
922
-        $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
923
-            'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : '';
924
-        $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
925
-            'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : '';
926
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
927
-            'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : '';
928
-        $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
929
-            'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : '';
930
-        $texto .= "".$versao.$especieNF.$fabEntrega.$dca;
922
+        $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
923
+            'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
924
+        $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
925
+            'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
926
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
927
+            'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
928
+        $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
929
+            'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
930
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
931 931
         if (isset($t)) {
932 932
             if ($t->hasAttributes()) {
933 933
                 $texto .= " Transmissor ";
@@ -1048,14 +1048,14 @@  discard block
 block discarded – undo
1048 1048
         }
1049 1049
         //####################################################################################
1050 1050
         //coluna esquerda identificação do emitente
1051
-        $w = round($maxW*0.41, 0);
1051
+        $w = round($maxW * 0.41, 0);
1052 1052
         if ($this->orientacao == 'P') {
1053 1053
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
1054 1054
         } else {
1055 1055
             $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
1056 1056
         }
1057 1057
         $w1 = $w;
1058
-        $h=32;
1058
+        $h = 32;
1059 1059
         $oldY += $h;
1060 1060
         $this->pdf->textBox($x, $y, $w, $h);
1061 1061
         $texto = 'IDENTIFICAÇÃO DO EMITENTE';
@@ -1076,39 +1076,39 @@  discard block
 block discarded – undo
1076 1076
                 $type == 'jpg';
1077 1077
             }
1078 1078
             //largura da imagem em mm
1079
-            $logoWmm = ($logoInfo[0]/72)*25.4;
1079
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
1080 1080
             //altura da imagem em mm
1081
-            $logoHmm = ($logoInfo[1]/72)*25.4;
1082
-            if ($this->logoAlign=='L') {
1083
-                $nImgW = round($w/3, 0);
1084
-                $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
1085
-                $xImg = $x+1;
1086
-                $yImg = round(($h-$nImgH)/2, 0)+$y;
1081
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
1082
+            if ($this->logoAlign == 'L') {
1083
+                $nImgW = round($w / 3, 0);
1084
+                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
1085
+                $xImg = $x + 1;
1086
+                $yImg = round(($h - $nImgH) / 2, 0) + $y;
1087 1087
                 //estabelecer posições do texto
1088
-                $x1 = round($xImg + $nImgW +1, 0);
1089
-                $y1 = round($h/3+$y, 0);
1090
-                $tw = round(2*$w/3, 0);
1091
-            } elseif ($this->logoAlign=='C') {
1092
-                $nImgH = round($h/3, 0);
1093
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
1094
-                $xImg = round(($w-$nImgW)/2+$x, 0);
1095
-                $yImg = $y+3;
1088
+                $x1 = round($xImg + $nImgW + 1, 0);
1089
+                $y1 = round($h / 3 + $y, 0);
1090
+                $tw = round(2 * $w / 3, 0);
1091
+            } elseif ($this->logoAlign == 'C') {
1092
+                $nImgH = round($h / 3, 0);
1093
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
1094
+                $xImg = round(($w - $nImgW) / 2 + $x, 0);
1095
+                $yImg = $y + 3;
1096 1096
                 $x1 = $x;
1097 1097
                 $y1 = round($yImg + $nImgH + 1, 0);
1098 1098
                 $tw = $w;
1099
-            } elseif ($this->logoAlign=='R') {
1100
-                $nImgW = round($w/3, 0);
1101
-                $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
1102
-                $xImg = round($x+($w-(1+$nImgW)), 0);
1103
-                $yImg = round(($h-$nImgH)/2, 0)+$y;
1099
+            } elseif ($this->logoAlign == 'R') {
1100
+                $nImgW = round($w / 3, 0);
1101
+                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
1102
+                $xImg = round($x + ($w - (1 + $nImgW)), 0);
1103
+                $yImg = round(($h - $nImgH) / 2, 0) + $y;
1104 1104
                 $x1 = $x;
1105
-                $y1 = round($h/3+$y, 0);
1106
-                $tw = round(2*$w/3, 0);
1107
-            } elseif ($this->logoAlign=='F') {
1108
-                $nImgH = round($h-5, 0);
1109
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
1110
-                $xImg = round(($w-$nImgW)/2+$x, 0);
1111
-                $yImg = $y+3;
1105
+                $y1 = round($h / 3 + $y, 0);
1106
+                $tw = round(2 * $w / 3, 0);
1107
+            } elseif ($this->logoAlign == 'F') {
1108
+                $nImgH = round($h - 5, 0);
1109
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
1110
+                $xImg = round(($w - $nImgW) / 2 + $x, 0);
1111
+                $yImg = $y + 3;
1112 1112
                 $x1 = $x;
1113 1113
                 $y1 = round($yImg + $nImgH + 1, 0);
1114 1114
                 $tw = $w;
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
             $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, $type);
1118 1118
         } else {
1119 1119
             $x1 = $x;
1120
-            $y1 = round($h/3+$y, 0);
1120
+            $y1 = round($h / 3 + $y, 0);
1121 1121
             $tw = $w;
1122 1122
         }
1123 1123
         // monta as informações apenas se diferente de full logo
@@ -1127,9 +1127,9 @@  discard block
 block discarded – undo
1127 1127
             $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue;
1128 1128
             $this->pdf->textBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, '');
1129 1129
             //endereço
1130
-            $y1 = $y1+5;
1130
+            $y1 = $y1 + 5;
1131 1131
             $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1132
-            $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
1132
+            $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
1133 1133
                  ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
1134 1134
                  : '';
1135 1135
             $lgr = $this->getTagValue($this->enderEmit, "xLgr");
@@ -1149,34 +1149,34 @@  discard block
 block discarded – undo
1149 1149
         //####################################################################################
1150 1150
         //coluna central Danfe
1151 1151
         $x += $w;
1152
-        $w=round($maxW * 0.17, 0);//35;
1152
+        $w = round($maxW * 0.17, 0); //35;
1153 1153
         $w2 = $w;
1154 1154
         $h = 32;
1155 1155
         $this->pdf->textBox($x, $y, $w, $h);
1156 1156
   
1157 1157
         $texto = "DANFE";
1158 1158
         $aFont = ['font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B'];
1159
-        $this->pdf->textBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
1159
+        $this->pdf->textBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
1160 1160
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1161 1161
         $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica';
1162 1162
         $h = 20;
1163
-        $this->pdf->textBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false);
1163
+        $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false);
1164 1164
         
1165 1165
 
1166 1166
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1167 1167
         $texto = '0 - ENTRADA';
1168 1168
         $y1 = $y + 14;
1169 1169
         $h = 8;
1170
-        $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1170
+        $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1171 1171
         $texto = '1 - SAÍDA';
1172 1172
         $y1 = $y + 17;
1173
-        $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1173
+        $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1174 1174
         //tipo de nF
1175 1175
         $aFont = ['font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B'];
1176 1176
         $y1 = $y + 13;
1177 1177
         $h = 7;
1178 1178
         $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
1179
-        $this->pdf->textBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, '');
1179
+        $this->pdf->textBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, '');
1180 1180
         //numero da NF
1181 1181
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1182 1182
         $y1 = $y + 20;
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
         //####################################################################################
1199 1199
         //coluna codigo de barras
1200 1200
         $x += $w;
1201
-        $w = ($maxW-$w1-$w2);//85;
1201
+        $w = ($maxW - $w1 - $w2); //85;
1202 1202
         $w3 = $w;
1203 1203
         $h = 32;
1204 1204
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1207,22 +1207,22 @@  discard block
 block discarded – undo
1207 1207
         $bW = 75;
1208 1208
         $bH = 12;
1209 1209
         //codigo de barras
1210
-        $this->pdf->Code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH);
1210
+        $this->pdf->Code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH);
1211 1211
         //linhas divisorias
1212
-        $this->pdf->line($x, $y+4+$bH, $x+$w, $y+4+$bH);
1213
-        $this->pdf->line($x, $y+12+$bH, $x+$w, $y+12+$bH);
1212
+        $this->pdf->line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH);
1213
+        $this->pdf->line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH);
1214 1214
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1215
-        $y1 = $y+4+$bH;
1215
+        $y1 = $y + 4 + $bH;
1216 1216
         $h = 7;
1217 1217
         $texto = 'CHAVE DE ACESSO';
1218 1218
         $this->pdf->textBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1219 1219
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
1220
-        $y1 = $y+8+$bH;
1220
+        $y1 = $y + 8 + $bH;
1221 1221
         $texto = $this->formatField($chave_acesso, $this->formatoChave);
1222
-        $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, '');
1223
-        $y1 = $y+12+$bH;
1222
+        $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, '');
1223
+        $y1 = $y + 12 + $bH;
1224 1224
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1225
-        $chaveContingencia="";
1225
+        $chaveContingencia = "";
1226 1226
         if ($this->pNotaDPEC()) {
1227 1227
             $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC';
1228 1228
         } else {
@@ -1233,16 +1233,16 @@  discard block
 block discarded – undo
1233 1233
             $chaveContingencia = $this->pGeraChaveAdicionalDeContingencia();
1234 1234
             $this->pdf->setFillColor(0, 0, 0);
1235 1235
             //codigo de barras
1236
-            $this->pdf->code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2);
1236
+            $this->pdf->code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2);
1237 1237
         } else {
1238 1238
             $texto = 'Consulta de autenticidade no portal nacional da NF-e';
1239
-            $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, '');
1240
-            $y1 = $y+16+$bH;
1239
+            $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, '');
1240
+            $y1 = $y + 16 + $bH;
1241 1241
             $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora';
1242 1242
             $this->pdf->textBox(
1243
-                $x+2,
1243
+                $x + 2,
1244 1244
                 $y1,
1245
-                $w-2,
1245
+                $w - 2,
1246 1246
                 $h,
1247 1247
                 $texto,
1248 1248
                 $aFont,
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
         //natureza da operação
1259 1259
         $texto = 'NATUREZA DA OPERAÇÃO';
1260 1260
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1261
-        $w = $w1+$w2;
1261
+        $w = $w1 + $w2;
1262 1262
         $y = $oldY;
1263 1263
         $oldY += $h;
1264 1264
         $x = $oldX;
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
                 $cStat = '';
1289 1289
             } else {
1290 1290
                 if (isset($this->nfeProc)) {
1291
-                    $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ?
1291
+                    $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ?
1292 1292
                             $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue : '';
1293 1293
                     $tsHora = $this->convertTime($this->nfeProc->getElementsByTagName("dhRecbto")->item(0)->nodeValue);
1294 1294
                     if ($texto != '') {
@@ -1319,25 +1319,25 @@  discard block
 block discarded – undo
1319 1319
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1320 1320
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1321 1321
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1322
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1322
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1323 1323
              ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1324 1324
              : '';
1325 1325
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1326 1326
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1327 1327
         //CNPJ
1328 1328
         $x += $w;
1329
-        $w = ($maxW-(2*$w));
1329
+        $w = ($maxW - (2 * $w));
1330 1330
         $texto = 'CNPJ / CPF';
1331 1331
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1332 1332
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1333 1333
         //Pegando valor do CPF/CNPJ
1334
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1334
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1335 1335
             $texto = $this->formatField(
1336 1336
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1337 1337
                 "###.###.###/####-##"
1338 1338
             );
1339 1339
         } else {
1340
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1340
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1341 1341
                 $this->formatField(
1342 1342
                     $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1343 1343
                     "###.###.###-##"
@@ -1353,22 +1353,22 @@  discard block
 block discarded – undo
1353 1353
         $resp = $this->statusNFe();
1354 1354
         if (!$resp['status']) {
1355 1355
             $x = 10;
1356
-            $y = $this->hPrint-130;
1356
+            $y = $this->hPrint - 130;
1357 1357
             $h = 25;
1358
-            $w = $maxW-(2*$x);
1358
+            $w = $maxW - (2 * $x);
1359 1359
             $this->pdf->setTextColor(90, 90, 90);
1360 1360
             $texto = $resp['message'];
1361 1361
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1362 1362
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1363 1363
             $y += $h;
1364 1364
             $h = 5;
1365
-            $w = $maxW-(2*$x);
1365
+            $w = $maxW - (2 * $x);
1366 1366
             if (isset($this->infProt) && $resp['status']) {
1367 1367
                 $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue;
1368 1368
             } else {
1369 1369
                 $xMotivo = '';
1370 1370
             }
1371
-            $texto = "SEM VALOR FISCAL\n".$xMotivo;
1371
+            $texto = "SEM VALOR FISCAL\n" . $xMotivo;
1372 1372
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1373 1373
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1374 1374
             $this->pdf->setTextColor(0, 0, 0);
@@ -1391,12 +1391,12 @@  discard block
 block discarded – undo
1391 1391
         if ($this->pNotaDPEC() || $this->tpEmis == 4) {
1392 1392
             //DPEC
1393 1393
             $x = 10;
1394
-            $y = $this->hPrint-130;
1394
+            $y = $this->hPrint - 130;
1395 1395
             $h = 25;
1396
-            $w = $maxW-(2*$x);
1396
+            $w = $maxW - (2 * $x);
1397 1397
             $this->pdf->SetTextColor(200, 200, 200);
1398
-            $texto = "DANFE impresso em contingência -\n".
1399
-                     "DPEC regularmente recebido pela Receita\n".
1398
+            $texto = "DANFE impresso em contingência -\n" .
1399
+                     "DPEC regularmente recebido pela Receita\n" .
1400 1400
                      "Federal do Brasil";
1401 1401
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1402 1402
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
@@ -1515,7 +1515,7 @@  discard block
 block discarded – undo
1515 1515
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1516 1516
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1517 1517
         //NOME / RAZÃO SOCIAL
1518
-        $w = round($maxW*0.61, 0);
1518
+        $w = round($maxW * 0.61, 0);
1519 1519
         $w1 = $w;
1520 1520
         $y += 3;
1521 1521
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1530,19 +1530,19 @@  discard block
 block discarded – undo
1530 1530
         }
1531 1531
         //CNPJ / CPF
1532 1532
         $x += $w;
1533
-        $w = round($maxW*0.23, 0);
1533
+        $w = round($maxW * 0.23, 0);
1534 1534
         $w2 = $w;
1535 1535
         $texto = 'CNPJ / CPF';
1536 1536
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1537 1537
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1538 1538
         //Pegando valor do CPF/CNPJ
1539
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1539
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1540 1540
             $texto = $this->formatField(
1541 1541
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1542 1542
                 "###.###.###/####-##"
1543 1543
             );
1544 1544
         } else {
1545
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1545
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1546 1546
                     $this->formatField(
1547 1547
                         $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1548 1548
                         "###.###.###-##"
@@ -1552,15 +1552,15 @@  discard block
 block discarded – undo
1552 1552
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1553 1553
         //DATA DA EMISSÃO
1554 1554
         $x += $w;
1555
-        $w = $maxW-($w1+$w2);
1555
+        $w = $maxW - ($w1 + $w2);
1556 1556
         $wx = $w;
1557 1557
         $texto = 'DATA DA EMISSÃO';
1558 1558
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1559 1559
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1560
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
1560
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
1561 1561
                 $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
1562 1562
         if ($dEmi == '') {
1563
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
1563
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
1564 1564
                     $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
1565 1565
             $aDemi = explode('T', $dEmi);
1566 1566
             $dEmi = $aDemi[0];
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1574 1574
         }
1575 1575
         //ENDEREÇO
1576
-        $w = round($maxW*0.47, 0);
1576
+        $w = round($maxW * 0.47, 0);
1577 1577
         $w1 = $w;
1578 1578
         $y += $h;
1579 1579
         $x = $oldX;
@@ -1588,7 +1588,7 @@  discard block
 block discarded – undo
1588 1588
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1589 1589
         //BAIRRO / DISTRITO
1590 1590
         $x += $w;
1591
-        $w = round($maxW*0.21, 0);
1591
+        $w = round($maxW * 0.21, 0);
1592 1592
         $w2 = $w;
1593 1593
         $texto = 'BAIRRO / DISTRITO';
1594 1594
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
@@ -1598,12 +1598,12 @@  discard block
 block discarded – undo
1598 1598
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1599 1599
         //CEP
1600 1600
         $x += $w;
1601
-        $w = $maxW-$w1-$w2-$wx;
1601
+        $w = $maxW - $w1 - $w2 - $wx;
1602 1602
         $w2 = $w;
1603 1603
         $texto = 'CEP';
1604 1604
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1605 1605
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1606
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1606
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1607 1607
                 $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1608 1608
         $texto = $this->formatField($texto, "#####-###");
1609 1609
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
@@ -1614,10 +1614,10 @@  discard block
 block discarded – undo
1614 1614
         $texto = 'DATA DA SAÍDA/ENTRADA';
1615 1615
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1616 1616
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1617
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ?
1617
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ?
1618 1618
                 $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue : '';
1619 1619
         if ($dSaiEnt == '') {
1620
-            $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ?
1620
+            $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ?
1621 1621
                     $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : '';
1622 1622
             $aDsaient = explode('T', $dSaiEnt);
1623 1623
             $dSaiEnt = $aDsaient[0];
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1635 1635
         $texto = $this->dest->getElementsByTagName("xMun")->item(0)->nodeValue;
1636 1636
         if (strtoupper(trim($texto)) == "EXTERIOR" && $this->dest->getElementsByTagName("xPais")->length > 0) {
1637
-            $texto .= " - " .  $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue;
1637
+            $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue;
1638 1638
         }
1639 1639
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1640 1640
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1649,18 +1649,18 @@  discard block
 block discarded – undo
1649 1649
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1650 1650
         //FONE / FAX
1651 1651
         $x += $w;
1652
-        $w = round(($maxW -$w1-$wx-8)/2, 0);
1652
+        $w = round(($maxW - $w1 - $wx - 8) / 2, 0);
1653 1653
         $w3 = $w;
1654 1654
         $texto = 'FONE / FAX';
1655 1655
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1656 1656
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1657
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ?
1657
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ?
1658 1658
                 $this->dest->getElementsByTagName("fone")->item(0)->nodeValue : '';
1659 1659
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1660 1660
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1661 1661
         //INSCRIÇÃO ESTADUAL
1662 1662
         $x += $w;
1663
-        $w = $maxW -$w1-$wx-8-$w3;
1663
+        $w = $maxW - $w1 - $wx - 8 - $w3;
1664 1664
         $texto = 'INSCRIÇÃO ESTADUAL';
1665 1665
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1666 1666
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1674,10 +1674,10 @@  discard block
 block discarded – undo
1674 1674
         $texto = 'HORA DA SAÍDA/ENTRADA';
1675 1675
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1676 1676
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1677
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ?
1677
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ?
1678 1678
                 $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue : '';
1679 1679
         if ($hSaiEnt == '') {
1680
-            $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ?
1680
+            $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ?
1681 1681
                     $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : '';
1682 1682
             $tsDhSaiEnt = $this->convertTime($dhSaiEnt);
1683 1683
             if ($tsDhSaiEnt != '') {
@@ -1756,7 +1756,7 @@  discard block
 block discarded – undo
1756 1756
     protected function faturaDANFE($x, $y)
1757 1757
     {
1758 1758
         $linha = 1;
1759
-        $h = 8+3;
1759
+        $h = 8 + 3;
1760 1760
         $oldx = $x;
1761 1761
         $textoFatura = $this->getTextoFatura();
1762 1762
         //verificar se existem duplicatas
@@ -1777,27 +1777,27 @@  discard block
 block discarded – undo
1777 1777
             $dupcont = 0;
1778 1778
             $nFat = $this->dup->length;
1779 1779
             if ($textoFatura !== "" && $this->exibirTextoFatura) {
1780
-                $myH=6;
1780
+                $myH = 6;
1781 1781
                 $myW = $this->wPrint;
1782 1782
                 if ($this->orientacao == 'L') {
1783 1783
                     $myW -= $this->wCanhoto;
1784 1784
                 }
1785 1785
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1786 1786
                 $this->pdf->textBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, '');
1787
-                $y+=$myH+1;
1787
+                $y += $myH + 1;
1788 1788
             }
1789 1789
             if ($this->orientacao == 'P') {
1790
-                $w = round($this->wPrint/7.018, 0)-1;
1790
+                $w = round($this->wPrint / 7.018, 0) - 1;
1791 1791
             } else {
1792 1792
                 $w = 28;
1793 1793
             }
1794 1794
             $increm = 1;
1795 1795
             foreach ($this->dup as $k => $d) {
1796
-                $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ?
1796
+                $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ?
1797 1797
                         $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue : '';
1798
-                $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ?
1798
+                $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ?
1799 1799
                         $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) : '';
1800
-                $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ?
1800
+                $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ?
1801 1801
                         'R$ ' . number_format(
1802 1802
                             $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1803 1803
                             2,
@@ -1806,14 +1806,14 @@  discard block
 block discarded – undo
1806 1806
                         ) : '';
1807 1807
                 $h = 8;
1808 1808
                 $texto = '';
1809
-                if ($nDup!='0' && $nDup!='') {
1809
+                if ($nDup != '0' && $nDup != '') {
1810 1810
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1811 1811
                     $this->pdf->textBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, '');
1812 1812
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1813 1813
                     $this->pdf->textBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, '');
1814 1814
                 } else {
1815 1815
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1816
-                    $this->pdf->textBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, '');
1816
+                    $this->pdf->textBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, '');
1817 1817
                 }
1818 1818
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1819 1819
                 $this->pdf->textBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, '');
@@ -1823,7 +1823,7 @@  discard block
 block discarded – undo
1823 1823
                 $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, '');
1824 1824
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1825 1825
                 $this->pdf->textBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, '');
1826
-                $x += $w+$increm;
1826
+                $x += $w + $increm;
1827 1827
                 $dupcont += 1;
1828 1828
                 if ($this->orientacao == 'P') {
1829 1829
                     $maxDupCont = 6;
@@ -1845,10 +1845,10 @@  discard block
 block discarded – undo
1845 1845
                 $y -= 9;
1846 1846
                 $linha--;
1847 1847
             }
1848
-            return ($y+$h);
1848
+            return ($y + $h);
1849 1849
         } else {
1850 1850
             $linha = 0;
1851
-            return ($y-2);
1851
+            return ($y - 2);
1852 1852
         }
1853 1853
     } //fim da função faturaDANFE
1854 1854
 
@@ -1864,7 +1864,7 @@  discard block
 block discarded – undo
1864 1864
     protected function pagamentoDANFE($x, $y)
1865 1865
     {
1866 1866
         $linha = 1;
1867
-        $h = 8+3;
1867
+        $h = 8 + 3;
1868 1868
         $oldx = $x;
1869 1869
         //verificar se existem cobranças definidas
1870 1870
         if (isset($this->detPag) && $this->detPag->length > 0) {
@@ -1883,7 +1883,7 @@  discard block
 block discarded – undo
1883 1883
             $dups = "";
1884 1884
             $dupcont = 0;
1885 1885
             if ($this->orientacao == 'P') {
1886
-                $w = round($this->wPrint/7.018, 0)-1;
1886
+                $w = round($this->wPrint / 7.018, 0) - 1;
1887 1887
             } else {
1888 1888
                 $w = 28;
1889 1889
             }
@@ -1893,16 +1893,16 @@  discard block
 block discarded – undo
1893 1893
                 $maxDupCont = 8;
1894 1894
             }
1895 1895
             $increm = 1;
1896
-            $formaPagamento = ['01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito',
1897
-                                    '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação',
1898
-                                    '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível',
1899
-                                    '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'];
1900
-            $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners',
1901
-                              '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
1896
+            $formaPagamento = ['01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito',
1897
+                                    '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação',
1898
+                                    '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível',
1899
+                                    '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros'];
1900
+            $bandeira = ['01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners',
1901
+                              '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros'];
1902 1902
             foreach ($this->detPag as $k => $d) {
1903 1903
                 $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
1904 1904
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue : '0';
1905
-                $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
1905
+                $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
1906 1906
                     ? 'R$ ' . number_format(
1907 1907
                         $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
1908 1908
                         2,
@@ -1913,7 +1913,7 @@  discard block
 block discarded – undo
1913 1913
                 $texto = '';
1914 1914
                 if (isset($formaPagamento[$fPag])) {
1915 1915
                     /*Exibir Item sem pagamento ou outros?*/
1916
-                    if ($fPag=='90' || $fPag=='99') {
1916
+                    if ($fPag == '90' || $fPag == '99') {
1917 1917
                         continue;
1918 1918
                     }
1919 1919
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
@@ -1922,16 +1922,16 @@  discard block
 block discarded – undo
1922 1922
                     $this->pdf->textBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, '');
1923 1923
                 } else {
1924 1924
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
1925
-                    $this->pdf->textBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, '');
1925
+                    $this->pdf->textBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, '');
1926 1926
                 }
1927 1927
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1928 1928
                 $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, '');
1929 1929
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1930 1930
                 $this->pdf->textBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, '');
1931
-                $x += $w+$increm;
1931
+                $x += $w + $increm;
1932 1932
                 $dupcont += 1;
1933 1933
 
1934
-                if ($dupcont>$maxDupCont) {
1934
+                if ($dupcont > $maxDupCont) {
1935 1935
                     $y += 9;
1936 1936
                     $x = $oldx;
1937 1937
                     $dupcont = 0;
@@ -1946,10 +1946,10 @@  discard block
 block discarded – undo
1946 1946
                 $y -= 9;
1947 1947
                 $linha--;
1948 1948
             }
1949
-            return ($y+$h);
1949
+            return ($y + $h);
1950 1950
         } else {
1951 1951
             $linha = 0;
1952
-            return ($y-2);
1952
+            return ($y - 2);
1953 1953
         }
1954 1954
     } //fim da função pagamentoDANFE
1955 1955
     
@@ -2061,7 +2061,7 @@  discard block
 block discarded – undo
2061 2061
         }
2062 2062
         $x = $this->impostoDanfeHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF");
2063 2063
 
2064
-        return ($y+$h);
2064
+        return ($y + $h);
2065 2065
     } //fim impostoDANFE
2066 2066
 
2067 2067
     /**
@@ -2089,13 +2089,13 @@  discard block
 block discarded – undo
2089 2089
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
2090 2090
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2091 2091
         //NOME / RAZÃO SOCIAL
2092
-        $w1 = $maxW*0.29;
2092
+        $w1 = $maxW * 0.29;
2093 2093
         $y += 3;
2094 2094
         $texto = 'NOME / RAZÃO SOCIAL';
2095 2095
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2096 2096
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2097 2097
         if (isset($this->transporta)) {
2098
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ?
2098
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ?
2099 2099
                     $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue : '';
2100 2100
         } else {
2101 2101
             $texto = '';
@@ -2104,11 +2104,11 @@  discard block
 block discarded – undo
2104 2104
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2105 2105
         //FRETE POR CONTA
2106 2106
         $x += $w1;
2107
-        $w2 = $maxW*0.15;
2107
+        $w2 = $maxW * 0.15;
2108 2108
         $texto = 'FRETE';
2109 2109
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2110 2110
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2111
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ?
2111
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ?
2112 2112
                 $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue : '0';
2113 2113
         switch ($tipoFrete) {
2114 2114
             case 0:
@@ -2138,7 +2138,7 @@  discard block
 block discarded – undo
2138 2138
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2139 2139
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2140 2140
         if (isset($this->veicTransp)) {
2141
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ?
2141
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ?
2142 2142
                     $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue : '';
2143 2143
         } else {
2144 2144
             $texto = '';
@@ -2151,10 +2151,10 @@  discard block
 block discarded – undo
2151 2151
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2152 2152
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2153 2153
         if (isset($this->veicTransp)) {
2154
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ?
2154
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ?
2155 2155
                     $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue : '';
2156 2156
         } elseif (isset($this->reboque)) {
2157
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ?
2157
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ?
2158 2158
                     $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue : '';
2159 2159
         } else {
2160 2160
             $texto = '';
@@ -2163,15 +2163,15 @@  discard block
 block discarded – undo
2163 2163
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2164 2164
         //UF
2165 2165
         $x += $w2;
2166
-        $w3 = round($maxW*0.04, 0);
2166
+        $w3 = round($maxW * 0.04, 0);
2167 2167
         $texto = 'UF';
2168 2168
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2169 2169
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2170 2170
         if (isset($this->veicTransp)) {
2171
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ?
2171
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ?
2172 2172
                     $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue : '';
2173 2173
         } elseif (isset($this->reboque)) {
2174
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ?
2174
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ?
2175 2175
                     $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue : '';
2176 2176
         } else {
2177 2177
             $texto = '';
@@ -2180,18 +2180,18 @@  discard block
 block discarded – undo
2180 2180
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2181 2181
         //CNPJ / CPF
2182 2182
         $x += $w3;
2183
-        $w = $maxW-($w1+3*$w2+$w3);
2183
+        $w = $maxW - ($w1 + 3 * $w2 + $w3);
2184 2184
         $texto = 'CNPJ / CPF';
2185 2185
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2186 2186
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2187 2187
         if (isset($this->transporta)) {
2188
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ?
2188
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ?
2189 2189
                     $this->formatField(
2190 2190
                         $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2191 2191
                         "##.###.###/####-##"
2192 2192
                     ) : '';
2193 2193
             if ($texto == '') {
2194
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ?
2194
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ?
2195 2195
                         $this->formatField(
2196 2196
                             $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2197 2197
                             "###.###.###-##"
@@ -2207,12 +2207,12 @@  discard block
 block discarded – undo
2207 2207
         $y += $h;
2208 2208
         $x = $oldX;
2209 2209
         $h = 7;
2210
-        $w1 = $maxW*0.44;
2210
+        $w1 = $maxW * 0.44;
2211 2211
         $texto = 'ENDEREÇO';
2212 2212
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2213 2213
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2214 2214
         if (isset($this->transporta)) {
2215
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ?
2215
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ?
2216 2216
                     $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue : '';
2217 2217
         } else {
2218 2218
             $texto = '';
@@ -2221,12 +2221,12 @@  discard block
 block discarded – undo
2221 2221
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2222 2222
         //MUNICÍPIO
2223 2223
         $x += $w1;
2224
-        $w2 = round($maxW*0.30, 0);
2224
+        $w2 = round($maxW * 0.30, 0);
2225 2225
         $texto = 'MUNICÍPIO';
2226 2226
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2227 2227
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2228 2228
         if (isset($this->transporta)) {
2229
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ?
2229
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ?
2230 2230
                     $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue : '';
2231 2231
         } else {
2232 2232
             $texto = '';
@@ -2235,12 +2235,12 @@  discard block
 block discarded – undo
2235 2235
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2236 2236
         //UF
2237 2237
         $x += $w2;
2238
-        $w3 = round($maxW*0.04, 0);
2238
+        $w3 = round($maxW * 0.04, 0);
2239 2239
         $texto = 'UF';
2240 2240
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2241 2241
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2242 2242
         if (isset($this->transporta)) {
2243
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ?
2243
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ?
2244 2244
                     $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue : '';
2245 2245
         } else {
2246 2246
             $texto = '';
@@ -2249,13 +2249,13 @@  discard block
 block discarded – undo
2249 2249
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2250 2250
         //INSCRIÇÃO ESTADUAL
2251 2251
         $x += $w3;
2252
-        $w = $maxW-($w1+$w2+$w3);
2252
+        $w = $maxW - ($w1 + $w2 + $w3);
2253 2253
         $texto = 'INSCRIÇÃO ESTADUAL';
2254 2254
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2255 2255
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2256 2256
         $texto = '';
2257 2257
         if (isset($this->transporta)) {
2258
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2258
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2259 2259
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2260 2260
             }
2261 2261
         }
@@ -2268,16 +2268,16 @@  discard block
 block discarded – undo
2268 2268
         $marca = '';
2269 2269
         $numero = '';
2270 2270
         $texto = '';
2271
-        $pesoBruto=0;
2272
-        $pesoLiquido=0;
2271
+        $pesoBruto = 0;
2272
+        $pesoLiquido = 0;
2273 2273
         foreach ($volumes as $volume) {
2274
-            $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2274
+            $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2275 2275
                     $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2276
-            $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2276
+            $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2277 2277
                     $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2278
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2278
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2279 2279
                     $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2280
-            $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2280
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2281 2281
                     $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2282 2282
             if ($texto != $especie && $especie != '') {
2283 2283
                 //tem várias especies
@@ -2285,7 +2285,7 @@  discard block
 block discarded – undo
2285 2285
             } else {
2286 2286
                 $especie = $texto;
2287 2287
             }
2288
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2288
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2289 2289
                     $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2290 2290
             if ($texto != $marca && $marca != '') {
2291 2291
                 //tem várias especies
@@ -2293,7 +2293,7 @@  discard block
 block discarded – undo
2293 2293
             } else {
2294 2294
                 $marca = $texto;
2295 2295
             }
2296
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ?
2296
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ?
2297 2297
                     $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue : '';
2298 2298
             if ($texto != $numero && $numero != '') {
2299 2299
                 //tem várias especies
@@ -2308,7 +2308,7 @@  discard block
 block discarded – undo
2308 2308
         $y += $h;
2309 2309
         $x = $oldX;
2310 2310
         $h = 7;
2311
-        $w1 = round($maxW*0.10, 0);
2311
+        $w1 = round($maxW * 0.10, 0);
2312 2312
         $texto = 'QUANTIDADE';
2313 2313
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2314 2314
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2319,7 +2319,7 @@  discard block
 block discarded – undo
2319 2319
         }
2320 2320
         //ESPÉCIE
2321 2321
         $x += $w1;
2322
-        $w2 = round($maxW*0.17, 0);
2322
+        $w2 = round($maxW * 0.17, 0);
2323 2323
         $texto = 'ESPÉCIE';
2324 2324
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2325 2325
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2331,7 +2331,7 @@  discard block
 block discarded – undo
2331 2331
         $texto = 'MARCA';
2332 2332
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2333 2333
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2334
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2334
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2335 2335
                 $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2336 2336
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
2337 2337
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -2345,7 +2345,7 @@  discard block
 block discarded – undo
2345 2345
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2346 2346
         //PESO BRUTO
2347 2347
         $x += $w2;
2348
-        $w3 = round($maxW*0.20, 0);
2348
+        $w3 = round($maxW * 0.20, 0);
2349 2349
         $texto = 'PESO BRUTO';
2350 2350
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2351 2351
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2358,7 +2358,7 @@  discard block
 block discarded – undo
2358 2358
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2359 2359
         //PESO LÍQUIDO
2360 2360
         $x += $w3;
2361
-        $w = $maxW -($w1+3*$w2+$w3);
2361
+        $w = $maxW - ($w1 + 3 * $w2 + $w3);
2362 2362
         $texto = 'PESO LÍQUIDO';
2363 2363
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2364 2364
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2369,7 +2369,7 @@  discard block
 block discarded – undo
2369 2369
         }
2370 2370
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
2371 2371
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
2372
-        return ($y+$h);
2372
+        return ($y + $h);
2373 2373
     } //fim transporteDANFE
2374 2374
 
2375 2375
 
@@ -2381,7 +2381,7 @@  discard block
 block discarded – undo
2381 2381
             return "";
2382 2382
         }
2383 2383
         $valor_original = $valor_original->nodeValue;
2384
-        $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2384
+        $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2385 2385
 
2386 2386
         if ($valor != "") {
2387 2387
             return sprintf($formato, $valor);
@@ -2428,18 +2428,18 @@  discard block
 block discarded – undo
2428 2428
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2429 2429
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2430 2430
         }
2431
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2431
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2432 2432
             ? substr(
2433 2433
                 $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2434 2434
                 0,
2435 2435
                 500
2436 2436
             )
2437 2437
             : '';
2438
-        if (! empty($infAdProd)) {
2438
+        if (!empty($infAdProd)) {
2439 2439
             $infAdProd = trim($infAdProd);
2440 2440
             $infAdProd .= ' ';
2441 2441
         }
2442
-        $loteTxt ='';
2442
+        $loteTxt = '';
2443 2443
         $rastro = $prod->getElementsByTagName("med");
2444 2444
         if (!isset($rastro)) {
2445 2445
             $rastro = $prod->getElementsByTagName("rastro");
@@ -2455,14 +2455,14 @@  discard block
 block discarded – undo
2455 2455
                 $i++;
2456 2456
             }
2457 2457
             if ($loteTxt != '') {
2458
-                $loteTxt.= ' ';
2458
+                $loteTxt .= ' ';
2459 2459
             }
2460 2460
         }
2461 2461
         //NT2013.006 FCI
2462
-        $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2463
-                ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2464
-        $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2465
-        $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad)!=0?"\n    ".$tmp_ad:'');
2462
+        $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2463
+                ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2464
+        $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2465
+        $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad) != 0 ? "\n    " . $tmp_ad : '');
2466 2466
         //decodifica os caracteres html no xml
2467 2467
         $texto = html_entity_decode($texto);
2468 2468
         if ($this->descProdQuebraLinha) {
@@ -2512,104 +2512,104 @@  discard block
 block discarded – undo
2512 2512
         // cabecalho LOOP COM OS DADOS DOS PRODUTOS
2513 2513
         //CÓDIGO PRODUTO
2514 2514
         $texto = "CÓDIGO PRODUTO";
2515
-        $w1 = round($w*0.09, 0);
2515
+        $w1 = round($w * 0.09, 0);
2516 2516
         $h = 4;
2517 2517
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2518 2518
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2519
-        $this->pdf->line($x+$w1, $y, $x+$w1, $y+$hmax);
2519
+        $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2520 2520
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2521 2521
         $x += $w1;
2522
-        $w2 = round($w*0.28, 0);
2522
+        $w2 = round($w * 0.28, 0);
2523 2523
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2524 2524
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2525 2525
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2526
-        $this->pdf->line($x+$w2, $y, $x+$w2, $y+$hmax);
2526
+        $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2527 2527
         //NCM/SH
2528 2528
         $x += $w2;
2529
-        $w3 = round($w*0.06, 0);
2529
+        $w3 = round($w * 0.06, 0);
2530 2530
         $texto = 'NCM/SH';
2531 2531
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2532 2532
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2533
-        $this->pdf->line($x+$w3, $y, $x+$w3, $y+$hmax);
2533
+        $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2534 2534
         //O/CST ou O/CSOSN
2535 2535
         $x += $w3;
2536
-        $w4 = round($w*0.05, 0);
2537
-        $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2
2536
+        $w4 = round($w * 0.05, 0);
2537
+        $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2
2538 2538
         if ($this->getTagValue($this->emit, 'CRT') == '3') {
2539
-             $texto = 'O/CST';//Regime Normal
2539
+             $texto = 'O/CST'; //Regime Normal
2540 2540
         }
2541 2541
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2542 2542
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2543
-        $this->pdf->line($x+$w4, $y, $x+$w4, $y+$hmax);
2543
+        $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2544 2544
         //CFOP
2545 2545
         $x += $w4;
2546
-        $w5 = round($w*0.04, 0);
2546
+        $w5 = round($w * 0.04, 0);
2547 2547
         $texto = 'CFOP';
2548 2548
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2549 2549
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2550
-        $this->pdf->line($x+$w5, $y, $x+$w5, $y+$hmax);
2550
+        $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2551 2551
         //UN
2552 2552
         $x += $w5;
2553
-        $w6 = round($w*0.03, 0);
2553
+        $w6 = round($w * 0.03, 0);
2554 2554
         $texto = 'UN';
2555 2555
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2556 2556
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2557
-        $this->pdf->line($x+$w6, $y, $x+$w6, $y+$hmax);
2557
+        $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2558 2558
         //QUANT
2559 2559
         $x += $w6;
2560
-        $w7 = round($w*0.07, 0);
2560
+        $w7 = round($w * 0.07, 0);
2561 2561
         $texto = 'QUANT';
2562 2562
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2563 2563
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2564
-        $this->pdf->line($x+$w7, $y, $x+$w7, $y+$hmax);
2564
+        $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2565 2565
         //VALOR UNIT
2566 2566
         $x += $w7;
2567
-        $w8 = round($w*0.06, 0);
2567
+        $w8 = round($w * 0.06, 0);
2568 2568
         $texto = 'VALOR UNIT';
2569 2569
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2570 2570
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2571
-        $this->pdf->line($x+$w8, $y, $x+$w8, $y+$hmax);
2571
+        $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2572 2572
         //VALOR TOTAL
2573 2573
         $x += $w8;
2574
-        $w9 = round($w*0.06, 0);
2574
+        $w9 = round($w * 0.06, 0);
2575 2575
         $texto = 'VALOR TOTAL';
2576 2576
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2577 2577
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2578
-        $this->pdf->line($x+$w9, $y, $x+$w9, $y+$hmax);
2578
+        $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2579 2579
         //B.CÁLC ICMS
2580 2580
         $x += $w9;
2581
-        $w10 = round($w*0.06, 0);
2581
+        $w10 = round($w * 0.06, 0);
2582 2582
         $texto = 'B.CÁLC ICMS';
2583 2583
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2584 2584
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2585
-        $this->pdf->line($x+$w10, $y, $x+$w10, $y+$hmax);
2585
+        $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2586 2586
         //VALOR ICMS
2587 2587
         $x += $w10;
2588
-        $w11 = round($w*0.06, 0);
2588
+        $w11 = round($w * 0.06, 0);
2589 2589
         $texto = 'VALOR ICMS';
2590 2590
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2591 2591
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2592
-        $this->pdf->line($x+$w11, $y, $x+$w11, $y+$hmax);
2592
+        $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2593 2593
         //VALOR IPI
2594 2594
         $x += $w11;
2595
-        $w12 = round($w*0.05, 0);
2595
+        $w12 = round($w * 0.05, 0);
2596 2596
         $texto = 'VALOR IPI';
2597 2597
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2598 2598
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2599
-        $this->pdf->line($x+$w12, $y, $x+$w12, $y+$hmax);
2599
+        $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2600 2600
         //ALÍQ. ICMS
2601 2601
         $x += $w12;
2602
-        $w13 = round($w*0.035, 0);
2602
+        $w13 = round($w * 0.035, 0);
2603 2603
         $texto = 'ALÍQ. ICMS';
2604 2604
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2605 2605
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2606
-        $this->pdf->line($x+$w13, $y, $x+$w13, $y+$hmax);
2606
+        $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2607 2607
         //ALÍQ. IPI
2608 2608
         $x += $w13;
2609
-        $w14 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13);
2609
+        $w14 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13);
2610 2610
         $texto = 'ALÍQ. IPI';
2611 2611
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2612
-        $this->pdf->line($oldX, $y+$h+1, $oldX + $w, $y+$h+1);
2612
+        $this->pdf->line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1);
2613 2613
         $y += 5;
2614 2614
         //##################################################################################
2615 2615
         // LOOP COM OS DADOS DOS PRODUTOS
@@ -2627,7 +2627,7 @@  discard block
 block discarded – undo
2627 2627
                 $textoProduto = trim($this->descricaoProduto($thisItem));
2628 2628
 
2629 2629
                 $linhaDescr = $this->pdf->getNumLines($textoProduto, $w2, $aFont);
2630
-                $h = round(($linhaDescr * $this->pdf->fontSize)+ ($linhaDescr * 0.5), 2);
2630
+                $h = round(($linhaDescr * $this->pdf->fontSize) + ($linhaDescr * 0.5), 2);
2631 2631
                 $hUsado += $h;
2632 2632
 
2633 2633
                 $diffH = $hmax - $hUsado;
@@ -2640,11 +2640,11 @@  discard block
 block discarded – undo
2640 2640
                         break;
2641 2641
                     }
2642 2642
                 }
2643
-                $y_linha=$y+$h;
2643
+                $y_linha = $y + $h;
2644 2644
                 // linha entre itens
2645 2645
                 $this->pdf->dashedHLine($oldX, $y_linha, $w, 0.1, 120);
2646 2646
                 //corrige o x
2647
-                $x=$oldX;
2647
+                $x = $oldX;
2648 2648
                 //codigo do produto
2649 2649
                 $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue;
2650 2650
                 $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'C', 0, '');
@@ -2657,16 +2657,16 @@  discard block
 block discarded – undo
2657 2657
                 }
2658 2658
                 $x += $w2;
2659 2659
                 //NCM
2660
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2660
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2661 2661
                         $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2662 2662
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2663 2663
                 $x += $w3;
2664 2664
                 //CST
2665 2665
                 if (isset($ICMS)) {
2666
-                    $origem =  $this->getTagValue($ICMS, "orig");
2667
-                    $cst =  $this->getTagValue($ICMS, "CST");
2668
-                    $csosn =  $this->getTagValue($ICMS, "CSOSN");
2669
-                    $texto = $origem.$cst.$csosn;
2666
+                    $origem = $this->getTagValue($ICMS, "orig");
2667
+                    $cst = $this->getTagValue($ICMS, "CST");
2668
+                    $csosn = $this->getTagValue($ICMS, "CSOSN");
2669
+                    $texto = $origem . $cst . $csosn;
2670 2670
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2671 2671
                 }
2672 2672
                 //CFOP
@@ -2700,7 +2700,7 @@  discard block
 block discarded – undo
2700 2700
                 //Valor da Base de calculo
2701 2701
                 $x += $w9;
2702 2702
                 if (isset($ICMS)) {
2703
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ?
2703
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ?
2704 2704
                             number_format(
2705 2705
                                 $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
2706 2706
                                 2,
@@ -2712,7 +2712,7 @@  discard block
 block discarded – undo
2712 2712
                 //Valor do ICMS
2713 2713
                 $x += $w10;
2714 2714
                 if (isset($ICMS)) {
2715
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
2715
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
2716 2716
                             number_format(
2717 2717
                                 $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
2718 2718
                                 2,
@@ -2724,8 +2724,8 @@  discard block
 block discarded – undo
2724 2724
                 //Valor do IPI
2725 2725
                 $x += $w11;
2726 2726
                 if (isset($IPI)) {
2727
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ?
2728
-                            number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") :'';
2727
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ?
2728
+                            number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") : '';
2729 2729
                 } else {
2730 2730
                     $texto = '';
2731 2731
                 }
@@ -2733,7 +2733,7 @@  discard block
 block discarded – undo
2733 2733
                 // %ICMS
2734 2734
                 $x += $w12;
2735 2735
                 if (isset($ICMS)) {
2736
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ?
2736
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ?
2737 2737
                             number_format(
2738 2738
                                 $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
2739 2739
                                 2,
@@ -2745,7 +2745,7 @@  discard block
 block discarded – undo
2745 2745
                 //%IPI
2746 2746
                 $x += $w13;
2747 2747
                 if (isset($IPI)) {
2748
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ?
2748
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ?
2749 2749
                             number_format($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, 2, ",", ".") : '';
2750 2750
                 } else {
2751 2751
                     $texto = '';
@@ -2770,7 +2770,7 @@  discard block
 block discarded – undo
2770 2770
                 $i++;
2771 2771
             }
2772 2772
         }
2773
-        return $oldY+$hmax;
2773
+        return $oldY + $hmax;
2774 2774
     }
2775 2775
 
2776 2776
 
@@ -2804,7 +2804,7 @@  discard block
 block discarded – undo
2804 2804
 
2805 2805
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
2806 2806
 
2807
-        $w1 = round($w*0.09, 0);
2807
+        $w1 = round($w * 0.09, 0);
2808 2808
 
2809 2809
         // Tabela Renavam Combustivel
2810 2810
         $renavamCombustivel = [
@@ -2906,54 +2906,54 @@  discard block
 block discarded – undo
2906 2906
 
2907 2907
         $yVeic = $y + $h;
2908 2908
         $texto = 'Chassi: ............: ' . $veiculoChassi;
2909
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
2909
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
2910 2910
         $yVeic += $h;
2911 2911
         $texto = 'Cor...................: ' . $veiculoCor;
2912
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
2912
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
2913 2913
         $yVeic += $h;
2914 2914
         $texto = 'Cilindrada........: ' . $veiculoCilindrada;
2915
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
2915
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
2916 2916
         $yVeic += $h;
2917 2917
         $texto = 'Cmkg...............: ' . $veiculoCmkg;
2918
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
2918
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
2919 2919
         $yVeic += $h;
2920 2920
         $texto = 'Tipo.................: ' . $renavamTiposVeiculos[intval($veiculoTipo)];
2921
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
2921
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
2922 2922
         $yVeic = $y + $h;
2923 2923
         $xVeic = $x + 65;
2924 2924
         $texto = 'Nº Motor: .........: ' . $veiculoMotor;
2925
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2925
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2926 2926
         $yVeic += $h;
2927 2927
         $texto = 'Renavam...........: ' . $veiculoRenavam;
2928
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2928
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2929 2929
         $yVeic += $h;
2930 2930
         $texto = 'HP.....................: ' . $veiculoHp;
2931
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2931
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2932 2932
         $yVeic += $h;
2933 2933
         $texto = 'Placa.................: ' . $veiculoPlaca;
2934
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2934
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2935 2935
         $yVeic += $h;
2936 2936
         $texto = 'Tipo Pintura......: ' . $tpPintValue;
2937
-        $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2937
+        $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2938 2938
         $yVeic = $y + $h;
2939 2939
         $xVeic = $xVeic + 55;
2940 2940
         $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo;
2941
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2941
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2942 2942
         $yVeic += $h;
2943 2943
         $texto = 'Especie..................: ' . $renavamEspecie[intval($veiculoEspecie)];
2944
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2944
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2945 2945
         $yVeic += $h;
2946 2946
         $texto = 'Combustivel..........: ' . $renavamCombustivel[intval($veiculoCombustivel)];
2947
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2947
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2948 2948
         $yVeic += $h;
2949 2949
         $texto = 'Serial.....................: ' . $veiculoSerial;
2950
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2950
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2951 2951
         $yVeic += $h;
2952
-        $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo;
2953
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2952
+        $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo;
2953
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2954 2954
         $yVeic += $h;
2955
-        $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia;
2956
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
2955
+        $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia;
2956
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
2957 2957
     }
2958 2958
 
2959 2959
     /**
@@ -2977,12 +2977,12 @@  discard block
 block discarded – undo
2977 2977
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2978 2978
         //INSCRIÇÃO MUNICIPAL
2979 2979
         $y += 3;
2980
-        $w = round($this->wPrint*0.23, 0);
2980
+        $w = round($this->wPrint * 0.23, 0);
2981 2981
         $texto = 'INSCRIÇÃO MUNICIPAL';
2982 2982
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2983 2983
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2984 2984
         //inscrição municipal
2985
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
2985
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
2986 2986
                 $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
2987 2987
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
2988 2988
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -2992,7 +2992,7 @@  discard block
 block discarded – undo
2992 2992
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2993 2993
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2994 2994
         if (isset($this->ISSQNtot)) {
2995
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
2995
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
2996 2996
                     $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
2997 2997
             $texto = number_format($texto, 2, ",", ".");
2998 2998
         } else {
@@ -3006,9 +3006,9 @@  discard block
 block discarded – undo
3006 3006
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3007 3007
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3008 3008
         if (isset($this->ISSQNtot)) {
3009
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3009
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3010 3010
                     $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3011
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3011
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3012 3012
         } else {
3013 3013
             $texto = '';
3014 3014
         }
@@ -3019,21 +3019,21 @@  discard block
 block discarded – undo
3019 3019
         if ($this->orientacao == 'P') {
3020 3020
             $w = $this->wPrint - (3 * $w);
3021 3021
         } else {
3022
-            $w = $this->wPrint - (3 * $w)-$this->wCanhoto;
3022
+            $w = $this->wPrint - (3 * $w) - $this->wCanhoto;
3023 3023
         }
3024 3024
         $texto = 'VALOR TOTAL DO ISSQN';
3025 3025
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3026 3026
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3027 3027
         if (isset($this->ISSQNtot)) {
3028
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3028
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3029 3029
                     $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3030
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3030
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3031 3031
         } else {
3032 3032
             $texto = '';
3033 3033
         }
3034 3034
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
3035 3035
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3036
-        return ($y+$h+1);
3036
+        return ($y + $h + 1);
3037 3037
     }
3038 3038
 
3039 3039
     /**
@@ -3054,7 +3054,7 @@  discard block
 block discarded – undo
3054 3054
         if ($this->orientacao == 'P') {
3055 3055
               $w = $this->wPrint;
3056 3056
         } else {
3057
-              $w = $this->wPrint-$this->wCanhoto;
3057
+              $w = $this->wPrint - $this->wCanhoto;
3058 3058
         }
3059 3059
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
3060 3060
         $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, '');
@@ -3070,15 +3070,15 @@  discard block
 block discarded – undo
3070 3070
         //$this->textoAdic com o texto completo do campo
3071 3071
         $y += 1;
3072 3072
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
3073
-        $this->pdf->textBox($x, $y+2, $w-2, $h-3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
3073
+        $this->pdf->textBox($x, $y + 2, $w - 2, $h - 3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
3074 3074
         //RESERVADO AO FISCO
3075 3075
         $texto = "RESERVADO AO FISCO";
3076 3076
         $x += $w;
3077 3077
         $y -= 1;
3078 3078
         if ($this->orientacao == 'P') {
3079
-            $w = $this->wPrint-$w;
3079
+            $w = $this->wPrint - $w;
3080 3080
         } else {
3081
-            $w = $this->wPrint-$w-$this->wCanhoto;
3081
+            $w = $this->wPrint - $w - $this->wCanhoto;
3082 3082
         }
3083 3083
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B'];
3084 3084
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -3117,8 +3117,8 @@  discard block
 block discarded – undo
3117 3117
         }
3118 3118
         $y += 2;
3119 3119
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
3120
-        $this->pdf->textBox($x, $y, $w-2, $h-3, $texto, $aFont, 'T', 'L', 0, '', false);
3121
-        return $y+$h;
3120
+        $this->pdf->textBox($x, $y, $w - 2, $h - 3, $texto, $aFont, 'T', 'L', 0, '', false);
3121
+        return $y + $h;
3122 3122
     }
3123 3123
 
3124 3124
     /**
@@ -3136,13 +3136,13 @@  discard block
 block discarded – undo
3136 3136
         if ($this->orientacao == 'P') {
3137 3137
               $w = $this->wPrint;
3138 3138
         } else {
3139
-              $w = $this->wPrint-$this->wCanhoto;
3139
+              $w = $this->wPrint - $this->wCanhoto;
3140 3140
               $x = $this->wCanhoto;
3141 3141
         }
3142 3142
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
3143
-        $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s');
3143
+        $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s');
3144 3144
         $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false);
3145
-        $texto = $this->creditos .  "  Powered by NFePHP";
3145
+        $texto = $this->creditos . "  Powered by NFePHP";
3146 3146
         $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'R', false, '');
3147 3147
     }
3148 3148
 
@@ -3195,9 +3195,9 @@  discard block
 block discarded – undo
3195 3195
         } else {
3196 3196
             //linha separadora do canhoto - 238
3197 3197
             //posicao altura
3198
-            $y = $this->wPrint-85;
3198
+            $y = $this->wPrint - 85;
3199 3199
             //altura
3200
-            $w = $this->wPrint-85-24;
3200
+            $w = $this->wPrint - 85 - 24;
3201 3201
         }
3202 3202
         $h = 10;
3203 3203
         //desenha caixa
@@ -3220,21 +3220,21 @@  discard block
 block discarded – undo
3220 3220
             $texto .= "AO LADO";
3221 3221
         }
3222 3222
         $texto .= ". EMISSÃO: ";
3223
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3223
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3224 3224
                 $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3225 3225
         if ($dEmi == '') {
3226
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3226
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3227 3227
                     $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3228 3228
             $aDemi = explode('T', $dEmi);
3229 3229
             $dEmi = $aDemi[0];
3230 3230
         }
3231
-        $texto .= $this->ymdTodmy($dEmi) ." ";
3231
+        $texto .= $this->ymdTodmy($dEmi) . " ";
3232 3232
         $texto .= "VALOR TOTAL: R$ ";
3233 3233
         $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " ";
3234 3234
         $texto .= "DESTINATÁRIO: ";
3235 3235
         $texto .= $destinatario;
3236 3236
         if ($this->orientacao == 'P') {
3237
-            $this->pdf->textBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false);
3237
+            $this->pdf->textBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false);
3238 3238
             $x1 = $x + $w;
3239 3239
             $w1 = $this->wPrint - $w;
3240 3240
             $texto = "NF-e";
@@ -3247,12 +3247,12 @@  discard block
 block discarded – undo
3247 3247
             //DATA DE RECEBIMENTO
3248 3248
             $texto = "DATA DE RECEBIMENTO";
3249 3249
             $y += $h;
3250
-            $w2 = round($this->wPrint*0.17, 0); //35;
3250
+            $w2 = round($this->wPrint * 0.17, 0); //35;
3251 3251
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3252 3252
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3253 3253
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3254 3254
             $x += $w2;
3255
-            $w3 = $w-$w2;
3255
+            $w3 = $w - $w2;
3256 3256
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3257 3257
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
3258 3258
             $x = $oldX;
@@ -3262,7 +3262,7 @@  discard block
 block discarded – undo
3262 3262
             return $y;
3263 3263
         } else {
3264 3264
             $x--;
3265
-            $x = $this->pdf->textBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3265
+            $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3266 3266
             //NUMERO DA NOTA FISCAL LOGO NFE
3267 3267
             $w1 = 18;
3268 3268
             $x1 = $oldX;
@@ -3276,18 +3276,18 @@  discard block
 block discarded – undo
3276 3276
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3277 3277
             //DATA DO RECEBIMENTO
3278 3278
             $texto = "DATA DO RECEBIMENTO";
3279
-            $y = $this->wPrint-85;
3279
+            $y = $this->wPrint - 85;
3280 3280
             $x = 12;
3281
-            $w2 = round($this->wPrint*0.17, 0); //35;
3281
+            $w2 = round($this->wPrint * 0.17, 0); //35;
3282 3282
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3283 3283
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3284 3284
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3285 3285
             $y -= $w2;
3286
-            $w3 = $w-$w2;
3286
+            $w3 = $w - $w2;
3287 3287
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3288 3288
             $aFont = ['font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>''];
3289 3289
             $x = $this->pdf->textBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
3290
-            $this->pdf->DashedVLine(23, $oldY, 0.1, $this->wPrint-20, 67);
3290
+            $this->pdf->DashedVLine(23, $oldY, 0.1, $this->wPrint - 20, 67);
3291 3291
             return $x;
3292 3292
         }
3293 3293
     }
@@ -3304,13 +3304,13 @@  discard block
 block discarded – undo
3304 3304
     {
3305 3305
         $saida = "";
3306 3306
         if (isset($this->compra)) {
3307
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3307
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3308 3308
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3309 3309
             }
3310
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3310
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3311 3311
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3312 3312
             }
3313
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3313
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3314 3314
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3315 3315
             }
3316 3316
         }
@@ -3336,21 +3336,21 @@  discard block
 block discarded – undo
3336 3336
         if ($vICMS > 0) {
3337 3337
             $vICMS = 1;
3338 3338
         }
3339
-        $icmss  = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue;
3339
+        $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue;
3340 3340
         if ($icmss > 0) {
3341 3341
             $icmss = 1;
3342 3342
         }
3343
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3343
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3344 3344
                 $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3345 3345
         if ($dEmi == '') {
3346
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3346
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3347 3347
                     $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3348 3348
             $aDemi = explode('T', $dEmi);
3349 3349
             $dEmi = $aDemi[0];
3350 3350
         }
3351 3351
         $dd  = $dEmi;
3352 3352
         $rpos = strrpos($dd, '-');
3353
-        $dd  = substr($dd, $rpos +1);
3353
+        $dd  = substr($dd, $rpos + 1);
3354 3354
         $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd);
3355 3355
         $chave = $chave . $this->modulo11($chave);
3356 3356
         return $chave;
@@ -3371,7 +3371,7 @@  discard block
 block discarded – undo
3371 3371
         $formaNfRef = "\r\nNF  Ref.: série:%d numero:%d emit:%s em %s modelo: %d";
3372 3372
         $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d";
3373 3373
         $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s";
3374
-        $saida='';
3374
+        $saida = '';
3375 3375
         $nfRefs = $this->ide->getElementsByTagName('NFref');
3376 3376
         if (0 === $nfRefs->length) {
3377 3377
             return $saida;
@@ -3387,7 +3387,7 @@  discard block
 block discarded – undo
3387 3387
             foreach ($refNFe as $chave_acessoRef) {
3388 3388
                 $chave_acesso = $chave_acessoRef->nodeValue;
3389 3389
                 $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave);
3390
-                $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2);
3390
+                $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2);
3391 3391
                 $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3392 3392
                 $serie  = substr($chave_acesso, 22, 3);
3393 3393
                 $numero = substr($chave_acesso, 25, 9);
@@ -3408,7 +3408,7 @@  discard block
 block discarded – undo
3408 3408
             foreach ($refCTe as $chave_acessoRef) {
3409 3409
                 $chave_acesso = $chave_acessoRef->nodeValue;
3410 3410
                 $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave);
3411
-                $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2);
3411
+                $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2);
3412 3412
                 $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3413 3413
                 $serie  = substr($chave_acesso, 22, 3);
3414 3414
                 $numero = substr($chave_acesso, 25, 9);
@@ -3424,10 +3424,9 @@  discard block
 block discarded – undo
3424 3424
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3425 3425
             foreach ($refNFP as $umaRefNFe) {
3426 3426
                 $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3427
-                $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3428
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3429
-                    '';
3430
-                $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3427
+                $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3428
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3429
+                $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3431 3430
                         $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3432 3431
                 $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3433 3432
                 $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
@@ -3453,6 +3452,6 @@  discard block
 block discarded – undo
3453 3452
         imagedestroy($image);
3454 3453
         $stringdata = ob_get_contents(); // read from buffer
3455 3454
         ob_end_clean();
3456
-        return 'data://text/plain;base64,'.base64_encode($stringdata);
3455
+        return 'data://text/plain;base64,' . base64_encode($stringdata);
3457 3456
     }
3458 3457
 }
Please login to merge, or discard this patch.