Completed
Pull Request — master (#433)
by
unknown
03:00
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 ";
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
         } else {
849 849
             if ($this->getTagValue($this->ide, "tpAmb") == '2') {
850 850
                 $resp['status'] = false;
851
-                $resp['message'][] =  "NFe EMITIDA EM HOMOLOGAÇÃO";
851
+                $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO";
852 852
             }
853 853
             $retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0);
854 854
             $cStat = $this->getTagValue($this->nfeProc, "cStat");
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
             } elseif (!empty($retEvento)) {
870 870
                 $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0);
871 871
                 $cStat = $this->getTagValue($infEvento, "cStat");
872
-                $tpEvento= $this->getTagValue($infEvento, "tpEvento");
872
+                $tpEvento = $this->getTagValue($infEvento, "tpEvento");
873 873
                 $dhEvento = date("d/m/Y H:i:s", $this->toTimestamp($this->getTagValue($infEvento, "dhRegEvento")));
874 874
                 $nProt = $this->getTagValue($infEvento, "nProt");
875 875
                 if ($tpEvento == '110111' && 
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
 
890 890
     protected function notaDPEC()
891 891
     {
892
-        return ! empty($this->numdepec);
892
+        return !empty($this->numdepec);
893 893
     }
894 894
 
895 895
     /**
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
         //se for right separa 2/3 para os dados e o terço seguinte para o logo
939 939
         //se não houver logo centraliza dos dados do emitente
940 940
         // coloca o logo
941
-        if (! empty($this->logomarca)) {
941
+        if (!empty($this->logomarca)) {
942 942
             $logoInfo = getimagesize($this->logomarca);
943 943
             //largura da imagem em mm
944 944
             $logoWmm = ($logoInfo[0] / 72) * 25.4;
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
             //endereço
995 995
             $y1     = $y1 + 5;
996 996
             $aFont  = ['font' => $this->fontePadrao, 'size' => 8, 'style' => ''];
997
-            $fone   = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
997
+            $fone   = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
998 998
                 ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
999 999
                 : '';
1000 1000
             $lgr    = $this->getTagValue($this->enderEmit, "xLgr");
@@ -1013,8 +1013,8 @@  discard block
 block discarded – undo
1013 1013
 
1014 1014
         //####################################################################################
1015 1015
         //coluna central Danfe
1016
-        $x  += $w;
1017
-        $w  = round($maxW * 0.17, 0);//35;
1016
+        $x += $w;
1017
+        $w  = round($maxW * 0.17, 0); //35;
1018 1018
         $w2 = $w;
1019 1019
         $h  = 32;
1020 1020
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1071,8 +1071,8 @@  discard block
 block discarded – undo
1071 1071
 
1072 1072
         //####################################################################################
1073 1073
         //coluna codigo de barras
1074
-        $x  += $w;
1075
-        $w  = ($maxW - $w1 - $w2);//85;
1074
+        $x += $w;
1075
+        $w  = ($maxW - $w1 - $w2); //85;
1076 1076
         $w3 = $w;
1077 1077
         $h  = 32;
1078 1078
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1102,7 +1102,7 @@  discard block
 block discarded – undo
1102 1102
         } else {
1103 1103
             $cabecalhoProtoAutorizacao = 'PROTOCOLO DE AUTORIZAÇÃO DE USO';
1104 1104
         }
1105
-        if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) {
1105
+        if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) {
1106 1106
             $cabecalhoProtoAutorizacao = "DADOS DA NF-E";
1107 1107
             $chaveContingencia         = $this->geraChaveAdicionalDeContingencia();
1108 1108
             $this->pdf->setFillColor(0, 0, 0);
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1135 1135
         $w     = $w1 + $w2;
1136 1136
         $y     = $oldY;
1137
-        $oldY  += $h;
1137
+        $oldY += $h;
1138 1138
         $x     = $oldX;
1139 1139
         $h     = 7;
1140 1140
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
         // NOTA : DANFE sem protocolo deve existir somente no caso de contingência !!!
1152 1152
         // Além disso, existem várias NFes em contingência que eu recebo com protocolo de autorização.
1153 1153
         // Na minha opinião, deveríamos mostra-lo, mas o  manual  da NFe v4.01 diz outra coisa...
1154
-        if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) {
1154
+        if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) {
1155 1155
             $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => 'B'];
1156 1156
             $texto = $this->formatField(
1157 1157
                 $chaveContingencia,
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
                 $cStat = '';
1166 1166
             } else {
1167 1167
                 if (isset($this->nfeProc)) {
1168
-                    $texto  = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1168
+                    $texto  = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1169 1169
                         ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1170 1170
                         : '';
1171 1171
                     $tsHora = $this->toTimestamp(
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1196 1196
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1197 1197
         //INSCRIÇÃO MUNICIPAL
1198
-        $x     += $w;
1198
+        $x += $w;
1199 1199
         $texto = 'INSCRIÇÃO MUNICIPAL';
1200 1200
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1201 1201
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1203,29 +1203,29 @@  discard block
 block discarded – undo
1203 1203
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1204 1204
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1205 1205
         //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.
1206
-        $x     += $w;
1206
+        $x += $w;
1207 1207
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1208 1208
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1209 1209
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1210
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1210
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1211 1211
             ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1212 1212
             : '';
1213 1213
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1214 1214
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1215 1215
         //CNPJ
1216
-        $x     += $w;
1216
+        $x += $w;
1217 1217
         $w     = ($maxW - (3 * $w));
1218 1218
         $texto = 'CNPJ';
1219 1219
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1220 1220
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1221 1221
         //Pegando valor do CPF/CNPJ
1222
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1222
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1223 1223
             $texto = $this->formatField(
1224 1224
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1225 1225
                 "###.###.###/####-##"
1226 1226
             );
1227 1227
         } else {
1228
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1228
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1229 1229
                 ? $this->formatField(
1230 1230
                     $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1231 1231
                     "###.###.###-##"
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
             $n = count($resp['message']);
1245 1245
             $alttot = $n * 15;
1246 1246
             $x = 10;
1247
-            $y = $this->hPrint/2 - $alttot/2;
1247
+            $y = $this->hPrint / 2 - $alttot / 2;
1248 1248
             $h = 15;
1249 1249
             $w = $maxW - (2 * $x);
1250 1250
             $this->pdf->settextcolor(90, 90, 90);
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
         //NOME / RAZÃO SOCIAL
1318 1318
         $w     = round($maxW * 0.61, 0);
1319 1319
         $w1    = $w;
1320
-        $y     += 3;
1320
+        $y += 3;
1321 1321
         $texto = 'NOME / RAZÃO SOCIAL';
1322 1322
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1323 1323
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1329,20 +1329,20 @@  discard block
 block discarded – undo
1329 1329
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1330 1330
         }
1331 1331
         //CNPJ / CPF
1332
-        $x     += $w;
1332
+        $x += $w;
1333 1333
         $w     = round($maxW * 0.23, 0);
1334 1334
         $w2    = $w;
1335 1335
         $texto = 'CNPJ / CPF';
1336 1336
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1337 1337
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1338 1338
         //Pegando valor do CPF/CNPJ
1339
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1339
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1340 1340
             $texto = $this->formatField(
1341 1341
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1342 1342
                 "###.###.###/####-##"
1343 1343
             );
1344 1344
         } else {
1345
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1345
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1346 1346
                 ? $this->formatField(
1347 1347
                     $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1348 1348
                     "###.###.###-##"
@@ -1352,17 +1352,17 @@  discard block
 block discarded – undo
1352 1352
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1353 1353
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1354 1354
         //DATA DA EMISSÃO
1355
-        $x     += $w;
1355
+        $x += $w;
1356 1356
         $w     = $maxW - ($w1 + $w2);
1357 1357
         $wx    = $w;
1358 1358
         $texto = 'DATA DA EMISSÃO';
1359 1359
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1360 1360
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1361
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1361
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1362 1362
             ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1363 1363
             : '';
1364 1364
         if ($dEmi == '') {
1365
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1365
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1366 1366
                 ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1367 1367
                 : '';
1368 1368
             $aDemi = explode('T', $dEmi);
@@ -1378,7 +1378,7 @@  discard block
 block discarded – undo
1378 1378
         //ENDEREÇO
1379 1379
         $w     = round($maxW * 0.47, 0);
1380 1380
         $w1    = $w;
1381
-        $y     += $h;
1381
+        $y += $h;
1382 1382
         $x     = $oldX;
1383 1383
         $texto = 'ENDEREÇO';
1384 1384
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1391 1391
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1392 1392
         //BAIRRO / DISTRITO
1393
-        $x     += $w;
1393
+        $x += $w;
1394 1394
         $w     = round($maxW * 0.21, 0);
1395 1395
         $w2    = $w;
1396 1396
         $texto = 'BAIRRO / DISTRITO';
@@ -1400,29 +1400,29 @@  discard block
 block discarded – undo
1400 1400
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1401 1401
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1402 1402
         //CEP
1403
-        $x     += $w;
1403
+        $x += $w;
1404 1404
         $w     = $maxW - $w1 - $w2 - $wx;
1405 1405
         $w2    = $w;
1406 1406
         $texto = 'CEP';
1407 1407
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1408 1408
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1409
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1409
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1410 1410
             ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1411 1411
             : '';
1412 1412
         $texto = $this->formatField($texto, "#####-###");
1413 1413
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1414 1414
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1415 1415
         //DATA DA SAÍDA
1416
-        $x     += $w;
1416
+        $x += $w;
1417 1417
         $w     = $wx;
1418 1418
         $texto = 'DATA DA SAÍDA/ENTRADA';
1419 1419
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1420 1420
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1421
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1421
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1422 1422
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1423 1423
             : '';
1424 1424
         if ($dSaiEnt == '') {
1425
-            $dSaiEnt  = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1425
+            $dSaiEnt  = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1426 1426
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1427 1427
                 : '';
1428 1428
             $aDsaient = explode('T', $dSaiEnt);
@@ -1433,7 +1433,7 @@  discard block
 block discarded – undo
1433 1433
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1434 1434
         //MUNICÍPIO
1435 1435
         $w     = $w1;
1436
-        $y     += $h;
1436
+        $y += $h;
1437 1437
         $x     = $oldX;
1438 1438
         $texto = 'MUNICÍPIO';
1439 1439
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1448 1448
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1449 1449
         //UF
1450
-        $x     += $w;
1450
+        $x += $w;
1451 1451
         $w     = 8;
1452 1452
         $texto = 'UF';
1453 1453
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1456,19 +1456,19 @@  discard block
 block discarded – undo
1456 1456
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1457 1457
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1458 1458
         //FONE / FAX
1459
-        $x     += $w;
1459
+        $x += $w;
1460 1460
         $w     = round(($maxW - $w1 - $wx - 8) / 2, 0);
1461 1461
         $w3    = $w;
1462 1462
         $texto = 'FONE / FAX';
1463 1463
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1464 1464
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1465
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1465
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1466 1466
             ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1467 1467
             : '';
1468 1468
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1469 1469
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1470 1470
         //INSCRIÇÃO ESTADUAL
1471
-        $x     += $w;
1471
+        $x += $w;
1472 1472
         $w     = $maxW - $w1 - $wx - 8 - $w3;
1473 1473
         $texto = 'INSCRIÇÃO ESTADUAL';
1474 1474
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1478,16 +1478,16 @@  discard block
 block discarded – undo
1478 1478
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1479 1479
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1480 1480
         //HORA DA SAÍDA
1481
-        $x     += $w;
1481
+        $x += $w;
1482 1482
         $w     = $wx;
1483 1483
         $texto = 'HORA DA SAÍDA/ENTRADA';
1484 1484
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1485 1485
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1486
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1486
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1487 1487
             ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1488 1488
             : '';
1489 1489
         if ($hSaiEnt == '') {
1490
-            $dhSaiEnt   = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1490
+            $dhSaiEnt   = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1491 1491
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1492 1492
                 : '';
1493 1493
             $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt);
@@ -1531,7 +1531,7 @@  discard block
 block discarded – undo
1531 1531
         //NOME / RAZÃO SOCIAL
1532 1532
         $w     = round($maxW * 0.61, 0);
1533 1533
         $w1    = $w;
1534
-        $y     += 3;
1534
+        $y += 3;
1535 1535
         $texto = 'NOME / RAZÃO SOCIAL';
1536 1536
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1537 1537
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1546,20 +1546,20 @@  discard block
 block discarded – undo
1546 1546
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1547 1547
         }
1548 1548
         //CNPJ / CPF
1549
-        $x     += $w;
1549
+        $x += $w;
1550 1550
         $w     = round($maxW * 0.23, 0);
1551 1551
         $w2    = $w;
1552 1552
         $texto = 'CNPJ / CPF';
1553 1553
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1554 1554
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1555 1555
         //Pegando valor do CPF/CNPJ
1556
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1556
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1557 1557
             $texto = $this->formatField(
1558 1558
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1559 1559
                 "###.###.###/####-##"
1560 1560
             );
1561 1561
         } else {
1562
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1562
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1563 1563
                 $this->formatField(
1564 1564
                     $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1565 1565
                     "###.###.###-##"
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1569 1569
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1570 1570
         //INSCRIÇÃO ESTADUAL
1571
-        $x     += $w;
1571
+        $x += $w;
1572 1572
         $w     = $maxW - ($w1 + $w2);
1573 1573
         $wx    = $w;
1574 1574
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1587,7 +1587,7 @@  discard block
 block discarded – undo
1587 1587
         //ENDEREÇO
1588 1588
         $w     = round($maxW * 0.355, 0) + $wx;
1589 1589
         $w1    = $w;
1590
-        $y     += $h;
1590
+        $y += $h;
1591 1591
         $x     = $oldX;
1592 1592
         $texto = 'ENDEREÇO';
1593 1593
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1599 1599
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1600 1600
         //BAIRRO / DISTRITO
1601
-        $x     += $w;
1601
+        $x += $w;
1602 1602
         $w     = round($maxW * 0.335, 0);
1603 1603
         $w2    = $w;
1604 1604
         $texto = 'BAIRRO / DISTRITO';
@@ -1608,12 +1608,12 @@  discard block
 block discarded – undo
1608 1608
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1609 1609
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1610 1610
         //CEP
1611
-        $x     += $w;
1611
+        $x += $w;
1612 1612
         $w     = $maxW - ($w1 + $w2);
1613 1613
         $texto = 'CEP';
1614 1614
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1615 1615
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1616
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1616
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1617 1617
             $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1618 1618
         $texto = $this->formatField($texto, "#####-###");
1619 1619
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1621,7 +1621,7 @@  discard block
 block discarded – undo
1621 1621
         //MUNICÍPIO
1622 1622
         $w     = round($maxW * 0.805, 0);
1623 1623
         $w1    = $w;
1624
-        $y     += $h;
1624
+        $y += $h;
1625 1625
         $x     = $oldX;
1626 1626
         $texto = 'MUNICÍPIO';
1627 1627
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1634 1634
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1635 1635
         //UF
1636
-        $x     += $w;
1636
+        $x += $w;
1637 1637
         $w     = 8;
1638 1638
         $texto = 'UF';
1639 1639
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1642,12 +1642,12 @@  discard block
 block discarded – undo
1642 1642
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1643 1643
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1644 1644
         //FONE / FAX
1645
-        $x     += $w;
1645
+        $x += $w;
1646 1646
         $w     = $maxW - $w - $w1;
1647 1647
         $texto = 'FONE / FAX';
1648 1648
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1649 1649
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1650
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1650
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1651 1651
             $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1652 1652
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1653 1653
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1684,7 +1684,7 @@  discard block
 block discarded – undo
1684 1684
         //NOME / RAZÃO SOCIAL
1685 1685
         $w     = round($maxW * 0.61, 0);
1686 1686
         $w1    = $w;
1687
-        $y     += 3;
1687
+        $y += 3;
1688 1688
         $texto = 'NOME / RAZÃO SOCIAL';
1689 1689
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1690 1690
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1699,20 +1699,20 @@  discard block
 block discarded – undo
1699 1699
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1700 1700
         }
1701 1701
         //CNPJ / CPF
1702
-        $x     += $w;
1702
+        $x += $w;
1703 1703
         $w     = round($maxW * 0.23, 0);
1704 1704
         $w2    = $w;
1705 1705
         $texto = 'CNPJ / CPF';
1706 1706
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1707 1707
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1708 1708
         //Pegando valor do CPF/CNPJ
1709
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1709
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1710 1710
             $texto = $this->formatField(
1711 1711
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1712 1712
                 "###.###.###/####-##"
1713 1713
             );
1714 1714
         } else {
1715
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1715
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1716 1716
                 $this->formatField(
1717 1717
                     $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1718 1718
                     "###.###.###-##"
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1722 1722
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1723 1723
         //INSCRIÇÃO ESTADUAL
1724
-        $x     += $w;
1724
+        $x += $w;
1725 1725
         $w     = $maxW - ($w1 + $w2);
1726 1726
         $wx    = $w;
1727 1727
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1740,7 +1740,7 @@  discard block
 block discarded – undo
1740 1740
         //ENDEREÇO
1741 1741
         $w     = round($maxW * 0.355, 0) + $wx;
1742 1742
         $w1    = $w;
1743
-        $y     += $h;
1743
+        $y += $h;
1744 1744
         $x     = $oldX;
1745 1745
         $texto = 'ENDEREÇO';
1746 1746
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1751,7 +1751,7 @@  discard block
 block discarded – undo
1751 1751
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1752 1752
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1753 1753
         //BAIRRO / DISTRITO
1754
-        $x     += $w;
1754
+        $x += $w;
1755 1755
         $w     = round($maxW * 0.335, 0);
1756 1756
         $w2    = $w;
1757 1757
         $texto = 'BAIRRO / DISTRITO';
@@ -1761,12 +1761,12 @@  discard block
 block discarded – undo
1761 1761
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1762 1762
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1763 1763
         //CEP
1764
-        $x     += $w;
1764
+        $x += $w;
1765 1765
         $w     = $maxW - ($w1 + $w2);
1766 1766
         $texto = 'CEP';
1767 1767
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1768 1768
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1769
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1769
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1770 1770
             $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1771 1771
         $texto = $this->formatField($texto, "#####-###");
1772 1772
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1774,7 +1774,7 @@  discard block
 block discarded – undo
1774 1774
         //MUNICÍPIO
1775 1775
         $w     = round($maxW * 0.805, 0);
1776 1776
         $w1    = $w;
1777
-        $y     += $h;
1777
+        $y += $h;
1778 1778
         $x     = $oldX;
1779 1779
         $texto = 'MUNICÍPIO';
1780 1780
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1787 1787
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1788 1788
         //UF
1789
-        $x     += $w;
1789
+        $x += $w;
1790 1790
         $w     = 8;
1791 1791
         $texto = 'UF';
1792 1792
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1795,12 +1795,12 @@  discard block
 block discarded – undo
1795 1795
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1796 1796
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1797 1797
         //FONE / FAX
1798
-        $x     += $w;
1798
+        $x += $w;
1799 1799
         $w     = $maxW - $w - $w1;
1800 1800
         $texto = 'FONE / FAX';
1801 1801
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1802 1802
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1803
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1803
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1804 1804
             $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1805 1805
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1806 1806
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
         if (isset($this->cobr)) {
1821 1821
             $fat = $this->cobr->getElementsByTagName("fat")->item(0);
1822 1822
             if (isset($fat)) {
1823
-                if (! empty($this->getTagValue($this->ide, "indPag"))) {
1823
+                if (!empty($this->getTagValue($this->ide, "indPag"))) {
1824 1824
                     $textoIndPag = "";
1825 1825
                     $indPag      = $this->getTagValue($this->ide, "indPag");
1826 1826
                     if ($indPag === "0") {
@@ -1895,7 +1895,7 @@  discard block
 block discarded – undo
1895 1895
             $h     = 8;
1896 1896
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
1897 1897
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1898
-            $y       += 3;
1898
+            $y += 3;
1899 1899
             $dups    = "";
1900 1900
             $dupcont = 0;
1901 1901
             $nFat    = $this->dup->length;
@@ -1929,13 +1929,13 @@  discard block
 block discarded – undo
1929 1929
             }
1930 1930
             $increm = 1;
1931 1931
             foreach ($this->dup as $k => $d) {
1932
-                $nDup  = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1932
+                $nDup  = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1933 1933
                     ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1934 1934
                     : '';
1935
-                $dDup  = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1935
+                $dDup  = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1936 1936
                     ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1937 1937
                     : '';
1938
-                $vDup  = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1938
+                $vDup  = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1939 1939
                     ? 'R$ ' . number_format(
1940 1940
                         $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1941 1941
                         2,
@@ -1982,7 +1982,7 @@  discard block
 block discarded – undo
1982 1982
             }
1983 1983
             if ($dupcont == 0) {
1984 1984
                 $y -= 9;
1985
-                $linha --;
1985
+                $linha--;
1986 1986
             }
1987 1987
 
1988 1988
             return ($y + $h);
@@ -2022,7 +2022,7 @@  discard block
 block discarded – undo
2022 2022
             $h     = 8;
2023 2023
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
2024 2024
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2025
-            $y       += 3;
2025
+            $y += 3;
2026 2026
             $dups    = "";
2027 2027
             $dupcont = 0;
2028 2028
             if ($this->orientacao == 'P') {
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
                 '90' => 'Sem pagamento',
2052 2052
                 '99' => 'Outros'
2053 2053
             ];
2054
-            $bandeira       = [
2054
+            $bandeira = [
2055 2055
                 '01' => 'Visa',
2056 2056
                 '02' => 'Mastercard',
2057 2057
                 '03' => 'American',
@@ -2064,10 +2064,10 @@  discard block
 block discarded – undo
2064 2064
                 '99' => 'Outros'
2065 2065
             ];
2066 2066
             foreach ($this->detPag as $k => $d) {
2067
-                $fPag  = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2067
+                $fPag  = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2068 2068
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
2069 2069
                     : '0';
2070
-                $vPag  = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2070
+                $vPag  = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2071 2071
                     ? 'R$ ' . number_format(
2072 2072
                         $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
2073 2073
                         2,
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
             }
2111 2111
             if ($dupcont == 0) {
2112 2112
                 $y -= 9;
2113
-                $linha --;
2113
+                $linha--;
2114 2114
             }
2115 2115
 
2116 2116
             return ($y + $h);
@@ -2142,7 +2142,7 @@  discard block
 block discarded – undo
2142 2142
         $the_field    = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0);
2143 2143
         if (isset($the_field)) {
2144 2144
             $the_value = $the_field->nodeValue;
2145
-            if (! empty($the_value)) {
2145
+            if (!empty($the_value)) {
2146 2146
                 $valorImposto = number_format($the_value, 2, ",", ".");
2147 2147
             }
2148 2148
         }
@@ -2171,10 +2171,10 @@  discard block
 block discarded – undo
2171 2171
         $x_inicial = $x;
2172 2172
         //#####################################################################
2173 2173
         $campos_por_linha = 9;
2174
-        if (! $this->exibirPIS) {
2175
-            $campos_por_linha --;
2174
+        if (!$this->exibirPIS) {
2175
+            $campos_por_linha--;
2176 2176
         }
2177
-        if (! $this->exibirIcmsInterestadual) {
2177
+        if (!$this->exibirIcmsInterestadual) {
2178 2178
             $campos_por_linha -= 2;
2179 2179
         }
2180 2180
 
@@ -2261,12 +2261,12 @@  discard block
 block discarded – undo
2261 2261
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2262 2262
         //NOME / RAZÃO SOCIAL
2263 2263
         $w1    = $maxW * 0.29;
2264
-        $y     += 3;
2264
+        $y += 3;
2265 2265
         $texto = 'NOME / RAZÃO SOCIAL';
2266 2266
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2267 2267
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2268 2268
         if (isset($this->transporta)) {
2269
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2269
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2270 2270
                 ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2271 2271
                 : '';
2272 2272
         } else {
@@ -2275,12 +2275,12 @@  discard block
 block discarded – undo
2275 2275
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2276 2276
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2277 2277
         //FRETE POR CONTA
2278
-        $x     += $w1;
2278
+        $x += $w1;
2279 2279
         $w2    = $maxW * 0.15;
2280 2280
         $texto = 'FRETE';
2281 2281
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2282 2282
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2283
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2283
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2284 2284
             ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2285 2285
             : '0';
2286 2286
         switch ($tipoFrete) {
@@ -2306,12 +2306,12 @@  discard block
 block discarded – undo
2306 2306
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2307 2307
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, '');
2308 2308
         //CÓDIGO ANTT
2309
-        $x     += $w2;
2309
+        $x += $w2;
2310 2310
         $texto = 'CÓDIGO ANTT';
2311 2311
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2312 2312
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2313 2313
         if (isset($this->veicTransp)) {
2314
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2314
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2315 2315
                 ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2316 2316
                 : '';
2317 2317
         } else {
@@ -2320,16 +2320,16 @@  discard block
 block discarded – undo
2320 2320
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2321 2321
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2322 2322
         //PLACA DO VEÍC
2323
-        $x     += $w2;
2323
+        $x += $w2;
2324 2324
         $texto = 'PLACA DO VEÍCULO';
2325 2325
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2326 2326
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2327 2327
         if (isset($this->veicTransp)) {
2328
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2328
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2329 2329
                 ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2330 2330
                 : '';
2331 2331
         } elseif (isset($this->reboque)) {
2332
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2332
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2333 2333
                 ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2334 2334
                 : '';
2335 2335
         } else {
@@ -2338,17 +2338,17 @@  discard block
 block discarded – undo
2338 2338
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2339 2339
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2340 2340
         //UF
2341
-        $x     += $w2;
2341
+        $x += $w2;
2342 2342
         $w3    = round($maxW * 0.04, 0);
2343 2343
         $texto = 'UF';
2344 2344
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2345 2345
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2346 2346
         if (isset($this->veicTransp)) {
2347
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2347
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2348 2348
                 ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2349 2349
                 : '';
2350 2350
         } elseif (isset($this->reboque)) {
2351
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2351
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2352 2352
                 ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2353 2353
                 : '';
2354 2354
         } else {
@@ -2357,20 +2357,20 @@  discard block
 block discarded – undo
2357 2357
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2358 2358
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2359 2359
         //CNPJ / CPF
2360
-        $x     += $w3;
2360
+        $x += $w3;
2361 2361
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2362 2362
         $texto = 'CNPJ / CPF';
2363 2363
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2364 2364
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2365 2365
         if (isset($this->transporta)) {
2366
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2366
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2367 2367
                 ? $this->formatField(
2368 2368
                     $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2369 2369
                     "##.###.###/####-##"
2370 2370
                 )
2371 2371
                 : '';
2372 2372
             if ($texto == '') {
2373
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2373
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2374 2374
                     ? $this->formatField(
2375 2375
                         $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2376 2376
                         "###.###.###-##"
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
2385 2385
         //#####################################################################
2386 2386
         //ENDEREÇO
2387
-        $y     += $h;
2387
+        $y += $h;
2388 2388
         $x     = $oldX;
2389 2389
         $h     = 7;
2390 2390
         $w1    = $maxW * 0.44;
@@ -2392,7 +2392,7 @@  discard block
 block discarded – undo
2392 2392
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2393 2393
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2394 2394
         if (isset($this->transporta)) {
2395
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2395
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2396 2396
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2397 2397
                 : '';
2398 2398
         } else {
@@ -2401,13 +2401,13 @@  discard block
 block discarded – undo
2401 2401
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2402 2402
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2403 2403
         //MUNICÍPIO
2404
-        $x     += $w1;
2404
+        $x += $w1;
2405 2405
         $w2    = round($maxW * 0.30, 0);
2406 2406
         $texto = 'MUNICÍPIO';
2407 2407
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2408 2408
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2409 2409
         if (isset($this->transporta)) {
2410
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2410
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2411 2411
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2412 2412
                 : '';
2413 2413
         } else {
@@ -2416,13 +2416,13 @@  discard block
 block discarded – undo
2416 2416
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2417 2417
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2418 2418
         //UF
2419
-        $x     += $w2;
2419
+        $x += $w2;
2420 2420
         $w3    = round($maxW * 0.04, 0);
2421 2421
         $texto = 'UF';
2422 2422
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2423 2423
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2424 2424
         if (isset($this->transporta)) {
2425
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2425
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2426 2426
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2427 2427
                 : '';
2428 2428
         } else {
@@ -2431,14 +2431,14 @@  discard block
 block discarded – undo
2431 2431
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2432 2432
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2433 2433
         //INSCRIÇÃO ESTADUAL
2434
-        $x     += $w3;
2434
+        $x += $w3;
2435 2435
         $w     = $maxW - ($w1 + $w2 + $w3);
2436 2436
         $texto = 'INSCRIÇÃO ESTADUAL';
2437 2437
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2438 2438
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2439 2439
         $texto = '';
2440 2440
         if (isset($this->transporta)) {
2441
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2441
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2442 2442
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2443 2443
             }
2444 2444
         }
@@ -2454,13 +2454,13 @@  discard block
 block discarded – undo
2454 2454
         $pesoBruto   = 0;
2455 2455
         $pesoLiquido = 0;
2456 2456
         foreach ($volumes as $volume) {
2457
-            $quantidade  += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2457
+            $quantidade  += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2458 2458
                 $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2459
-            $pesoBruto   += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2459
+            $pesoBruto   += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2460 2460
                 $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2461
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2461
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2462 2462
                 $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2463
-            $texto       = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2463
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2464 2464
                 $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2465 2465
             if ($texto != $especie && $especie != '') {
2466 2466
                 //tem várias especies
@@ -2468,7 +2468,7 @@  discard block
 block discarded – undo
2468 2468
             } else {
2469 2469
                 $especie = $texto;
2470 2470
             }
2471
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2471
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2472 2472
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2473 2473
                 : '';
2474 2474
             if ($texto != $marca && $marca != '') {
@@ -2477,7 +2477,7 @@  discard block
 block discarded – undo
2477 2477
             } else {
2478 2478
                 $marca = $texto;
2479 2479
             }
2480
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2480
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2481 2481
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2482 2482
                 : '';
2483 2483
             if ($texto != $numero && $numero != '') {
@@ -2490,20 +2490,20 @@  discard block
 block discarded – undo
2490 2490
 
2491 2491
         //#####################################################################
2492 2492
         //QUANTIDADE
2493
-        $y     += $h;
2493
+        $y += $h;
2494 2494
         $x     = $oldX;
2495 2495
         $h     = 7;
2496 2496
         $w1    = round($maxW * 0.10, 0);
2497 2497
         $texto = 'QUANTIDADE';
2498 2498
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2499 2499
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2500
-        if (! empty($quantidade)) {
2500
+        if (!empty($quantidade)) {
2501 2501
             $texto = $quantidade;
2502 2502
             $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2503 2503
             $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, '');
2504 2504
         }
2505 2505
         //ESPÉCIE
2506
-        $x     += $w1;
2506
+        $x += $w1;
2507 2507
         $w2    = round($maxW * 0.17, 0);
2508 2508
         $texto = 'ESPÉCIE';
2509 2509
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2512,16 +2512,16 @@  discard block
 block discarded – undo
2512 2512
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2513 2513
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2514 2514
         //MARCA
2515
-        $x     += $w2;
2515
+        $x += $w2;
2516 2516
         $texto = 'MARCA';
2517 2517
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2518 2518
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2519
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2519
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2520 2520
             $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2521 2521
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2522 2522
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2523 2523
         //NUMERAÇÃO
2524
-        $x     += $w2;
2524
+        $x += $w2;
2525 2525
         $texto = 'NUMERAÇÃO';
2526 2526
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2527 2527
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2529,7 +2529,7 @@  discard block
 block discarded – undo
2529 2529
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2530 2530
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2531 2531
         //PESO BRUTO
2532
-        $x     += $w2;
2532
+        $x += $w2;
2533 2533
         $w3    = round($maxW * 0.20, 0);
2534 2534
         $texto = 'PESO BRUTO';
2535 2535
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2542,7 +2542,7 @@  discard block
 block discarded – undo
2542 2542
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2543 2543
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2544 2544
         //PESO LÍQUIDO
2545
-        $x     += $w3;
2545
+        $x += $w3;
2546 2546
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2547 2547
         $texto = 'PESO LÍQUIDO';
2548 2548
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2562,11 +2562,11 @@  discard block
 block discarded – undo
2562 2562
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2563 2563
     {
2564 2564
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
2565
-        if (! isset($valor_original)) {
2565
+        if (!isset($valor_original)) {
2566 2566
             return "";
2567 2567
         }
2568 2568
         $valor_original = $valor_original->nodeValue;
2569
-        $valor          = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2569
+        $valor          = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2570 2570
 
2571 2571
         if ($valor != "") {
2572 2572
             return sprintf($formato, $valor);
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
         $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0);
2593 2593
         $impostos   = '';
2594 2594
 
2595
-        if (! empty($ICMS)) {
2595
+        if (!empty($ICMS)) {
2596 2596
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s");
2597 2597
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%");
2598 2598
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s");
@@ -2608,7 +2608,7 @@  discard block
 block discarded – undo
2608 2608
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s");
2609 2609
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s");
2610 2610
         }
2611
-        if (! empty($ICMSUFDest)) {
2611
+        if (!empty($ICMSUFDest)) {
2612 2612
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%");
2613 2613
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%");
2614 2614
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%");
@@ -2616,20 +2616,20 @@  discard block
 block discarded – undo
2616 2616
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2617 2617
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2618 2618
         }
2619
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2619
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2620 2620
             ? substr(
2621 2621
                 $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2622 2622
                 0,
2623 2623
                 500
2624 2624
             )
2625 2625
             : '';
2626
-        if (! empty($infAdProd)) {
2626
+        if (!empty($infAdProd)) {
2627 2627
             $infAdProd = trim($infAdProd);
2628 2628
             $infAdProd .= ' ';
2629 2629
         }
2630 2630
         $loteTxt = '';
2631 2631
         $rastro  = $prod->getElementsByTagName("med");
2632
-        if (! empty($prod->getElementsByTagName("rastro"))) {
2632
+        if (!empty($prod->getElementsByTagName("rastro"))) {
2633 2633
             $rastro = $prod->getElementsByTagName("rastro");
2634 2634
             $i      = 0;
2635 2635
             while ($i < $rastro->length) {
@@ -2638,14 +2638,14 @@  discard block
 block discarded – undo
2638 2638
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dFab', ' Fab: ');
2639 2639
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dVal', ' Val: ');
2640 2640
                 $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: ');
2641
-                $i ++;
2641
+                $i++;
2642 2642
             }
2643 2643
             if ($loteTxt != '') {
2644 2644
                 $loteTxt .= ' ';
2645 2645
             }
2646 2646
         }
2647 2647
         //NT2013.006 FCI
2648
-        $nFCI   = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2648
+        $nFCI   = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2649 2649
             ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2650 2650
         $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2651 2651
         $texto  = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
@@ -2695,7 +2695,7 @@  discard block
 block discarded – undo
2695 2695
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2696 2696
         $y += 3;
2697 2697
         //desenha a caixa dos dados dos itens da NF
2698
-        $hmax  += 1;
2698
+        $hmax += 1;
2699 2699
         $texto = '';
2700 2700
         $this->pdf->textBox($x, $y, $w, $hmax);
2701 2701
         //##################################################################################
@@ -2708,101 +2708,101 @@  discard block
 block discarded – undo
2708 2708
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2709 2709
         $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2710 2710
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2711
-        $x     += $w1;
2711
+        $x += $w1;
2712 2712
         $w2    = round($w * 0.25, 0);
2713 2713
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2714 2714
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2715 2715
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2716 2716
         $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2717 2717
         //NCM/SH
2718
-        $x     += $w2;
2718
+        $x += $w2;
2719 2719
         $w3    = round($w * 0.06, 0);
2720 2720
         $texto = 'NCM/SH';
2721 2721
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2722 2722
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2723 2723
         $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2724 2724
         //O/CST ou O/CSOSN
2725
-        $x     += $w3;
2725
+        $x += $w3;
2726 2726
         $w4    = round($w * 0.05, 0);
2727 2727
         $texto = 'O/CST'; // CRT = 2 ou CRT = 3
2728 2728
         if ($this->getTagValue($this->emit, 'CRT') == '1') {
2729
-            $texto = 'O/CSOSN';//Regime do Simples CRT = 1
2729
+            $texto = 'O/CSOSN'; //Regime do Simples CRT = 1
2730 2730
         }
2731 2731
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2732 2732
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2733 2733
         $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2734 2734
         //CFOP
2735
-        $x     += $w4;
2735
+        $x += $w4;
2736 2736
         $w5    = round($w * 0.04, 0);
2737 2737
         $texto = 'CFOP';
2738 2738
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2739 2739
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2740 2740
         $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2741 2741
         //UN
2742
-        $x     += $w5;
2742
+        $x += $w5;
2743 2743
         $w6    = round($w * 0.03, 0);
2744 2744
         $texto = 'UN';
2745 2745
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2746 2746
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2747 2747
         $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2748 2748
         //QUANT
2749
-        $x     += $w6;
2749
+        $x += $w6;
2750 2750
         $w7    = round($w * 0.08, 0);
2751 2751
         $texto = 'QUANT';
2752 2752
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2753 2753
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2754 2754
         $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2755 2755
         //VALOR UNIT
2756
-        $x     += $w7;
2756
+        $x += $w7;
2757 2757
         $w8    = round($w * 0.06, 0);
2758 2758
         $texto = 'VALOR UNIT';
2759 2759
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2760 2760
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2761 2761
         $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2762 2762
         //VALOR TOTAL
2763
-        $x     += $w8;
2763
+        $x += $w8;
2764 2764
         $w9    = round($w * 0.06, 0);
2765 2765
         $texto = 'VALOR TOTAL';
2766 2766
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2767 2767
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2768 2768
         $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2769 2769
         //VALOR DESCONTO
2770
-        $x     += $w9;
2770
+        $x += $w9;
2771 2771
         $w10   = round($w * 0.05, 0);
2772 2772
         $texto = 'VALOR DESC';
2773 2773
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2774 2774
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2775 2775
         $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2776 2776
         //B.CÁLC ICMS
2777
-        $x     += $w10;
2777
+        $x += $w10;
2778 2778
         $w11   = round($w * 0.06, 0);
2779 2779
         $texto = 'B.CÁLC ICMS';
2780 2780
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2781 2781
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2782 2782
         $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2783 2783
         //VALOR ICMS
2784
-        $x     += $w11;
2784
+        $x += $w11;
2785 2785
         $w12   = round($w * 0.06, 0);
2786 2786
         $texto = 'VALOR ICMS';
2787 2787
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2788 2788
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2789 2789
         $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2790 2790
         //VALOR IPI
2791
-        $x     += $w12;
2791
+        $x += $w12;
2792 2792
         $w13   = round($w * 0.05, 0);
2793 2793
         $texto = 'VALOR IPI';
2794 2794
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2795 2795
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2796 2796
         $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2797 2797
         //ALÍQ. ICMS
2798
-        $x     += $w13;
2798
+        $x += $w13;
2799 2799
         $w14   = round($w * 0.04, 0);
2800 2800
         $texto = 'ALÍQ. ICMS';
2801 2801
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2802 2802
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2803 2803
         $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2804 2804
         //ALÍQ. IPI
2805
-        $x     += $w14;
2805
+        $x += $w14;
2806 2806
         $w15   = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2807 2807
         $texto = 'ALÍQ. IPI';
2808 2808
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
@@ -2847,7 +2847,7 @@  discard block
 block discarded – undo
2847 2847
                 // Informação sobre unidade de medida tributavel.
2848 2848
                 // Se não for para exibir a unidade de medida tributavel, então
2849 2849
                 // A Escrita irá começar em 0.
2850
-                if (! $mostrarUnidadeTributavel) {
2850
+                if (!$mostrarUnidadeTributavel) {
2851 2851
                     $yTrib = 0;
2852 2852
                 }
2853 2853
                 $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel);
@@ -2882,7 +2882,7 @@  discard block
 block discarded – undo
2882 2882
                 }
2883 2883
                 $x += $w2;
2884 2884
                 //NCM
2885
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2885
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2886 2886
                     $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2887 2887
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2888 2888
                 $x += $w3;
@@ -2895,11 +2895,11 @@  discard block
 block discarded – undo
2895 2895
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2896 2896
                 }
2897 2897
                 //CFOP
2898
-                $x     += $w4;
2898
+                $x += $w4;
2899 2899
                 $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue;
2900 2900
                 $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, '');
2901 2901
                 //Unidade
2902
-                $x     += $w5;
2902
+                $x += $w5;
2903 2903
                 $texto = $uCom;
2904 2904
                 $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, '');
2905 2905
                 //Unidade de medida tributável
@@ -2920,7 +2920,7 @@  discard block
 block discarded – undo
2920 2920
                 // QTDADE Tributável
2921 2921
                 if ($mostrarUnidadeTributavel) {
2922 2922
                     $qTrib = $prod->getElementsByTagName("qTrib")->item(0);
2923
-                    if (! empty($qTrib)) {
2923
+                    if (!empty($qTrib)) {
2924 2924
                         $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", ".");
2925 2925
                         $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2926 2926
                     }
@@ -2933,7 +2933,7 @@  discard block
 block discarded – undo
2933 2933
                 // Valor Unitário Tributável
2934 2934
                 if ($mostrarUnidadeTributavel) {
2935 2935
                     $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0);
2936
-                    if (! empty($vUnTrib)) {
2936
+                    if (!empty($vUnTrib)) {
2937 2937
                         $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", ".");
2938 2938
                         $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2939 2939
                     }
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
                 $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2948 2948
                 $x += $w9;
2949 2949
                 //Valor do Desconto
2950
-                $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2950
+                $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2951 2951
                     ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0;
2952 2952
 
2953 2953
                 $texto = number_format($vdesc, 2, ",", ".");
@@ -2955,7 +2955,7 @@  discard block
 block discarded – undo
2955 2955
                 //Valor da Base de calculo
2956 2956
                 $x += $w10;
2957 2957
                 if (isset($ICMS)) {
2958
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2958
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2959 2959
                         ? number_format(
2960 2960
                             $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
2961 2961
                             2,
@@ -2968,7 +2968,7 @@  discard block
 block discarded – undo
2968 2968
                 //Valor do ICMS
2969 2969
                 $x += $w11;
2970 2970
                 if (isset($ICMS)) {
2971
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2971
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2972 2972
                         ? number_format(
2973 2973
                             $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
2974 2974
                             2,
@@ -2981,7 +2981,7 @@  discard block
 block discarded – undo
2981 2981
                 //Valor do IPI
2982 2982
                 $x += $w12;
2983 2983
                 if (isset($IPI)) {
2984
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2984
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2985 2985
                         ? number_format(
2986 2986
                             $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
2987 2987
                             2,
@@ -2996,7 +2996,7 @@  discard block
 block discarded – undo
2996 2996
                 // %ICMS
2997 2997
                 $x += $w13;
2998 2998
                 if (isset($ICMS)) {
2999
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2999
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
3000 3000
                         ? number_format(
3001 3001
                             $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
3002 3002
                             2,
@@ -3009,7 +3009,7 @@  discard block
 block discarded – undo
3009 3009
                 //%IPI
3010 3010
                 $x += $w14;
3011 3011
                 if (isset($IPI)) {
3012
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3012
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3013 3013
                         ? number_format(
3014 3014
                             $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
3015 3015
                             2,
@@ -3027,17 +3027,17 @@  discard block
 block discarded – undo
3027 3027
                 $veicProd = $prod->getElementsByTagName("veicProd")->item(0);
3028 3028
                 // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran
3029 3029
                 // Verifica se a Tag existe
3030
-                if (! empty($veicProd)) {
3030
+                if (!empty($veicProd)) {
3031 3031
                     $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod);
3032 3032
                 }
3033 3033
 
3034 3034
 
3035 3035
                 $y += $h;
3036
-                $i ++;
3036
+                $i++;
3037 3037
                 //incrementa o controle dos itens processados.
3038
-                $this->qtdeItensProc ++;
3038
+                $this->qtdeItensProc++;
3039 3039
             } else {
3040
-                $i ++;
3040
+                $i++;
3041 3041
             }
3042 3042
         }
3043 3043
 
@@ -3242,23 +3242,23 @@  discard block
 block discarded – undo
3242 3242
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
3243 3243
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3244 3244
         //INSCRIÇÃO MUNICIPAL
3245
-        $y     += 3;
3245
+        $y += 3;
3246 3246
         $w     = round($this->wPrint * 0.23, 0);
3247 3247
         $texto = 'INSCRIÇÃO MUNICIPAL';
3248 3248
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3249 3249
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3250 3250
         //inscrição municipal
3251
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3251
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3252 3252
             $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3253 3253
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3254 3254
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
3255 3255
         //VALOR TOTAL DOS SERVIÇOS
3256
-        $x     += $w;
3256
+        $x += $w;
3257 3257
         $texto = 'VALOR TOTAL DOS SERVIÇOS';
3258 3258
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3259 3259
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3260 3260
         if (isset($this->ISSQNtot)) {
3261
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3261
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3262 3262
                 $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3263 3263
             $texto = number_format($texto, 2, ",", ".");
3264 3264
         } else {
@@ -3267,14 +3267,14 @@  discard block
 block discarded – undo
3267 3267
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3268 3268
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3269 3269
         //BASE DE CÁLCULO DO ISSQN
3270
-        $x     += $w;
3270
+        $x += $w;
3271 3271
         $texto = 'BASE DE CÁLCULO DO ISSQN';
3272 3272
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3273 3273
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3274 3274
         if (isset($this->ISSQNtot)) {
3275
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3275
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3276 3276
                 $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3277
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3277
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3278 3278
         } else {
3279 3279
             $texto = '';
3280 3280
         }
@@ -3291,9 +3291,9 @@  discard block
 block discarded – undo
3291 3291
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3292 3292
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3293 3293
         if (isset($this->ISSQNtot)) {
3294
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3294
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3295 3295
                 $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3296
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3296
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3297 3297
         } else {
3298 3298
             $texto = '';
3299 3299
         }
@@ -3332,7 +3332,7 @@  discard block
 block discarded – undo
3332 3332
 
3333 3333
         //INFORMAÇÕES COMPLEMENTARES
3334 3334
         $texto = "INFORMAÇÕES COMPLEMENTARES";
3335
-        $y     += 3;
3335
+        $y += 3;
3336 3336
         $w     = $this->wAdic;
3337 3337
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B'];
3338 3338
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -3342,7 +3342,7 @@  discard block
 block discarded – undo
3342 3342
         //$this->textoAdic com o texto completo do campo
3343 3343
         //echo str_replace("\n", "<br>",$this->textoAdic);
3344 3344
         //die;
3345
-        $y     += 1;
3345
+        $y += 1;
3346 3346
         $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => ''];
3347 3347
         //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>''];
3348 3348
         $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
@@ -3393,7 +3393,7 @@  discard block
 block discarded – undo
3393 3393
                 $texto = 'CONTINGÊNCIA SVC-RS' . $dhCont . $xJust;
3394 3394
                 break;
3395 3395
         }
3396
-        $y     += 2;
3396
+        $y += 2;
3397 3397
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
3398 3398
         $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false);
3399 3399
 
@@ -3448,7 +3448,7 @@  discard block
 block discarded – undo
3448 3448
         $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
3449 3449
         if ($tpNF == '0') {
3450 3450
             //NFe de Entrada
3451
-            $emitente     = '';
3451
+            $emitente = '';
3452 3452
             $emitente     .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - ";
3453 3453
             $emitente     .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", ";
3454 3454
             $emitente     .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - ";
@@ -3501,10 +3501,10 @@  discard block
 block discarded – undo
3501 3501
             $texto .= "AO LADO";
3502 3502
         }
3503 3503
         $texto .= ". EMISSÃO: ";
3504
-        $dEmi  = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3504
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3505 3505
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3506 3506
         if ($dEmi == '') {
3507
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3507
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3508 3508
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3509 3509
             $aDemi = explode('T', $dEmi);
3510 3510
             $dEmi  = $aDemi[0];
@@ -3527,12 +3527,12 @@  discard block
 block discarded – undo
3527 3527
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3528 3528
             //DATA DE RECEBIMENTO
3529 3529
             $texto = "DATA DE RECEBIMENTO";
3530
-            $y     += $h;
3530
+            $y += $h;
3531 3531
             $w2    = round($this->wPrint * 0.17, 0); //35;
3532 3532
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3533 3533
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3534 3534
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3535
-            $x     += $w2;
3535
+            $x += $w2;
3536 3536
             $w3    = $w - $w2;
3537 3537
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3538 3538
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3543,7 +3543,7 @@  discard block
 block discarded – undo
3543 3543
 
3544 3544
             return $y;
3545 3545
         } else {
3546
-            $x --;
3546
+            $x--;
3547 3547
             $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3548 3548
             //NUMERO DA NOTA FISCAL LOGO NFE
3549 3549
             $w1    = 18;
@@ -3564,7 +3564,7 @@  discard block
 block discarded – undo
3564 3564
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3565 3565
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3566 3566
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3567
-            $y     -= $w2;
3567
+            $y -= $w2;
3568 3568
             $w3    = $w - $w2;
3569 3569
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3570 3570
             $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => ''];
@@ -3585,18 +3585,18 @@  discard block
 block discarded – undo
3585 3585
      */
3586 3586
     protected function geraInformacoesDaTagCompra()
3587 3587
     {
3588
-        if (! $this->gerarInformacoesAutomaticas) {
3588
+        if (!$this->gerarInformacoesAutomaticas) {
3589 3589
             return '';
3590 3590
         }
3591 3591
         $saida = "";
3592 3592
         if (isset($this->compra)) {
3593
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3593
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3594 3594
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3595 3595
             }
3596
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3596
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3597 3597
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3598 3598
             }
3599
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3599
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3600 3600
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3601 3601
             }
3602 3602
         }
