Completed
Pull Request — master (#392)
by Eduardo
02:45
created
src/NFe/Danfe.php 3 patches
Doc Comments   +27 added lines, -19 removed lines patch added patch discarded remove patch
@@ -868,8 +868,8 @@  discard block
 block discarded – undo
868 868
      *header
869 869
      * Monta o cabelhalho da DANFE (retrato e paisagem)
870 870
      *
871
-     * @param number $x      Posição horizontal inicial, canto esquerdo
872
-     * @param number $y      Posição vertical inicial, canto superior
871
+     * @param integer $x      Posição horizontal inicial, canto esquerdo
872
+     * @param integer $y      Posição vertical inicial, canto superior
873 873
      * @param number $pag    Número da Página
874 874
      * @param number $totPag Total de páginas
875 875
      *
@@ -1257,8 +1257,8 @@  discard block
 block discarded – undo
1257 1257
      *
1258 1258
      * @name   destinatarioDANFE
1259 1259
      *
1260
-     * @param number $x Posição horizontal canto esquerdo
1261
-     * @param number $y Posição vertical canto superior
1260
+     * @param integer $x Posição horizontal canto esquerdo
1261
+     * @param integer $y Posição vertical canto superior
1262 1262
      *
1263 1263
      * @return number Posição vertical final
1264 1264
      */
@@ -1471,8 +1471,8 @@  discard block
 block discarded – undo
1471 1471
      *
1472 1472
      * @name   localEntregaDANFE
1473 1473
      *
1474
-     * @param number $x Posição horizontal canto esquerdo
1475
-     * @param number $y Posição vertical canto superior
1474
+     * @param integer $x Posição horizontal canto esquerdo
1475
+     * @param integer $y Posição vertical canto superior
1476 1476
      *
1477 1477
      * @return number Posição vertical final
1478 1478
      */
@@ -1623,8 +1623,8 @@  discard block
 block discarded – undo
1623 1623
      *
1624 1624
      * @name   localretiradaDANFE
1625 1625
      *
1626
-     * @param number $x Posição horizontal canto esquerdo
1627
-     * @param number $y Posição vertical canto superior
1626
+     * @param integer $x Posição horizontal canto esquerdo
1627
+     * @param integer $y Posição vertical canto superior
1628 1628
      *
1629 1629
      * @return number Posição vertical final
1630 1630
      */
@@ -1774,7 +1774,7 @@  discard block
 block discarded – undo
1774 1774
      * Gera a String do Texto da Fatura
1775 1775
      *
1776 1776
      * @name   getTextoFatura
1777
-     * @return uma String com o texto ou "";
1777
+     * @return string String com o texto ou "";
1778 1778
      */
1779 1779
     protected function getTextoFatura() {
1780 1780
         if (isset($this->cobr)) {
@@ -1830,8 +1830,8 @@  discard block
 block discarded – undo
1830 1830
      *
1831 1831
      * @name   fatura
1832 1832
      *
1833
-     * @param number $x Posição horizontal canto esquerdo
1834
-     * @param number $y Posição vertical canto superior
1833
+     * @param integer $x Posição horizontal canto esquerdo
1834
+     * @param double $y Posição vertical canto superior
1835 1835
      *
1836 1836
      * @return number Posição vertical final
1837 1837
      */
@@ -1957,8 +1957,8 @@  discard block
 block discarded – undo
1957 1957
      *
1958 1958
      * @name   pagamento
1959 1959
      *
1960
-     * @param number $x Posição horizontal canto esquerdo
1961
-     * @param number $y Posição vertical canto superior
1960
+     * @param integer $x Posição horizontal canto esquerdo
1961
+     * @param double $y Posição vertical canto superior
1962 1962
      *
1963 1963
      * @return number Posição vertical final
1964 1964
      */
@@ -2090,6 +2090,8 @@  discard block
 block discarded – undo
2090 2090
      * @param float $h Altura do campo
2091 2091
      * @param float $h Título do campo
2092 2092
      * @param float $h Valor do imposto
2093
+     * @param string $titulo
2094
+     * @param string $campoImposto
2093 2095
      *
2094 2096
      * @return float Sugestão do $x do próximo imposto
2095 2097
      */
@@ -2117,10 +2119,10 @@  discard block
 block discarded – undo
2117 2119
      * imposto
2118 2120
      * Monta o campo de impostos e totais da DANFE (retrato e paisagem)
2119 2121
      *
2120
-     * @param number $x Posição horizontal canto esquerdo
2121
-     * @param number $y Posição vertical canto superior
2122
+     * @param integer $x Posição horizontal canto esquerdo
2123
+     * @param double $y Posição vertical canto superior
2122 2124
      *
2123
-     * @return number Posição vertical final
2125
+     * @return double Posição vertical final
2124 2126
      */
2125 2127
     protected function imposto($x, $y) {
2126 2128
         $x_inicial = $x;
@@ -2513,6 +2515,10 @@  discard block
 block discarded – undo
2513 2515
     } //fim transporte
2514 2516
 
2515 2517
 
2518
+    /**
2519
+     * @param string $campo
2520
+     * @param string $formato
2521
+     */
2516 2522
     protected function descricaoProdutoHelper($origem, $campo, $formato) {
2517 2523
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
2518 2524
         if (! isset($valor_original)) {
@@ -2620,7 +2626,6 @@  discard block
 block discarded – undo
2620 2626
      * @param float $x       Posição horizontal canto esquerdo
2621 2627
      * @param float $y       Posição vertical canto superior
2622 2628
      * @param float $nInicio Número do item inicial
2623
-     * @param float $max     Número do item final
2624 2629
      * @param float $hmax    Altura máxima do campo de itens em mm
2625 2630
      *
2626 2631
      * @return float Posição vertical final
@@ -3361,8 +3366,8 @@  discard block
 block discarded – undo
3361 3366
      *
3362 3367
      * @name   canhotoDANFE
3363 3368
      *
3364
-     * @param number $x Posição horizontal canto esquerdo
3365
-     * @param number $y Posição vertical canto superior
3369
+     * @param integer $x Posição horizontal canto esquerdo
3370
+     * @param integer $y Posição vertical canto superior
3366 3371
      *
3367 3372
      * @return number Posição vertical final
3368 3373
      *
@@ -3663,6 +3668,9 @@  discard block
 block discarded – undo
3663 3668
         return $saida;
3664 3669
     }
3665 3670
 
3671
+    /**
3672
+     * @param string $xml
3673
+     */
3666 3674
     private function loadDoc($xml) {
3667 3675
         $this->xml = $xml;
3668 3676
         if (! empty($xml)) {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace NFePHP\DA\NFe;
3 3
 
4
-use InvalidArgumentException;
5 4
 use NFePHP\DA\Legacy\Dom;
6 5
 use NFePHP\DA\Legacy\Pdf;
7 6
 use \NFePHP\DA\Common\DaCommon;
Please login to merge, or discard this patch.
Spacing   +229 added lines, -230 removed lines patch added patch discarded remove patch
@@ -323,39 +323,39 @@  discard block
 block discarded – undo
323 323
     protected function calculoEspacoVericalDadosAdicionais() {
324 324
         $this->textoAdic = '';
325 325
         //informações adicionais
326
-        $fontProduto            = [
326
+        $fontProduto = [
327 327
             'font'  => $this->fontePadrao,
328 328
             'size'  => 8,
329 329
             'style' => ''
330 330
         ];
331 331
         $k                      = $this->pdf->k;
332 332
         $this->textadicfontsize = $fontProduto['size'] / $k;
333
-        $this->textoAdic        .= $this->geraInformacoesDasNotasReferenciadas();
333
+        $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
334 334
         if (isset($this->infAdic)) {
335 335
             $i = 0;
336 336
             if ($this->textoAdic != '') {
337 337
                 $this->textoAdic .= ". \n";
338 338
             }
339
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl"))
339
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl"))
340 340
                 ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl"))
341 341
                 : '';
342
-            $infPedido       = $this->geraInformacoesDaTagCompra();
342
+            $infPedido = $this->geraInformacoesDaTagCompra();
343 343
             if ($infPedido != "") {
344 344
                 $this->textoAdic .= $infPedido;
345 345
             }
346 346
             $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
347
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco"))
347
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco"))
348 348
                 ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco")
349 349
                 : '';
350
-            $obsCont         = $this->infAdic->getElementsByTagName("obsCont");
350
+            $obsCont = $this->infAdic->getElementsByTagName("obsCont");
351 351
             if (isset($obsCont)) {
352 352
                 foreach ($obsCont as $obs) {
353 353
                     $campo           = $obsCont->item($i)->getAttribute("xCampo");
354
-                    $xTexto          = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
354
+                    $xTexto          = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
355 355
                         ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue
356 356
                         : '';
357 357
                     $this->textoAdic .= "\n" . $campo . ':  ' . trim($xTexto);
358
-                    $i ++;
358
+                    $i++;
359 359
                 }
360 360
             }
361 361
         }
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             $flagVTT  = $flagVTT && (strpos(strtolower(trim($this->textoAdic)), 'trib') ||
370 370
                     strpos(strtolower(trim($this->textoAdic)), 'imp'));
371 371
             $vTotTrib = $this->getTagValue($this->ICMSTot, 'vTotTrib');
372
-            if ($vTotTrib != '' && ! $flagVTT) {
372
+            if ($vTotTrib != '' && !$flagVTT) {
373 373
                 $this->textoAdic .= "\n Valor Aproximado dos Tributos : R$ "
374 374
                     . number_format($vTotTrib, 2, ",", ".");
375 375
             }
@@ -381,9 +381,9 @@  discard block
 block discarded – undo
381 381
         $this->textadicfontsize = $this->pdf->fontSize;
382 382
         $hdadosadic             = ceil($numlinhasdados * ($this->textadicfontsize));
383 383
         if ($hdadosadic > 70) {
384
-            for ($f = 8; $f > 3; $f --) {
384
+            for ($f = 8; $f > 3; $f--) {
385 385
                 $this->pdf->setFont($this->fontePadrao, '', $f);
386
-                $fontProduto            = [
386
+                $fontProduto = [
387 387
                     'font'  => $this->fontePadrao,
388 388
                     'size'  => $f,
389 389
                     'style' => ''
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
         $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais();
511 511
 
512 512
         //altura disponivel para os campos da DANFE
513
-        $hcabecalho    = 47;//para cabeçalho
514
-        $hdestinatario = 25;//para destinatario
515
-        $hduplicatas   = 12;//para cada grupo de 7 duplicatas
513
+        $hcabecalho    = 47; //para cabeçalho
514
+        $hdestinatario = 25; //para destinatario
515
+        $hduplicatas   = 12; //para cada grupo de 7 duplicatas
516 516
         if (isset($this->entrega)) {
517 517
             $hlocalentrega = 25;
518 518
         } else {
@@ -523,11 +523,11 @@  discard block
 block discarded – undo
523 523
         } else {
524 524
             $hlocalretirada = 0;
525 525
         }
526
-        $himposto    = 18;// para imposto
527
-        $htransporte = 25;// para transporte
528
-        $hissqn      = 11;// para issqn
529
-        $hfooter     = 5;// para rodape
530
-        $hCabecItens = 4;//cabeçalho dos itens
526
+        $himposto    = 18; // para imposto
527
+        $htransporte = 25; // para transporte
528
+        $hissqn      = 11; // para issqn
529
+        $hfooter     = 5; // para rodape
530
+        $hCabecItens = 4; //cabeçalho dos itens
531 531
         $hOCUPADA    = $hcabecalho
532 532
             + $hdestinatario
533 533
             + $hlocalentrega
@@ -550,10 +550,10 @@  discard block
 block discarded – undo
550 550
         $this->sizeExtraTextoFatura());*/
551 551
 
552 552
         if ($this->orientacao == 'P') {
553
-            $hDispo1 -= 24 * $this->qCanhoto;//para canhoto
554
-            $w       = $this->wPrint;
553
+            $hDispo1 -= 24 * $this->qCanhoto; //para canhoto
554
+            $w = $this->wPrint;
555 555
         } else {
556
-            $hcanhoto = $this->hPrint;//para canhoto
556
+            $hcanhoto = $this->hPrint; //para canhoto
557 557
             $w        = $this->wPrint - $this->wCanhoto;
558 558
         }
559 559
         //$hDispo1 += 14;
@@ -569,12 +569,12 @@  discard block
 block discarded – undo
569 569
         while ($i < $this->det->length) {
570 570
             $hUsado += $this->calculeHeight($this->det->item($i));
571 571
             if ($hUsado > $hDispo) {
572
-                $totPag ++;
572
+                $totPag++;
573 573
                 $hDispo = $hDispo2;
574 574
                 $hUsado = $hCabecItens;
575
-                $i --; // decrementa para readicionar o item que não coube nessa pagina na outra.
575
+                $i--; // decrementa para readicionar o item que não coube nessa pagina na outra.
576 576
             }
577
-            $i ++;
577
+            $i++;
578 578
         } //fim da soma das areas de itens usadas
579 579
         $qtdeItens = $i; //controle da quantidade de itens no DANFE
580 580
         //montagem da primeira página
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
         $formaPag = [];
607 607
         if (isset($this->detPag) && $this->detPag->length > 0) {
608 608
             foreach ($this->detPag as $k => $d) {
609
-                $fPag            = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
609
+                $fPag            = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
610 610
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
611 611
                     : '0';
612 612
                 $formaPag[$fPag] = $fPag;
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
         }
651 651
 
652 652
         //loop para páginas seguintes
653
-        for ($n = 2; $n <= $totPag; $n ++) {
653
+        for ($n = 2; $n <= $totPag; $n++) {
654 654
             // fixa as margens
655 655
             $this->pdf->setMargins($this->margesq, $this->margsup);
656 656
             //adiciona nova página
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
             }
675 675
             //se estiver na última página e ainda restar itens para inserir, adiciona mais uma página
676 676
             if ($n == $totPag && $this->qtdeItensProc < $qtdeItens) {
677
-                $totPag ++;
677
+                $totPag++;
678 678
             }
679 679
         }
680 680
     }
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
         if ($startPos === false) {
703 703
             return $cdata;
704 704
         }
705
-        for ($x = $len; $x > 0; $x --) {
705
+        for ($x = $len; $x > 0; $x--) {
706 706
             if (substr($cdata, $x, 1) == '>') {
707 707
                 $endPos = $x;
708 708
                 break;
@@ -795,15 +795,15 @@  discard block
 block discarded – undo
795 795
         //grupo CADATA infCpl
796 796
         $t          = $dom->getElementsByTagName('transmissor')->item(0);
797 797
         $r          = $dom->getElementsByTagName('receptor')->item(0);
798
-        $versao     = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
798
+        $versao     = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
799 799
             'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
800
-        $especieNF  = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
800
+        $especieNF  = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
801 801
             'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
802
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
802
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
803 803
             'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
804
-        $dca        = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
804
+        $dca        = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
805 805
             'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
806
-        $texto      .= "" . $versao . $especieNF . $fabEntrega . $dca;
806
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
807 807
         if (isset($t)) {
808 808
             if ($t->hasAttributes()) {
809 809
                 $texto .= " Transmissor ";
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
      * @return array
835 835
      */
836 836
     protected function statusNFe() {
837
-        if (! isset($this->nfeProc)) {
837
+        if (!isset($this->nfeProc)) {
838 838
             return ['status' => false, 'message' => 'NFe NÃO PROTOCOLADA'];
839 839
         }
840 840
         if ($this->getTagValue($this->ide, "tpAmb") == '2') {
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
     }
862 862
 
863 863
     protected function notaDPEC() {
864
-        return ! empty($this->numdepec);
864
+        return !empty($this->numdepec);
865 865
     }
866 866
 
867 867
     /**
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
         //se for right separa 2/3 para os dados e o terço seguinte para o logo
910 910
         //se não houver logo centraliza dos dados do emitente
911 911
         // coloca o logo
912
-        if (! empty($this->logomarca)) {
912
+        if (!empty($this->logomarca)) {
913 913
             $logoInfo = getimagesize($this->logomarca);
914 914
             //largura da imagem em mm
915 915
             $logoWmm = ($logoInfo[0] / 72) * 25.4;
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
             //endereço
966 966
             $y1     = $y1 + 5;
967 967
             $aFont  = ['font' => $this->fontePadrao, 'size' => 8, 'style' => ''];
968
-            $fone   = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
968
+            $fone   = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
969 969
                 ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
970 970
                 : '';
971 971
             $lgr    = $this->getTagValue($this->enderEmit, "xLgr");
@@ -984,8 +984,8 @@  discard block
 block discarded – undo
984 984
 
985 985
         //####################################################################################
986 986
         //coluna central Danfe
987
-        $x  += $w;
988
-        $w  = round($maxW * 0.17, 0);//35;
987
+        $x += $w;
988
+        $w  = round($maxW * 0.17, 0); //35;
989 989
         $w2 = $w;
990 990
         $h  = 32;
991 991
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1042,8 +1042,8 @@  discard block
 block discarded – undo
1042 1042
 
1043 1043
         //####################################################################################
1044 1044
         //coluna codigo de barras
1045
-        $x  += $w;
1046
-        $w  = ($maxW - $w1 - $w2);//85;
1045
+        $x += $w;
1046
+        $w  = ($maxW - $w1 - $w2); //85;
1047 1047
         $w3 = $w;
1048 1048
         $h  = 32;
1049 1049
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
         } else {
1074 1074
             $cabecalhoProtoAutorizacao = 'PROTOCOLO DE AUTORIZAÇÃO DE USO';
1075 1075
         }
1076
-        if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) {
1076
+        if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) {
1077 1077
             $cabecalhoProtoAutorizacao = "DADOS DA NF-E";
1078 1078
             $chaveContingencia         = $this->geraChaveAdicionalDeContingencia();
1079 1079
             $this->pdf->setFillColor(0, 0, 0);
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1106 1106
         $w     = $w1 + $w2;
1107 1107
         $y     = $oldY;
1108
-        $oldY  += $h;
1108
+        $oldY += $h;
1109 1109
         $x     = $oldX;
1110 1110
         $h     = 7;
1111 1111
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
         // NOTA : DANFE sem protocolo deve existir somente no caso de contingência !!!
1123 1123
         // Além disso, existem várias NFes em contingência que eu recebo com protocolo de autorização.
1124 1124
         // Na minha opinião, deveríamos mostra-lo, mas o  manual  da NFe v4.01 diz outra coisa...
1125
-        if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) {
1125
+        if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) {
1126 1126
             $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => 'B'];
1127 1127
             $texto = $this->formatField(
1128 1128
                 $chaveContingencia,
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
                 $cStat = '';
1137 1137
             } else {
1138 1138
                 if (isset($this->nfeProc)) {
1139
-                    $texto  = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1139
+                    $texto  = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1140 1140
                         ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1141 1141
                         : '';
1142 1142
                     $tsHora = $this->toTimestamp(
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1167 1167
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1168 1168
         //INSCRIÇÃO MUNICIPAL
1169
-        $x     += $w;
1169
+        $x += $w;
1170 1170
         $texto = 'INSCRIÇÃO MUNICIPAL';
1171 1171
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1172 1172
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1174,29 +1174,29 @@  discard block
 block discarded – undo
1174 1174
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1175 1175
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1176 1176
         //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.
1177
-        $x     += $w;
1177
+        $x += $w;
1178 1178
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1179 1179
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1180 1180
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1181
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1181
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1182 1182
             ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1183 1183
             : '';
1184 1184
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1185 1185
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1186 1186
         //CNPJ
1187
-        $x     += $w;
1187
+        $x += $w;
1188 1188
         $w     = ($maxW - (3 * $w));
1189 1189
         $texto = 'CNPJ';
1190 1190
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1191 1191
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1192 1192
         //Pegando valor do CPF/CNPJ
1193
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1193
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1194 1194
             $texto = $this->formatField(
1195 1195
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1196 1196
                 "###.###.###/####-##"
1197 1197
             );
1198 1198
         } else {
1199
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1199
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1200 1200
                 ? $this->formatField(
1201 1201
                     $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1202 1202
                     "###.###.###-##"
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
         $tpAmb = $this->ide->getElementsByTagName('tpAmb')->item(0)->nodeValue;
1212 1212
         //indicar cancelamento
1213 1213
         $resp = $this->statusNFe();
1214
-        if (! $resp['status']) {
1214
+        if (!$resp['status']) {
1215 1215
             $x = 10;
1216 1216
             $y = $this->hPrint - 130;
1217 1217
             $h = 25;
@@ -1280,7 +1280,7 @@  discard block
 block discarded – undo
1280 1280
         //NOME / RAZÃO SOCIAL
1281 1281
         $w     = round($maxW * 0.61, 0);
1282 1282
         $w1    = $w;
1283
-        $y     += 3;
1283
+        $y += 3;
1284 1284
         $texto = 'NOME / RAZÃO SOCIAL';
1285 1285
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1286 1286
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1292,20 +1292,20 @@  discard block
 block discarded – undo
1292 1292
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1293 1293
         }
1294 1294
         //CNPJ / CPF
1295
-        $x     += $w;
1295
+        $x += $w;
1296 1296
         $w     = round($maxW * 0.23, 0);
1297 1297
         $w2    = $w;
1298 1298
         $texto = 'CNPJ / CPF';
1299 1299
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1300 1300
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1301 1301
         //Pegando valor do CPF/CNPJ
1302
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1302
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1303 1303
             $texto = $this->formatField(
1304 1304
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1305 1305
                 "###.###.###/####-##"
1306 1306
             );
1307 1307
         } else {
1308
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1308
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1309 1309
                 ? $this->formatField(
1310 1310
                     $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1311 1311
                     "###.###.###-##"
@@ -1315,17 +1315,17 @@  discard block
 block discarded – undo
1315 1315
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1316 1316
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1317 1317
         //DATA DA EMISSÃO
1318
-        $x     += $w;
1318
+        $x += $w;
1319 1319
         $w     = $maxW - ($w1 + $w2);
1320 1320
         $wx    = $w;
1321 1321
         $texto = 'DATA DA EMISSÃO';
1322 1322
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1323 1323
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1324
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1324
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1325 1325
             ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1326 1326
             : '';
1327 1327
         if ($dEmi == '') {
1328
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1328
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1329 1329
                 ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1330 1330
                 : '';
1331 1331
             $aDemi = explode('T', $dEmi);
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
         //ENDEREÇO
1342 1342
         $w     = round($maxW * 0.47, 0);
1343 1343
         $w1    = $w;
1344
-        $y     += $h;
1344
+        $y += $h;
1345 1345
         $x     = $oldX;
1346 1346
         $texto = 'ENDEREÇO';
1347 1347
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1354 1354
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1355 1355
         //BAIRRO / DISTRITO
1356
-        $x     += $w;
1356
+        $x += $w;
1357 1357
         $w     = round($maxW * 0.21, 0);
1358 1358
         $w2    = $w;
1359 1359
         $texto = 'BAIRRO / DISTRITO';
@@ -1363,29 +1363,29 @@  discard block
 block discarded – undo
1363 1363
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1364 1364
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1365 1365
         //CEP
1366
-        $x     += $w;
1366
+        $x += $w;
1367 1367
         $w     = $maxW - $w1 - $w2 - $wx;
1368 1368
         $w2    = $w;
1369 1369
         $texto = 'CEP';
1370 1370
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1371 1371
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1372
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1372
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1373 1373
             ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1374 1374
             : '';
1375 1375
         $texto = $this->formatField($texto, "#####-###");
1376 1376
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1377 1377
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1378 1378
         //DATA DA SAÍDA
1379
-        $x     += $w;
1379
+        $x += $w;
1380 1380
         $w     = $wx;
1381 1381
         $texto = 'DATA DA SAÍDA/ENTRADA';
1382 1382
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1383 1383
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1384
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1384
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1385 1385
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1386 1386
             : '';
1387 1387
         if ($dSaiEnt == '') {
1388
-            $dSaiEnt  = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1388
+            $dSaiEnt  = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1389 1389
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1390 1390
                 : '';
1391 1391
             $aDsaient = explode('T', $dSaiEnt);
@@ -1396,7 +1396,7 @@  discard block
 block discarded – undo
1396 1396
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1397 1397
         //MUNICÍPIO
1398 1398
         $w     = $w1;
1399
-        $y     += $h;
1399
+        $y += $h;
1400 1400
         $x     = $oldX;
1401 1401
         $texto = 'MUNICÍPIO';
1402 1402
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1410,7 +1410,7 @@  discard block
 block discarded – undo
1410 1410
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1411 1411
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1412 1412
         //UF
1413
-        $x     += $w;
1413
+        $x += $w;
1414 1414
         $w     = 8;
1415 1415
         $texto = 'UF';
1416 1416
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1419,19 +1419,19 @@  discard block
 block discarded – undo
1419 1419
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1420 1420
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1421 1421
         //FONE / FAX
1422
-        $x     += $w;
1422
+        $x += $w;
1423 1423
         $w     = round(($maxW - $w1 - $wx - 8) / 2, 0);
1424 1424
         $w3    = $w;
1425 1425
         $texto = 'FONE / FAX';
1426 1426
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1427 1427
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1428
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1428
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1429 1429
             ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1430 1430
             : '';
1431 1431
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1432 1432
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1433 1433
         //INSCRIÇÃO ESTADUAL
1434
-        $x     += $w;
1434
+        $x += $w;
1435 1435
         $w     = $maxW - $w1 - $wx - 8 - $w3;
1436 1436
         $texto = 'INSCRIÇÃO ESTADUAL';
1437 1437
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1441,16 +1441,16 @@  discard block
 block discarded – undo
1441 1441
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1442 1442
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1443 1443
         //HORA DA SAÍDA
1444
-        $x     += $w;
1444
+        $x += $w;
1445 1445
         $w     = $wx;
1446 1446
         $texto = 'HORA DA SAÍDA/ENTRADA';
1447 1447
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1448 1448
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1449
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1449
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1450 1450
             ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1451 1451
             : '';
1452 1452
         if ($hSaiEnt == '') {
1453
-            $dhSaiEnt   = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1453
+            $dhSaiEnt   = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1454 1454
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1455 1455
                 : '';
1456 1456
             $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt);
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
         //NOME / RAZÃO SOCIAL
1494 1494
         $w     = round($maxW * 0.61, 0);
1495 1495
         $w1    = $w;
1496
-        $y     += 3;
1496
+        $y += 3;
1497 1497
         $texto = 'NOME / RAZÃO SOCIAL';
1498 1498
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1499 1499
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1508,20 +1508,20 @@  discard block
 block discarded – undo
1508 1508
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1509 1509
         }
1510 1510
         //CNPJ / CPF
1511
-        $x     += $w;
1511
+        $x += $w;
1512 1512
         $w     = round($maxW * 0.23, 0);
1513 1513
         $w2    = $w;
1514 1514
         $texto = 'CNPJ / CPF';
1515 1515
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1516 1516
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1517 1517
         //Pegando valor do CPF/CNPJ
1518
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1518
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1519 1519
             $texto = $this->formatField(
1520 1520
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1521 1521
                 "###.###.###/####-##"
1522 1522
             );
1523 1523
         } else {
1524
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1524
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1525 1525
                 $this->formatField(
1526 1526
                     $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1527 1527
                     "###.###.###-##"
@@ -1530,7 +1530,7 @@  discard block
 block discarded – undo
1530 1530
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1531 1531
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1532 1532
         //INSCRIÇÃO ESTADUAL
1533
-        $x     += $w;
1533
+        $x += $w;
1534 1534
         $w     = $maxW - ($w1 + $w2);
1535 1535
         $wx    = $w;
1536 1536
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1549,7 +1549,7 @@  discard block
 block discarded – undo
1549 1549
         //ENDEREÇO
1550 1550
         $w     = round($maxW * 0.355, 0) + $wx;
1551 1551
         $w1    = $w;
1552
-        $y     += $h;
1552
+        $y += $h;
1553 1553
         $x     = $oldX;
1554 1554
         $texto = 'ENDEREÇO';
1555 1555
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1560,7 +1560,7 @@  discard block
 block discarded – undo
1560 1560
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1561 1561
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1562 1562
         //BAIRRO / DISTRITO
1563
-        $x     += $w;
1563
+        $x += $w;
1564 1564
         $w     = round($maxW * 0.335, 0);
1565 1565
         $w2    = $w;
1566 1566
         $texto = 'BAIRRO / DISTRITO';
@@ -1570,12 +1570,12 @@  discard block
 block discarded – undo
1570 1570
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1571 1571
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1572 1572
         //CEP
1573
-        $x     += $w;
1573
+        $x += $w;
1574 1574
         $w     = $maxW - ($w1 + $w2);
1575 1575
         $texto = 'CEP';
1576 1576
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1577 1577
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1578
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1578
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1579 1579
             $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1580 1580
         $texto = $this->formatField($texto, "#####-###");
1581 1581
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1583,7 +1583,7 @@  discard block
 block discarded – undo
1583 1583
         //MUNICÍPIO
1584 1584
         $w     = round($maxW * 0.805, 0);
1585 1585
         $w1    = $w;
1586
-        $y     += $h;
1586
+        $y += $h;
1587 1587
         $x     = $oldX;
1588 1588
         $texto = 'MUNICÍPIO';
1589 1589
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1595,7 +1595,7 @@  discard block
 block discarded – undo
1595 1595
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1596 1596
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1597 1597
         //UF
1598
-        $x     += $w;
1598
+        $x += $w;
1599 1599
         $w     = 8;
1600 1600
         $texto = 'UF';
1601 1601
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1604,12 +1604,12 @@  discard block
 block discarded – undo
1604 1604
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1605 1605
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1606 1606
         //FONE / FAX
1607
-        $x     += $w;
1607
+        $x += $w;
1608 1608
         $w     = $maxW - $w - $w1;
1609 1609
         $texto = 'FONE / FAX';
1610 1610
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1611 1611
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1612
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1612
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1613 1613
             $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1614 1614
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1615 1615
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1645,7 +1645,7 @@  discard block
 block discarded – undo
1645 1645
         //NOME / RAZÃO SOCIAL
1646 1646
         $w     = round($maxW * 0.61, 0);
1647 1647
         $w1    = $w;
1648
-        $y     += 3;
1648
+        $y += 3;
1649 1649
         $texto = 'NOME / RAZÃO SOCIAL';
1650 1650
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1651 1651
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1660,20 +1660,20 @@  discard block
 block discarded – undo
1660 1660
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1661 1661
         }
1662 1662
         //CNPJ / CPF
1663
-        $x     += $w;
1663
+        $x += $w;
1664 1664
         $w     = round($maxW * 0.23, 0);
1665 1665
         $w2    = $w;
1666 1666
         $texto = 'CNPJ / CPF';
1667 1667
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1668 1668
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1669 1669
         //Pegando valor do CPF/CNPJ
1670
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1670
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1671 1671
             $texto = $this->formatField(
1672 1672
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1673 1673
                 "###.###.###/####-##"
1674 1674
             );
1675 1675
         } else {
1676
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1676
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1677 1677
                 $this->formatField(
1678 1678
                     $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1679 1679
                     "###.###.###-##"
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1683 1683
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1684 1684
         //INSCRIÇÃO ESTADUAL
1685
-        $x     += $w;
1685
+        $x += $w;
1686 1686
         $w     = $maxW - ($w1 + $w2);
1687 1687
         $wx    = $w;
1688 1688
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
         //ENDEREÇO
1702 1702
         $w     = round($maxW * 0.355, 0) + $wx;
1703 1703
         $w1    = $w;
1704
-        $y     += $h;
1704
+        $y += $h;
1705 1705
         $x     = $oldX;
1706 1706
         $texto = 'ENDEREÇO';
1707 1707
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1713 1713
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1714 1714
         //BAIRRO / DISTRITO
1715
-        $x     += $w;
1715
+        $x += $w;
1716 1716
         $w     = round($maxW * 0.335, 0);
1717 1717
         $w2    = $w;
1718 1718
         $texto = 'BAIRRO / DISTRITO';
@@ -1722,12 +1722,12 @@  discard block
 block discarded – undo
1722 1722
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1723 1723
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1724 1724
         //CEP
1725
-        $x     += $w;
1725
+        $x += $w;
1726 1726
         $w     = $maxW - ($w1 + $w2);
1727 1727
         $texto = 'CEP';
1728 1728
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1729 1729
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1730
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1730
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1731 1731
             $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1732 1732
         $texto = $this->formatField($texto, "#####-###");
1733 1733
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1735,7 +1735,7 @@  discard block
 block discarded – undo
1735 1735
         //MUNICÍPIO
1736 1736
         $w     = round($maxW * 0.805, 0);
1737 1737
         $w1    = $w;
1738
-        $y     += $h;
1738
+        $y += $h;
1739 1739
         $x     = $oldX;
1740 1740
         $texto = 'MUNICÍPIO';
1741 1741
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1747,7 +1747,7 @@  discard block
 block discarded – undo
1747 1747
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1748 1748
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1749 1749
         //UF
1750
-        $x     += $w;
1750
+        $x += $w;
1751 1751
         $w     = 8;
1752 1752
         $texto = 'UF';
1753 1753
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1756,12 +1756,12 @@  discard block
 block discarded – undo
1756 1756
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1757 1757
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1758 1758
         //FONE / FAX
1759
-        $x     += $w;
1759
+        $x += $w;
1760 1760
         $w     = $maxW - $w - $w1;
1761 1761
         $texto = 'FONE / FAX';
1762 1762
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1763 1763
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1764
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1764
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1765 1765
             $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1766 1766
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1767 1767
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
         if (isset($this->cobr)) {
1781 1781
             $fat = $this->cobr->getElementsByTagName("fat")->item(0);
1782 1782
             if (isset($fat)) {
1783
-                if (! empty($this->getTagValue($this->ide, "indPag"))) {
1783
+                if (!empty($this->getTagValue($this->ide, "indPag"))) {
1784 1784
                     $textoIndPag = "";
1785 1785
                     $indPag      = $this->getTagValue($this->ide, "indPag");
1786 1786
                     if ($indPag === "0") {
@@ -1853,7 +1853,7 @@  discard block
 block discarded – undo
1853 1853
             $h     = 8;
1854 1854
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
1855 1855
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1856
-            $y       += 3;
1856
+            $y += 3;
1857 1857
             $dups    = "";
1858 1858
             $dupcont = 0;
1859 1859
             $nFat    = $this->dup->length;
@@ -1887,13 +1887,13 @@  discard block
 block discarded – undo
1887 1887
             }
1888 1888
             $increm = 1;
1889 1889
             foreach ($this->dup as $k => $d) {
1890
-                $nDup  = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1890
+                $nDup  = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1891 1891
                     ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1892 1892
                     : '';
1893
-                $dDup  = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1893
+                $dDup  = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1894 1894
                     ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1895 1895
                     : '';
1896
-                $vDup  = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1896
+                $vDup  = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1897 1897
                     ? 'R$ ' . number_format(
1898 1898
                         $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1899 1899
                         2,
@@ -1940,7 +1940,7 @@  discard block
 block discarded – undo
1940 1940
             }
1941 1941
             if ($dupcont == 0) {
1942 1942
                 $y -= 9;
1943
-                $linha --;
1943
+                $linha--;
1944 1944
             }
1945 1945
 
1946 1946
             return ($y + $h);
@@ -1979,7 +1979,7 @@  discard block
 block discarded – undo
1979 1979
             $h     = 8;
1980 1980
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
1981 1981
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1982
-            $y       += 3;
1982
+            $y += 3;
1983 1983
             $dups    = "";
1984 1984
             $dupcont = 0;
1985 1985
             if ($this->orientacao == 'P') {
@@ -2008,7 +2008,7 @@  discard block
 block discarded – undo
2008 2008
                 '90' => 'Sem pagamento',
2009 2009
                 '99' => 'Outros'
2010 2010
             ];
2011
-            $bandeira       = [
2011
+            $bandeira = [
2012 2012
                 '01' => 'Visa',
2013 2013
                 '02' => 'Mastercard',
2014 2014
                 '03' => 'American',
@@ -2021,10 +2021,10 @@  discard block
 block discarded – undo
2021 2021
                 '99' => 'Outros'
2022 2022
             ];
2023 2023
             foreach ($this->detPag as $k => $d) {
2024
-                $fPag  = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2024
+                $fPag  = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2025 2025
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
2026 2026
                     : '0';
2027
-                $vPag  = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2027
+                $vPag  = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2028 2028
                     ? 'R$ ' . number_format(
2029 2029
                         $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
2030 2030
                         2,
@@ -2067,7 +2067,7 @@  discard block
 block discarded – undo
2067 2067
             }
2068 2068
             if ($dupcont == 0) {
2069 2069
                 $y -= 9;
2070
-                $linha --;
2070
+                $linha--;
2071 2071
             }
2072 2072
 
2073 2073
             return ($y + $h);
@@ -2098,7 +2098,7 @@  discard block
 block discarded – undo
2098 2098
         $the_field    = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0);
2099 2099
         if (isset($the_field)) {
2100 2100
             $the_value = $the_field->nodeValue;
2101
-            if (! empty($the_value)) {
2101
+            if (!empty($the_value)) {
2102 2102
                 $valorImposto = number_format($the_value, 2, ",", ".");
2103 2103
             }
2104 2104
         }
@@ -2126,10 +2126,10 @@  discard block
 block discarded – undo
2126 2126
         $x_inicial = $x;
2127 2127
         //#####################################################################
2128 2128
         $campos_por_linha = 9;
2129
-        if (! $this->exibirPIS) {
2130
-            $campos_por_linha --;
2129
+        if (!$this->exibirPIS) {
2130
+            $campos_por_linha--;
2131 2131
         }
2132
-        if (! $this->exibirIcmsInterestadual) {
2132
+        if (!$this->exibirIcmsInterestadual) {
2133 2133
             $campos_por_linha -= 2;
2134 2134
         }
2135 2135
 
@@ -2215,12 +2215,12 @@  discard block
 block discarded – undo
2215 2215
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2216 2216
         //NOME / RAZÃO SOCIAL
2217 2217
         $w1    = $maxW * 0.29;
2218
-        $y     += 3;
2218
+        $y += 3;
2219 2219
         $texto = 'NOME / RAZÃO SOCIAL';
2220 2220
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2221 2221
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2222 2222
         if (isset($this->transporta)) {
2223
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2223
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2224 2224
                 ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2225 2225
                 : '';
2226 2226
         } else {
@@ -2229,12 +2229,12 @@  discard block
 block discarded – undo
2229 2229
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2230 2230
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2231 2231
         //FRETE POR CONTA
2232
-        $x     += $w1;
2232
+        $x += $w1;
2233 2233
         $w2    = $maxW * 0.15;
2234 2234
         $texto = 'FRETE';
2235 2235
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2236 2236
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2237
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2237
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2238 2238
             ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2239 2239
             : '0';
2240 2240
         switch ($tipoFrete) {
@@ -2260,12 +2260,12 @@  discard block
 block discarded – undo
2260 2260
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2261 2261
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, '');
2262 2262
         //CÓDIGO ANTT
2263
-        $x     += $w2;
2263
+        $x += $w2;
2264 2264
         $texto = 'CÓDIGO ANTT';
2265 2265
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2266 2266
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2267 2267
         if (isset($this->veicTransp)) {
2268
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2268
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2269 2269
                 ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2270 2270
                 : '';
2271 2271
         } else {
@@ -2274,16 +2274,16 @@  discard block
 block discarded – undo
2274 2274
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2275 2275
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2276 2276
         //PLACA DO VEÍC
2277
-        $x     += $w2;
2277
+        $x += $w2;
2278 2278
         $texto = 'PLACA DO VEÍCULO';
2279 2279
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2280 2280
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2281 2281
         if (isset($this->veicTransp)) {
2282
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2282
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2283 2283
                 ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2284 2284
                 : '';
2285 2285
         } elseif (isset($this->reboque)) {
2286
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2286
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2287 2287
                 ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2288 2288
                 : '';
2289 2289
         } else {
@@ -2292,17 +2292,17 @@  discard block
 block discarded – undo
2292 2292
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2293 2293
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2294 2294
         //UF
2295
-        $x     += $w2;
2295
+        $x += $w2;
2296 2296
         $w3    = round($maxW * 0.04, 0);
2297 2297
         $texto = 'UF';
2298 2298
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2299 2299
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2300 2300
         if (isset($this->veicTransp)) {
2301
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2301
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2302 2302
                 ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2303 2303
                 : '';
2304 2304
         } elseif (isset($this->reboque)) {
2305
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2305
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2306 2306
                 ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2307 2307
                 : '';
2308 2308
         } else {
@@ -2311,20 +2311,20 @@  discard block
 block discarded – undo
2311 2311
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2312 2312
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2313 2313
         //CNPJ / CPF
2314
-        $x     += $w3;
2314
+        $x += $w3;
2315 2315
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2316 2316
         $texto = 'CNPJ / CPF';
2317 2317
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2318 2318
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2319 2319
         if (isset($this->transporta)) {
2320
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2320
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2321 2321
                 ? $this->formatField(
2322 2322
                     $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2323 2323
                     "##.###.###/####-##"
2324 2324
                 )
2325 2325
                 : '';
2326 2326
             if ($texto == '') {
2327
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2327
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2328 2328
                     ? $this->formatField(
2329 2329
                         $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2330 2330
                         "###.###.###-##"
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
2339 2339
         //#####################################################################
2340 2340
         //ENDEREÇO
2341
-        $y     += $h;
2341
+        $y += $h;
2342 2342
         $x     = $oldX;
2343 2343
         $h     = 7;
2344 2344
         $w1    = $maxW * 0.44;
@@ -2346,7 +2346,7 @@  discard block
 block discarded – undo
2346 2346
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2347 2347
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2348 2348
         if (isset($this->transporta)) {
2349
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2349
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2350 2350
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2351 2351
                 : '';
2352 2352
         } else {
@@ -2355,13 +2355,13 @@  discard block
 block discarded – undo
2355 2355
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2356 2356
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2357 2357
         //MUNICÍPIO
2358
-        $x     += $w1;
2358
+        $x += $w1;
2359 2359
         $w2    = round($maxW * 0.30, 0);
2360 2360
         $texto = 'MUNICÍPIO';
2361 2361
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2362 2362
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2363 2363
         if (isset($this->transporta)) {
2364
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2364
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2365 2365
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2366 2366
                 : '';
2367 2367
         } else {
@@ -2370,13 +2370,13 @@  discard block
 block discarded – undo
2370 2370
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2371 2371
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2372 2372
         //UF
2373
-        $x     += $w2;
2373
+        $x += $w2;
2374 2374
         $w3    = round($maxW * 0.04, 0);
2375 2375
         $texto = 'UF';
2376 2376
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2377 2377
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2378 2378
         if (isset($this->transporta)) {
2379
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2379
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2380 2380
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2381 2381
                 : '';
2382 2382
         } else {
@@ -2385,14 +2385,14 @@  discard block
 block discarded – undo
2385 2385
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2386 2386
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2387 2387
         //INSCRIÇÃO ESTADUAL
2388
-        $x     += $w3;
2388
+        $x += $w3;
2389 2389
         $w     = $maxW - ($w1 + $w2 + $w3);
2390 2390
         $texto = 'INSCRIÇÃO ESTADUAL';
2391 2391
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2392 2392
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2393 2393
         $texto = '';
2394 2394
         if (isset($this->transporta)) {
2395
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2395
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2396 2396
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2397 2397
             }
2398 2398
         }
@@ -2408,13 +2408,13 @@  discard block
 block discarded – undo
2408 2408
         $pesoBruto   = 0;
2409 2409
         $pesoLiquido = 0;
2410 2410
         foreach ($volumes as $volume) {
2411
-            $quantidade  += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2411
+            $quantidade  += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2412 2412
                 $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2413
-            $pesoBruto   += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2413
+            $pesoBruto   += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2414 2414
                 $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2415
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2415
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2416 2416
                 $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2417
-            $texto       = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2417
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2418 2418
                 $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2419 2419
             if ($texto != $especie && $especie != '') {
2420 2420
                 //tem várias especies
@@ -2422,7 +2422,7 @@  discard block
 block discarded – undo
2422 2422
             } else {
2423 2423
                 $especie = $texto;
2424 2424
             }
2425
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2425
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2426 2426
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2427 2427
                 : '';
2428 2428
             if ($texto != $marca && $marca != '') {
@@ -2431,7 +2431,7 @@  discard block
 block discarded – undo
2431 2431
             } else {
2432 2432
                 $marca = $texto;
2433 2433
             }
2434
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2434
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2435 2435
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2436 2436
                 : '';
2437 2437
             if ($texto != $numero && $numero != '') {
@@ -2444,20 +2444,20 @@  discard block
 block discarded – undo
2444 2444
 
2445 2445
         //#####################################################################
2446 2446
         //QUANTIDADE
2447
-        $y     += $h;
2447
+        $y += $h;
2448 2448
         $x     = $oldX;
2449 2449
         $h     = 7;
2450 2450
         $w1    = round($maxW * 0.10, 0);
2451 2451
         $texto = 'QUANTIDADE';
2452 2452
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2453 2453
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2454
-        if (! empty($quantidade)) {
2454
+        if (!empty($quantidade)) {
2455 2455
             $texto = $quantidade;
2456 2456
             $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2457 2457
             $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, '');
2458 2458
         }
2459 2459
         //ESPÉCIE
2460
-        $x     += $w1;
2460
+        $x += $w1;
2461 2461
         $w2    = round($maxW * 0.17, 0);
2462 2462
         $texto = 'ESPÉCIE';
2463 2463
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2466,16 +2466,16 @@  discard block
 block discarded – undo
2466 2466
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2467 2467
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2468 2468
         //MARCA
2469
-        $x     += $w2;
2469
+        $x += $w2;
2470 2470
         $texto = 'MARCA';
2471 2471
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2472 2472
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2473
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2473
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2474 2474
             $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2475 2475
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2476 2476
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2477 2477
         //NUMERAÇÃO
2478
-        $x     += $w2;
2478
+        $x += $w2;
2479 2479
         $texto = 'NUMERAÇÃO';
2480 2480
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2481 2481
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2483,7 +2483,7 @@  discard block
 block discarded – undo
2483 2483
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2484 2484
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2485 2485
         //PESO BRUTO
2486
-        $x     += $w2;
2486
+        $x += $w2;
2487 2487
         $w3    = round($maxW * 0.20, 0);
2488 2488
         $texto = 'PESO BRUTO';
2489 2489
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2497 2497
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2498 2498
         //PESO LÍQUIDO
2499
-        $x     += $w3;
2499
+        $x += $w3;
2500 2500
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2501 2501
         $texto = 'PESO LÍQUIDO';
2502 2502
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2515,11 +2515,11 @@  discard block
 block discarded – undo
2515 2515
 
2516 2516
     protected function descricaoProdutoHelper($origem, $campo, $formato) {
2517 2517
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
2518
-        if (! isset($valor_original)) {
2518
+        if (!isset($valor_original)) {
2519 2519
             return "";
2520 2520
         }
2521 2521
         $valor_original = $valor_original->nodeValue;
2522
-        $valor          = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2522
+        $valor          = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2523 2523
 
2524 2524
         if ($valor != "") {
2525 2525
             return sprintf($formato, $valor);
@@ -2544,7 +2544,7 @@  discard block
 block discarded – undo
2544 2544
         $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0);
2545 2545
         $impostos   = '';
2546 2546
 
2547
-        if (! empty($ICMS)) {
2547
+        if (!empty($ICMS)) {
2548 2548
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s");
2549 2549
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%");
2550 2550
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s");
@@ -2560,7 +2560,7 @@  discard block
 block discarded – undo
2560 2560
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s");
2561 2561
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s");
2562 2562
         }
2563
-        if (! empty($ICMSUFDest)) {
2563
+        if (!empty($ICMSUFDest)) {
2564 2564
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%");
2565 2565
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%");
2566 2566
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%");
@@ -2568,20 +2568,20 @@  discard block
 block discarded – undo
2568 2568
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2569 2569
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2570 2570
         }
2571
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2571
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2572 2572
             ? substr(
2573 2573
                 $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2574 2574
                 0,
2575 2575
                 500
2576 2576
             )
2577 2577
             : '';
2578
-        if (! empty($infAdProd)) {
2578
+        if (!empty($infAdProd)) {
2579 2579
             $infAdProd = trim($infAdProd);
2580 2580
             $infAdProd .= ' ';
2581 2581
         }
2582 2582
         $loteTxt = '';
2583 2583
         $rastro  = $prod->getElementsByTagName("med");
2584
-        if (! empty($prod->getElementsByTagName("rastro"))) {
2584
+        if (!empty($prod->getElementsByTagName("rastro"))) {
2585 2585
             $rastro = $prod->getElementsByTagName("rastro");
2586 2586
             $i      = 0;
2587 2587
             while ($i < $rastro->length) {
@@ -2590,14 +2590,14 @@  discard block
 block discarded – undo
2590 2590
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dFab', ' Fab: ');
2591 2591
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dVal', ' Val: ');
2592 2592
                 $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: ');
2593
-                $i ++;
2593
+                $i++;
2594 2594
             }
2595 2595
             if ($loteTxt != '') {
2596 2596
                 $loteTxt .= ' ';
2597 2597
             }
2598 2598
         }
2599 2599
         //NT2013.006 FCI
2600
-        $nFCI   = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2600
+        $nFCI   = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2601 2601
             ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2602 2602
         $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2603 2603
         $texto  = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
@@ -2647,7 +2647,7 @@  discard block
 block discarded – undo
2647 2647
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2648 2648
         $y += 3;
2649 2649
         //desenha a caixa dos dados dos itens da NF
2650
-        $hmax  += 1;
2650
+        $hmax += 1;
2651 2651
         $texto = '';
2652 2652
         $this->pdf->textBox($x, $y, $w, $hmax);
2653 2653
         //##################################################################################
@@ -2660,101 +2660,101 @@  discard block
 block discarded – undo
2660 2660
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2661 2661
         $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2662 2662
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2663
-        $x     += $w1;
2663
+        $x += $w1;
2664 2664
         $w2    = round($w * 0.25, 0);
2665 2665
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2666 2666
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2667 2667
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2668 2668
         $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2669 2669
         //NCM/SH
2670
-        $x     += $w2;
2670
+        $x += $w2;
2671 2671
         $w3    = round($w * 0.06, 0);
2672 2672
         $texto = 'NCM/SH';
2673 2673
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2674 2674
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2675 2675
         $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2676 2676
         //O/CST ou O/CSOSN
2677
-        $x     += $w3;
2677
+        $x += $w3;
2678 2678
         $w4    = round($w * 0.05, 0);
2679
-        $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2
2679
+        $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2
2680 2680
         if ($this->getTagValue($this->emit, 'CRT') == '3') {
2681
-            $texto = 'O/CST';//Regime Normal
2681
+            $texto = 'O/CST'; //Regime Normal
2682 2682
         }
2683 2683
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2684 2684
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2685 2685
         $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2686 2686
         //CFOP
2687
-        $x     += $w4;
2687
+        $x += $w4;
2688 2688
         $w5    = round($w * 0.04, 0);
2689 2689
         $texto = 'CFOP';
2690 2690
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2691 2691
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2692 2692
         $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2693 2693
         //UN
2694
-        $x     += $w5;
2694
+        $x += $w5;
2695 2695
         $w6    = round($w * 0.03, 0);
2696 2696
         $texto = 'UN';
2697 2697
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2698 2698
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2699 2699
         $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2700 2700
         //QUANT
2701
-        $x     += $w6;
2701
+        $x += $w6;
2702 2702
         $w7    = round($w * 0.08, 0);
2703 2703
         $texto = 'QUANT';
2704 2704
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2705 2705
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2706 2706
         $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2707 2707
         //VALOR UNIT
2708
-        $x     += $w7;
2708
+        $x += $w7;
2709 2709
         $w8    = round($w * 0.06, 0);
2710 2710
         $texto = 'VALOR UNIT';
2711 2711
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2712 2712
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2713 2713
         $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2714 2714
         //VALOR TOTAL
2715
-        $x     += $w8;
2715
+        $x += $w8;
2716 2716
         $w9    = round($w * 0.06, 0);
2717 2717
         $texto = 'VALOR TOTAL';
2718 2718
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2719 2719
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2720 2720
         $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2721 2721
         //VALOR DESCONTO
2722
-        $x     += $w9;
2722
+        $x += $w9;
2723 2723
         $w10   = round($w * 0.05, 0);
2724 2724
         $texto = 'VALOR DESC';
2725 2725
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2726 2726
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2727 2727
         $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2728 2728
         //B.CÁLC ICMS
2729
-        $x     += $w10;
2729
+        $x += $w10;
2730 2730
         $w11   = round($w * 0.06, 0);
2731 2731
         $texto = 'B.CÁLC ICMS';
2732 2732
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2733 2733
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2734 2734
         $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2735 2735
         //VALOR ICMS
2736
-        $x     += $w11;
2736
+        $x += $w11;
2737 2737
         $w12   = round($w * 0.06, 0);
2738 2738
         $texto = 'VALOR ICMS';
2739 2739
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2740 2740
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2741 2741
         $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2742 2742
         //VALOR IPI
2743
-        $x     += $w12;
2743
+        $x += $w12;
2744 2744
         $w13   = round($w * 0.05, 0);
2745 2745
         $texto = 'VALOR IPI';
2746 2746
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2747 2747
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2748 2748
         $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2749 2749
         //ALÍQ. ICMS
2750
-        $x     += $w13;
2750
+        $x += $w13;
2751 2751
         $w14   = round($w * 0.04, 0);
2752 2752
         $texto = 'ALÍQ. ICMS';
2753 2753
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2754 2754
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2755 2755
         $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2756 2756
         //ALÍQ. IPI
2757
-        $x     += $w14;
2757
+        $x += $w14;
2758 2758
         $w15   = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2759 2759
         $texto = 'ALÍQ. IPI';
2760 2760
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
@@ -2778,7 +2778,7 @@  discard block
 block discarded – undo
2778 2778
 
2779 2779
                 // Posição y dos dados das unidades tributaveis.
2780 2780
                 $yTrib = $this->pdf->fontSize + .5;
2781
-                if (! $this->mostrarUnidadeTributavel) {
2781
+                if (!$this->mostrarUnidadeTributavel) {
2782 2782
                     $yTrib = 0;
2783 2783
                 }
2784 2784
                 $h      = $this->calculeHeight($thisItem);
@@ -2813,7 +2813,7 @@  discard block
 block discarded – undo
2813 2813
                 }
2814 2814
                 $x += $w2;
2815 2815
                 //NCM
2816
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2816
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2817 2817
                     $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2818 2818
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2819 2819
                 $x += $w3;
@@ -2826,17 +2826,17 @@  discard block
 block discarded – undo
2826 2826
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2827 2827
                 }
2828 2828
                 //CFOP
2829
-                $x     += $w4;
2829
+                $x += $w4;
2830 2830
                 $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue;
2831 2831
                 $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, '');
2832 2832
                 //Unidade
2833
-                $x     += $w5;
2833
+                $x += $w5;
2834 2834
                 $texto = $prod->getElementsByTagName("uCom")->item(0)->nodeValue;
2835 2835
                 $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, '');
2836 2836
                 //Unidade de medida tributável
2837 2837
                 if ($this->mostrarUnidadeTributavel) {
2838 2838
                     $uTrib = $prod->getElementsByTagName("uTrib")->item(0);
2839
-                    if (! empty($uTrib)) {
2839
+                    if (!empty($uTrib)) {
2840 2840
                         $texto = $uTrib->nodeValue;
2841 2841
                         $this->pdf->textBox($x, $yTrib, $w6, $h, $texto, $aFont, 'T', 'C', 0, '');
2842 2842
                     }
@@ -2854,7 +2854,7 @@  discard block
 block discarded – undo
2854 2854
                 // QTDADE Tributável
2855 2855
                 if ($this->mostrarUnidadeTributavel) {
2856 2856
                     $qTrib = $prod->getElementsByTagName("qTrib")->item(0);
2857
-                    if (! empty($qTrib)) {
2857
+                    if (!empty($qTrib)) {
2858 2858
                         $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", ".");
2859 2859
                         $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2860 2860
                     }
@@ -2867,7 +2867,7 @@  discard block
 block discarded – undo
2867 2867
                 // Valor Unitário Tributável
2868 2868
                 if ($this->mostrarUnidadeTributavel) {
2869 2869
                     $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0);
2870
-                    if (! empty($vUnTrib)) {
2870
+                    if (!empty($vUnTrib)) {
2871 2871
                         $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", ".");
2872 2872
                         $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2873 2873
                     }
@@ -2881,7 +2881,7 @@  discard block
 block discarded – undo
2881 2881
                 $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2882 2882
                 $x += $w9;
2883 2883
                 //Valor do Desconto
2884
-                $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2884
+                $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2885 2885
                     ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0;
2886 2886
 
2887 2887
                 $texto = number_format($vdesc, 2, ",", ".");
@@ -2889,7 +2889,7 @@  discard block
 block discarded – undo
2889 2889
                 //Valor da Base de calculo
2890 2890
                 $x += $w10;
2891 2891
                 if (isset($ICMS)) {
2892
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2892
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2893 2893
                         ? number_format(
2894 2894
                             $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
2895 2895
                             2,
@@ -2902,7 +2902,7 @@  discard block
 block discarded – undo
2902 2902
                 //Valor do ICMS
2903 2903
                 $x += $w11;
2904 2904
                 if (isset($ICMS)) {
2905
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2905
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2906 2906
                         ? number_format(
2907 2907
                             $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
2908 2908
                             2,
@@ -2915,7 +2915,7 @@  discard block
 block discarded – undo
2915 2915
                 //Valor do IPI
2916 2916
                 $x += $w12;
2917 2917
                 if (isset($IPI)) {
2918
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2918
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2919 2919
                         ? number_format(
2920 2920
                             $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
2921 2921
                             2,
@@ -2930,7 +2930,7 @@  discard block
 block discarded – undo
2930 2930
                 // %ICMS
2931 2931
                 $x += $w13;
2932 2932
                 if (isset($ICMS)) {
2933
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2933
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2934 2934
                         ? number_format(
2935 2935
                             $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
2936 2936
                             2,
@@ -2943,7 +2943,7 @@  discard block
 block discarded – undo
2943 2943
                 //%IPI
2944 2944
                 $x += $w14;
2945 2945
                 if (isset($IPI)) {
2946
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
2946
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
2947 2947
                         ? number_format(
2948 2948
                             $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
2949 2949
                             2,
@@ -2961,17 +2961,17 @@  discard block
 block discarded – undo
2961 2961
                 $veicProd = $prod->getElementsByTagName("veicProd")->item(0);
2962 2962
                 // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran
2963 2963
                 // Verifica se a Tag existe
2964
-                if (! empty($veicProd)) {
2964
+                if (!empty($veicProd)) {
2965 2965
                     $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod);
2966 2966
                 }
2967 2967
 
2968 2968
 
2969 2969
                 $y += $h;
2970
-                $i ++;
2970
+                $i++;
2971 2971
                 //incrementa o controle dos itens processados.
2972
-                $this->qtdeItensProc ++;
2972
+                $this->qtdeItensProc++;
2973 2973
             } else {
2974
-                $i ++;
2974
+                $i++;
2975 2975
             }
2976 2976
         }
2977 2977
 
@@ -3174,23 +3174,23 @@  discard block
 block discarded – undo
3174 3174
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
3175 3175
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3176 3176
         //INSCRIÇÃO MUNICIPAL
3177
-        $y     += 3;
3177
+        $y += 3;
3178 3178
         $w     = round($this->wPrint * 0.23, 0);
3179 3179
         $texto = 'INSCRIÇÃO MUNICIPAL';
3180 3180
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3181 3181
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3182 3182
         //inscrição municipal
3183
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3183
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3184 3184
             $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3185 3185
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3186 3186
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
3187 3187
         //VALOR TOTAL DOS SERVIÇOS
3188
-        $x     += $w;
3188
+        $x += $w;
3189 3189
         $texto = 'VALOR TOTAL DOS SERVIÇOS';
3190 3190
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3191 3191
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3192 3192
         if (isset($this->ISSQNtot)) {
3193
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3193
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3194 3194
                 $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3195 3195
             $texto = number_format($texto, 2, ",", ".");
3196 3196
         } else {
@@ -3199,14 +3199,14 @@  discard block
 block discarded – undo
3199 3199
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3200 3200
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3201 3201
         //BASE DE CÁLCULO DO ISSQN
3202
-        $x     += $w;
3202
+        $x += $w;
3203 3203
         $texto = 'BASE DE CÁLCULO DO ISSQN';
3204 3204
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3205 3205
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3206 3206
         if (isset($this->ISSQNtot)) {
3207
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3207
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3208 3208
                 $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3209
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3209
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3210 3210
         } else {
3211 3211
             $texto = '';
3212 3212
         }
@@ -3223,9 +3223,9 @@  discard block
 block discarded – undo
3223 3223
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3224 3224
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3225 3225
         if (isset($this->ISSQNtot)) {
3226
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3226
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3227 3227
                 $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3228
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3228
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3229 3229
         } else {
3230 3230
             $texto = '';
3231 3231
         }
@@ -3263,7 +3263,7 @@  discard block
 block discarded – undo
3263 3263
 
3264 3264
         //INFORMAÇÕES COMPLEMENTARES
3265 3265
         $texto = "INFORMAÇÕES COMPLEMENTARES";
3266
-        $y     += 3;
3266
+        $y += 3;
3267 3267
         $w     = $this->wAdic;
3268 3268
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B'];
3269 3269
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -3273,7 +3273,7 @@  discard block
 block discarded – undo
3273 3273
         //$this->textoAdic com o texto completo do campo
3274 3274
         //echo str_replace("\n", "<br>",$this->textoAdic);
3275 3275
         //die;
3276
-        $y     += 1;
3276
+        $y += 1;
3277 3277
         $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => ''];
3278 3278
         //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>''];
3279 3279
         $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
@@ -3324,7 +3324,7 @@  discard block
 block discarded – undo
3324 3324
                 $texto = 'CONTINGÊNCIA SVC-RS' . $dhCont . $xJust;
3325 3325
                 break;
3326 3326
         }
3327
-        $y     += 2;
3327
+        $y += 2;
3328 3328
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
3329 3329
         $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false);
3330 3330
 
@@ -3377,7 +3377,7 @@  discard block
 block discarded – undo
3377 3377
         $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
3378 3378
         if ($tpNF == '0') {
3379 3379
             //NFe de Entrada
3380
-            $emitente     = '';
3380
+            $emitente = '';
3381 3381
             $emitente     .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - ";
3382 3382
             $emitente     .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", ";
3383 3383
             $emitente     .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - ";
@@ -3430,10 +3430,10 @@  discard block
 block discarded – undo
3430 3430
             $texto .= "AO LADO";
3431 3431
         }
3432 3432
         $texto .= ". EMISSÃO: ";
3433
-        $dEmi  = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3433
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3434 3434
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3435 3435
         if ($dEmi == '') {
3436
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3436
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3437 3437
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3438 3438
             $aDemi = explode('T', $dEmi);
3439 3439
             $dEmi  = $aDemi[0];
@@ -3456,12 +3456,12 @@  discard block
 block discarded – undo
3456 3456
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3457 3457
             //DATA DE RECEBIMENTO
3458 3458
             $texto = "DATA DE RECEBIMENTO";
3459
-            $y     += $h;
3459
+            $y += $h;
3460 3460
             $w2    = round($this->wPrint * 0.17, 0); //35;
3461 3461
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3462 3462
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3463 3463
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3464
-            $x     += $w2;
3464
+            $x += $w2;
3465 3465
             $w3    = $w - $w2;
3466 3466
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3467 3467
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3472,7 +3472,7 @@  discard block
 block discarded – undo
3472 3472
 
3473 3473
             return $y;
3474 3474
         } else {
3475
-            $x --;
3475
+            $x--;
3476 3476
             $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3477 3477
             //NUMERO DA NOTA FISCAL LOGO NFE
3478 3478
             $w1    = 18;
@@ -3493,7 +3493,7 @@  discard block
 block discarded – undo
3493 3493
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3494 3494
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3495 3495
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3496
-            $y     -= $w2;
3496
+            $y -= $w2;
3497 3497
             $w3    = $w - $w2;
3498 3498
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3499 3499
             $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => ''];
@@ -3513,18 +3513,18 @@  discard block
 block discarded – undo
3513 3513
      * @return string com as informacoes dos pedidos.
3514 3514
      */
3515 3515
     protected function geraInformacoesDaTagCompra() {
3516
-        if (! $this->gerarInformacoesAutomaticas) {
3516
+        if (!$this->gerarInformacoesAutomaticas) {
3517 3517
             return '';
3518 3518
         }
3519 3519
         $saida = "";
3520 3520
         if (isset($this->compra)) {
3521
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3521
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3522 3522
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3523 3523
             }
3524
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3524
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3525 3525
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3526 3526
             }
3527
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3527
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3528 3528
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3529 3529
             }
3530 3530
         }
@@ -3554,10 +3554,10 @@  discard block
 block discarded – undo
3554 3554
         if ($icmss > 0) {
3555 3555
             $icmss = 1;
3556 3556
         }
3557
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3557
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3558 3558
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3559 3559
         if ($dEmi == '') {
3560
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3560
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3561 3561
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3562 3562
             $aDemi = explode('T', $dEmi);
3563 3563
             $dEmi  = $aDemi[0];
@@ -3580,7 +3580,7 @@  discard block
 block discarded – undo
3580 3580
      * @return string Informacoes a serem adicionadas no rodapé sobre notas referenciadas.
3581 3581
      */
3582 3582
     protected function geraInformacoesDasNotasReferenciadas() {
3583
-        if (! $this->gerarInformacoesAutomaticas) {
3583
+        if (!$this->gerarInformacoesAutomaticas) {
3584 3584
             return '';
3585 3585
         }
3586 3586
         $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]";
@@ -3608,7 +3608,7 @@  discard block
 block discarded – undo
3608 3608
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3609 3609
                 $serie         = substr($chave_acesso, 22, 3);
3610 3610
                 $numero        = substr($chave_acesso, 25, 9);
3611
-                $saida         .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3611
+                $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3612 3612
             }
3613 3613
             $refNF = $nfRef->getElementsByTagName('refNF');
3614 3614
             foreach ($refNF as $umaRefNFe) {
@@ -3619,7 +3619,7 @@  discard block
 block discarded – undo
3619 3619
                 $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue;
3620 3620
                 $data   = substr($data, 2, 2) . "/20" . substr($data, 0, 2);
3621 3621
                 $cnpj   = $this->formatField($cnpj, "##.###.###/####-##");
3622
-                $saida  .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3622
+                $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3623 3623
             }
3624 3624
             $refCTe = $nfRef->getElementsByTagName('refCTe');
3625 3625
             foreach ($refCTe as $chave_acessoRef) {
@@ -3629,7 +3629,7 @@  discard block
 block discarded – undo
3629 3629
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3630 3630
                 $serie         = substr($chave_acesso, 22, 3);
3631 3631
                 $numero        = substr($chave_acesso, 25, 9);
3632
-                $saida         .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3632
+                $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3633 3633
             }
3634 3634
             $refECF = $nfRef->getElementsByTagName('refECF');
3635 3635
             foreach ($refECF as $umaRefNFe) {
@@ -3641,10 +3641,9 @@  discard block
 block discarded – undo
3641 3641
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3642 3642
             foreach ($refNFP as $umaRefNFe) {
3643 3643
                 $data   = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3644
-                $cnpj   = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3645
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3646
-                    '';
3647
-                $cpf    = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3644
+                $cnpj   = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3645
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3646
+                $cpf    = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3648 3647
                     $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3649 3648
                 $mod    = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3650 3649
                 $serie  = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
@@ -3665,7 +3664,7 @@  discard block
 block discarded – undo
3665 3664
 
3666 3665
     private function loadDoc($xml) {
3667 3666
         $this->xml = $xml;
3668
-        if (! empty($xml)) {
3667
+        if (!empty($xml)) {
3669 3668
             $this->dom = new Dom();
3670 3669
             $this->dom->loadXML($this->xml);
3671 3670
             if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) {
Please login to merge, or discard this patch.