Completed
Pull Request — master (#433)
by
unknown
02:57
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' && ($cStat == '101' || $cStat == '151' || $cStat == '135' || $cStat == '155')) {
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 
885 885
     protected function notaDPEC()
886 886
     {
887
-        return ! empty($this->numdepec);
887
+        return !empty($this->numdepec);
888 888
     }
889 889
 
890 890
     /**
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
         //se for right separa 2/3 para os dados e o terço seguinte para o logo
934 934
         //se não houver logo centraliza dos dados do emitente
935 935
         // coloca o logo
936
-        if (! empty($this->logomarca)) {
936
+        if (!empty($this->logomarca)) {
937 937
             $logoInfo = getimagesize($this->logomarca);
938 938
             //largura da imagem em mm
939 939
             $logoWmm = ($logoInfo[0] / 72) * 25.4;
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
             //endereço
990 990
             $y1     = $y1 + 5;
991 991
             $aFont  = ['font' => $this->fontePadrao, 'size' => 8, 'style' => ''];
992
-            $fone   = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
992
+            $fone   = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
993 993
                 ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
994 994
                 : '';
995 995
             $lgr    = $this->getTagValue($this->enderEmit, "xLgr");
@@ -1008,8 +1008,8 @@  discard block
 block discarded – undo
1008 1008
 
1009 1009
         //####################################################################################
1010 1010
         //coluna central Danfe
1011
-        $x  += $w;
1012
-        $w  = round($maxW * 0.17, 0);//35;
1011
+        $x += $w;
1012
+        $w  = round($maxW * 0.17, 0); //35;
1013 1013
         $w2 = $w;
1014 1014
         $h  = 32;
1015 1015
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1066,8 +1066,8 @@  discard block
 block discarded – undo
1066 1066
 
1067 1067
         //####################################################################################
1068 1068
         //coluna codigo de barras
1069
-        $x  += $w;
1070
-        $w  = ($maxW - $w1 - $w2);//85;
1069
+        $x += $w;
1070
+        $w  = ($maxW - $w1 - $w2); //85;
1071 1071
         $w3 = $w;
1072 1072
         $h  = 32;
1073 1073
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
         } else {
1098 1098
             $cabecalhoProtoAutorizacao = 'PROTOCOLO DE AUTORIZAÇÃO DE USO';
1099 1099
         }
1100
-        if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) {
1100
+        if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) {
1101 1101
             $cabecalhoProtoAutorizacao = "DADOS DA NF-E";
1102 1102
             $chaveContingencia         = $this->geraChaveAdicionalDeContingencia();
1103 1103
             $this->pdf->setFillColor(0, 0, 0);
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1130 1130
         $w     = $w1 + $w2;
1131 1131
         $y     = $oldY;
1132
-        $oldY  += $h;
1132
+        $oldY += $h;
1133 1133
         $x     = $oldX;
1134 1134
         $h     = 7;
1135 1135
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
         // NOTA : DANFE sem protocolo deve existir somente no caso de contingência !!!
1147 1147
         // Além disso, existem várias NFes em contingência que eu recebo com protocolo de autorização.
1148 1148
         // Na minha opinião, deveríamos mostra-lo, mas o  manual  da NFe v4.01 diz outra coisa...
1149
-        if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) {
1149
+        if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) {
1150 1150
             $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => 'B'];
1151 1151
             $texto = $this->formatField(
1152 1152
                 $chaveContingencia,
@@ -1160,7 +1160,7 @@  discard block
 block discarded – undo
1160 1160
                 $cStat = '';
1161 1161
             } else {
1162 1162
                 if (isset($this->nfeProc)) {
1163
-                    $texto  = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1163
+                    $texto  = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1164 1164
                         ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1165 1165
                         : '';
1166 1166
                     $tsHora = $this->toTimestamp(
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1191 1191
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1192 1192
         //INSCRIÇÃO MUNICIPAL
1193
-        $x     += $w;
1193
+        $x += $w;
1194 1194
         $texto = 'INSCRIÇÃO MUNICIPAL';
1195 1195
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1196 1196
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1198,29 +1198,29 @@  discard block
 block discarded – undo
1198 1198
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1199 1199
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1200 1200
         //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.
1201
-        $x     += $w;
1201
+        $x += $w;
1202 1202
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1203 1203
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1204 1204
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1205
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1205
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1206 1206
             ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1207 1207
             : '';
1208 1208
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1209 1209
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1210 1210
         //CNPJ
1211
-        $x     += $w;
1211
+        $x += $w;
1212 1212
         $w     = ($maxW - (3 * $w));
1213 1213
         $texto = 'CNPJ';
1214 1214
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1215 1215
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1216 1216
         //Pegando valor do CPF/CNPJ
1217
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1217
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1218 1218
             $texto = $this->formatField(
1219 1219
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1220 1220
                 "###.###.###/####-##"
1221 1221
             );
1222 1222
         } else {
1223
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1223
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1224 1224
                 ? $this->formatField(
1225 1225
                     $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1226 1226
                     "###.###.###-##"
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
             $n = count($resp['message']);
1240 1240
             $alttot = $n * 15;
1241 1241
             $x = 10;
1242
-            $y = $this->hPrint/2 - $alttot/2;
1242
+            $y = $this->hPrint / 2 - $alttot / 2;
1243 1243
             $h = 15;
1244 1244
             $w = $maxW - (2 * $x);
1245 1245
             $this->pdf->settextcolor(90, 90, 90);
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
         //NOME / RAZÃO SOCIAL
1313 1313
         $w     = round($maxW * 0.61, 0);
1314 1314
         $w1    = $w;
1315
-        $y     += 3;
1315
+        $y += 3;
1316 1316
         $texto = 'NOME / RAZÃO SOCIAL';
1317 1317
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1318 1318
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1324,20 +1324,20 @@  discard block
 block discarded – undo
1324 1324
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1325 1325
         }
1326 1326
         //CNPJ / CPF
1327
-        $x     += $w;
1327
+        $x += $w;
1328 1328
         $w     = round($maxW * 0.23, 0);
1329 1329
         $w2    = $w;
1330 1330
         $texto = 'CNPJ / CPF';
1331 1331
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1332 1332
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1333 1333
         //Pegando valor do CPF/CNPJ
1334
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1334
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1335 1335
             $texto = $this->formatField(
1336 1336
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1337 1337
                 "###.###.###/####-##"
1338 1338
             );
1339 1339
         } else {
1340
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1340
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1341 1341
                 ? $this->formatField(
1342 1342
                     $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1343 1343
                     "###.###.###-##"
@@ -1347,17 +1347,17 @@  discard block
 block discarded – undo
1347 1347
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1348 1348
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1349 1349
         //DATA DA EMISSÃO
1350
-        $x     += $w;
1350
+        $x += $w;
1351 1351
         $w     = $maxW - ($w1 + $w2);
1352 1352
         $wx    = $w;
1353 1353
         $texto = 'DATA DA EMISSÃO';
1354 1354
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1355 1355
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1356
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1356
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1357 1357
             ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1358 1358
             : '';
1359 1359
         if ($dEmi == '') {
1360
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1360
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1361 1361
                 ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1362 1362
                 : '';
1363 1363
             $aDemi = explode('T', $dEmi);
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
         //ENDEREÇO
1374 1374
         $w     = round($maxW * 0.47, 0);
1375 1375
         $w1    = $w;
1376
-        $y     += $h;
1376
+        $y += $h;
1377 1377
         $x     = $oldX;
1378 1378
         $texto = 'ENDEREÇO';
1379 1379
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1386 1386
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1387 1387
         //BAIRRO / DISTRITO
1388
-        $x     += $w;
1388
+        $x += $w;
1389 1389
         $w     = round($maxW * 0.21, 0);
1390 1390
         $w2    = $w;
1391 1391
         $texto = 'BAIRRO / DISTRITO';
@@ -1395,29 +1395,29 @@  discard block
 block discarded – undo
1395 1395
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1396 1396
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1397 1397
         //CEP
1398
-        $x     += $w;
1398
+        $x += $w;
1399 1399
         $w     = $maxW - $w1 - $w2 - $wx;
1400 1400
         $w2    = $w;
1401 1401
         $texto = 'CEP';
1402 1402
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1403 1403
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1404
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1404
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1405 1405
             ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1406 1406
             : '';
1407 1407
         $texto = $this->formatField($texto, "#####-###");
1408 1408
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1409 1409
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1410 1410
         //DATA DA SAÍDA
1411
-        $x     += $w;
1411
+        $x += $w;
1412 1412
         $w     = $wx;
1413 1413
         $texto = 'DATA DA SAÍDA/ENTRADA';
1414 1414
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1415 1415
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1416
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1416
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1417 1417
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1418 1418
             : '';
1419 1419
         if ($dSaiEnt == '') {
1420
-            $dSaiEnt  = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1420
+            $dSaiEnt  = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1421 1421
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1422 1422
                 : '';
1423 1423
             $aDsaient = explode('T', $dSaiEnt);
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1429 1429
         //MUNICÍPIO
1430 1430
         $w     = $w1;
1431
-        $y     += $h;
1431
+        $y += $h;
1432 1432
         $x     = $oldX;
1433 1433
         $texto = 'MUNICÍPIO';
1434 1434
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1443 1443
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1444 1444
         //UF
1445
-        $x     += $w;
1445
+        $x += $w;
1446 1446
         $w     = 8;
1447 1447
         $texto = 'UF';
1448 1448
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1451,19 +1451,19 @@  discard block
 block discarded – undo
1451 1451
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1452 1452
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1453 1453
         //FONE / FAX
1454
-        $x     += $w;
1454
+        $x += $w;
1455 1455
         $w     = round(($maxW - $w1 - $wx - 8) / 2, 0);
1456 1456
         $w3    = $w;
1457 1457
         $texto = 'FONE / FAX';
1458 1458
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1459 1459
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1460
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1460
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1461 1461
             ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1462 1462
             : '';
1463 1463
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1464 1464
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1465 1465
         //INSCRIÇÃO ESTADUAL
1466
-        $x     += $w;
1466
+        $x += $w;
1467 1467
         $w     = $maxW - $w1 - $wx - 8 - $w3;
1468 1468
         $texto = 'INSCRIÇÃO ESTADUAL';
1469 1469
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1473,16 +1473,16 @@  discard block
 block discarded – undo
1473 1473
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1474 1474
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1475 1475
         //HORA DA SAÍDA
1476
-        $x     += $w;
1476
+        $x += $w;
1477 1477
         $w     = $wx;
1478 1478
         $texto = 'HORA DA SAÍDA/ENTRADA';
1479 1479
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1480 1480
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1481
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1481
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1482 1482
             ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1483 1483
             : '';
1484 1484
         if ($hSaiEnt == '') {
1485
-            $dhSaiEnt   = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1485
+            $dhSaiEnt   = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1486 1486
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1487 1487
                 : '';
1488 1488
             $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt);
@@ -1526,7 +1526,7 @@  discard block
 block discarded – undo
1526 1526
         //NOME / RAZÃO SOCIAL
1527 1527
         $w     = round($maxW * 0.61, 0);
1528 1528
         $w1    = $w;
1529
-        $y     += 3;
1529
+        $y += 3;
1530 1530
         $texto = 'NOME / RAZÃO SOCIAL';
1531 1531
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1532 1532
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1541,20 +1541,20 @@  discard block
 block discarded – undo
1541 1541
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1542 1542
         }
1543 1543
         //CNPJ / CPF
1544
-        $x     += $w;
1544
+        $x += $w;
1545 1545
         $w     = round($maxW * 0.23, 0);
1546 1546
         $w2    = $w;
1547 1547
         $texto = 'CNPJ / CPF';
1548 1548
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1549 1549
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1550 1550
         //Pegando valor do CPF/CNPJ
1551
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1551
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1552 1552
             $texto = $this->formatField(
1553 1553
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1554 1554
                 "###.###.###/####-##"
1555 1555
             );
1556 1556
         } else {
1557
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1557
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1558 1558
                 $this->formatField(
1559 1559
                     $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1560 1560
                     "###.###.###-##"
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1564 1564
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1565 1565
         //INSCRIÇÃO ESTADUAL
1566
-        $x     += $w;
1566
+        $x += $w;
1567 1567
         $w     = $maxW - ($w1 + $w2);
1568 1568
         $wx    = $w;
1569 1569
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1582,7 +1582,7 @@  discard block
 block discarded – undo
1582 1582
         //ENDEREÇO
1583 1583
         $w     = round($maxW * 0.355, 0) + $wx;
1584 1584
         $w1    = $w;
1585
-        $y     += $h;
1585
+        $y += $h;
1586 1586
         $x     = $oldX;
1587 1587
         $texto = 'ENDEREÇO';
1588 1588
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1593,7 +1593,7 @@  discard block
 block discarded – undo
1593 1593
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1594 1594
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1595 1595
         //BAIRRO / DISTRITO
1596
-        $x     += $w;
1596
+        $x += $w;
1597 1597
         $w     = round($maxW * 0.335, 0);
1598 1598
         $w2    = $w;
1599 1599
         $texto = 'BAIRRO / DISTRITO';
@@ -1603,12 +1603,12 @@  discard block
 block discarded – undo
1603 1603
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1604 1604
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1605 1605
         //CEP
1606
-        $x     += $w;
1606
+        $x += $w;
1607 1607
         $w     = $maxW - ($w1 + $w2);
1608 1608
         $texto = 'CEP';
1609 1609
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1610 1610
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1611
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1611
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1612 1612
             $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1613 1613
         $texto = $this->formatField($texto, "#####-###");
1614 1614
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
         //MUNICÍPIO
1617 1617
         $w     = round($maxW * 0.805, 0);
1618 1618
         $w1    = $w;
1619
-        $y     += $h;
1619
+        $y += $h;
1620 1620
         $x     = $oldX;
1621 1621
         $texto = 'MUNICÍPIO';
1622 1622
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1629 1629
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1630 1630
         //UF
1631
-        $x     += $w;
1631
+        $x += $w;
1632 1632
         $w     = 8;
1633 1633
         $texto = 'UF';
1634 1634
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1637,12 +1637,12 @@  discard block
 block discarded – undo
1637 1637
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1638 1638
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1639 1639
         //FONE / FAX
1640
-        $x     += $w;
1640
+        $x += $w;
1641 1641
         $w     = $maxW - $w - $w1;
1642 1642
         $texto = 'FONE / FAX';
1643 1643
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1644 1644
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1645
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1645
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1646 1646
             $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1647 1647
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1648 1648
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1679,7 +1679,7 @@  discard block
 block discarded – undo
1679 1679
         //NOME / RAZÃO SOCIAL
1680 1680
         $w     = round($maxW * 0.61, 0);
1681 1681
         $w1    = $w;
1682
-        $y     += 3;
1682
+        $y += 3;
1683 1683
         $texto = 'NOME / RAZÃO SOCIAL';
1684 1684
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1685 1685
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1694,20 +1694,20 @@  discard block
 block discarded – undo
1694 1694
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1695 1695
         }
1696 1696
         //CNPJ / CPF
1697
-        $x     += $w;
1697
+        $x += $w;
1698 1698
         $w     = round($maxW * 0.23, 0);
1699 1699
         $w2    = $w;
1700 1700
         $texto = 'CNPJ / CPF';
1701 1701
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1702 1702
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1703 1703
         //Pegando valor do CPF/CNPJ
1704
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1704
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1705 1705
             $texto = $this->formatField(
1706 1706
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1707 1707
                 "###.###.###/####-##"
1708 1708
             );
1709 1709
         } else {
1710
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1710
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1711 1711
                 $this->formatField(
1712 1712
                     $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1713 1713
                     "###.###.###-##"
@@ -1716,7 +1716,7 @@  discard block
 block discarded – undo
1716 1716
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1717 1717
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1718 1718
         //INSCRIÇÃO ESTADUAL
1719
-        $x     += $w;
1719
+        $x += $w;
1720 1720
         $w     = $maxW - ($w1 + $w2);
1721 1721
         $wx    = $w;
1722 1722
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1735,7 +1735,7 @@  discard block
 block discarded – undo
1735 1735
         //ENDEREÇO
1736 1736
         $w     = round($maxW * 0.355, 0) + $wx;
1737 1737
         $w1    = $w;
1738
-        $y     += $h;
1738
+        $y += $h;
1739 1739
         $x     = $oldX;
1740 1740
         $texto = 'ENDEREÇO';
1741 1741
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1746,7 +1746,7 @@  discard block
 block discarded – undo
1746 1746
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1747 1747
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1748 1748
         //BAIRRO / DISTRITO
1749
-        $x     += $w;
1749
+        $x += $w;
1750 1750
         $w     = round($maxW * 0.335, 0);
1751 1751
         $w2    = $w;
1752 1752
         $texto = 'BAIRRO / DISTRITO';
@@ -1756,12 +1756,12 @@  discard block
 block discarded – undo
1756 1756
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1757 1757
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1758 1758
         //CEP
1759
-        $x     += $w;
1759
+        $x += $w;
1760 1760
         $w     = $maxW - ($w1 + $w2);
1761 1761
         $texto = 'CEP';
1762 1762
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1763 1763
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1764
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1764
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1765 1765
             $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1766 1766
         $texto = $this->formatField($texto, "#####-###");
1767 1767
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
         //MUNICÍPIO
1770 1770
         $w     = round($maxW * 0.805, 0);
1771 1771
         $w1    = $w;
1772
-        $y     += $h;
1772
+        $y += $h;
1773 1773
         $x     = $oldX;
1774 1774
         $texto = 'MUNICÍPIO';
1775 1775
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1781,7 +1781,7 @@  discard block
 block discarded – undo
1781 1781
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1782 1782
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1783 1783
         //UF
1784
-        $x     += $w;
1784
+        $x += $w;
1785 1785
         $w     = 8;
1786 1786
         $texto = 'UF';
1787 1787
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1790,12 +1790,12 @@  discard block
 block discarded – undo
1790 1790
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1791 1791
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1792 1792
         //FONE / FAX
1793
-        $x     += $w;
1793
+        $x += $w;
1794 1794
         $w     = $maxW - $w - $w1;
1795 1795
         $texto = 'FONE / FAX';
1796 1796
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1797 1797
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1798
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1798
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1799 1799
             $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1800 1800
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1801 1801
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1815,7 +1815,7 @@  discard block
 block discarded – undo
1815 1815
         if (isset($this->cobr)) {
1816 1816
             $fat = $this->cobr->getElementsByTagName("fat")->item(0);
1817 1817
             if (isset($fat)) {
1818
-                if (! empty($this->getTagValue($this->ide, "indPag"))) {
1818
+                if (!empty($this->getTagValue($this->ide, "indPag"))) {
1819 1819
                     $textoIndPag = "";
1820 1820
                     $indPag      = $this->getTagValue($this->ide, "indPag");
1821 1821
                     if ($indPag === "0") {
@@ -1890,7 +1890,7 @@  discard block
 block discarded – undo
1890 1890
             $h     = 8;
1891 1891
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
1892 1892
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1893
-            $y       += 3;
1893
+            $y += 3;
1894 1894
             $dups    = "";
1895 1895
             $dupcont = 0;
1896 1896
             $nFat    = $this->dup->length;
@@ -1924,13 +1924,13 @@  discard block
 block discarded – undo
1924 1924
             }
1925 1925
             $increm = 1;
1926 1926
             foreach ($this->dup as $k => $d) {
1927
-                $nDup  = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1927
+                $nDup  = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1928 1928
                     ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1929 1929
                     : '';
1930
-                $dDup  = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1930
+                $dDup  = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1931 1931
                     ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1932 1932
                     : '';
1933
-                $vDup  = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1933
+                $vDup  = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1934 1934
                     ? 'R$ ' . number_format(
1935 1935
                         $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1936 1936
                         2,
@@ -1977,7 +1977,7 @@  discard block
 block discarded – undo
1977 1977
             }
1978 1978
             if ($dupcont == 0) {
1979 1979
                 $y -= 9;
1980
-                $linha --;
1980
+                $linha--;
1981 1981
             }
1982 1982
 
1983 1983
             return ($y + $h);
@@ -2017,7 +2017,7 @@  discard block
 block discarded – undo
2017 2017
             $h     = 8;
2018 2018
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
2019 2019
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2020
-            $y       += 3;
2020
+            $y += 3;
2021 2021
             $dups    = "";
2022 2022
             $dupcont = 0;
2023 2023
             if ($this->orientacao == 'P') {
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
                 '90' => 'Sem pagamento',
2047 2047
                 '99' => 'Outros'
2048 2048
             ];
2049
-            $bandeira       = [
2049
+            $bandeira = [
2050 2050
                 '01' => 'Visa',
2051 2051
                 '02' => 'Mastercard',
2052 2052
                 '03' => 'American',
@@ -2059,10 +2059,10 @@  discard block
 block discarded – undo
2059 2059
                 '99' => 'Outros'
2060 2060
             ];
2061 2061
             foreach ($this->detPag as $k => $d) {
2062
-                $fPag  = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2062
+                $fPag  = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2063 2063
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
2064 2064
                     : '0';
2065
-                $vPag  = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2065
+                $vPag  = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2066 2066
                     ? 'R$ ' . number_format(
2067 2067
                         $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
2068 2068
                         2,
@@ -2105,7 +2105,7 @@  discard block
 block discarded – undo
2105 2105
             }
2106 2106
             if ($dupcont == 0) {
2107 2107
                 $y -= 9;
2108
-                $linha --;
2108
+                $linha--;
2109 2109
             }
2110 2110
 
2111 2111
             return ($y + $h);
@@ -2137,7 +2137,7 @@  discard block
 block discarded – undo
2137 2137
         $the_field    = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0);
2138 2138
         if (isset($the_field)) {
2139 2139
             $the_value = $the_field->nodeValue;
2140
-            if (! empty($the_value)) {
2140
+            if (!empty($the_value)) {
2141 2141
                 $valorImposto = number_format($the_value, 2, ",", ".");
2142 2142
             }
2143 2143
         }
@@ -2166,10 +2166,10 @@  discard block
 block discarded – undo
2166 2166
         $x_inicial = $x;
2167 2167
         //#####################################################################
2168 2168
         $campos_por_linha = 9;
2169
-        if (! $this->exibirPIS) {
2170
-            $campos_por_linha --;
2169
+        if (!$this->exibirPIS) {
2170
+            $campos_por_linha--;
2171 2171
         }
2172
-        if (! $this->exibirIcmsInterestadual) {
2172
+        if (!$this->exibirIcmsInterestadual) {
2173 2173
             $campos_por_linha -= 2;
2174 2174
         }
2175 2175
 
@@ -2256,12 +2256,12 @@  discard block
 block discarded – undo
2256 2256
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2257 2257
         //NOME / RAZÃO SOCIAL
2258 2258
         $w1    = $maxW * 0.29;
2259
-        $y     += 3;
2259
+        $y += 3;
2260 2260
         $texto = 'NOME / RAZÃO SOCIAL';
2261 2261
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2262 2262
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2263 2263
         if (isset($this->transporta)) {
2264
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2264
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2265 2265
                 ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2266 2266
                 : '';
2267 2267
         } else {
@@ -2270,12 +2270,12 @@  discard block
 block discarded – undo
2270 2270
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2271 2271
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2272 2272
         //FRETE POR CONTA
2273
-        $x     += $w1;
2273
+        $x += $w1;
2274 2274
         $w2    = $maxW * 0.15;
2275 2275
         $texto = 'FRETE';
2276 2276
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2277 2277
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2278
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2278
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2279 2279
             ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2280 2280
             : '0';
2281 2281
         switch ($tipoFrete) {
@@ -2301,12 +2301,12 @@  discard block
 block discarded – undo
2301 2301
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2302 2302
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, '');
2303 2303
         //CÓDIGO ANTT
2304
-        $x     += $w2;
2304
+        $x += $w2;
2305 2305
         $texto = 'CÓDIGO ANTT';
2306 2306
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2307 2307
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2308 2308
         if (isset($this->veicTransp)) {
2309
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2309
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2310 2310
                 ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2311 2311
                 : '';
2312 2312
         } else {
@@ -2315,16 +2315,16 @@  discard block
 block discarded – undo
2315 2315
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2316 2316
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2317 2317
         //PLACA DO VEÍC
2318
-        $x     += $w2;
2318
+        $x += $w2;
2319 2319
         $texto = 'PLACA DO VEÍCULO';
2320 2320
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2321 2321
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2322 2322
         if (isset($this->veicTransp)) {
2323
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2323
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2324 2324
                 ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2325 2325
                 : '';
2326 2326
         } elseif (isset($this->reboque)) {
2327
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2327
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2328 2328
                 ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2329 2329
                 : '';
2330 2330
         } else {
@@ -2333,17 +2333,17 @@  discard block
 block discarded – undo
2333 2333
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2334 2334
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2335 2335
         //UF
2336
-        $x     += $w2;
2336
+        $x += $w2;
2337 2337
         $w3    = round($maxW * 0.04, 0);
2338 2338
         $texto = 'UF';
2339 2339
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2340 2340
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2341 2341
         if (isset($this->veicTransp)) {
2342
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2342
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2343 2343
                 ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2344 2344
                 : '';
2345 2345
         } elseif (isset($this->reboque)) {
2346
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2346
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2347 2347
                 ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2348 2348
                 : '';
2349 2349
         } else {
@@ -2352,20 +2352,20 @@  discard block
 block discarded – undo
2352 2352
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2353 2353
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2354 2354
         //CNPJ / CPF
2355
-        $x     += $w3;
2355
+        $x += $w3;
2356 2356
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2357 2357
         $texto = 'CNPJ / CPF';
2358 2358
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2359 2359
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2360 2360
         if (isset($this->transporta)) {
2361
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2361
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2362 2362
                 ? $this->formatField(
2363 2363
                     $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2364 2364
                     "##.###.###/####-##"
2365 2365
                 )
2366 2366
                 : '';
2367 2367
             if ($texto == '') {
2368
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2368
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2369 2369
                     ? $this->formatField(
2370 2370
                         $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2371 2371
                         "###.###.###-##"
@@ -2379,7 +2379,7 @@  discard block
 block discarded – undo
2379 2379
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
2380 2380
         //#####################################################################
2381 2381
         //ENDEREÇO
2382
-        $y     += $h;
2382
+        $y += $h;
2383 2383
         $x     = $oldX;
2384 2384
         $h     = 7;
2385 2385
         $w1    = $maxW * 0.44;
@@ -2387,7 +2387,7 @@  discard block
 block discarded – undo
2387 2387
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2388 2388
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2389 2389
         if (isset($this->transporta)) {
2390
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2390
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2391 2391
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2392 2392
                 : '';
2393 2393
         } else {
@@ -2396,13 +2396,13 @@  discard block
 block discarded – undo
2396 2396
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2397 2397
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2398 2398
         //MUNICÍPIO
2399
-        $x     += $w1;
2399
+        $x += $w1;
2400 2400
         $w2    = round($maxW * 0.30, 0);
2401 2401
         $texto = 'MUNICÍPIO';
2402 2402
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2403 2403
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2404 2404
         if (isset($this->transporta)) {
2405
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2405
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2406 2406
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2407 2407
                 : '';
2408 2408
         } else {
@@ -2411,13 +2411,13 @@  discard block
 block discarded – undo
2411 2411
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2412 2412
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2413 2413
         //UF
2414
-        $x     += $w2;
2414
+        $x += $w2;
2415 2415
         $w3    = round($maxW * 0.04, 0);
2416 2416
         $texto = 'UF';
2417 2417
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2418 2418
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2419 2419
         if (isset($this->transporta)) {
2420
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2420
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2421 2421
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2422 2422
                 : '';
2423 2423
         } else {
@@ -2426,14 +2426,14 @@  discard block
 block discarded – undo
2426 2426
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2427 2427
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2428 2428
         //INSCRIÇÃO ESTADUAL
2429
-        $x     += $w3;
2429
+        $x += $w3;
2430 2430
         $w     = $maxW - ($w1 + $w2 + $w3);
2431 2431
         $texto = 'INSCRIÇÃO ESTADUAL';
2432 2432
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2433 2433
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2434 2434
         $texto = '';
2435 2435
         if (isset($this->transporta)) {
2436
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2436
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2437 2437
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2438 2438
             }
2439 2439
         }
@@ -2449,13 +2449,13 @@  discard block
 block discarded – undo
2449 2449
         $pesoBruto   = 0;
2450 2450
         $pesoLiquido = 0;
2451 2451
         foreach ($volumes as $volume) {
2452
-            $quantidade  += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2452
+            $quantidade  += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2453 2453
                 $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2454
-            $pesoBruto   += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2454
+            $pesoBruto   += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2455 2455
                 $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2456
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2456
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2457 2457
                 $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2458
-            $texto       = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2458
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2459 2459
                 $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2460 2460
             if ($texto != $especie && $especie != '') {
2461 2461
                 //tem várias especies
@@ -2463,7 +2463,7 @@  discard block
 block discarded – undo
2463 2463
             } else {
2464 2464
                 $especie = $texto;
2465 2465
             }
2466
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2466
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2467 2467
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2468 2468
                 : '';
2469 2469
             if ($texto != $marca && $marca != '') {
@@ -2472,7 +2472,7 @@  discard block
 block discarded – undo
2472 2472
             } else {
2473 2473
                 $marca = $texto;
2474 2474
             }
2475
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2475
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2476 2476
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2477 2477
                 : '';
2478 2478
             if ($texto != $numero && $numero != '') {
@@ -2485,20 +2485,20 @@  discard block
 block discarded – undo
2485 2485
 
2486 2486
         //#####################################################################
2487 2487
         //QUANTIDADE
2488
-        $y     += $h;
2488
+        $y += $h;
2489 2489
         $x     = $oldX;
2490 2490
         $h     = 7;
2491 2491
         $w1    = round($maxW * 0.10, 0);
2492 2492
         $texto = 'QUANTIDADE';
2493 2493
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2494 2494
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2495
-        if (! empty($quantidade)) {
2495
+        if (!empty($quantidade)) {
2496 2496
             $texto = $quantidade;
2497 2497
             $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2498 2498
             $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, '');
2499 2499
         }
2500 2500
         //ESPÉCIE
2501
-        $x     += $w1;
2501
+        $x += $w1;
2502 2502
         $w2    = round($maxW * 0.17, 0);
2503 2503
         $texto = 'ESPÉCIE';
2504 2504
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2507,16 +2507,16 @@  discard block
 block discarded – undo
2507 2507
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2508 2508
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2509 2509
         //MARCA
2510
-        $x     += $w2;
2510
+        $x += $w2;
2511 2511
         $texto = 'MARCA';
2512 2512
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2513 2513
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2514
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2514
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2515 2515
             $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2516 2516
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2517 2517
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2518 2518
         //NUMERAÇÃO
2519
-        $x     += $w2;
2519
+        $x += $w2;
2520 2520
         $texto = 'NUMERAÇÃO';
2521 2521
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2522 2522
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2524,7 +2524,7 @@  discard block
 block discarded – undo
2524 2524
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2525 2525
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2526 2526
         //PESO BRUTO
2527
-        $x     += $w2;
2527
+        $x += $w2;
2528 2528
         $w3    = round($maxW * 0.20, 0);
2529 2529
         $texto = 'PESO BRUTO';
2530 2530
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2537,7 +2537,7 @@  discard block
 block discarded – undo
2537 2537
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2538 2538
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2539 2539
         //PESO LÍQUIDO
2540
-        $x     += $w3;
2540
+        $x += $w3;
2541 2541
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2542 2542
         $texto = 'PESO LÍQUIDO';
2543 2543
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2557,11 +2557,11 @@  discard block
 block discarded – undo
2557 2557
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2558 2558
     {
2559 2559
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
2560
-        if (! isset($valor_original)) {
2560
+        if (!isset($valor_original)) {
2561 2561
             return "";
2562 2562
         }
2563 2563
         $valor_original = $valor_original->nodeValue;
2564
-        $valor          = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2564
+        $valor          = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2565 2565
 
2566 2566
         if ($valor != "") {
2567 2567
             return sprintf($formato, $valor);
@@ -2587,7 +2587,7 @@  discard block
 block discarded – undo
2587 2587
         $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0);
2588 2588
         $impostos   = '';
2589 2589
 
2590
-        if (! empty($ICMS)) {
2590
+        if (!empty($ICMS)) {
2591 2591
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s");
2592 2592
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%");
2593 2593
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s");
@@ -2603,7 +2603,7 @@  discard block
 block discarded – undo
2603 2603
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s");
2604 2604
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s");
2605 2605
         }
2606
-        if (! empty($ICMSUFDest)) {
2606
+        if (!empty($ICMSUFDest)) {
2607 2607
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%");
2608 2608
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%");
2609 2609
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%");
@@ -2611,20 +2611,20 @@  discard block
 block discarded – undo
2611 2611
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2612 2612
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2613 2613
         }
2614
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2614
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2615 2615
             ? substr(
2616 2616
                 $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2617 2617
                 0,
2618 2618
                 500
2619 2619
             )
2620 2620
             : '';
2621
-        if (! empty($infAdProd)) {
2621
+        if (!empty($infAdProd)) {
2622 2622
             $infAdProd = trim($infAdProd);
2623 2623
             $infAdProd .= ' ';
2624 2624
         }
2625 2625
         $loteTxt = '';
2626 2626
         $rastro  = $prod->getElementsByTagName("med");
2627
-        if (! empty($prod->getElementsByTagName("rastro"))) {
2627
+        if (!empty($prod->getElementsByTagName("rastro"))) {
2628 2628
             $rastro = $prod->getElementsByTagName("rastro");
2629 2629
             $i      = 0;
2630 2630
             while ($i < $rastro->length) {
@@ -2633,14 +2633,14 @@  discard block
 block discarded – undo
2633 2633
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dFab', ' Fab: ');
2634 2634
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dVal', ' Val: ');
2635 2635
                 $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: ');
2636
-                $i ++;
2636
+                $i++;
2637 2637
             }
2638 2638
             if ($loteTxt != '') {
2639 2639
                 $loteTxt .= ' ';
2640 2640
             }
2641 2641
         }
2642 2642
         //NT2013.006 FCI
2643
-        $nFCI   = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2643
+        $nFCI   = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2644 2644
             ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2645 2645
         $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2646 2646
         $texto  = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
@@ -2690,7 +2690,7 @@  discard block
 block discarded – undo
2690 2690
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2691 2691
         $y += 3;
2692 2692
         //desenha a caixa dos dados dos itens da NF
2693
-        $hmax  += 1;
2693
+        $hmax += 1;
2694 2694
         $texto = '';
2695 2695
         $this->pdf->textBox($x, $y, $w, $hmax);
2696 2696
         //##################################################################################
@@ -2703,101 +2703,101 @@  discard block
 block discarded – undo
2703 2703
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2704 2704
         $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2705 2705
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2706
-        $x     += $w1;
2706
+        $x += $w1;
2707 2707
         $w2    = round($w * 0.25, 0);
2708 2708
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2709 2709
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2710 2710
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2711 2711
         $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2712 2712
         //NCM/SH
2713
-        $x     += $w2;
2713
+        $x += $w2;
2714 2714
         $w3    = round($w * 0.06, 0);
2715 2715
         $texto = 'NCM/SH';
2716 2716
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2717 2717
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2718 2718
         $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2719 2719
         //O/CST ou O/CSOSN
2720
-        $x     += $w3;
2720
+        $x += $w3;
2721 2721
         $w4    = round($w * 0.05, 0);
2722 2722
         $texto = 'O/CST'; // CRT = 2 ou CRT = 3
2723 2723
         if ($this->getTagValue($this->emit, 'CRT') == '1') {
2724
-            $texto = 'O/CSOSN';//Regime do Simples CRT = 1
2724
+            $texto = 'O/CSOSN'; //Regime do Simples CRT = 1
2725 2725
         }
2726 2726
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2727 2727
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2728 2728
         $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2729 2729
         //CFOP
2730
-        $x     += $w4;
2730
+        $x += $w4;
2731 2731
         $w5    = round($w * 0.04, 0);
2732 2732
         $texto = 'CFOP';
2733 2733
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2734 2734
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2735 2735
         $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2736 2736
         //UN
2737
-        $x     += $w5;
2737
+        $x += $w5;
2738 2738
         $w6    = round($w * 0.03, 0);
2739 2739
         $texto = 'UN';
2740 2740
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2741 2741
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2742 2742
         $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2743 2743
         //QUANT
2744
-        $x     += $w6;
2744
+        $x += $w6;
2745 2745
         $w7    = round($w * 0.08, 0);
2746 2746
         $texto = 'QUANT';
2747 2747
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2748 2748
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2749 2749
         $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2750 2750
         //VALOR UNIT
2751
-        $x     += $w7;
2751
+        $x += $w7;
2752 2752
         $w8    = round($w * 0.06, 0);
2753 2753
         $texto = 'VALOR UNIT';
2754 2754
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2755 2755
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2756 2756
         $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2757 2757
         //VALOR TOTAL
2758
-        $x     += $w8;
2758
+        $x += $w8;
2759 2759
         $w9    = round($w * 0.06, 0);
2760 2760
         $texto = 'VALOR TOTAL';
2761 2761
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2762 2762
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2763 2763
         $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2764 2764
         //VALOR DESCONTO
2765
-        $x     += $w9;
2765
+        $x += $w9;
2766 2766
         $w10   = round($w * 0.05, 0);
2767 2767
         $texto = 'VALOR DESC';
2768 2768
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2769 2769
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2770 2770
         $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2771 2771
         //B.CÁLC ICMS
2772
-        $x     += $w10;
2772
+        $x += $w10;
2773 2773
         $w11   = round($w * 0.06, 0);
2774 2774
         $texto = 'B.CÁLC ICMS';
2775 2775
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2776 2776
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2777 2777
         $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2778 2778
         //VALOR ICMS
2779
-        $x     += $w11;
2779
+        $x += $w11;
2780 2780
         $w12   = round($w * 0.06, 0);
2781 2781
         $texto = 'VALOR ICMS';
2782 2782
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2783 2783
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2784 2784
         $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2785 2785
         //VALOR IPI
2786
-        $x     += $w12;
2786
+        $x += $w12;
2787 2787
         $w13   = round($w * 0.05, 0);
2788 2788
         $texto = 'VALOR IPI';
2789 2789
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2790 2790
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2791 2791
         $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2792 2792
         //ALÍQ. ICMS
2793
-        $x     += $w13;
2793
+        $x += $w13;
2794 2794
         $w14   = round($w * 0.04, 0);
2795 2795
         $texto = 'ALÍQ. ICMS';
2796 2796
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2797 2797
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2798 2798
         $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2799 2799
         //ALÍQ. IPI
2800
-        $x     += $w14;
2800
+        $x += $w14;
2801 2801
         $w15   = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2802 2802
         $texto = 'ALÍQ. IPI';
2803 2803
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
@@ -2842,7 +2842,7 @@  discard block
 block discarded – undo
2842 2842
                 // Informação sobre unidade de medida tributavel.
2843 2843
                 // Se não for para exibir a unidade de medida tributavel, então
2844 2844
                 // A Escrita irá começar em 0.
2845
-                if (! $mostrarUnidadeTributavel) {
2845
+                if (!$mostrarUnidadeTributavel) {
2846 2846
                     $yTrib = 0;
2847 2847
                 }
2848 2848
                 $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel);
@@ -2877,7 +2877,7 @@  discard block
 block discarded – undo
2877 2877
                 }
2878 2878
                 $x += $w2;
2879 2879
                 //NCM
2880
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2880
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2881 2881
                     $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2882 2882
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2883 2883
                 $x += $w3;
@@ -2890,11 +2890,11 @@  discard block
 block discarded – undo
2890 2890
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2891 2891
                 }
2892 2892
                 //CFOP
2893
-                $x     += $w4;
2893
+                $x += $w4;
2894 2894
                 $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue;
2895 2895
                 $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, '');
2896 2896
                 //Unidade
2897
-                $x     += $w5;
2897
+                $x += $w5;
2898 2898
                 $texto = $uCom;
2899 2899
                 $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, '');
2900 2900
                 //Unidade de medida tributável
@@ -2915,7 +2915,7 @@  discard block
 block discarded – undo
2915 2915
                 // QTDADE Tributável
2916 2916
                 if ($mostrarUnidadeTributavel) {
2917 2917
                     $qTrib = $prod->getElementsByTagName("qTrib")->item(0);
2918
-                    if (! empty($qTrib)) {
2918
+                    if (!empty($qTrib)) {
2919 2919
                         $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", ".");
2920 2920
                         $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2921 2921
                     }
@@ -2928,7 +2928,7 @@  discard block
 block discarded – undo
2928 2928
                 // Valor Unitário Tributável
2929 2929
                 if ($mostrarUnidadeTributavel) {
2930 2930
                     $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0);
2931
-                    if (! empty($vUnTrib)) {
2931
+                    if (!empty($vUnTrib)) {
2932 2932
                         $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", ".");
2933 2933
                         $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2934 2934
                     }
@@ -2942,7 +2942,7 @@  discard block
 block discarded – undo
2942 2942
                 $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2943 2943
                 $x += $w9;
2944 2944
                 //Valor do Desconto
2945
-                $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2945
+                $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2946 2946
                     ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0;
2947 2947
 
2948 2948
                 $texto = number_format($vdesc, 2, ",", ".");
@@ -2950,7 +2950,7 @@  discard block
 block discarded – undo
2950 2950
                 //Valor da Base de calculo
2951 2951
                 $x += $w10;
2952 2952
                 if (isset($ICMS)) {
2953
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2953
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2954 2954
                         ? number_format(
2955 2955
                             $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
2956 2956
                             2,
@@ -2963,7 +2963,7 @@  discard block
 block discarded – undo
2963 2963
                 //Valor do ICMS
2964 2964
                 $x += $w11;
2965 2965
                 if (isset($ICMS)) {
2966
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2966
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2967 2967
                         ? number_format(
2968 2968
                             $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
2969 2969
                             2,
@@ -2976,7 +2976,7 @@  discard block
 block discarded – undo
2976 2976
                 //Valor do IPI
2977 2977
                 $x += $w12;
2978 2978
                 if (isset($IPI)) {
2979
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2979
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2980 2980
                         ? number_format(
2981 2981
                             $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
2982 2982
                             2,
@@ -2991,7 +2991,7 @@  discard block
 block discarded – undo
2991 2991
                 // %ICMS
2992 2992
                 $x += $w13;
2993 2993
                 if (isset($ICMS)) {
2994
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2994
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2995 2995
                         ? number_format(
2996 2996
                             $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
2997 2997
                             2,
@@ -3004,7 +3004,7 @@  discard block
 block discarded – undo
3004 3004
                 //%IPI
3005 3005
                 $x += $w14;
3006 3006
                 if (isset($IPI)) {
3007
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3007
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3008 3008
                         ? number_format(
3009 3009
                             $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
3010 3010
                             2,
@@ -3022,17 +3022,17 @@  discard block
 block discarded – undo
3022 3022
                 $veicProd = $prod->getElementsByTagName("veicProd")->item(0);
3023 3023
                 // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran
3024 3024
                 // Verifica se a Tag existe
3025
-                if (! empty($veicProd)) {
3025
+                if (!empty($veicProd)) {
3026 3026
                     $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod);
3027 3027
                 }
3028 3028
 
3029 3029
 
3030 3030
                 $y += $h;
3031
-                $i ++;
3031
+                $i++;
3032 3032
                 //incrementa o controle dos itens processados.
3033
-                $this->qtdeItensProc ++;
3033
+                $this->qtdeItensProc++;
3034 3034
             } else {
3035
-                $i ++;
3035
+                $i++;
3036 3036
             }
3037 3037
         }
3038 3038
 
@@ -3237,23 +3237,23 @@  discard block
 block discarded – undo
3237 3237
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
3238 3238
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3239 3239
         //INSCRIÇÃO MUNICIPAL
3240
-        $y     += 3;
3240
+        $y += 3;
3241 3241
         $w     = round($this->wPrint * 0.23, 0);
3242 3242
         $texto = 'INSCRIÇÃO MUNICIPAL';
3243 3243
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3244 3244
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3245 3245
         //inscrição municipal
3246
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3246
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3247 3247
             $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3248 3248
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3249 3249
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
3250 3250
         //VALOR TOTAL DOS SERVIÇOS
3251
-        $x     += $w;
3251
+        $x += $w;
3252 3252
         $texto = 'VALOR TOTAL DOS SERVIÇOS';
3253 3253
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3254 3254
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3255 3255
         if (isset($this->ISSQNtot)) {
3256
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3256
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3257 3257
                 $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3258 3258
             $texto = number_format($texto, 2, ",", ".");
3259 3259
         } else {
@@ -3262,14 +3262,14 @@  discard block
 block discarded – undo
3262 3262
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3263 3263
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3264 3264
         //BASE DE CÁLCULO DO ISSQN
3265
-        $x     += $w;
3265
+        $x += $w;
3266 3266
         $texto = 'BASE DE CÁLCULO DO ISSQN';
3267 3267
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3268 3268
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3269 3269
         if (isset($this->ISSQNtot)) {
3270
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3270
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3271 3271
                 $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3272
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3272
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3273 3273
         } else {
3274 3274
             $texto = '';
3275 3275
         }
@@ -3286,9 +3286,9 @@  discard block
 block discarded – undo
3286 3286
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3287 3287
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3288 3288
         if (isset($this->ISSQNtot)) {
3289
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3289
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3290 3290
                 $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3291
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3291
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3292 3292
         } else {
3293 3293
             $texto = '';
3294 3294
         }
@@ -3327,7 +3327,7 @@  discard block
 block discarded – undo
3327 3327
 
3328 3328
         //INFORMAÇÕES COMPLEMENTARES
3329 3329
         $texto = "INFORMAÇÕES COMPLEMENTARES";
3330
-        $y     += 3;
3330
+        $y += 3;
3331 3331
         $w     = $this->wAdic;
3332 3332
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B'];
3333 3333
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -3337,7 +3337,7 @@  discard block
 block discarded – undo
3337 3337
         //$this->textoAdic com o texto completo do campo
3338 3338
         //echo str_replace("\n", "<br>",$this->textoAdic);
3339 3339
         //die;
3340
-        $y     += 1;
3340
+        $y += 1;
3341 3341
         $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => ''];
3342 3342
         //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>''];
3343 3343
         $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
@@ -3388,7 +3388,7 @@  discard block
 block discarded – undo
3388 3388
                 $texto = 'CONTINGÊNCIA SVC-RS' . $dhCont . $xJust;
3389 3389
                 break;
3390 3390
         }
3391
-        $y     += 2;
3391
+        $y += 2;
3392 3392
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
3393 3393
         $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false);
3394 3394
 
@@ -3443,7 +3443,7 @@  discard block
 block discarded – undo
3443 3443
         $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
3444 3444
         if ($tpNF == '0') {
3445 3445
             //NFe de Entrada
3446
-            $emitente     = '';
3446
+            $emitente = '';
3447 3447
             $emitente     .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - ";
3448 3448
             $emitente     .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", ";
3449 3449
             $emitente     .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - ";
@@ -3496,10 +3496,10 @@  discard block
 block discarded – undo
3496 3496
             $texto .= "AO LADO";
3497 3497
         }
3498 3498
         $texto .= ". EMISSÃO: ";
3499
-        $dEmi  = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3499
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3500 3500
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3501 3501
         if ($dEmi == '') {
3502
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3502
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3503 3503
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3504 3504
             $aDemi = explode('T', $dEmi);
3505 3505
             $dEmi  = $aDemi[0];
@@ -3522,12 +3522,12 @@  discard block
 block discarded – undo
3522 3522
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3523 3523
             //DATA DE RECEBIMENTO
3524 3524
             $texto = "DATA DE RECEBIMENTO";
3525
-            $y     += $h;
3525
+            $y += $h;
3526 3526
             $w2    = round($this->wPrint * 0.17, 0); //35;
3527 3527
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3528 3528
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3529 3529
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3530
-            $x     += $w2;
3530
+            $x += $w2;
3531 3531
             $w3    = $w - $w2;
3532 3532
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3533 3533
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3538,7 +3538,7 @@  discard block
 block discarded – undo
3538 3538
 
3539 3539
             return $y;
3540 3540
         } else {
3541
-            $x --;
3541
+            $x--;
3542 3542
             $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3543 3543
             //NUMERO DA NOTA FISCAL LOGO NFE
3544 3544
             $w1    = 18;
@@ -3559,7 +3559,7 @@  discard block
 block discarded – undo
3559 3559
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3560 3560
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3561 3561
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3562
-            $y     -= $w2;
3562
+            $y -= $w2;
3563 3563
             $w3    = $w - $w2;
3564 3564
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3565 3565
             $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => ''];
@@ -3580,18 +3580,18 @@  discard block
 block discarded – undo
3580 3580
      */
3581 3581
     protected function geraInformacoesDaTagCompra()
3582 3582
     {
3583
-        if (! $this->gerarInformacoesAutomaticas) {
3583
+        if (!$this->gerarInformacoesAutomaticas) {
3584 3584
             return '';
3585 3585
         }
3586 3586
         $saida = "";
3587 3587
         if (isset($this->compra)) {
3588
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3588
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3589 3589
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3590 3590
             }
3591
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3591
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3592 3592
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3593 3593
             }
3594
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3594
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3595 3595
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3596 3596
             }
3597 3597
         }
