Passed
Pull Request — master (#432)
by
unknown
03:02
created
src/NFe/Danfe.php 1 patch
Spacing   +230 added lines, -231 removed lines patch added patch discarded remove patch
@@ -310,39 +310,39 @@  discard block
 block discarded – undo
310 310
     {
311 311
         $this->textoAdic = '';
312 312
         //informações adicionais
313
-        $fontProduto            = [
313
+        $fontProduto = [
314 314
             'font'  => $this->fontePadrao,
315 315
             'size'  => 8,
316 316
             'style' => ''
317 317
         ];
318 318
         $k                      = $this->pdf->k;
319 319
         $this->textadicfontsize = $fontProduto['size'] / $k;
320
-        $this->textoAdic        .= $this->geraInformacoesDasNotasReferenciadas();
320
+        $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
321 321
         if (isset($this->infAdic)) {
322 322
             $i = 0;
323 323
             if ($this->textoAdic != '') {
324 324
                 $this->textoAdic .= ". \n";
325 325
             }
326
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl"))
326
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl"))
327 327
                 ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl"))
328 328
                 : '';
329
-            $infPedido       = $this->geraInformacoesDaTagCompra();
329
+            $infPedido = $this->geraInformacoesDaTagCompra();
330 330
             if ($infPedido != "") {
331 331
                 $this->textoAdic .= $infPedido;
332 332
             }
333 333
             $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
334
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco"))
334
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco"))
335 335
                 ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco")
336 336
                 : '';
337
-            $obsCont         = $this->infAdic->getElementsByTagName("obsCont");
337
+            $obsCont = $this->infAdic->getElementsByTagName("obsCont");
338 338
             if (isset($obsCont)) {
339 339
                 foreach ($obsCont as $obs) {
340 340
                     $campo           = $obsCont->item($i)->getAttribute("xCampo");
341
-                    $xTexto          = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
341
+                    $xTexto          = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
342 342
                         ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue
343 343
                         : '';
344 344
                     $this->textoAdic .= "\n" . $campo . ':  ' . trim($xTexto);
345
-                    $i ++;
345
+                    $i++;
346 346
                 }
347 347
             }
348 348
         }
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
             $flagVTT  = $flagVTT && (strpos(strtolower(trim($this->textoAdic)), 'trib') ||
357 357
                     strpos(strtolower(trim($this->textoAdic)), 'imp'));
358 358
             $vTotTrib = $this->getTagValue($this->ICMSTot, 'vTotTrib');
359
-            if ($vTotTrib != '' && ! $flagVTT) {
359
+            if ($vTotTrib != '' && !$flagVTT) {
360 360
                 $this->textoAdic .= "\n Valor Aproximado dos Tributos : R$ "
361 361
                     . number_format($vTotTrib, 2, ",", ".");
362 362
             }
@@ -367,9 +367,9 @@  discard block
 block discarded – undo
367 367
         $this->textadicfontsize = $this->pdf->fontSize;
368 368
         $hdadosadic             = ceil($numlinhasdados * ($this->textadicfontsize));
369 369
         if ($hdadosadic > 70) {
370
-            for ($f = 8; $f > 3; $f --) {
370
+            for ($f = 8; $f > 3; $f--) {
371 371
                 $this->pdf->setFont($this->fontePadrao, '', $f);
372
-                $fontProduto            = [
372
+                $fontProduto = [
373 373
                     'font'  => $this->fontePadrao,
374 374
                     'size'  => $f,
375 375
                     'style' => ''
@@ -497,9 +497,9 @@  discard block
 block discarded – undo
497 497
         $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais();
498 498
 
499 499
         //altura disponivel para os campos da DANFE
500
-        $hcabecalho    = 47;//para cabeçalho
501
-        $hdestinatario = 25;//para destinatario
502
-        $hduplicatas   = 12;//para cada grupo de 7 duplicatas
500
+        $hcabecalho    = 47; //para cabeçalho
501
+        $hdestinatario = 25; //para destinatario
502
+        $hduplicatas   = 12; //para cada grupo de 7 duplicatas
503 503
         if (isset($this->entrega)) {
504 504
             $hlocalentrega = 25;
505 505
         } else {
@@ -510,11 +510,11 @@  discard block
 block discarded – undo
510 510
         } else {
511 511
             $hlocalretirada = 0;
512 512
         }
513
-        $himposto    = 18;// para imposto
514
-        $htransporte = 25;// para transporte
515
-        $hissqn      = 11;// para issqn
516
-        $hfooter     = 5;// para rodape
517
-        $hCabecItens = 4;//cabeçalho dos itens
513
+        $himposto    = 18; // para imposto
514
+        $htransporte = 25; // para transporte
515
+        $hissqn      = 11; // para issqn
516
+        $hfooter     = 5; // para rodape
517
+        $hCabecItens = 4; //cabeçalho dos itens
518 518
         $hOCUPADA    = $hcabecalho
519 519
             + $hdestinatario
520 520
             + $hlocalentrega
@@ -537,10 +537,10 @@  discard block
 block discarded – undo
537 537
         $this->sizeExtraTextoFatura());*/
538 538
 
539 539
         if ($this->orientacao == 'P') {
540
-            $hDispo1 -= 24 * $this->qCanhoto;//para canhoto
541
-            $w       = $this->wPrint;
540
+            $hDispo1 -= 24 * $this->qCanhoto; //para canhoto
541
+            $w = $this->wPrint;
542 542
         } else {
543
-            $hcanhoto = $this->hPrint;//para canhoto
543
+            $hcanhoto = $this->hPrint; //para canhoto
544 544
             $w        = $this->wPrint - $this->wCanhoto;
545 545
         }
546 546
         //$hDispo1 += 14;
@@ -561,18 +561,18 @@  discard block
 block discarded – undo
561 561
             $prod = $itemProd->getElementsByTagName('prod')->item(0);
562 562
             $uCom = $prod->getElementsByTagName("uCom")->item(0)->nodeValue;
563 563
             $uTrib = $prod->getElementsByTagName("uTrib")->item(0);
564
-            if (! empty($uTrib) && strcmp($uCom, $uTrib->nodeValue) != 0) {
564
+            if (!empty($uTrib) && strcmp($uCom, $uTrib->nodeValue) != 0) {
565 565
                 $mostrarUnidadeTributavel = true;
566 566
             }
567 567
 
568 568
             $hUsado += $this->calculeHeight($itemProd, $mostrarUnidadeTributavel);
569 569
             if ($hUsado > $hDispo) {
570
-                $totPag ++;
570
+                $totPag++;
571 571
                 $hDispo = $hDispo2;
572 572
                 $hUsado = $hCabecItens;
573
-                $i --; // decrementa para readicionar o item que não coube nessa pagina na outra.
573
+                $i--; // decrementa para readicionar o item que não coube nessa pagina na outra.
574 574
             }
575
-            $i ++;
575
+            $i++;
576 576
         } //fim da soma das areas de itens usadas
577 577
         $qtdeItens = $i; //controle da quantidade de itens no DANFE
578 578
         //montagem da primeira página
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
         $formaPag = [];
605 605
         if (isset($this->detPag) && $this->detPag->length > 0) {
606 606
             foreach ($this->detPag as $k => $d) {
607
-                $fPag            = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
607
+                $fPag            = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
608 608
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
609 609
                     : '0';
610 610
                 $formaPag[$fPag] = $fPag;
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
         }
649 649
 
650 650
         //loop para páginas seguintes
651
-        for ($n = 2; $n <= $totPag; $n ++) {
651
+        for ($n = 2; $n <= $totPag; $n++) {
652 652
             // fixa as margens
653 653
             $this->pdf->setMargins($this->margesq, $this->margsup);
654 654
             //adiciona nova página
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
             }
673 673
             //se estiver na última página e ainda restar itens para inserir, adiciona mais uma página
674 674
             if ($n == $totPag && $this->qtdeItensProc < $qtdeItens) {
675
-                $totPag ++;
675
+                $totPag++;
676 676
             }
677 677
         }
678 678
     }
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
         if ($startPos === false) {
702 702
             return $cdata;
703 703
         }
704
-        for ($x = $len; $x > 0; $x --) {
704
+        for ($x = $len; $x > 0; $x--) {
705 705
             if (substr($cdata, $x, 1) == '>') {
706 706
                 $endPos = $x;
707 707
                 break;
@@ -797,15 +797,15 @@  discard block
 block discarded – undo
797 797
         //grupo CADATA infCpl
798 798
         $t          = $dom->getElementsByTagName('transmissor')->item(0);
799 799
         $r          = $dom->getElementsByTagName('receptor')->item(0);
800
-        $versao     = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
800
+        $versao     = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
801 801
             'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
802
-        $especieNF  = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
802
+        $especieNF  = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
803 803
             'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
804
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
804
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
805 805
             'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
806
-        $dca        = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
806
+        $dca        = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
807 807
             'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
808
-        $texto      .= "" . $versao . $especieNF . $fabEntrega . $dca;
808
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
809 809
         if (isset($t)) {
810 810
             if ($t->hasAttributes()) {
811 811
                 $texto .= " Transmissor ";
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
             $resp['message'][] = 'NFe NÃO PROTOCOLADA';
848 848
         } elseif ($this->getTagValue($this->ide, "tpAmb") == '2') {
849 849
             $resp['status'] = false;
850
-            $resp['message'][] =  "NFe EMITIDA EM HOMOLOGAÇÃO";
850
+            $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO";
851 851
         }
852 852
         $retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0);
853 853
         $cStat = $this->getTagValue($this->nfeProc, "cStat");
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
         } elseif (!empty($retEvento)) {
869 869
             $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0);
870 870
             $cStat = $this->getTagValue($infEvento, "cStat");
871
-            $tpEvento= $this->getTagValue($infEvento, "tpEvento");
871
+            $tpEvento = $this->getTagValue($infEvento, "tpEvento");
872 872
             $dhEvento = date("d/m/Y H:i:s", $this->toTimestamp($this->getTagValue($infEvento, "dhRegEvento")));
873 873
             $nProt = $this->getTagValue($infEvento, "nProt");
874 874
             if ($tpEvento == '110111' && ($cStat == '101' || $cStat == '151' || $cStat == '135' || $cStat == '155')) {
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
 
883 883
     protected function notaDPEC()
884 884
     {
885
-        return ! empty($this->numdepec);
885
+        return !empty($this->numdepec);
886 886
     }
887 887
 
888 888
     /**
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
         //se for right separa 2/3 para os dados e o terço seguinte para o logo
932 932
         //se não houver logo centraliza dos dados do emitente
933 933
         // coloca o logo
934
-        if (! empty($this->logomarca)) {
934
+        if (!empty($this->logomarca)) {
935 935
             $logoInfo = getimagesize($this->logomarca);
936 936
             //largura da imagem em mm
937 937
             $logoWmm = ($logoInfo[0] / 72) * 25.4;
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
             //endereço
988 988
             $y1     = $y1 + 5;
989 989
             $aFont  = ['font' => $this->fontePadrao, 'size' => 8, 'style' => ''];
990
-            $fone   = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
990
+            $fone   = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
991 991
                 ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
992 992
                 : '';
993 993
             $lgr    = $this->getTagValue($this->enderEmit, "xLgr");
@@ -1006,8 +1006,8 @@  discard block
 block discarded – undo
1006 1006
 
1007 1007
         //####################################################################################
1008 1008
         //coluna central Danfe
1009
-        $x  += $w;
1010
-        $w  = round($maxW * 0.17, 0);//35;
1009
+        $x += $w;
1010
+        $w  = round($maxW * 0.17, 0); //35;
1011 1011
         $w2 = $w;
1012 1012
         $h  = 32;
1013 1013
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1064,8 +1064,8 @@  discard block
 block discarded – undo
1064 1064
 
1065 1065
         //####################################################################################
1066 1066
         //coluna codigo de barras
1067
-        $x  += $w;
1068
-        $w  = ($maxW - $w1 - $w2);//85;
1067
+        $x += $w;
1068
+        $w  = ($maxW - $w1 - $w2); //85;
1069 1069
         $w3 = $w;
1070 1070
         $h  = 32;
1071 1071
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
         } else {
1096 1096
             $cabecalhoProtoAutorizacao = 'PROTOCOLO DE AUTORIZAÇÃO DE USO';
1097 1097
         }
1098
-        if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) {
1098
+        if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) {
1099 1099
             $cabecalhoProtoAutorizacao = "DADOS DA NF-E";
1100 1100
             $chaveContingencia         = $this->geraChaveAdicionalDeContingencia();
1101 1101
             $this->pdf->setFillColor(0, 0, 0);
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1128 1128
         $w     = $w1 + $w2;
1129 1129
         $y     = $oldY;
1130
-        $oldY  += $h;
1130
+        $oldY += $h;
1131 1131
         $x     = $oldX;
1132 1132
         $h     = 7;
1133 1133
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
         // NOTA : DANFE sem protocolo deve existir somente no caso de contingência !!!
1145 1145
         // Além disso, existem várias NFes em contingência que eu recebo com protocolo de autorização.
1146 1146
         // Na minha opinião, deveríamos mostra-lo, mas o  manual  da NFe v4.01 diz outra coisa...
1147
-        if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) {
1147
+        if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) {
1148 1148
             $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => 'B'];
1149 1149
             $texto = $this->formatField(
1150 1150
                 $chaveContingencia,
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
                 $cStat = '';
1159 1159
             } else {
1160 1160
                 if (isset($this->nfeProc)) {
1161
-                    $texto  = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1161
+                    $texto  = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1162 1162
                         ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1163 1163
                         : '';
1164 1164
                     $tsHora = $this->toTimestamp(
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1189 1189
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1190 1190
         //INSCRIÇÃO MUNICIPAL
1191
-        $x     += $w;
1191
+        $x += $w;
1192 1192
         $texto = 'INSCRIÇÃO MUNICIPAL';
1193 1193
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1194 1194
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1196,29 +1196,29 @@  discard block
 block discarded – undo
1196 1196
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1197 1197
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1198 1198
         //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.
1199
-        $x     += $w;
1199
+        $x += $w;
1200 1200
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1201 1201
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1202 1202
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1203
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1203
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1204 1204
             ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1205 1205
             : '';
1206 1206
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1207 1207
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1208 1208
         //CNPJ
1209
-        $x     += $w;
1209
+        $x += $w;
1210 1210
         $w     = ($maxW - (3 * $w));
1211 1211
         $texto = 'CNPJ';
1212 1212
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1213 1213
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1214 1214
         //Pegando valor do CPF/CNPJ
1215
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1215
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1216 1216
             $texto = $this->formatField(
1217 1217
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1218 1218
                 "###.###.###/####-##"
1219 1219
             );
1220 1220
         } else {
1221
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1221
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1222 1222
                 ? $this->formatField(
1223 1223
                     $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1224 1224
                     "###.###.###-##"
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
             $n = count($resp['message']);
1238 1238
             $alttot = $n * 15;
1239 1239
             $x = 10;
1240
-            $y = $this->hPrint/2 - $alttot/2;
1240
+            $y = $this->hPrint / 2 - $alttot / 2;
1241 1241
             $h = 15;
1242 1242
             $w = $maxW - (2 * $x);
1243 1243
             $this->pdf->settextcolor(90, 90, 90);
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
         //NOME / RAZÃO SOCIAL
1311 1311
         $w     = round($maxW * 0.61, 0);
1312 1312
         $w1    = $w;
1313
-        $y     += 3;
1313
+        $y += 3;
1314 1314
         $texto = 'NOME / RAZÃO SOCIAL';
1315 1315
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1316 1316
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1322,20 +1322,20 @@  discard block
 block discarded – undo
1322 1322
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1323 1323
         }
1324 1324
         //CNPJ / CPF
1325
-        $x     += $w;
1325
+        $x += $w;
1326 1326
         $w     = round($maxW * 0.23, 0);
1327 1327
         $w2    = $w;
1328 1328
         $texto = 'CNPJ / CPF';
1329 1329
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1330 1330
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1331 1331
         //Pegando valor do CPF/CNPJ
1332
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1332
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1333 1333
             $texto = $this->formatField(
1334 1334
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1335 1335
                 "###.###.###/####-##"
1336 1336
             );
1337 1337
         } else {
1338
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1338
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1339 1339
                 ? $this->formatField(
1340 1340
                     $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1341 1341
                     "###.###.###-##"
@@ -1345,17 +1345,17 @@  discard block
 block discarded – undo
1345 1345
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1346 1346
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1347 1347
         //DATA DA EMISSÃO
1348
-        $x     += $w;
1348
+        $x += $w;
1349 1349
         $w     = $maxW - ($w1 + $w2);
1350 1350
         $wx    = $w;
1351 1351
         $texto = 'DATA DA EMISSÃO';
1352 1352
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1353 1353
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1354
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1354
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1355 1355
             ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1356 1356
             : '';
1357 1357
         if ($dEmi == '') {
1358
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1358
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1359 1359
                 ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1360 1360
                 : '';
1361 1361
             $aDemi = explode('T', $dEmi);
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
         //ENDEREÇO
1372 1372
         $w     = round($maxW * 0.47, 0);
1373 1373
         $w1    = $w;
1374
-        $y     += $h;
1374
+        $y += $h;
1375 1375
         $x     = $oldX;
1376 1376
         $texto = 'ENDEREÇO';
1377 1377
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1384 1384
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1385 1385
         //BAIRRO / DISTRITO
1386
-        $x     += $w;
1386
+        $x += $w;
1387 1387
         $w     = round($maxW * 0.21, 0);
1388 1388
         $w2    = $w;
1389 1389
         $texto = 'BAIRRO / DISTRITO';
@@ -1393,29 +1393,29 @@  discard block
 block discarded – undo
1393 1393
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1394 1394
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1395 1395
         //CEP
1396
-        $x     += $w;
1396
+        $x += $w;
1397 1397
         $w     = $maxW - $w1 - $w2 - $wx;
1398 1398
         $w2    = $w;
1399 1399
         $texto = 'CEP';
1400 1400
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1401 1401
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1402
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1402
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1403 1403
             ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1404 1404
             : '';
1405 1405
         $texto = $this->formatField($texto, "#####-###");
1406 1406
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1407 1407
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1408 1408
         //DATA DA SAÍDA
1409
-        $x     += $w;
1409
+        $x += $w;
1410 1410
         $w     = $wx;
1411 1411
         $texto = 'DATA DA SAÍDA/ENTRADA';
1412 1412
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1413 1413
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1414
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1414
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1415 1415
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1416 1416
             : '';
1417 1417
         if ($dSaiEnt == '') {
1418
-            $dSaiEnt  = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1418
+            $dSaiEnt  = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1419 1419
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1420 1420
                 : '';
1421 1421
             $aDsaient = explode('T', $dSaiEnt);
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1427 1427
         //MUNICÍPIO
1428 1428
         $w     = $w1;
1429
-        $y     += $h;
1429
+        $y += $h;
1430 1430
         $x     = $oldX;
1431 1431
         $texto = 'MUNICÍPIO';
1432 1432
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1441 1441
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1442 1442
         //UF
1443
-        $x     += $w;
1443
+        $x += $w;
1444 1444
         $w     = 8;
1445 1445
         $texto = 'UF';
1446 1446
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1449,19 +1449,19 @@  discard block
 block discarded – undo
1449 1449
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1450 1450
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1451 1451
         //FONE / FAX
1452
-        $x     += $w;
1452
+        $x += $w;
1453 1453
         $w     = round(($maxW - $w1 - $wx - 8) / 2, 0);
1454 1454
         $w3    = $w;
1455 1455
         $texto = 'FONE / FAX';
1456 1456
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1457 1457
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1458
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1458
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1459 1459
             ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1460 1460
             : '';
1461 1461
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1462 1462
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1463 1463
         //INSCRIÇÃO ESTADUAL
1464
-        $x     += $w;
1464
+        $x += $w;
1465 1465
         $w     = $maxW - $w1 - $wx - 8 - $w3;
1466 1466
         $texto = 'INSCRIÇÃO ESTADUAL';
1467 1467
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1471,16 +1471,16 @@  discard block
 block discarded – undo
1471 1471
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1472 1472
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1473 1473
         //HORA DA SAÍDA
1474
-        $x     += $w;
1474
+        $x += $w;
1475 1475
         $w     = $wx;
1476 1476
         $texto = 'HORA DA SAÍDA/ENTRADA';
1477 1477
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1478 1478
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1479
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1479
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1480 1480
             ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1481 1481
             : '';
1482 1482
         if ($hSaiEnt == '') {
1483
-            $dhSaiEnt   = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1483
+            $dhSaiEnt   = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1484 1484
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1485 1485
                 : '';
1486 1486
             $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt);
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
         //NOME / RAZÃO SOCIAL
1525 1525
         $w     = round($maxW * 0.61, 0);
1526 1526
         $w1    = $w;
1527
-        $y     += 3;
1527
+        $y += 3;
1528 1528
         $texto = 'NOME / RAZÃO SOCIAL';
1529 1529
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1530 1530
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1539,20 +1539,20 @@  discard block
 block discarded – undo
1539 1539
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1540 1540
         }
1541 1541
         //CNPJ / CPF
1542
-        $x     += $w;
1542
+        $x += $w;
1543 1543
         $w     = round($maxW * 0.23, 0);
1544 1544
         $w2    = $w;
1545 1545
         $texto = 'CNPJ / CPF';
1546 1546
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1547 1547
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1548 1548
         //Pegando valor do CPF/CNPJ
1549
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1549
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1550 1550
             $texto = $this->formatField(
1551 1551
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1552 1552
                 "###.###.###/####-##"
1553 1553
             );
1554 1554
         } else {
1555
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1555
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1556 1556
                 $this->formatField(
1557 1557
                     $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1558 1558
                     "###.###.###-##"
@@ -1561,7 +1561,7 @@  discard block
 block discarded – undo
1561 1561
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1562 1562
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1563 1563
         //INSCRIÇÃO ESTADUAL
1564
-        $x     += $w;
1564
+        $x += $w;
1565 1565
         $w     = $maxW - ($w1 + $w2);
1566 1566
         $wx    = $w;
1567 1567
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1580,7 +1580,7 @@  discard block
 block discarded – undo
1580 1580
         //ENDEREÇO
1581 1581
         $w     = round($maxW * 0.355, 0) + $wx;
1582 1582
         $w1    = $w;
1583
-        $y     += $h;
1583
+        $y += $h;
1584 1584
         $x     = $oldX;
1585 1585
         $texto = 'ENDEREÇO';
1586 1586
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1592 1592
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1593 1593
         //BAIRRO / DISTRITO
1594
-        $x     += $w;
1594
+        $x += $w;
1595 1595
         $w     = round($maxW * 0.335, 0);
1596 1596
         $w2    = $w;
1597 1597
         $texto = 'BAIRRO / DISTRITO';
@@ -1601,12 +1601,12 @@  discard block
 block discarded – undo
1601 1601
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1602 1602
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1603 1603
         //CEP
1604
-        $x     += $w;
1604
+        $x += $w;
1605 1605
         $w     = $maxW - ($w1 + $w2);
1606 1606
         $texto = 'CEP';
1607 1607
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1608 1608
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1609
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1609
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1610 1610
             $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1611 1611
         $texto = $this->formatField($texto, "#####-###");
1612 1612
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1614,7 +1614,7 @@  discard block
 block discarded – undo
1614 1614
         //MUNICÍPIO
1615 1615
         $w     = round($maxW * 0.805, 0);
1616 1616
         $w1    = $w;
1617
-        $y     += $h;
1617
+        $y += $h;
1618 1618
         $x     = $oldX;
1619 1619
         $texto = 'MUNICÍPIO';
1620 1620
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1627 1627
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1628 1628
         //UF
1629
-        $x     += $w;
1629
+        $x += $w;
1630 1630
         $w     = 8;
1631 1631
         $texto = 'UF';
1632 1632
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1635,12 +1635,12 @@  discard block
 block discarded – undo
1635 1635
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1636 1636
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1637 1637
         //FONE / FAX
1638
-        $x     += $w;
1638
+        $x += $w;
1639 1639
         $w     = $maxW - $w - $w1;
1640 1640
         $texto = 'FONE / FAX';
1641 1641
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1642 1642
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1643
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1643
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1644 1644
             $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1645 1645
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1646 1646
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1677,7 +1677,7 @@  discard block
 block discarded – undo
1677 1677
         //NOME / RAZÃO SOCIAL
1678 1678
         $w     = round($maxW * 0.61, 0);
1679 1679
         $w1    = $w;
1680
-        $y     += 3;
1680
+        $y += 3;
1681 1681
         $texto = 'NOME / RAZÃO SOCIAL';
1682 1682
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1683 1683
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1692,20 +1692,20 @@  discard block
 block discarded – undo
1692 1692
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1693 1693
         }
1694 1694
         //CNPJ / CPF
1695
-        $x     += $w;
1695
+        $x += $w;
1696 1696
         $w     = round($maxW * 0.23, 0);
1697 1697
         $w2    = $w;
1698 1698
         $texto = 'CNPJ / CPF';
1699 1699
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1700 1700
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1701 1701
         //Pegando valor do CPF/CNPJ
1702
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1702
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1703 1703
             $texto = $this->formatField(
1704 1704
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1705 1705
                 "###.###.###/####-##"
1706 1706
             );
1707 1707
         } else {
1708
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1708
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1709 1709
                 $this->formatField(
1710 1710
                     $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1711 1711
                     "###.###.###-##"
@@ -1714,7 +1714,7 @@  discard block
 block discarded – undo
1714 1714
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1715 1715
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1716 1716
         //INSCRIÇÃO ESTADUAL
1717
-        $x     += $w;
1717
+        $x += $w;
1718 1718
         $w     = $maxW - ($w1 + $w2);
1719 1719
         $wx    = $w;
1720 1720
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1733,7 +1733,7 @@  discard block
 block discarded – undo
1733 1733
         //ENDEREÇO
1734 1734
         $w     = round($maxW * 0.355, 0) + $wx;
1735 1735
         $w1    = $w;
1736
-        $y     += $h;
1736
+        $y += $h;
1737 1737
         $x     = $oldX;
1738 1738
         $texto = 'ENDEREÇO';
1739 1739
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1744,7 +1744,7 @@  discard block
 block discarded – undo
1744 1744
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1745 1745
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1746 1746
         //BAIRRO / DISTRITO
1747
-        $x     += $w;
1747
+        $x += $w;
1748 1748
         $w     = round($maxW * 0.335, 0);
1749 1749
         $w2    = $w;
1750 1750
         $texto = 'BAIRRO / DISTRITO';
@@ -1754,12 +1754,12 @@  discard block
 block discarded – undo
1754 1754
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1755 1755
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1756 1756
         //CEP
1757
-        $x     += $w;
1757
+        $x += $w;
1758 1758
         $w     = $maxW - ($w1 + $w2);
1759 1759
         $texto = 'CEP';
1760 1760
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1761 1761
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1762
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1762
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1763 1763
             $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1764 1764
         $texto = $this->formatField($texto, "#####-###");
1765 1765
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
         //MUNICÍPIO
1768 1768
         $w     = round($maxW * 0.805, 0);
1769 1769
         $w1    = $w;
1770
-        $y     += $h;
1770
+        $y += $h;
1771 1771
         $x     = $oldX;
1772 1772
         $texto = 'MUNICÍPIO';
1773 1773
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1780 1780
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1781 1781
         //UF
1782
-        $x     += $w;
1782
+        $x += $w;
1783 1783
         $w     = 8;
1784 1784
         $texto = 'UF';
1785 1785
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1788,12 +1788,12 @@  discard block
 block discarded – undo
1788 1788
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1789 1789
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1790 1790
         //FONE / FAX
1791
-        $x     += $w;
1791
+        $x += $w;
1792 1792
         $w     = $maxW - $w - $w1;
1793 1793
         $texto = 'FONE / FAX';
1794 1794
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1795 1795
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1796
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1796
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1797 1797
             $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1798 1798
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1799 1799
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1813,7 +1813,7 @@  discard block
 block discarded – undo
1813 1813
         if (isset($this->cobr)) {
1814 1814
             $fat = $this->cobr->getElementsByTagName("fat")->item(0);
1815 1815
             if (isset($fat)) {
1816
-                if (! empty($this->getTagValue($this->ide, "indPag"))) {
1816
+                if (!empty($this->getTagValue($this->ide, "indPag"))) {
1817 1817
                     $textoIndPag = "";
1818 1818
                     $indPag      = $this->getTagValue($this->ide, "indPag");
1819 1819
                     if ($indPag === "0") {
@@ -1888,7 +1888,7 @@  discard block
 block discarded – undo
1888 1888
             $h     = 8;
1889 1889
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
1890 1890
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1891
-            $y       += 3;
1891
+            $y += 3;
1892 1892
             $dups    = "";
1893 1893
             $dupcont = 0;
1894 1894
             $nFat    = $this->dup->length;
@@ -1922,13 +1922,13 @@  discard block
 block discarded – undo
1922 1922
             }
1923 1923
             $increm = 1;
1924 1924
             foreach ($this->dup as $k => $d) {
1925
-                $nDup  = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1925
+                $nDup  = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1926 1926
                     ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1927 1927
                     : '';
1928
-                $dDup  = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1928
+                $dDup  = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1929 1929
                     ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1930 1930
                     : '';
1931
-                $vDup  = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1931
+                $vDup  = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1932 1932
                     ? 'R$ ' . number_format(
1933 1933
                         $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1934 1934
                         2,
@@ -1975,7 +1975,7 @@  discard block
 block discarded – undo
1975 1975
             }
1976 1976
             if ($dupcont == 0) {
1977 1977
                 $y -= 9;
1978
-                $linha --;
1978
+                $linha--;
1979 1979
             }
1980 1980
 
1981 1981
             return ($y + $h);
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
             $h     = 8;
2016 2016
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
2017 2017
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2018
-            $y       += 3;
2018
+            $y += 3;
2019 2019
             $dups    = "";
2020 2020
             $dupcont = 0;
2021 2021
             if ($this->orientacao == 'P') {
@@ -2044,7 +2044,7 @@  discard block
 block discarded – undo
2044 2044
                 '90' => 'Sem pagamento',
2045 2045
                 '99' => 'Outros'
2046 2046
             ];
2047
-            $bandeira       = [
2047
+            $bandeira = [
2048 2048
                 '01' => 'Visa',
2049 2049
                 '02' => 'Mastercard',
2050 2050
                 '03' => 'American',
@@ -2057,10 +2057,10 @@  discard block
 block discarded – undo
2057 2057
                 '99' => 'Outros'
2058 2058
             ];
2059 2059
             foreach ($this->detPag as $k => $d) {
2060
-                $fPag  = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2060
+                $fPag  = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2061 2061
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
2062 2062
                     : '0';
2063
-                $vPag  = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2063
+                $vPag  = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2064 2064
                     ? 'R$ ' . number_format(
2065 2065
                         $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
2066 2066
                         2,
@@ -2103,7 +2103,7 @@  discard block
 block discarded – undo
2103 2103
             }
2104 2104
             if ($dupcont == 0) {
2105 2105
                 $y -= 9;
2106
-                $linha --;
2106
+                $linha--;
2107 2107
             }
2108 2108
 
2109 2109
             return ($y + $h);
@@ -2135,7 +2135,7 @@  discard block
 block discarded – undo
2135 2135
         $the_field    = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0);
2136 2136
         if (isset($the_field)) {
2137 2137
             $the_value = $the_field->nodeValue;
2138
-            if (! empty($the_value)) {
2138
+            if (!empty($the_value)) {
2139 2139
                 $valorImposto = number_format($the_value, 2, ",", ".");
2140 2140
             }
2141 2141
         }
@@ -2164,10 +2164,10 @@  discard block
 block discarded – undo
2164 2164
         $x_inicial = $x;
2165 2165
         //#####################################################################
2166 2166
         $campos_por_linha = 9;
2167
-        if (! $this->exibirPIS) {
2168
-            $campos_por_linha --;
2167
+        if (!$this->exibirPIS) {
2168
+            $campos_por_linha--;
2169 2169
         }
2170
-        if (! $this->exibirIcmsInterestadual) {
2170
+        if (!$this->exibirIcmsInterestadual) {
2171 2171
             $campos_por_linha -= 2;
2172 2172
         }
2173 2173
 
@@ -2254,12 +2254,12 @@  discard block
 block discarded – undo
2254 2254
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2255 2255
         //NOME / RAZÃO SOCIAL
2256 2256
         $w1    = $maxW * 0.29;
2257
-        $y     += 3;
2257
+        $y += 3;
2258 2258
         $texto = 'NOME / RAZÃO SOCIAL';
2259 2259
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2260 2260
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2261 2261
         if (isset($this->transporta)) {
2262
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2262
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2263 2263
                 ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2264 2264
                 : '';
2265 2265
         } else {
@@ -2268,12 +2268,12 @@  discard block
 block discarded – undo
2268 2268
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2269 2269
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2270 2270
         //FRETE POR CONTA
2271
-        $x     += $w1;
2271
+        $x += $w1;
2272 2272
         $w2    = $maxW * 0.15;
2273 2273
         $texto = 'FRETE';
2274 2274
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2275 2275
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2276
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2276
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2277 2277
             ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2278 2278
             : '0';
2279 2279
         switch ($tipoFrete) {
@@ -2299,12 +2299,12 @@  discard block
 block discarded – undo
2299 2299
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2300 2300
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, '');
2301 2301
         //CÓDIGO ANTT
2302
-        $x     += $w2;
2302
+        $x += $w2;
2303 2303
         $texto = 'CÓDIGO ANTT';
2304 2304
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2305 2305
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2306 2306
         if (isset($this->veicTransp)) {
2307
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2307
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2308 2308
                 ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2309 2309
                 : '';
2310 2310
         } else {
@@ -2313,16 +2313,16 @@  discard block
 block discarded – undo
2313 2313
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2314 2314
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2315 2315
         //PLACA DO VEÍC
2316
-        $x     += $w2;
2316
+        $x += $w2;
2317 2317
         $texto = 'PLACA DO VEÍCULO';
2318 2318
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2319 2319
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2320 2320
         if (isset($this->veicTransp)) {
2321
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2321
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2322 2322
                 ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2323 2323
                 : '';
2324 2324
         } elseif (isset($this->reboque)) {
2325
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2325
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2326 2326
                 ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2327 2327
                 : '';
2328 2328
         } else {
@@ -2331,17 +2331,17 @@  discard block
 block discarded – undo
2331 2331
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2332 2332
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2333 2333
         //UF
2334
-        $x     += $w2;
2334
+        $x += $w2;
2335 2335
         $w3    = round($maxW * 0.04, 0);
2336 2336
         $texto = 'UF';
2337 2337
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2338 2338
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2339 2339
         if (isset($this->veicTransp)) {
2340
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2340
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2341 2341
                 ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2342 2342
                 : '';
2343 2343
         } elseif (isset($this->reboque)) {
2344
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2344
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2345 2345
                 ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2346 2346
                 : '';
2347 2347
         } else {
@@ -2350,20 +2350,20 @@  discard block
 block discarded – undo
2350 2350
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2351 2351
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2352 2352
         //CNPJ / CPF
2353
-        $x     += $w3;
2353
+        $x += $w3;
2354 2354
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2355 2355
         $texto = 'CNPJ / CPF';
2356 2356
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2357 2357
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2358 2358
         if (isset($this->transporta)) {
2359
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2359
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2360 2360
                 ? $this->formatField(
2361 2361
                     $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2362 2362
                     "##.###.###/####-##"
2363 2363
                 )
2364 2364
                 : '';
2365 2365
             if ($texto == '') {
2366
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2366
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2367 2367
                     ? $this->formatField(
2368 2368
                         $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2369 2369
                         "###.###.###-##"
@@ -2377,7 +2377,7 @@  discard block
 block discarded – undo
2377 2377
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
2378 2378
         //#####################################################################
2379 2379
         //ENDEREÇO
2380
-        $y     += $h;
2380
+        $y += $h;
2381 2381
         $x     = $oldX;
2382 2382
         $h     = 7;
2383 2383
         $w1    = $maxW * 0.44;
@@ -2385,7 +2385,7 @@  discard block
 block discarded – undo
2385 2385
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2386 2386
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2387 2387
         if (isset($this->transporta)) {
2388
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2388
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2389 2389
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2390 2390
                 : '';
2391 2391
         } else {
@@ -2394,13 +2394,13 @@  discard block
 block discarded – undo
2394 2394
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2395 2395
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2396 2396
         //MUNICÍPIO
2397
-        $x     += $w1;
2397
+        $x += $w1;
2398 2398
         $w2    = round($maxW * 0.30, 0);
2399 2399
         $texto = 'MUNICÍPIO';
2400 2400
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2401 2401
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2402 2402
         if (isset($this->transporta)) {
2403
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2403
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2404 2404
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2405 2405
                 : '';
2406 2406
         } else {
@@ -2409,13 +2409,13 @@  discard block
 block discarded – undo
2409 2409
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2410 2410
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2411 2411
         //UF
2412
-        $x     += $w2;
2412
+        $x += $w2;
2413 2413
         $w3    = round($maxW * 0.04, 0);
2414 2414
         $texto = 'UF';
2415 2415
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2416 2416
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2417 2417
         if (isset($this->transporta)) {
2418
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2418
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2419 2419
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2420 2420
                 : '';
2421 2421
         } else {
@@ -2424,14 +2424,14 @@  discard block
 block discarded – undo
2424 2424
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2425 2425
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2426 2426
         //INSCRIÇÃO ESTADUAL
2427
-        $x     += $w3;
2427
+        $x += $w3;
2428 2428
         $w     = $maxW - ($w1 + $w2 + $w3);
2429 2429
         $texto = 'INSCRIÇÃO ESTADUAL';
2430 2430
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2431 2431
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2432 2432
         $texto = '';
2433 2433
         if (isset($this->transporta)) {
2434
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2434
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2435 2435
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2436 2436
             }
2437 2437
         }
@@ -2447,13 +2447,13 @@  discard block
 block discarded – undo
2447 2447
         $pesoBruto   = 0;
2448 2448
         $pesoLiquido = 0;
2449 2449
         foreach ($volumes as $volume) {
2450
-            $quantidade  += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2450
+            $quantidade  += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2451 2451
                 $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2452
-            $pesoBruto   += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2452
+            $pesoBruto   += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2453 2453
                 $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2454
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2454
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2455 2455
                 $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2456
-            $texto       = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2456
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2457 2457
                 $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2458 2458
             if ($texto != $especie && $especie != '') {
2459 2459
                 //tem várias especies
@@ -2461,7 +2461,7 @@  discard block
 block discarded – undo
2461 2461
             } else {
2462 2462
                 $especie = $texto;
2463 2463
             }
2464
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2464
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2465 2465
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2466 2466
                 : '';
2467 2467
             if ($texto != $marca && $marca != '') {
@@ -2470,7 +2470,7 @@  discard block
 block discarded – undo
2470 2470
             } else {
2471 2471
                 $marca = $texto;
2472 2472
             }
2473
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2473
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2474 2474
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2475 2475
                 : '';
2476 2476
             if ($texto != $numero && $numero != '') {
@@ -2483,20 +2483,20 @@  discard block
 block discarded – undo
2483 2483
 
2484 2484
         //#####################################################################
2485 2485
         //QUANTIDADE
2486
-        $y     += $h;
2486
+        $y += $h;
2487 2487
         $x     = $oldX;
2488 2488
         $h     = 7;
2489 2489
         $w1    = round($maxW * 0.10, 0);
2490 2490
         $texto = 'QUANTIDADE';
2491 2491
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2492 2492
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2493
-        if (! empty($quantidade)) {
2493
+        if (!empty($quantidade)) {
2494 2494
             $texto = $quantidade;
2495 2495
             $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2496 2496
             $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, '');
2497 2497
         }
2498 2498
         //ESPÉCIE
2499
-        $x     += $w1;
2499
+        $x += $w1;
2500 2500
         $w2    = round($maxW * 0.17, 0);
2501 2501
         $texto = 'ESPÉCIE';
2502 2502
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2505,16 +2505,16 @@  discard block
 block discarded – undo
2505 2505
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2506 2506
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2507 2507
         //MARCA
2508
-        $x     += $w2;
2508
+        $x += $w2;
2509 2509
         $texto = 'MARCA';
2510 2510
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2511 2511
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2512
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2512
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2513 2513
             $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2514 2514
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2515 2515
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2516 2516
         //NUMERAÇÃO
2517
-        $x     += $w2;
2517
+        $x += $w2;
2518 2518
         $texto = 'NUMERAÇÃO';
2519 2519
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2520 2520
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2522,7 +2522,7 @@  discard block
 block discarded – undo
2522 2522
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2523 2523
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2524 2524
         //PESO BRUTO
2525
-        $x     += $w2;
2525
+        $x += $w2;
2526 2526
         $w3    = round($maxW * 0.20, 0);
2527 2527
         $texto = 'PESO BRUTO';
2528 2528
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2535,7 +2535,7 @@  discard block
 block discarded – undo
2535 2535
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2536 2536
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2537 2537
         //PESO LÍQUIDO
2538
-        $x     += $w3;
2538
+        $x += $w3;
2539 2539
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2540 2540
         $texto = 'PESO LÍQUIDO';
2541 2541
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2555,11 +2555,11 @@  discard block
 block discarded – undo
2555 2555
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2556 2556
     {
2557 2557
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
2558
-        if (! isset($valor_original)) {
2558
+        if (!isset($valor_original)) {
2559 2559
             return "";
2560 2560
         }
2561 2561
         $valor_original = $valor_original->nodeValue;
2562
-        $valor          = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2562
+        $valor          = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2563 2563
 
2564 2564
         if ($valor != "") {
2565 2565
             return sprintf($formato, $valor);
@@ -2585,7 +2585,7 @@  discard block
 block discarded – undo
2585 2585
         $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0);
2586 2586
         $impostos   = '';
2587 2587
 
2588
-        if (! empty($ICMS)) {
2588
+        if (!empty($ICMS)) {
2589 2589
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s");
2590 2590
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%");
2591 2591
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s");
@@ -2601,7 +2601,7 @@  discard block
 block discarded – undo
2601 2601
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s");
2602 2602
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s");
2603 2603
         }
2604
-        if (! empty($ICMSUFDest)) {
2604
+        if (!empty($ICMSUFDest)) {
2605 2605
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%");
2606 2606
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%");
2607 2607
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%");
@@ -2609,20 +2609,20 @@  discard block
 block discarded – undo
2609 2609
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2610 2610
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2611 2611
         }
2612
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2612
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2613 2613
             ? substr(
2614 2614
                 $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2615 2615
                 0,
2616 2616
                 500
2617 2617
             )
2618 2618
             : '';
2619
-        if (! empty($infAdProd)) {
2619
+        if (!empty($infAdProd)) {
2620 2620
             $infAdProd = trim($infAdProd);
2621 2621
             $infAdProd .= ' ';
2622 2622
         }
2623 2623
         $loteTxt = '';
2624 2624
         $rastro  = $prod->getElementsByTagName("med");
2625
-        if (! empty($prod->getElementsByTagName("rastro"))) {
2625
+        if (!empty($prod->getElementsByTagName("rastro"))) {
2626 2626
             $rastro = $prod->getElementsByTagName("rastro");
2627 2627
             $i      = 0;
2628 2628
             while ($i < $rastro->length) {
@@ -2631,14 +2631,14 @@  discard block
 block discarded – undo
2631 2631
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dFab', ' Fab: ');
2632 2632
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dVal', ' Val: ');
2633 2633
                 $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: ');
2634
-                $i ++;
2634
+                $i++;
2635 2635
             }
2636 2636
             if ($loteTxt != '') {
2637 2637
                 $loteTxt .= ' ';
2638 2638
             }
2639 2639
         }
2640 2640
         //NT2013.006 FCI
2641
-        $nFCI   = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2641
+        $nFCI   = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2642 2642
             ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2643 2643
         $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2644 2644
         $texto  = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
@@ -2688,7 +2688,7 @@  discard block
 block discarded – undo
2688 2688
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2689 2689
         $y += 3;
2690 2690
         //desenha a caixa dos dados dos itens da NF
2691
-        $hmax  += 1;
2691
+        $hmax += 1;
2692 2692
         $texto = '';
2693 2693
         $this->pdf->textBox($x, $y, $w, $hmax);
2694 2694
         //##################################################################################
@@ -2701,101 +2701,101 @@  discard block
 block discarded – undo
2701 2701
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2702 2702
         $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2703 2703
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2704
-        $x     += $w1;
2704
+        $x += $w1;
2705 2705
         $w2    = round($w * 0.25, 0);
2706 2706
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2707 2707
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2708 2708
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2709 2709
         $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2710 2710
         //NCM/SH
2711
-        $x     += $w2;
2711
+        $x += $w2;
2712 2712
         $w3    = round($w * 0.06, 0);
2713 2713
         $texto = 'NCM/SH';
2714 2714
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2715 2715
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2716 2716
         $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2717 2717
         //O/CST ou O/CSOSN
2718
-        $x     += $w3;
2718
+        $x += $w3;
2719 2719
         $w4    = round($w * 0.05, 0);
2720 2720
         $texto = 'O/CST'; // CRT = 2 ou CRT = 3
2721 2721
         if ($this->getTagValue($this->emit, 'CRT') == '1') {
2722
-            $texto = 'O/CSOSN';//Regime do Simples CRT = 1
2722
+            $texto = 'O/CSOSN'; //Regime do Simples CRT = 1
2723 2723
         }
2724 2724
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2725 2725
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2726 2726
         $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2727 2727
         //CFOP
2728
-        $x     += $w4;
2728
+        $x += $w4;
2729 2729
         $w5    = round($w * 0.04, 0);
2730 2730
         $texto = 'CFOP';
2731 2731
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2732 2732
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2733 2733
         $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2734 2734
         //UN
2735
-        $x     += $w5;
2735
+        $x += $w5;
2736 2736
         $w6    = round($w * 0.03, 0);
2737 2737
         $texto = 'UN';
2738 2738
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2739 2739
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2740 2740
         $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2741 2741
         //QUANT
2742
-        $x     += $w6;
2742
+        $x += $w6;
2743 2743
         $w7    = round($w * 0.08, 0);
2744 2744
         $texto = 'QUANT';
2745 2745
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2746 2746
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2747 2747
         $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2748 2748
         //VALOR UNIT
2749
-        $x     += $w7;
2749
+        $x += $w7;
2750 2750
         $w8    = round($w * 0.06, 0);
2751 2751
         $texto = 'VALOR UNIT';
2752 2752
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2753 2753
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2754 2754
         $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2755 2755
         //VALOR TOTAL
2756
-        $x     += $w8;
2756
+        $x += $w8;
2757 2757
         $w9    = round($w * 0.06, 0);
2758 2758
         $texto = 'VALOR TOTAL';
2759 2759
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2760 2760
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2761 2761
         $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2762 2762
         //VALOR DESCONTO
2763
-        $x     += $w9;
2763
+        $x += $w9;
2764 2764
         $w10   = round($w * 0.05, 0);
2765 2765
         $texto = 'VALOR DESC';
2766 2766
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2767 2767
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2768 2768
         $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2769 2769
         //B.CÁLC ICMS
2770
-        $x     += $w10;
2770
+        $x += $w10;
2771 2771
         $w11   = round($w * 0.06, 0);
2772 2772
         $texto = 'B.CÁLC ICMS';
2773 2773
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2774 2774
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2775 2775
         $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2776 2776
         //VALOR ICMS
2777
-        $x     += $w11;
2777
+        $x += $w11;
2778 2778
         $w12   = round($w * 0.06, 0);
2779 2779
         $texto = 'VALOR ICMS';
2780 2780
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2781 2781
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2782 2782
         $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2783 2783
         //VALOR IPI
2784
-        $x     += $w12;
2784
+        $x += $w12;
2785 2785
         $w13   = round($w * 0.05, 0);
2786 2786
         $texto = 'VALOR IPI';
2787 2787
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2788 2788
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2789 2789
         $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2790 2790
         //ALÍQ. ICMS
2791
-        $x     += $w13;
2791
+        $x += $w13;
2792 2792
         $w14   = round($w * 0.04, 0);
2793 2793
         $texto = 'ALÍQ. ICMS';
2794 2794
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2795 2795
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2796 2796
         $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2797 2797
         //ALÍQ. IPI
2798
-        $x     += $w14;
2798
+        $x += $w14;
2799 2799
         $w15   = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2800 2800
         $texto = 'ALÍQ. IPI';
2801 2801
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
@@ -2840,7 +2840,7 @@  discard block
 block discarded – undo
2840 2840
                 // Informação sobre unidade de medida tributavel.
2841 2841
                 // Se não for para exibir a unidade de medida tributavel, então
2842 2842
                 // A Escrita irá começar em 0.
2843
-                if (! $mostrarUnidadeTributavel) {
2843
+                if (!$mostrarUnidadeTributavel) {
2844 2844
                     $yTrib = 0;
2845 2845
                 }
2846 2846
                 $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel);
@@ -2875,7 +2875,7 @@  discard block
 block discarded – undo
2875 2875
                 }
2876 2876
                 $x += $w2;
2877 2877
                 //NCM
2878
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2878
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2879 2879
                     $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2880 2880
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2881 2881
                 $x += $w3;
@@ -2888,11 +2888,11 @@  discard block
 block discarded – undo
2888 2888
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2889 2889
                 }
2890 2890
                 //CFOP
2891
-                $x     += $w4;
2891
+                $x += $w4;
2892 2892
                 $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue;
2893 2893
                 $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, '');
2894 2894
                 //Unidade
2895
-                $x     += $w5;
2895
+                $x += $w5;
2896 2896
                 $texto = $uCom;
2897 2897
                 $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, '');
2898 2898
                 //Unidade de medida tributável
@@ -2913,7 +2913,7 @@  discard block
 block discarded – undo
2913 2913
                 // QTDADE Tributável
2914 2914
                 if ($mostrarUnidadeTributavel) {
2915 2915
                     $qTrib = $prod->getElementsByTagName("qTrib")->item(0);
2916
-                    if (! empty($qTrib)) {
2916
+                    if (!empty($qTrib)) {
2917 2917
                         $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", ".");
2918 2918
                         $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2919 2919
                     }
@@ -2926,7 +2926,7 @@  discard block
 block discarded – undo
2926 2926
                 // Valor Unitário Tributável
2927 2927
                 if ($mostrarUnidadeTributavel) {
2928 2928
                     $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0);
2929
-                    if (! empty($vUnTrib)) {
2929
+                    if (!empty($vUnTrib)) {
2930 2930
                         $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", ".");
2931 2931
                         $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2932 2932
                     }
@@ -2940,7 +2940,7 @@  discard block
 block discarded – undo
2940 2940
                 $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2941 2941
                 $x += $w9;
2942 2942
                 //Valor do Desconto
2943
-                $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2943
+                $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2944 2944
                     ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0;
2945 2945
 
2946 2946
                 $texto = number_format($vdesc, 2, ",", ".");
@@ -2948,7 +2948,7 @@  discard block
 block discarded – undo
2948 2948
                 //Valor da Base de calculo
2949 2949
                 $x += $w10;
2950 2950
                 if (isset($ICMS)) {
2951
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2951
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2952 2952
                         ? number_format(
2953 2953
                             $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
2954 2954
                             2,
@@ -2961,7 +2961,7 @@  discard block
 block discarded – undo
2961 2961
                 //Valor do ICMS
2962 2962
                 $x += $w11;
2963 2963
                 if (isset($ICMS)) {
2964
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2964
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2965 2965
                         ? number_format(
2966 2966
                             $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
2967 2967
                             2,
@@ -2974,7 +2974,7 @@  discard block
 block discarded – undo
2974 2974
                 //Valor do IPI
2975 2975
                 $x += $w12;
2976 2976
                 if (isset($IPI)) {
2977
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2977
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2978 2978
                         ? number_format(
2979 2979
                             $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
2980 2980
                             2,
@@ -2989,7 +2989,7 @@  discard block
 block discarded – undo
2989 2989
                 // %ICMS
2990 2990
                 $x += $w13;
2991 2991
                 if (isset($ICMS)) {
2992
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2992
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2993 2993
                         ? number_format(
2994 2994
                             $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
2995 2995
                             2,
@@ -3002,7 +3002,7 @@  discard block
 block discarded – undo
3002 3002
                 //%IPI
3003 3003
                 $x += $w14;
3004 3004
                 if (isset($IPI)) {
3005
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3005
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3006 3006
                         ? number_format(
3007 3007
                             $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
3008 3008
                             2,
@@ -3020,17 +3020,17 @@  discard block
 block discarded – undo
3020 3020
                 $veicProd = $prod->getElementsByTagName("veicProd")->item(0);
3021 3021
                 // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran
3022 3022
                 // Verifica se a Tag existe
3023
-                if (! empty($veicProd)) {
3023
+                if (!empty($veicProd)) {
3024 3024
                     $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod);
3025 3025
                 }
3026 3026
 
3027 3027
 
3028 3028
                 $y += $h;
3029
-                $i ++;
3029
+                $i++;
3030 3030
                 //incrementa o controle dos itens processados.
3031
-                $this->qtdeItensProc ++;
3031
+                $this->qtdeItensProc++;
3032 3032
             } else {
3033
-                $i ++;
3033
+                $i++;
3034 3034
             }
3035 3035
         }
3036 3036
 
@@ -3235,23 +3235,23 @@  discard block
 block discarded – undo
3235 3235
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
3236 3236
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3237 3237
         //INSCRIÇÃO MUNICIPAL
3238
-        $y     += 3;
3238
+        $y += 3;
3239 3239
         $w     = round($this->wPrint * 0.23, 0);
3240 3240
         $texto = 'INSCRIÇÃO MUNICIPAL';
3241 3241
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3242 3242
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3243 3243
         //inscrição municipal
3244
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3244
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3245 3245
             $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3246 3246
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3247 3247
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
3248 3248
         //VALOR TOTAL DOS SERVIÇOS
3249
-        $x     += $w;
3249
+        $x += $w;
3250 3250
         $texto = 'VALOR TOTAL DOS SERVIÇOS';
3251 3251
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3252 3252
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3253 3253
         if (isset($this->ISSQNtot)) {
3254
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3254
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3255 3255
                 $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3256 3256
             $texto = number_format($texto, 2, ",", ".");
3257 3257
         } else {
@@ -3260,14 +3260,14 @@  discard block
 block discarded – undo
3260 3260
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3261 3261
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3262 3262
         //BASE DE CÁLCULO DO ISSQN
3263
-        $x     += $w;
3263
+        $x += $w;
3264 3264
         $texto = 'BASE DE CÁLCULO DO ISSQN';
3265 3265
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3266 3266
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3267 3267
         if (isset($this->ISSQNtot)) {
3268
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3268
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3269 3269
                 $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3270
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3270
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3271 3271
         } else {
3272 3272
             $texto = '';
3273 3273
         }
@@ -3284,9 +3284,9 @@  discard block
 block discarded – undo
3284 3284
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3285 3285
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3286 3286
         if (isset($this->ISSQNtot)) {
3287
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3287
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3288 3288
                 $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3289
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3289
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3290 3290
         } else {
3291 3291
             $texto = '';
3292 3292
         }
@@ -3325,7 +3325,7 @@  discard block
 block discarded – undo
3325 3325
 
3326 3326
         //INFORMAÇÕES COMPLEMENTARES
3327 3327
         $texto = "INFORMAÇÕES COMPLEMENTARES";
3328
-        $y     += 3;
3328
+        $y += 3;
3329 3329
         $w     = $this->wAdic;
3330 3330
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B'];
3331 3331
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -3335,7 +3335,7 @@  discard block
 block discarded – undo
3335 3335
         //$this->textoAdic com o texto completo do campo
3336 3336
         //echo str_replace("\n", "<br>",$this->textoAdic);
3337 3337
         //die;
3338
-        $y     += 1;
3338
+        $y += 1;
3339 3339
         $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => ''];
3340 3340
         //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>''];
3341 3341
         $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
@@ -3386,7 +3386,7 @@  discard block
 block discarded – undo
3386 3386
                 $texto = 'CONTINGÊNCIA SVC-RS' . $dhCont . $xJust;
3387 3387
                 break;
3388 3388
         }
3389
-        $y     += 2;
3389
+        $y += 2;
3390 3390
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
3391 3391
         $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false);
3392 3392
 
@@ -3441,7 +3441,7 @@  discard block
 block discarded – undo
3441 3441
         $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
3442 3442
         if ($tpNF == '0') {
3443 3443
             //NFe de Entrada
3444
-            $emitente     = '';
3444
+            $emitente = '';
3445 3445
             $emitente     .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - ";
3446 3446
             $emitente     .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", ";
3447 3447
             $emitente     .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - ";
@@ -3494,10 +3494,10 @@  discard block
 block discarded – undo
3494 3494
             $texto .= "AO LADO";
3495 3495
         }
3496 3496
         $texto .= ". EMISSÃO: ";
3497
-        $dEmi  = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3497
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3498 3498
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3499 3499
         if ($dEmi == '') {
3500
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3500
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3501 3501
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3502 3502
             $aDemi = explode('T', $dEmi);
3503 3503
             $dEmi  = $aDemi[0];
@@ -3520,12 +3520,12 @@  discard block
 block discarded – undo
3520 3520
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3521 3521
             //DATA DE RECEBIMENTO
3522 3522
             $texto = "DATA DE RECEBIMENTO";
3523
-            $y     += $h;
3523
+            $y += $h;
3524 3524
             $w2    = round($this->wPrint * 0.17, 0); //35;
3525 3525
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3526 3526
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3527 3527
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3528
-            $x     += $w2;
3528
+            $x += $w2;
3529 3529
             $w3    = $w - $w2;
3530 3530
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3531 3531
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3536,7 +3536,7 @@  discard block
 block discarded – undo
3536 3536
 
3537 3537
             return $y;
3538 3538
         } else {
3539
-            $x --;
3539
+            $x--;
3540 3540
             $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3541 3541
             //NUMERO DA NOTA FISCAL LOGO NFE
3542 3542
             $w1    = 18;
@@ -3557,7 +3557,7 @@  discard block
 block discarded – undo
3557 3557
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3558 3558
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3559 3559
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3560
-            $y     -= $w2;
3560
+            $y -= $w2;
3561 3561
             $w3    = $w - $w2;
3562 3562
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3563 3563
             $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => ''];
@@ -3578,18 +3578,18 @@  discard block
 block discarded – undo
3578 3578
      */
3579 3579
     protected function geraInformacoesDaTagCompra()
3580 3580
     {
3581
-        if (! $this->gerarInformacoesAutomaticas) {
3581
+        if (!$this->gerarInformacoesAutomaticas) {
3582 3582
             return '';
3583 3583
         }
3584 3584
         $saida = "";
3585 3585
         if (isset($this->compra)) {
3586
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3586
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3587 3587
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3588 3588
             }
3589
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3589
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3590 3590
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3591 3591
             }
3592
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3592
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3593 3593
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3594 3594
             }
3595 3595
         }
@@ -3620,10 +3620,10 @@  discard block
 block discarded – undo
3620 3620
         if ($icmss > 0) {
3621 3621
             $icmss = 1;
3622 3622
         }
3623
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3623
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3624 3624
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3625 3625
         if ($dEmi == '') {
3626
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3626
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3627 3627
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3628 3628
             $aDemi = explode('T', $dEmi);
3629 3629
             $dEmi  = $aDemi[0];
@@ -3647,7 +3647,7 @@  discard block
 block discarded – undo
3647 3647
      */
3648 3648
     protected function geraInformacoesDasNotasReferenciadas()
3649 3649
     {
3650
-        if (! $this->gerarInformacoesAutomaticas) {
3650
+        if (!$this->gerarInformacoesAutomaticas) {
3651 3651
             return '';
3652 3652
         }
3653 3653
         $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]";
@@ -3675,7 +3675,7 @@  discard block
 block discarded – undo
3675 3675
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3676 3676
                 $serie         = substr($chave_acesso, 22, 3);
3677 3677
                 $numero        = substr($chave_acesso, 25, 9);
3678
-                $saida         .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3678
+                $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3679 3679
             }
3680 3680
             $refNF = $nfRef->getElementsByTagName('refNF');
3681 3681
             foreach ($refNF as $umaRefNFe) {
@@ -3686,7 +3686,7 @@  discard block
 block discarded – undo
3686 3686
                 $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue;
3687 3687
                 $data   = substr($data, 2, 2) . "/20" . substr($data, 0, 2);
3688 3688
                 $cnpj   = $this->formatField($cnpj, "##.###.###/####-##");
3689
-                $saida  .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3689
+                $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3690 3690
             }
3691 3691
             $refCTe = $nfRef->getElementsByTagName('refCTe');
3692 3692
             foreach ($refCTe as $chave_acessoRef) {
@@ -3696,7 +3696,7 @@  discard block
 block discarded – undo
3696 3696
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3697 3697
                 $serie         = substr($chave_acesso, 22, 3);
3698 3698
                 $numero        = substr($chave_acesso, 25, 9);
3699
-                $saida         .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3699
+                $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3700 3700
             }
3701 3701
             $refECF = $nfRef->getElementsByTagName('refECF');
3702 3702
             foreach ($refECF as $umaRefNFe) {
@@ -3708,10 +3708,9 @@  discard block
 block discarded – undo
3708 3708
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3709 3709
             foreach ($refNFP as $umaRefNFe) {
3710 3710
                 $data   = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3711
-                $cnpj   = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3712
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3713
-                    '';
3714
-                $cpf    = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3711
+                $cnpj   = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3712
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3713
+                $cpf    = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3715 3714
                     $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3716 3715
                 $mod    = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3717 3716
                 $serie  = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
@@ -3733,7 +3732,7 @@  discard block
 block discarded – undo
3733 3732
     private function loadDoc($xml)
3734 3733
     {
3735 3734
         $this->xml = $xml;
3736
-        if (! empty($xml)) {
3735
+        if (!empty($xml)) {
3737 3736
             $this->dom = new Dom();
3738 3737
             $this->dom->loadXML($this->xml);
3739 3738
             if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) {
@@ -3787,7 +3786,7 @@  discard block
 block discarded – undo
3787 3786
         $numlinhas    = $this->pdf->getNumLines($textoProduto, $w2, $aFont);
3788 3787
 
3789 3788
         if ($mostrarUnidadeTributavel && $numlinhas == 1) {
3790
-            $numlinhas ++;
3789
+            $numlinhas++;
3791 3790
         }
3792 3791
 
3793 3792
         return round(($numlinhas * $this->pdf->fontSize) + ($numlinhas * 0.5), 2);
Please login to merge, or discard this patch.