Passed
Push — master ( 20086d...a9ce0e )
by Roberto
01:52 queued 13s
created
src/NFe/Danfe.php 1 patch
Spacing   +225 added lines, -226 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
     {
344 344
         $this->textoAdic = '';
345 345
         //informações adicionais
346
-        $fontProduto            = [
346
+        $fontProduto = [
347 347
             'font'  => $this->fontePadrao,
348 348
             'size'  => 8,
349 349
             'style' => ''
@@ -356,16 +356,16 @@  discard block
 block discarded – undo
356 356
             if ($this->textoAdic != '') {
357 357
                 $this->textoAdic .= ". \n";
358 358
             }
359
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl"))
359
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl"))
360 360
                 //? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl"))
361 361
                 ? 'Inf. Contribuinte: ' . $this->getTagValue($this->infAdic, "infCpl")
362 362
                 : '';
363
-            $infPedido       = $this->geraInformacoesDaTagCompra();
363
+            $infPedido = $this->geraInformacoesDaTagCompra();
364 364
             if ($infPedido != "") {
365 365
                 $this->textoAdic .= $infPedido;
366 366
             }
367 367
             $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
368
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco"))
368
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco"))
369 369
                 ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco")
370 370
                 : '';
371 371
             if ($this->obsshow) {
@@ -373,11 +373,11 @@  discard block
 block discarded – undo
373 373
                 if (isset($obsCont)) {
374 374
                     foreach ($obsCont as $obs) {
375 375
                         $campo = $obsCont->item($i)->getAttribute("xCampo");
376
-                        $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
376
+                        $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
377 377
                             ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue
378 378
                             : '';
379 379
                         $this->textoAdic .= "\n" . $campo . ':  ' . trim($xTexto);
380
-                        $i ++;
380
+                        $i++;
381 381
                     }
382 382
                 }
383 383
             }
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
             $flagVTT = $flagVTT && (strpos(strtolower(trim($this->textoAdic)), 'trib') ||
393 393
                     strpos(strtolower(trim($this->textoAdic)), 'imp'));
394 394
             $vTotTrib = $this->getTagValue($this->ICMSTot, 'vTotTrib');
395
-            if ($vTotTrib != '' && ! $flagVTT) {
395
+            if ($vTotTrib != '' && !$flagVTT) {
396 396
                 $this->textoAdic .= "\n Valor Aproximado dos Tributos : R$ "
397 397
                     . number_format($vTotTrib, 2, ",", ".");
398 398
             }
@@ -403,9 +403,9 @@  discard block
 block discarded – undo
403 403
         $this->textadicfontsize = $this->pdf->fontSize;
404 404
         $hdadosadic = ceil($numlinhasdados * ($this->textadicfontsize));
405 405
         if ($hdadosadic > 70) {
406
-            for ($f = 8; $f > 3; $f --) {
406
+            for ($f = 8; $f > 3; $f--) {
407 407
                 $this->pdf->setFont($this->fontePadrao, '', $f);
408
-                $fontProduto            = [
408
+                $fontProduto = [
409 409
                     'font'  => $this->fontePadrao,
410 410
                     'size'  => $f,
411 411
                     'style' => ''
@@ -528,9 +528,9 @@  discard block
 block discarded – undo
528 528
         $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais();
529 529
 
530 530
         //altura disponivel para os campos da DANFE
531
-        $hcabecalho    = 47;//para cabeçalho
532
-        $hdestinatario = 25;//para destinatario
533
-        $hduplicatas   = 12;//para cada grupo de 7 duplicatas
531
+        $hcabecalho    = 47; //para cabeçalho
532
+        $hdestinatario = 25; //para destinatario
533
+        $hduplicatas   = 12; //para cada grupo de 7 duplicatas
534 534
         if (isset($this->entrega)) {
535 535
             $hlocalentrega = 25;
536 536
         } else {
@@ -541,11 +541,11 @@  discard block
 block discarded – undo
541 541
         } else {
542 542
             $hlocalretirada = 0;
543 543
         }
544
-        $himposto    = 18;// para imposto
545
-        $htransporte = 25;// para transporte
546
-        $hissqn      = 11;// para issqn
547
-        $hfooter     = 5;// para rodape
548
-        $hCabecItens = 4;//cabeçalho dos itens
544
+        $himposto    = 18; // para imposto
545
+        $htransporte = 25; // para transporte
546
+        $hissqn      = 11; // para issqn
547
+        $hfooter     = 5; // para rodape
548
+        $hCabecItens = 4; //cabeçalho dos itens
549 549
         $hOCUPADA    = $hcabecalho
550 550
             + $hdestinatario
551 551
             + $hlocalentrega
@@ -568,10 +568,10 @@  discard block
 block discarded – undo
568 568
         $this->sizeExtraTextoFatura());*/
569 569
 
570 570
         if ($this->orientacao == 'P') {
571
-            $hDispo1 -= 24 * $this->qCanhoto;//para canhoto
572
-            $w       = $this->wPrint;
571
+            $hDispo1 -= 24 * $this->qCanhoto; //para canhoto
572
+            $w = $this->wPrint;
573 573
         } else {
574
-            $hcanhoto = $this->hPrint;//para canhoto
574
+            $hcanhoto = $this->hPrint; //para canhoto
575 575
             $w        = $this->wPrint - $this->wCanhoto;
576 576
         }
577 577
         //$hDispo1 += 14;
@@ -607,12 +607,12 @@  discard block
 block discarded – undo
607 607
             );
608 608
             $hUsado += $this->calculeHeight($itemProd, $mostrarUnidadeTributavel);
609 609
             if ($hUsado > $hDispo) {
610
-                $totPag ++;
610
+                $totPag++;
611 611
                 $hDispo = $hDispo2;
612 612
                 $hUsado = $hCabecItens;
613
-                $i --; // decrementa para readicionar o item que não coube nessa pagina na outra.
613
+                $i--; // decrementa para readicionar o item que não coube nessa pagina na outra.
614 614
             }
615
-            $i ++;
615
+            $i++;
616 616
         } //fim da soma das areas de itens usadas
617 617
         $qtdeItens = $i; //controle da quantidade de itens no DANFE
618 618
         //montagem da primeira página
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
         $formaPag = [];
645 645
         if (isset($this->detPag) && $this->detPag->length > 0) {
646 646
             foreach ($this->detPag as $k => $d) {
647
-                $fPag            = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
647
+                $fPag            = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
648 648
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
649 649
                     : '0';
650 650
                 $formaPag[$fPag] = $fPag;
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
         }
689 689
 
690 690
         //loop para páginas seguintes
691
-        for ($n = 2; $n <= $totPag; $n ++) {
691
+        for ($n = 2; $n <= $totPag; $n++) {
692 692
             // fixa as margens
693 693
             $this->pdf->setMargins($this->margesq, $this->margsup);
694 694
             //adiciona nova página
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
             }
713 713
             //se estiver na última página e ainda restar itens para inserir, adiciona mais uma página
714 714
             if ($n == $totPag && $this->qtdeItensProc < $qtdeItens) {
715
-                $totPag ++;
715
+                $totPag++;
716 716
             }
717 717
         }
718 718
     }
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
         if ($startPos === false) {
742 742
             return $cdata;
743 743
         }
744
-        for ($x = $len; $x > 0; $x --) {
744
+        for ($x = $len; $x > 0; $x--) {
745 745
             if (substr($cdata, $x, 1) == '>') {
746 746
                 $endPos = $x;
747 747
                 break;
@@ -837,15 +837,15 @@  discard block
 block discarded – undo
837 837
         //grupo CADATA infCpl
838 838
         $t          = $dom->getElementsByTagName('transmissor')->item(0);
839 839
         $r          = $dom->getElementsByTagName('receptor')->item(0);
840
-        $versao     = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
840
+        $versao     = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
841 841
             'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
842
-        $especieNF  = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
842
+        $especieNF  = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
843 843
             'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
844
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
844
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
845 845
             'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
846
-        $dca        = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
846
+        $dca        = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
847 847
             'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
848
-        $texto      .= "" . $versao . $especieNF . $fabEntrega . $dca;
848
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
849 849
         if (isset($t)) {
850 850
             if ($t->hasAttributes()) {
851 851
                 $texto .= " Transmissor ";
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
         } else {
892 892
             if ($this->getTagValue($this->ide, "tpAmb") == '2') {
893 893
                 $resp['status'] = false;
894
-                $resp['message'][] =  "NFe EMITIDA EM HOMOLOGAÇÃO";
894
+                $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO";
895 895
             }
896 896
             $retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0);
897 897
             $cStat = $this->getTagValue($this->nfeProc, "cStat");
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
             } elseif (!empty($retEvento)) {
913 913
                 $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0);
914 914
                 $cStat = $this->getTagValue($infEvento, "cStat");
915
-                $tpEvento= $this->getTagValue($infEvento, "tpEvento");
915
+                $tpEvento = $this->getTagValue($infEvento, "tpEvento");
916 916
                 $dhEvento = $this->toDateTime($this->getTagValue($infEvento, "dhRegEvento"))->format("d/m/Y H:i:s");
917 917
                 $nProt = $this->getTagValue($infEvento, "nProt");
918 918
                 if ($tpEvento == '110111' &&
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
         //se for right separa 2/3 para os dados e o terço seguinte para o logo
977 977
         //se não houver logo centraliza dos dados do emitente
978 978
         // coloca o logo
979
-        if (! empty($this->logomarca)) {
979
+        if (!empty($this->logomarca)) {
980 980
             $logoInfo = getimagesize($this->logomarca);
981 981
             //largura da imagem em mm
982 982
             $logoWmm = ($logoInfo[0] / 72) * 25.4;
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
             //endereço
1033 1033
             $y1     = $y1 + 5;
1034 1034
             $aFont  = ['font' => $this->fontePadrao, 'size' => 8, 'style' => ''];
1035
-            $fone   = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
1035
+            $fone   = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
1036 1036
                 ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
1037 1037
                 : '';
1038 1038
             $lgr    = $this->getTagValue($this->enderEmit, "xLgr");
@@ -1051,8 +1051,8 @@  discard block
 block discarded – undo
1051 1051
 
1052 1052
         //####################################################################################
1053 1053
         //coluna central Danfe
1054
-        $x  += $w;
1055
-        $w  = round($maxW * 0.17, 0);//35;
1054
+        $x += $w;
1055
+        $w  = round($maxW * 0.17, 0); //35;
1056 1056
         $w2 = $w;
1057 1057
         $h  = 32;
1058 1058
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1109,8 +1109,8 @@  discard block
 block discarded – undo
1109 1109
 
1110 1110
         //####################################################################################
1111 1111
         //coluna codigo de barras
1112
-        $x  += $w;
1113
-        $w  = ($maxW - $w1 - $w2);//85;
1112
+        $x += $w;
1113
+        $w  = ($maxW - $w1 - $w2); //85;
1114 1114
         $w3 = $w;
1115 1115
         $h  = 32;
1116 1116
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1173 1173
         $w     = $w1 + $w2;
1174 1174
         $y     = $oldY;
1175
-        $oldY  += $h;
1175
+        $oldY += $h;
1176 1176
         $x     = $oldX;
1177 1177
         $h     = 7;
1178 1178
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
                 $cStat = '';
1204 1204
             } else {
1205 1205
                 if (isset($this->nfeProc)) {
1206
-                    $texto  = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1206
+                    $texto  = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1207 1207
                         ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1208 1208
                         : '';
1209 1209
                     $dtHora = $this->toDateTime(
@@ -1233,7 +1233,7 @@  discard block
 block discarded – undo
1233 1233
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1234 1234
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1235 1235
         //INSCRIÇÃO MUNICIPAL
1236
-        $x     += $w;
1236
+        $x += $w;
1237 1237
         $texto = 'INSCRIÇÃO MUNICIPAL';
1238 1238
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1239 1239
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1241,29 +1241,29 @@  discard block
 block discarded – undo
1241 1241
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1242 1242
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1243 1243
         //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.
1244
-        $x     += $w;
1244
+        $x += $w;
1245 1245
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1246 1246
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1247 1247
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1248
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1248
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1249 1249
             ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1250 1250
             : '';
1251 1251
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1252 1252
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1253 1253
         //CNPJ
1254
-        $x     += $w;
1254
+        $x += $w;
1255 1255
         $w     = ($maxW - (3 * $w));
1256 1256
         $texto = 'CNPJ / CPF';
1257 1257
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1258 1258
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1259 1259
         //Pegando valor do CPF/CNPJ
1260
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1260
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1261 1261
             $texto = $this->formatField(
1262 1262
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1263 1263
                 "###.###.###/####-##"
1264 1264
             );
1265 1265
         } else {
1266
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1266
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1267 1267
                 ? $this->formatField(
1268 1268
                     $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1269 1269
                     "###.###.###-##"
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
             $n = count($resp['message']);
1283 1283
             $alttot = $n * 15;
1284 1284
             $x = 10;
1285
-            $y = $this->hPrint/2 - $alttot/2;
1285
+            $y = $this->hPrint / 2 - $alttot / 2;
1286 1286
             $h = 15;
1287 1287
             $w = $maxW - (2 * $x);
1288 1288
             $this->pdf->settextcolor(170, 170, 170);
@@ -1355,7 +1355,7 @@  discard block
 block discarded – undo
1355 1355
         //NOME / RAZÃO SOCIAL
1356 1356
         $w     = round($maxW * 0.61, 0);
1357 1357
         $w1    = $w;
1358
-        $y     += 3;
1358
+        $y += 3;
1359 1359
         $texto = 'NOME / RAZÃO SOCIAL';
1360 1360
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1361 1361
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1367,20 +1367,20 @@  discard block
 block discarded – undo
1367 1367
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1368 1368
         }
1369 1369
         //CNPJ / CPF
1370
-        $x     += $w;
1370
+        $x += $w;
1371 1371
         $w     = round($maxW * 0.23, 0);
1372 1372
         $w2    = $w;
1373 1373
         $texto = 'CNPJ / CPF';
1374 1374
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1375 1375
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1376 1376
         //Pegando valor do CPF/CNPJ
1377
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1377
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1378 1378
             $texto = $this->formatField(
1379 1379
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1380 1380
                 "###.###.###/####-##"
1381 1381
             );
1382 1382
         } else {
1383
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1383
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1384 1384
                 ? $this->formatField(
1385 1385
                     $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1386 1386
                     "###.###.###-##"
@@ -1390,17 +1390,17 @@  discard block
 block discarded – undo
1390 1390
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1391 1391
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1392 1392
         //DATA DA EMISSÃO
1393
-        $x     += $w;
1393
+        $x += $w;
1394 1394
         $w     = $maxW - ($w1 + $w2);
1395 1395
         $wx    = $w;
1396 1396
         $texto = 'DATA DA EMISSÃO';
1397 1397
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1398 1398
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1399
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1399
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1400 1400
             ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1401 1401
             : '';
1402 1402
         if ($dEmi == '') {
1403
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1403
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1404 1404
                 ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1405 1405
                 : '';
1406 1406
             $aDemi = explode('T', $dEmi);
@@ -1416,7 +1416,7 @@  discard block
 block discarded – undo
1416 1416
         //ENDEREÇO
1417 1417
         $w     = round($maxW * 0.47, 0);
1418 1418
         $w1    = $w;
1419
-        $y     += $h;
1419
+        $y += $h;
1420 1420
         $x     = $oldX;
1421 1421
         $texto = 'ENDEREÇO';
1422 1422
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1429 1429
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1430 1430
         //BAIRRO / DISTRITO
1431
-        $x     += $w;
1431
+        $x += $w;
1432 1432
         $w     = round($maxW * 0.21, 0);
1433 1433
         $w2    = $w;
1434 1434
         $texto = 'BAIRRO / DISTRITO';
@@ -1438,29 +1438,29 @@  discard block
 block discarded – undo
1438 1438
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1439 1439
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1440 1440
         //CEP
1441
-        $x     += $w;
1441
+        $x += $w;
1442 1442
         $w     = $maxW - $w1 - $w2 - $wx;
1443 1443
         $w2    = $w;
1444 1444
         $texto = 'CEP';
1445 1445
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1446 1446
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1447
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1447
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1448 1448
             ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1449 1449
             : '';
1450 1450
         $texto = $this->formatField($texto, "#####-###");
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
         //DATA DA SAÍDA
1454
-        $x     += $w;
1454
+        $x += $w;
1455 1455
         $w     = $wx;
1456 1456
         $texto = 'DATA DA SAÍDA/ENTRADA';
1457 1457
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1458 1458
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1459
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1459
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1460 1460
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1461 1461
             : '';
1462 1462
         if ($dSaiEnt == '') {
1463
-            $dSaiEnt  = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1463
+            $dSaiEnt  = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1464 1464
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1465 1465
                 : '';
1466 1466
             $aDsaient = explode('T', $dSaiEnt);
@@ -1471,7 +1471,7 @@  discard block
 block discarded – undo
1471 1471
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1472 1472
         //MUNICÍPIO
1473 1473
         $w     = $w1;
1474
-        $y     += $h;
1474
+        $y += $h;
1475 1475
         $x     = $oldX;
1476 1476
         $texto = 'MUNICÍPIO';
1477 1477
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1486 1486
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1487 1487
         //UF
1488
-        $x     += $w;
1488
+        $x += $w;
1489 1489
         $w     = 8;
1490 1490
         $texto = 'UF';
1491 1491
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1494,19 +1494,19 @@  discard block
 block discarded – undo
1494 1494
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1495 1495
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1496 1496
         //FONE / FAX
1497
-        $x     += $w;
1497
+        $x += $w;
1498 1498
         $w     = round(($maxW - $w1 - $wx - 8) / 2, 0);
1499 1499
         $w3    = $w;
1500 1500
         $texto = 'FONE / FAX';
1501 1501
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1502 1502
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1503
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1503
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1504 1504
             ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1505 1505
             : '';
1506 1506
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1507 1507
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1508 1508
         //INSCRIÇÃO ESTADUAL
1509
-        $x     += $w;
1509
+        $x += $w;
1510 1510
         $w     = $maxW - $w1 - $wx - 8 - $w3;
1511 1511
         $texto = 'INSCRIÇÃO ESTADUAL';
1512 1512
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1516,16 +1516,16 @@  discard block
 block discarded – undo
1516 1516
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1517 1517
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1518 1518
         //HORA DA SAÍDA
1519
-        $x     += $w;
1519
+        $x += $w;
1520 1520
         $w     = $wx;
1521 1521
         $texto = 'HORA DA SAÍDA/ENTRADA';
1522 1522
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1523 1523
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1524
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1524
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1525 1525
             ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1526 1526
             : '';
1527 1527
         if ($hSaiEnt == '') {
1528
-            $dhSaiEnt   = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1528
+            $dhSaiEnt   = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1529 1529
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1530 1530
                 : '';
1531 1531
             $tsDhSaiEnt = $this->toDateTime($dhSaiEnt);
@@ -1569,7 +1569,7 @@  discard block
 block discarded – undo
1569 1569
         //NOME / RAZÃO SOCIAL
1570 1570
         $w     = round($maxW * 0.61, 0);
1571 1571
         $w1    = $w;
1572
-        $y     += 3;
1572
+        $y += 3;
1573 1573
         $texto = 'NOME / RAZÃO SOCIAL';
1574 1574
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1575 1575
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1584,20 +1584,20 @@  discard block
 block discarded – undo
1584 1584
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1585 1585
         }
1586 1586
         //CNPJ / CPF
1587
-        $x     += $w;
1587
+        $x += $w;
1588 1588
         $w     = round($maxW * 0.23, 0);
1589 1589
         $w2    = $w;
1590 1590
         $texto = 'CNPJ / CPF';
1591 1591
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1592 1592
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1593 1593
         //Pegando valor do CPF/CNPJ
1594
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1594
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1595 1595
             $texto = $this->formatField(
1596 1596
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1597 1597
                 "###.###.###/####-##"
1598 1598
             );
1599 1599
         } else {
1600
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1600
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1601 1601
                 $this->formatField(
1602 1602
                     $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1603 1603
                     "###.###.###-##"
@@ -1606,7 +1606,7 @@  discard block
 block discarded – undo
1606 1606
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1607 1607
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1608 1608
         //INSCRIÇÃO ESTADUAL
1609
-        $x     += $w;
1609
+        $x += $w;
1610 1610
         $w     = $maxW - ($w1 + $w2);
1611 1611
         $wx    = $w;
1612 1612
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1625,7 +1625,7 @@  discard block
 block discarded – undo
1625 1625
         //ENDEREÇO
1626 1626
         $w     = round($maxW * 0.355, 0) + $wx;
1627 1627
         $w1    = $w;
1628
-        $y     += $h;
1628
+        $y += $h;
1629 1629
         $x     = $oldX;
1630 1630
         $texto = 'ENDEREÇO';
1631 1631
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1636,7 +1636,7 @@  discard block
 block discarded – undo
1636 1636
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1637 1637
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1638 1638
         //BAIRRO / DISTRITO
1639
-        $x     += $w;
1639
+        $x += $w;
1640 1640
         $w     = round($maxW * 0.335, 0);
1641 1641
         $w2    = $w;
1642 1642
         $texto = 'BAIRRO / DISTRITO';
@@ -1646,12 +1646,12 @@  discard block
 block discarded – undo
1646 1646
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1647 1647
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1648 1648
         //CEP
1649
-        $x     += $w;
1649
+        $x += $w;
1650 1650
         $w     = $maxW - ($w1 + $w2);
1651 1651
         $texto = 'CEP';
1652 1652
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1653 1653
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1654
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1654
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1655 1655
             $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1656 1656
         $texto = $this->formatField($texto, "#####-###");
1657 1657
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1659,7 +1659,7 @@  discard block
 block discarded – undo
1659 1659
         //MUNICÍPIO
1660 1660
         $w     = round($maxW * 0.805, 0);
1661 1661
         $w1    = $w;
1662
-        $y     += $h;
1662
+        $y += $h;
1663 1663
         $x     = $oldX;
1664 1664
         $texto = 'MUNICÍPIO';
1665 1665
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1672 1672
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1673 1673
         //UF
1674
-        $x     += $w;
1674
+        $x += $w;
1675 1675
         $w     = 8;
1676 1676
         $texto = 'UF';
1677 1677
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1680,12 +1680,12 @@  discard block
 block discarded – undo
1680 1680
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1681 1681
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1682 1682
         //FONE / FAX
1683
-        $x     += $w;
1683
+        $x += $w;
1684 1684
         $w     = $maxW - $w - $w1;
1685 1685
         $texto = 'FONE / FAX';
1686 1686
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1687 1687
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1688
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1688
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1689 1689
             $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1690 1690
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1691 1691
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1722,7 +1722,7 @@  discard block
 block discarded – undo
1722 1722
         //NOME / RAZÃO SOCIAL
1723 1723
         $w     = round($maxW * 0.61, 0);
1724 1724
         $w1    = $w;
1725
-        $y     += 3;
1725
+        $y += 3;
1726 1726
         $texto = 'NOME / RAZÃO SOCIAL';
1727 1727
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1728 1728
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1737,20 +1737,20 @@  discard block
 block discarded – undo
1737 1737
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1738 1738
         }
1739 1739
         //CNPJ / CPF
1740
-        $x     += $w;
1740
+        $x += $w;
1741 1741
         $w     = round($maxW * 0.23, 0);
1742 1742
         $w2    = $w;
1743 1743
         $texto = 'CNPJ / CPF';
1744 1744
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1745 1745
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1746 1746
         //Pegando valor do CPF/CNPJ
1747
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1747
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1748 1748
             $texto = $this->formatField(
1749 1749
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1750 1750
                 "###.###.###/####-##"
1751 1751
             );
1752 1752
         } else {
1753
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1753
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1754 1754
                 $this->formatField(
1755 1755
                     $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1756 1756
                     "###.###.###-##"
@@ -1759,7 +1759,7 @@  discard block
 block discarded – undo
1759 1759
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1760 1760
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1761 1761
         //INSCRIÇÃO ESTADUAL
1762
-        $x     += $w;
1762
+        $x += $w;
1763 1763
         $w     = $maxW - ($w1 + $w2);
1764 1764
         $wx    = $w;
1765 1765
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1778,7 +1778,7 @@  discard block
 block discarded – undo
1778 1778
         //ENDEREÇO
1779 1779
         $w     = round($maxW * 0.355, 0) + $wx;
1780 1780
         $w1    = $w;
1781
-        $y     += $h;
1781
+        $y += $h;
1782 1782
         $x     = $oldX;
1783 1783
         $texto = 'ENDEREÇO';
1784 1784
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1789,7 +1789,7 @@  discard block
 block discarded – undo
1789 1789
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1790 1790
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1791 1791
         //BAIRRO / DISTRITO
1792
-        $x     += $w;
1792
+        $x += $w;
1793 1793
         $w     = round($maxW * 0.335, 0);
1794 1794
         $w2    = $w;
1795 1795
         $texto = 'BAIRRO / DISTRITO';
@@ -1799,12 +1799,12 @@  discard block
 block discarded – undo
1799 1799
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1800 1800
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1801 1801
         //CEP
1802
-        $x     += $w;
1802
+        $x += $w;
1803 1803
         $w     = $maxW - ($w1 + $w2);
1804 1804
         $texto = 'CEP';
1805 1805
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1806 1806
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1807
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1807
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1808 1808
             $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1809 1809
         $texto = $this->formatField($texto, "#####-###");
1810 1810
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
         //MUNICÍPIO
1813 1813
         $w     = round($maxW * 0.805, 0);
1814 1814
         $w1    = $w;
1815
-        $y     += $h;
1815
+        $y += $h;
1816 1816
         $x     = $oldX;
1817 1817
         $texto = 'MUNICÍPIO';
1818 1818
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1825 1825
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1826 1826
         //UF
1827
-        $x     += $w;
1827
+        $x += $w;
1828 1828
         $w     = 8;
1829 1829
         $texto = 'UF';
1830 1830
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1833,12 +1833,12 @@  discard block
 block discarded – undo
1833 1833
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1834 1834
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1835 1835
         //FONE / FAX
1836
-        $x     += $w;
1836
+        $x += $w;
1837 1837
         $w     = $maxW - $w - $w1;
1838 1838
         $texto = 'FONE / FAX';
1839 1839
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1840 1840
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1841
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1841
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1842 1842
             $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1843 1843
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1844 1844
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
         if (isset($this->cobr)) {
1859 1859
             $fat = $this->cobr->getElementsByTagName("fat")->item(0);
1860 1860
             if (isset($fat)) {
1861
-                if (! empty($this->getTagValue($this->ide, "indPag"))) {
1861
+                if (!empty($this->getTagValue($this->ide, "indPag"))) {
1862 1862
                     $textoIndPag = "";
1863 1863
                     $indPag      = $this->getTagValue($this->ide, "indPag");
1864 1864
                     if ($indPag === "0") {
@@ -1932,7 +1932,7 @@  discard block
 block discarded – undo
1932 1932
             $h     = 8;
1933 1933
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
1934 1934
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1935
-            $y       += 3;
1935
+            $y += 3;
1936 1936
             $dups    = "";
1937 1937
             $dupcont = 0;
1938 1938
             $nFat    = $this->dup->length;
@@ -1966,13 +1966,13 @@  discard block
 block discarded – undo
1966 1966
             }
1967 1967
             $increm = 1;
1968 1968
             foreach ($this->dup as $k => $d) {
1969
-                $nDup  = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1969
+                $nDup  = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1970 1970
                     ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1971 1971
                     : '';
1972
-                $dDup  = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1972
+                $dDup  = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1973 1973
                     ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1974 1974
                     : '';
1975
-                $vDup  = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1975
+                $vDup  = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1976 1976
                     ? 'R$ ' . number_format(
1977 1977
                         $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1978 1978
                         2,
@@ -2019,7 +2019,7 @@  discard block
 block discarded – undo
2019 2019
             }
2020 2020
             if ($dupcont == 0) {
2021 2021
                 $y -= 9;
2022
-                $linha --;
2022
+                $linha--;
2023 2023
             }
2024 2024
 
2025 2025
             return ($y + $h);
@@ -2059,7 +2059,7 @@  discard block
 block discarded – undo
2059 2059
             $h     = 8;
2060 2060
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
2061 2061
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2062
-            $y       += 3;
2062
+            $y += 3;
2063 2063
             $dups    = "";
2064 2064
             $dupcont = 0;
2065 2065
             if ($this->orientacao == 'P') {
@@ -2092,7 +2092,7 @@  discard block
 block discarded – undo
2092 2092
                 '90' => 'Sem pagamento',
2093 2093
                 '99' => 'Outros'
2094 2094
             ];
2095
-            $bandeira       = [
2095
+            $bandeira = [
2096 2096
                 '01' => 'Visa',
2097 2097
                 '02' => 'Mastercard',
2098 2098
                 '03' => 'American',
@@ -2105,10 +2105,10 @@  discard block
 block discarded – undo
2105 2105
                 '99' => 'Outros'
2106 2106
             ];
2107 2107
             foreach ($this->detPag as $k => $d) {
2108
-                $fPag  = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2108
+                $fPag  = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2109 2109
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
2110 2110
                     : '0';
2111
-                $vPag  = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2111
+                $vPag  = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2112 2112
                     ? 'R$ ' . number_format(
2113 2113
                         $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
2114 2114
                         2,
@@ -2151,7 +2151,7 @@  discard block
 block discarded – undo
2151 2151
             }
2152 2152
             if ($dupcont == 0) {
2153 2153
                 $y -= 9;
2154
-                $linha --;
2154
+                $linha--;
2155 2155
             }
2156 2156
 
2157 2157
             return ($y + $h);
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
         $the_field    = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0);
2184 2184
         if (isset($the_field)) {
2185 2185
             $the_value = $the_field->nodeValue;
2186
-            if (! empty($the_value)) {
2186
+            if (!empty($the_value)) {
2187 2187
                 $valorImposto = number_format($the_value, 2, ",", ".");
2188 2188
             }
2189 2189
         }
@@ -2212,10 +2212,10 @@  discard block
 block discarded – undo
2212 2212
         $x_inicial = $x;
2213 2213
         //#####################################################################
2214 2214
         $campos_por_linha = 9;
2215
-        if (! $this->exibirPIS) {
2216
-            $campos_por_linha --;
2215
+        if (!$this->exibirPIS) {
2216
+            $campos_por_linha--;
2217 2217
         }
2218
-        if (! $this->exibirIcmsInterestadual) {
2218
+        if (!$this->exibirIcmsInterestadual) {
2219 2219
             $campos_por_linha -= 2;
2220 2220
         }
2221 2221
 
@@ -2302,12 +2302,12 @@  discard block
 block discarded – undo
2302 2302
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2303 2303
         //NOME / RAZÃO SOCIAL
2304 2304
         $w1    = $maxW * 0.29;
2305
-        $y     += 3;
2305
+        $y += 3;
2306 2306
         $texto = 'NOME / RAZÃO SOCIAL';
2307 2307
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2308 2308
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2309 2309
         if (isset($this->transporta)) {
2310
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2310
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2311 2311
                 ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2312 2312
                 : '';
2313 2313
         } else {
@@ -2316,12 +2316,12 @@  discard block
 block discarded – undo
2316 2316
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2317 2317
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2318 2318
         //FRETE POR CONTA
2319
-        $x     += $w1;
2319
+        $x += $w1;
2320 2320
         $w2    = $maxW * 0.15;
2321 2321
         $texto = 'FRETE';
2322 2322
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2323 2323
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2324
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2324
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2325 2325
             ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2326 2326
             : '0';
2327 2327
         switch ($tipoFrete) {
@@ -2347,12 +2347,12 @@  discard block
 block discarded – undo
2347 2347
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2348 2348
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, '');
2349 2349
         //CÓDIGO ANTT
2350
-        $x     += $w2;
2350
+        $x += $w2;
2351 2351
         $texto = 'CÓDIGO ANTT';
2352 2352
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2353 2353
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2354 2354
         if (isset($this->veicTransp)) {
2355
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2355
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2356 2356
                 ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2357 2357
                 : '';
2358 2358
         } else {
@@ -2361,16 +2361,16 @@  discard block
 block discarded – undo
2361 2361
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2362 2362
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2363 2363
         //PLACA DO VEÍC
2364
-        $x     += $w2;
2364
+        $x += $w2;
2365 2365
         $texto = 'PLACA DO VEÍCULO';
2366 2366
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2367 2367
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2368 2368
         if (isset($this->veicTransp)) {
2369
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2369
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2370 2370
                 ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2371 2371
                 : '';
2372 2372
         } elseif (isset($this->reboque)) {
2373
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2373
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2374 2374
                 ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2375 2375
                 : '';
2376 2376
         } else {
@@ -2379,17 +2379,17 @@  discard block
 block discarded – undo
2379 2379
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2380 2380
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2381 2381
         //UF
2382
-        $x     += $w2;
2382
+        $x += $w2;
2383 2383
         $w3    = round($maxW * 0.04, 0);
2384 2384
         $texto = 'UF';
2385 2385
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2386 2386
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2387 2387
         if (isset($this->veicTransp)) {
2388
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2388
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2389 2389
                 ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2390 2390
                 : '';
2391 2391
         } elseif (isset($this->reboque)) {
2392
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2392
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2393 2393
                 ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2394 2394
                 : '';
2395 2395
         } else {
@@ -2398,20 +2398,20 @@  discard block
 block discarded – undo
2398 2398
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2399 2399
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2400 2400
         //CNPJ / CPF
2401
-        $x     += $w3;
2401
+        $x += $w3;
2402 2402
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2403 2403
         $texto = 'CNPJ / CPF';
2404 2404
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2405 2405
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2406 2406
         if (isset($this->transporta)) {
2407
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2407
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2408 2408
                 ? $this->formatField(
2409 2409
                     $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2410 2410
                     "##.###.###/####-##"
2411 2411
                 )
2412 2412
                 : '';
2413 2413
             if ($texto == '') {
2414
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2414
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2415 2415
                     ? $this->formatField(
2416 2416
                         $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2417 2417
                         "###.###.###-##"
@@ -2425,7 +2425,7 @@  discard block
 block discarded – undo
2425 2425
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
2426 2426
         //#####################################################################
2427 2427
         //ENDEREÇO
2428
-        $y     += $h;
2428
+        $y += $h;
2429 2429
         $x     = $oldX;
2430 2430
         $h     = 7;
2431 2431
         $w1    = $maxW * 0.44;
@@ -2433,7 +2433,7 @@  discard block
 block discarded – undo
2433 2433
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2434 2434
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2435 2435
         if (isset($this->transporta)) {
2436
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2436
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2437 2437
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2438 2438
                 : '';
2439 2439
         } else {
@@ -2442,13 +2442,13 @@  discard block
 block discarded – undo
2442 2442
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2443 2443
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2444 2444
         //MUNICÍPIO
2445
-        $x     += $w1;
2445
+        $x += $w1;
2446 2446
         $w2    = round($maxW * 0.30, 0);
2447 2447
         $texto = 'MUNICÍPIO';
2448 2448
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2449 2449
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2450 2450
         if (isset($this->transporta)) {
2451
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2451
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2452 2452
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2453 2453
                 : '';
2454 2454
         } else {
@@ -2457,13 +2457,13 @@  discard block
 block discarded – undo
2457 2457
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2458 2458
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2459 2459
         //UF
2460
-        $x     += $w2;
2460
+        $x += $w2;
2461 2461
         $w3    = round($maxW * 0.04, 0);
2462 2462
         $texto = 'UF';
2463 2463
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2464 2464
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2465 2465
         if (isset($this->transporta)) {
2466
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2466
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2467 2467
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2468 2468
                 : '';
2469 2469
         } else {
@@ -2472,14 +2472,14 @@  discard block
 block discarded – undo
2472 2472
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2473 2473
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2474 2474
         //INSCRIÇÃO ESTADUAL
2475
-        $x     += $w3;
2475
+        $x += $w3;
2476 2476
         $w     = $maxW - ($w1 + $w2 + $w3);
2477 2477
         $texto = 'INSCRIÇÃO ESTADUAL';
2478 2478
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2479 2479
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2480 2480
         $texto = '';
2481 2481
         if (isset($this->transporta)) {
2482
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2482
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2483 2483
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2484 2484
             }
2485 2485
         }
@@ -2495,13 +2495,13 @@  discard block
 block discarded – undo
2495 2495
         $pesoBruto   = 0;
2496 2496
         $pesoLiquido = 0;
2497 2497
         foreach ($volumes as $volume) {
2498
-            $quantidade  += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2498
+            $quantidade  += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2499 2499
                 $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2500
-            $pesoBruto   += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2500
+            $pesoBruto   += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2501 2501
                 $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2502
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2502
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2503 2503
                 $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2504
-            $texto       = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2504
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2505 2505
                 $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2506 2506
             if ($texto != $especie && $especie != '') {
2507 2507
                 //tem várias especies
@@ -2509,7 +2509,7 @@  discard block
 block discarded – undo
2509 2509
             } else {
2510 2510
                 $especie = $texto;
2511 2511
             }
2512
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2512
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2513 2513
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2514 2514
                 : '';
2515 2515
             if ($texto != $marca && $marca != '') {
@@ -2518,7 +2518,7 @@  discard block
 block discarded – undo
2518 2518
             } else {
2519 2519
                 $marca = $texto;
2520 2520
             }
2521
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2521
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2522 2522
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2523 2523
                 : '';
2524 2524
             if ($texto != $numero && $numero != '') {
@@ -2531,20 +2531,20 @@  discard block
 block discarded – undo
2531 2531
 
2532 2532
         //#####################################################################
2533 2533
         //QUANTIDADE
2534
-        $y     += $h;
2534
+        $y += $h;
2535 2535
         $x     = $oldX;
2536 2536
         $h     = 7;
2537 2537
         $w1    = round($maxW * 0.10, 0);
2538 2538
         $texto = 'QUANTIDADE';
2539 2539
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2540 2540
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2541
-        if (! empty($quantidade)) {
2541
+        if (!empty($quantidade)) {
2542 2542
             $texto = $quantidade;
2543 2543
             $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2544 2544
             $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, '');
2545 2545
         }
2546 2546
         //ESPÉCIE
2547
-        $x     += $w1;
2547
+        $x += $w1;
2548 2548
         $w2    = round($maxW * 0.17, 0);
2549 2549
         $texto = 'ESPÉCIE';
2550 2550
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2553,16 +2553,16 @@  discard block
 block discarded – undo
2553 2553
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2554 2554
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2555 2555
         //MARCA
2556
-        $x     += $w2;
2556
+        $x += $w2;
2557 2557
         $texto = 'MARCA';
2558 2558
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2559 2559
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2560
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2560
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2561 2561
             $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2562 2562
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2563 2563
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2564 2564
         //NUMERAÇÃO
2565
-        $x     += $w2;
2565
+        $x += $w2;
2566 2566
         $texto = 'NUMERAÇÃO';
2567 2567
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2568 2568
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2570,7 +2570,7 @@  discard block
 block discarded – undo
2570 2570
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2571 2571
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2572 2572
         //PESO BRUTO
2573
-        $x     += $w2;
2573
+        $x += $w2;
2574 2574
         $w3    = round($maxW * 0.20, 0);
2575 2575
         $texto = 'PESO BRUTO';
2576 2576
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2583,7 +2583,7 @@  discard block
 block discarded – undo
2583 2583
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2584 2584
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2585 2585
         //PESO LÍQUIDO
2586
-        $x     += $w3;
2586
+        $x += $w3;
2587 2587
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2588 2588
         $texto = 'PESO LÍQUIDO';
2589 2589
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2603,11 +2603,11 @@  discard block
 block discarded – undo
2603 2603
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2604 2604
     {
2605 2605
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
2606
-        if (! isset($valor_original)) {
2606
+        if (!isset($valor_original)) {
2607 2607
             return "";
2608 2608
         }
2609 2609
         $valor_original = $valor_original->nodeValue;
2610
-        $valor          = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2610
+        $valor          = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2611 2611
 
2612 2612
         if ($valor != "") {
2613 2613
             return sprintf($formato, $valor);
@@ -2633,7 +2633,7 @@  discard block
 block discarded – undo
2633 2633
         $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0);
2634 2634
         $impostos   = '';
2635 2635
 
2636
-        if (! empty($ICMS)) {
2636
+        if (!empty($ICMS)) {
2637 2637
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s");
2638 2638
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%");
2639 2639
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s");
@@ -2649,7 +2649,7 @@  discard block
 block discarded – undo
2649 2649
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s");
2650 2650
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s");
2651 2651
         }
2652
-        if (! empty($ICMSUFDest)) {
2652
+        if (!empty($ICMSUFDest)) {
2653 2653
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%");
2654 2654
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%");
2655 2655
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%");
@@ -2657,7 +2657,7 @@  discard block
 block discarded – undo
2657 2657
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2658 2658
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2659 2659
         }
2660
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2660
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2661 2661
             ? substr(
2662 2662
                 //$this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2663 2663
                 $itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue,
@@ -2665,13 +2665,13 @@  discard block
 block discarded – undo
2665 2665
                 500
2666 2666
             )
2667 2667
             : '';
2668
-        if (! empty($infAdProd)) {
2668
+        if (!empty($infAdProd)) {
2669 2669
             $infAdProd = trim($infAdProd);
2670 2670
             $infAdProd .= ' ';
2671 2671
         }
2672 2672
         $loteTxt = '';
2673 2673
         $rastro  = $prod->getElementsByTagName("med");
2674
-        if (! empty($prod->getElementsByTagName("rastro"))) {
2674
+        if (!empty($prod->getElementsByTagName("rastro"))) {
2675 2675
             $rastro = $prod->getElementsByTagName("rastro");
2676 2676
             $i      = 0;
2677 2677
             while ($i < $rastro->length) {
@@ -2685,14 +2685,14 @@  discard block
 block discarded – undo
2685 2685
                 $loteTxt .= $datafab; //$this->getTagDate($rastro->item($i), 'dFab', ' Fab: ');
2686 2686
                 $loteTxt .= $dataval; //$this->getTagDate($rastro->item($i), 'dVal', ' Val: ');
2687 2687
                 $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: ');
2688
-                $i ++;
2688
+                $i++;
2689 2689
             }
2690 2690
             if ($loteTxt != '') {
2691 2691
                 $loteTxt .= ' ';
2692 2692
             }
2693 2693
         }
2694 2694
         //NT2013.006 FCI
2695
-        $nFCI   = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2695
+        $nFCI   = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2696 2696
             ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2697 2697
         $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2698 2698
         $texto  = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
@@ -2742,7 +2742,7 @@  discard block
 block discarded – undo
2742 2742
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2743 2743
         $y += 3;
2744 2744
         //desenha a caixa dos dados dos itens da NF
2745
-        $hmax  += 1;
2745
+        $hmax += 1;
2746 2746
         $texto = '';
2747 2747
         $this->pdf->textBox($x, $y, $w, $hmax);
2748 2748
         //##################################################################################
@@ -2755,101 +2755,101 @@  discard block
 block discarded – undo
2755 2755
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2756 2756
         $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2757 2757
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2758
-        $x     += $w1;
2758
+        $x += $w1;
2759 2759
         $w2    = round($w * 0.25, 0);
2760 2760
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2761 2761
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2762 2762
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2763 2763
         $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2764 2764
         //NCM/SH
2765
-        $x     += $w2;
2765
+        $x += $w2;
2766 2766
         $w3    = round($w * 0.06, 0);
2767 2767
         $texto = 'NCM/SH';
2768 2768
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2769 2769
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2770 2770
         $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2771 2771
         //O/CST ou O/CSOSN
2772
-        $x     += $w3;
2772
+        $x += $w3;
2773 2773
         $w4    = round($w * 0.05, 0);
2774 2774
         $texto = 'O/CST'; // CRT = 2 ou CRT = 3
2775 2775
         if ($this->getTagValue($this->emit, 'CRT') == '1') {
2776
-            $texto = 'O/CSOSN';//Regime do Simples CRT = 1
2776
+            $texto = 'O/CSOSN'; //Regime do Simples CRT = 1
2777 2777
         }
2778 2778
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2779 2779
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2780 2780
         $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2781 2781
         //CFOP
2782
-        $x     += $w4;
2782
+        $x += $w4;
2783 2783
         $w5    = round($w * 0.04, 0);
2784 2784
         $texto = 'CFOP';
2785 2785
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2786 2786
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2787 2787
         $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2788 2788
         //UN
2789
-        $x     += $w5;
2789
+        $x += $w5;
2790 2790
         $w6    = round($w * 0.03, 0);
2791 2791
         $texto = 'UN';
2792 2792
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2793 2793
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2794 2794
         $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2795 2795
         //QUANT
2796
-        $x     += $w6;
2796
+        $x += $w6;
2797 2797
         $w7    = round($w * 0.08, 0);
2798 2798
         $texto = 'QUANT';
2799 2799
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2800 2800
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2801 2801
         $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2802 2802
         //VALOR UNIT
2803
-        $x     += $w7;
2803
+        $x += $w7;
2804 2804
         $w8    = round($w * 0.06, 0);
2805 2805
         $texto = 'VALOR UNIT';
2806 2806
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2807 2807
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2808 2808
         $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2809 2809
         //VALOR TOTAL
2810
-        $x     += $w8;
2810
+        $x += $w8;
2811 2811
         $w9    = round($w * 0.06, 0);
2812 2812
         $texto = 'VALOR TOTAL';
2813 2813
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2814 2814
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2815 2815
         $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2816 2816
         //VALOR DESCONTO
2817
-        $x     += $w9;
2817
+        $x += $w9;
2818 2818
         $w10   = round($w * 0.05, 0);
2819 2819
         $texto = 'VALOR DESC';
2820 2820
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2821 2821
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2822 2822
         $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2823 2823
         //B.CÁLC ICMS
2824
-        $x     += $w10;
2824
+        $x += $w10;
2825 2825
         $w11   = round($w * 0.06, 0);
2826 2826
         $texto = 'B.CÁLC ICMS';
2827 2827
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2828 2828
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2829 2829
         $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2830 2830
         //VALOR ICMS
2831
-        $x     += $w11;
2831
+        $x += $w11;
2832 2832
         $w12   = round($w * 0.06, 0);
2833 2833
         $texto = 'VALOR ICMS';
2834 2834
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2835 2835
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2836 2836
         $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2837 2837
         //VALOR IPI
2838
-        $x     += $w12;
2838
+        $x += $w12;
2839 2839
         $w13   = round($w * 0.05, 0);
2840 2840
         $texto = 'VALOR IPI';
2841 2841
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2842 2842
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2843 2843
         $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2844 2844
         //ALÍQ. ICMS
2845
-        $x     += $w13;
2845
+        $x += $w13;
2846 2846
         $w14   = round($w * 0.04, 0);
2847 2847
         $texto = 'ALÍQ. ICMS';
2848 2848
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2849 2849
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2850 2850
         $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2851 2851
         //ALÍQ. IPI
2852
-        $x     += $w14;
2852
+        $x += $w14;
2853 2853
         $w15   = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2854 2854
         $texto = 'ALÍQ. IPI';
2855 2855
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
@@ -2903,7 +2903,7 @@  discard block
 block discarded – undo
2903 2903
                 // Informação sobre unidade de medida tributavel.
2904 2904
                 // Se não for para exibir a unidade de medida tributavel, então
2905 2905
                 // A Escrita irá começar em 0.
2906
-                if (! $mostrarUnidadeTributavel) {
2906
+                if (!$mostrarUnidadeTributavel) {
2907 2907
                     $yTrib = 0;
2908 2908
                 }
2909 2909
                 $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel);
@@ -2938,7 +2938,7 @@  discard block
 block discarded – undo
2938 2938
                 }
2939 2939
                 $x += $w2;
2940 2940
                 //NCM
2941
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2941
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2942 2942
                     $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2943 2943
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2944 2944
                 $x += $w3;
@@ -2951,11 +2951,11 @@  discard block
 block discarded – undo
2951 2951
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2952 2952
                 }
2953 2953
                 //CFOP
2954
-                $x     += $w4;
2954
+                $x += $w4;
2955 2955
                 $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue;
2956 2956
                 $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, '');
2957 2957
                 //Unidade
2958
-                $x     += $w5;
2958
+                $x += $w5;
2959 2959
                 $texto = $uCom;
2960 2960
                 $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, '');
2961 2961
                 //Unidade de medida tributável
@@ -2977,7 +2977,7 @@  discard block
 block discarded – undo
2977 2977
                 // QTDADE Tributável
2978 2978
                 if ($mostrarUnidadeTributavel) {
2979 2979
                     $qTrib = $prod->getElementsByTagName("qTrib")->item(0);
2980
-                    if (! empty($qTrib)) {
2980
+                    if (!empty($qTrib)) {
2981 2981
                         $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", ".");
2982 2982
                         $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2983 2983
                     }
@@ -2990,7 +2990,7 @@  discard block
 block discarded – undo
2990 2990
                 // Valor Unitário Tributável
2991 2991
                 if ($mostrarUnidadeTributavel) {
2992 2992
                     $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0);
2993
-                    if (! empty($vUnTrib)) {
2993
+                    if (!empty($vUnTrib)) {
2994 2994
                         $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", ".");
2995 2995
                         $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2996 2996
                     }
@@ -3004,7 +3004,7 @@  discard block
 block discarded – undo
3004 3004
                 $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
3005 3005
                 $x += $w9;
3006 3006
                 //Valor do Desconto
3007
-                $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
3007
+                $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
3008 3008
                     ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0;
3009 3009
 
3010 3010
                 $texto = number_format($vdesc, 2, ",", ".");
@@ -3012,7 +3012,7 @@  discard block
 block discarded – undo
3012 3012
                 //Valor da Base de calculo
3013 3013
                 $x += $w10;
3014 3014
                 if (isset($ICMS)) {
3015
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
3015
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
3016 3016
                         ? number_format(
3017 3017
                             $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
3018 3018
                             2,
@@ -3025,7 +3025,7 @@  discard block
 block discarded – undo
3025 3025
                 //Valor do ICMS
3026 3026
                 $x += $w11;
3027 3027
                 if (isset($ICMS)) {
3028
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
3028
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
3029 3029
                         ? number_format(
3030 3030
                             $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
3031 3031
                             2,
@@ -3038,7 +3038,7 @@  discard block
 block discarded – undo
3038 3038
                 //Valor do IPI
3039 3039
                 $x += $w12;
3040 3040
                 if (isset($IPI)) {
3041
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
3041
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
3042 3042
                         ? number_format(
3043 3043
                             $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
3044 3044
                             2,
@@ -3053,7 +3053,7 @@  discard block
 block discarded – undo
3053 3053
                 // %ICMS
3054 3054
                 $x += $w13;
3055 3055
                 if (isset($ICMS)) {
3056
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
3056
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
3057 3057
                         ? number_format(
3058 3058
                             $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
3059 3059
                             2,
@@ -3066,7 +3066,7 @@  discard block
 block discarded – undo
3066 3066
                 //%IPI
3067 3067
                 $x += $w14;
3068 3068
                 if (isset($IPI)) {
3069
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3069
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3070 3070
                         ? number_format(
3071 3071
                             $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
3072 3072
                             2,
@@ -3084,17 +3084,17 @@  discard block
 block discarded – undo
3084 3084
                 $veicProd = $prod->getElementsByTagName("veicProd")->item(0);
3085 3085
                 // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran
3086 3086
                 // Verifica se a Tag existe
3087
-                if (! empty($veicProd)) {
3087
+                if (!empty($veicProd)) {
3088 3088
                     $this->dadosItenVeiculoDANFE($oldX + 3, $y + 40, $nInicio, 3, $prod);
3089 3089
                 }
3090 3090
 
3091 3091
 
3092 3092
                 $y += $h;
3093
-                $i ++;
3093
+                $i++;
3094 3094
                 //incrementa o controle dos itens processados.
3095
-                $this->qtdeItensProc ++;
3095
+                $this->qtdeItensProc++;
3096 3096
             } else {
3097
-                $i ++;
3097
+                $i++;
3098 3098
             }
3099 3099
         }
3100 3100
 
@@ -3211,7 +3211,7 @@  discard block
 block discarded – undo
3211 3211
         $veiculoTipo       = $veicProd->getElementsByTagName("tpVeic")->item(0)->nodeValue;
3212 3212
 
3213 3213
         $veiculoMotor       = $veicProd->getElementsByTagName("nMotor")->item(0)->nodeValue;
3214
-        $veiculoCodigoModelo     = $veicProd->getElementsByTagName("cMod")->item(0)->nodeValue;
3214
+        $veiculoCodigoModelo = $veicProd->getElementsByTagName("cMod")->item(0)->nodeValue;
3215 3215
         $veiculoHp          = $veicProd->getElementsByTagName("pot")->item(0)->nodeValue;
3216 3216
         $veiculoPlaca       = ''; //$veiculo->getElementsByTagName("CMT")->item(0)->nodeValue;
3217 3217
         $veiculoTipoPintura = $veicProd->getElementsByTagName("tpPint")->item(0)->nodeValue;
@@ -3299,23 +3299,23 @@  discard block
 block discarded – undo
3299 3299
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
3300 3300
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3301 3301
         //INSCRIÇÃO MUNICIPAL
3302
-        $y     += 3;
3302
+        $y += 3;
3303 3303
         $w     = round($this->wPrint * 0.23, 0);
3304 3304
         $texto = 'INSCRIÇÃO MUNICIPAL';
3305 3305
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3306 3306
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3307 3307
         //inscrição municipal
3308
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3308
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3309 3309
             $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3310 3310
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3311 3311
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
3312 3312
         //VALOR TOTAL DOS SERVIÇOS
3313
-        $x     += $w;
3313
+        $x += $w;
3314 3314
         $texto = 'VALOR TOTAL DOS SERVIÇOS';
3315 3315
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3316 3316
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3317 3317
         if (isset($this->ISSQNtot)) {
3318
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3318
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3319 3319
                 $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3320 3320
             $texto = number_format($texto, 2, ",", ".");
3321 3321
         } else {
@@ -3324,14 +3324,14 @@  discard block
 block discarded – undo
3324 3324
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3325 3325
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3326 3326
         //BASE DE CÁLCULO DO ISSQN
3327
-        $x     += $w;
3327
+        $x += $w;
3328 3328
         $texto = 'BASE DE CÁLCULO DO ISSQN';
3329 3329
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3330 3330
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3331 3331
         if (isset($this->ISSQNtot)) {
3332
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3332
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3333 3333
                 $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3334
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3334
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3335 3335
         } else {
3336 3336
             $texto = '';
3337 3337
         }
@@ -3348,9 +3348,9 @@  discard block
 block discarded – undo
3348 3348
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3349 3349
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3350 3350
         if (isset($this->ISSQNtot)) {
3351
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3351
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3352 3352
                 $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3353
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3353
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3354 3354
         } else {
3355 3355
             $texto = '';
3356 3356
         }
@@ -3389,13 +3389,13 @@  discard block
 block discarded – undo
3389 3389
 
3390 3390
         //INFORMAÇÕES COMPLEMENTARES
3391 3391
         $texto = "INFORMAÇÕES COMPLEMENTARES";
3392
-        $y     += 3;
3392
+        $y += 3;
3393 3393
         $w     = $this->wAdic;
3394 3394
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B'];
3395 3395
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3396 3396
         //o texto com os dados adicionais foi obtido na função montaDANFE
3397 3397
         //e carregado em uma propriedade privada da classe
3398
-        $y     += 1;
3398
+        $y += 1;
3399 3399
         $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => ''];
3400 3400
         //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>''];
3401 3401
         $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
@@ -3440,7 +3440,7 @@  discard block
 block discarded – undo
3440 3440
                 $texto = "CONTINGÊNCIA SVC-RS\n" . $dhCont . "\n" . $xJust;
3441 3441
                 break;
3442 3442
         }
3443
-        $y     += 2;
3443
+        $y += 2;
3444 3444
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
3445 3445
         $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false);
3446 3446
 
@@ -3495,7 +3495,7 @@  discard block
 block discarded – undo
3495 3495
         $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
3496 3496
         if ($tpNF == '0') {
3497 3497
             //NFe de Entrada
3498
-            $emitente     = '';
3498
+            $emitente = '';
3499 3499
             $emitente     .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - ";
3500 3500
             $emitente     .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", ";
3501 3501
             $emitente     .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - ";
@@ -3548,10 +3548,10 @@  discard block
 block discarded – undo
3548 3548
             $texto .= "AO LADO";
3549 3549
         }
3550 3550
         $texto .= ". EMISSÃO: ";
3551
-        $dEmi  = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3551
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3552 3552
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3553 3553
         if ($dEmi == '') {
3554
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3554
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3555 3555
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3556 3556
             $aDemi = explode('T', $dEmi);
3557 3557
             $dEmi  = $aDemi[0];
@@ -3574,12 +3574,12 @@  discard block
 block discarded – undo
3574 3574
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3575 3575
             //DATA DE RECEBIMENTO
3576 3576
             $texto = "DATA DE RECEBIMENTO";
3577
-            $y     += $h;
3577
+            $y += $h;
3578 3578
             $w2    = round($this->wPrint * 0.17, 0); //35;
3579 3579
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3580 3580
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3581 3581
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3582
-            $x     += $w2;
3582
+            $x += $w2;
3583 3583
             $w3    = $w - $w2;
3584 3584
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3585 3585
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3590,7 +3590,7 @@  discard block
 block discarded – undo
3590 3590
 
3591 3591
             return $y;
3592 3592
         } else {
3593
-            $x --;
3593
+            $x--;
3594 3594
             $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3595 3595
             //NUMERO DA NOTA FISCAL LOGO NFE
3596 3596
             $w1    = 18;
@@ -3611,7 +3611,7 @@  discard block
 block discarded – undo
3611 3611
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3612 3612
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3613 3613
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3614
-            $y     -= $w2;
3614
+            $y -= $w2;
3615 3615
             $w3    = $w - $w2;
3616 3616
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3617 3617
             $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => ''];
@@ -3632,18 +3632,18 @@  discard block
 block discarded – undo
3632 3632
      */
3633 3633
     protected function geraInformacoesDaTagCompra()
3634 3634
     {
3635
-        if (! $this->gerarInformacoesAutomaticas) {
3635
+        if (!$this->gerarInformacoesAutomaticas) {
3636 3636
             return '';
3637 3637
         }
3638 3638
         $saida = "";
3639 3639
         if (isset($this->compra)) {
3640
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3640
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3641 3641
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3642 3642
             }
3643
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3643
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3644 3644
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3645 3645
             }
3646
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3646
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3647 3647
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3648 3648
             }
3649 3649
         }
@@ -3674,10 +3674,10 @@  discard block
 block discarded – undo
3674 3674
         if ($icmss > 0) {
3675 3675
             $icmss = 1;
3676 3676
         }
3677
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3677
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3678 3678
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3679 3679
         if ($dEmi == '') {
3680
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3680
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3681 3681
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3682 3682
             $aDemi = explode('T', $dEmi);
3683 3683
             $dEmi  = $aDemi[0];
@@ -3701,7 +3701,7 @@  discard block
 block discarded – undo
3701 3701
      */
3702 3702
     protected function geraInformacoesDasNotasReferenciadas()
3703 3703
     {
3704
-        if (! $this->gerarInformacoesAutomaticas) {
3704
+        if (!$this->gerarInformacoesAutomaticas) {
3705 3705
             return '';
3706 3706
         }
3707 3707
         $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]";
@@ -3729,7 +3729,7 @@  discard block
 block discarded – undo
3729 3729
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3730 3730
                 $serie         = substr($chave_acesso, 22, 3);
3731 3731
                 $numero        = substr($chave_acesso, 25, 9);
3732
-                $saida         .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3732
+                $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3733 3733
             }
3734 3734
             $refNF = $nfRef->getElementsByTagName('refNF');
3735 3735
             foreach ($refNF as $umaRefNFe) {
@@ -3740,7 +3740,7 @@  discard block
 block discarded – undo
3740 3740
                 $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue;
3741 3741
                 $data   = substr($data, 2, 2) . "/20" . substr($data, 0, 2);
3742 3742
                 $cnpj   = $this->formatField($cnpj, "##.###.###/####-##");
3743
-                $saida  .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3743
+                $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3744 3744
             }
3745 3745
             $refCTe = $nfRef->getElementsByTagName('refCTe');
3746 3746
             foreach ($refCTe as $chave_acessoRef) {
@@ -3750,7 +3750,7 @@  discard block
 block discarded – undo
3750 3750
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3751 3751
                 $serie         = substr($chave_acesso, 22, 3);
3752 3752
                 $numero        = substr($chave_acesso, 25, 9);
3753
-                $saida         .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3753
+                $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3754 3754
             }
3755 3755
             $refECF = $nfRef->getElementsByTagName('refECF');
3756 3756
             foreach ($refECF as $umaRefNFe) {
@@ -3762,10 +3762,9 @@  discard block
 block discarded – undo
3762 3762
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3763 3763
             foreach ($refNFP as $umaRefNFe) {
3764 3764
                 $data   = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3765
-                $cnpj   = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3766
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3767
-                    '';
3768
-                $cpf    = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3765
+                $cnpj   = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3766
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3767
+                $cpf    = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3769 3768
                     $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3770 3769
                 $mod    = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3771 3770
                 $serie  = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
@@ -3787,7 +3786,7 @@  discard block
 block discarded – undo
3787 3786
     private function loadDoc($xml)
3788 3787
     {
3789 3788
         $this->xml = $xml;
3790
-        if (! empty($xml)) {
3789
+        if (!empty($xml)) {
3791 3790
             $this->dom = new Dom();
3792 3791
             $this->dom->loadXML($this->xml);
3793 3792
             if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) {
@@ -3841,7 +3840,7 @@  discard block
 block discarded – undo
3841 3840
         $numlinhas    = $this->pdf->getNumLines($textoProduto, $w2, $aFont);
3842 3841
 
3843 3842
         if ($mostrarUnidadeTributavel && $numlinhas == 1) {
3844
-            $numlinhas ++;
3843
+            $numlinhas++;
3845 3844
         }
3846 3845
 
3847 3846
         return round(($numlinhas * $this->pdf->fontSize) + ($numlinhas * 0.5), 2);
Please login to merge, or discard this patch.