@@ -3622,10 +3622,10 @@  discard block
 block discarded – undo
3622 3622
         if ($icmss > 0) {
3623 3623
             $icmss = 1;
3624 3624
         }
3625
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3625
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3626 3626
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3627 3627
         if ($dEmi == '') {
3628
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3628
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3629 3629
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3630 3630
             $aDemi = explode('T', $dEmi);
3631 3631
             $dEmi  = $aDemi[0];
@@ -3649,7 +3649,7 @@  discard block
 block discarded – undo
3649 3649
      */
3650 3650
     protected function geraInformacoesDasNotasReferenciadas()
3651 3651
     {
3652
-        if (! $this->gerarInformacoesAutomaticas) {
3652
+        if (!$this->gerarInformacoesAutomaticas) {
3653 3653
             return '';
3654 3654
         }
3655 3655
         $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]";
@@ -3677,7 +3677,7 @@  discard block
 block discarded – undo
3677 3677
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3678 3678
                 $serie         = substr($chave_acesso, 22, 3);
3679 3679
                 $numero        = substr($chave_acesso, 25, 9);
3680
-                $saida         .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3680
+                $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3681 3681
             }
3682 3682
             $refNF = $nfRef->getElementsByTagName('refNF');
3683 3683
             foreach ($refNF as $umaRefNFe) {
@@ -3688,7 +3688,7 @@  discard block
 block discarded – undo
3688 3688
                 $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue;
3689 3689
                 $data   = substr($data, 2, 2) . "/20" . substr($data, 0, 2);
3690 3690
                 $cnpj   = $this->formatField($cnpj, "##.###.###/####-##");
3691
-                $saida  .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3691
+                $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3692 3692
             }
3693 3693
             $refCTe = $nfRef->getElementsByTagName('refCTe');
3694 3694
             foreach ($refCTe as $chave_acessoRef) {
@@ -3698,7 +3698,7 @@  discard block
 block discarded – undo
3698 3698
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3699 3699
                 $serie         = substr($chave_acesso, 22, 3);
3700 3700
                 $numero        = substr($chave_acesso, 25, 9);
3701
-                $saida         .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3701
+                $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3702 3702
             }
3703 3703
             $refECF = $nfRef->getElementsByTagName('refECF');
3704 3704
             foreach ($refECF as $umaRefNFe) {
@@ -3710,10 +3710,9 @@  discard block
 block discarded – undo
3710 3710
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3711 3711
             foreach ($refNFP as $umaRefNFe) {
3712 3712
                 $data   = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3713
-                $cnpj   = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3714
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3715
-                    '';
3716
-                $cpf    = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3713
+                $cnpj   = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3714
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3715
+                $cpf    = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3717 3716
                     $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3718 3717
                 $mod    = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3719 3718
                 $serie  = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
@@ -3735,7 +3734,7 @@  discard block
 block discarded – undo
3735 3734
     private function loadDoc($xml)
3736 3735
     {
3737 3736
         $this->xml = $xml;
3738
-        if (! empty($xml)) {
3737
+        if (!empty($xml)) {
3739 3738
             $this->dom = new Dom();
3740 3739
             $this->dom->loadXML($this->xml);
3741 3740
             if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) {
@@ -3789,7 +3788,7 @@  discard block
 block discarded – undo
3789 3788
         $numlinhas    = $this->pdf->getNumLines($textoProduto, $w2, $aFont);
3790 3789
 
3791 3790
         if ($mostrarUnidadeTributavel && $numlinhas == 1) {
3792
-            $numlinhas ++;
3791
+            $numlinhas++;
3793 3792
         }
3794 3793
 
3795 3794
         return round(($numlinhas * $this->pdf->fontSize) + ($numlinhas * 0.5), 2);
Please login to merge, or discard this patch.