@@ -3627,10 +3627,10 @@  discard block
 block discarded – undo
3627 3627
         if ($icmss > 0) {
3628 3628
             $icmss = 1;
3629 3629
         }
3630
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3630
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3631 3631
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3632 3632
         if ($dEmi == '') {
3633
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3633
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3634 3634
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3635 3635
             $aDemi = explode('T', $dEmi);
3636 3636
             $dEmi  = $aDemi[0];
@@ -3654,7 +3654,7 @@  discard block
 block discarded – undo
3654 3654
      */
3655 3655
     protected function geraInformacoesDasNotasReferenciadas()
3656 3656
     {
3657
-        if (! $this->gerarInformacoesAutomaticas) {
3657
+        if (!$this->gerarInformacoesAutomaticas) {
3658 3658
             return '';
3659 3659
         }
3660 3660
         $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]";
@@ -3682,7 +3682,7 @@  discard block
 block discarded – undo
3682 3682
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3683 3683
                 $serie         = substr($chave_acesso, 22, 3);
3684 3684
                 $numero        = substr($chave_acesso, 25, 9);
3685
-                $saida         .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3685
+                $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3686 3686
             }
3687 3687
             $refNF = $nfRef->getElementsByTagName('refNF');
3688 3688
             foreach ($refNF as $umaRefNFe) {
@@ -3693,7 +3693,7 @@  discard block
 block discarded – undo
3693 3693
                 $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue;
3694 3694
                 $data   = substr($data, 2, 2) . "/20" . substr($data, 0, 2);
3695 3695
                 $cnpj   = $this->formatField($cnpj, "##.###.###/####-##");
3696
-                $saida  .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3696
+                $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3697 3697
             }
3698 3698
             $refCTe = $nfRef->getElementsByTagName('refCTe');
3699 3699
             foreach ($refCTe as $chave_acessoRef) {
@@ -3703,7 +3703,7 @@  discard block
 block discarded – undo
3703 3703
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3704 3704
                 $serie         = substr($chave_acesso, 22, 3);
3705 3705
                 $numero        = substr($chave_acesso, 25, 9);
3706
-                $saida         .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3706
+                $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3707 3707
             }
3708 3708
             $refECF = $nfRef->getElementsByTagName('refECF');
3709 3709
             foreach ($refECF as $umaRefNFe) {
@@ -3715,10 +3715,9 @@  discard block
 block discarded – undo
3715 3715
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3716 3716
             foreach ($refNFP as $umaRefNFe) {
3717 3717
                 $data   = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3718
-                $cnpj   = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3719
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3720
-                    '';
3721
-                $cpf    = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3718
+                $cnpj   = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3719
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3720
+                $cpf    = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3722 3721
                     $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3723 3722
                 $mod    = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3724 3723
                 $serie  = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
@@ -3740,7 +3739,7 @@  discard block
 block discarded – undo
3740 3739
     private function loadDoc($xml)
3741 3740
     {
3742 3741
         $this->xml = $xml;
3743
-        if (! empty($xml)) {
3742
+        if (!empty($xml)) {
3744 3743
             $this->dom = new Dom();
3745 3744
             $this->dom->loadXML($this->xml);
3746 3745
             if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) {
@@ -3794,7 +3793,7 @@  discard block
 block discarded – undo
3794 3793
         $numlinhas    = $this->pdf->getNumLines($textoProduto, $w2, $aFont);
3795 3794
 
3796 3795
         if ($mostrarUnidadeTributavel && $numlinhas == 1) {
3797
-            $numlinhas ++;
3796
+            $numlinhas++;
3798 3797
         }
3799 3798
 
3800 3799
         return round(($numlinhas * $this->pdf->fontSize) + ($numlinhas * 0.5), 2);
Please login to merge, or discard this patch.