Passed
Pull Request — master (#389)
by Eduardo
03:13
created
src/NFe/Danfe.php 3 patches
Doc Comments   +27 added lines, -19 removed lines patch added patch discarded remove patch
@@ -835,8 +835,8 @@  discard block
 block discarded – undo
835 835
      *header
836 836
      * Monta o cabelhalho da DANFE (retrato e paisagem)
837 837
      *
838
-     * @param  number $x      Posição horizontal inicial, canto esquerdo
839
-     * @param  number $y      Posição vertical inicial, canto superior
838
+     * @param  integer $x      Posição horizontal inicial, canto esquerdo
839
+     * @param  integer $y      Posição vertical inicial, canto superior
840 840
      * @param  number $pag    Número da Página
841 841
      * @param  number $totPag Total de páginas
842 842
      * @return number Posição vertical final
@@ -1222,8 +1222,8 @@  discard block
 block discarded – undo
1222 1222
      * Monta o campo com os dados do destinatário na DANFE. (retrato e paisagem)
1223 1223
      *
1224 1224
      * @name   destinatarioDANFE
1225
-     * @param  number $x Posição horizontal canto esquerdo
1226
-     * @param  number $y Posição vertical canto superior
1225
+     * @param  integer $x Posição horizontal canto esquerdo
1226
+     * @param  integer $y Posição vertical canto superior
1227 1227
      * @return number Posição vertical final
1228 1228
      */
1229 1229
     protected function destinatarioDANFE($x = 0, $y = 0)
@@ -1434,8 +1434,8 @@  discard block
 block discarded – undo
1434 1434
      * Monta o campo com os dados do local de entrega na DANFE. (retrato e paisagem)
1435 1435
      *
1436 1436
      * @name   localEntregaDANFE
1437
-     * @param  number $x Posição horizontal canto esquerdo
1438
-     * @param  number $y Posição vertical canto superior
1437
+     * @param  integer $x Posição horizontal canto esquerdo
1438
+     * @param  integer $y Posição vertical canto superior
1439 1439
      * @return number Posição vertical final
1440 1440
      */
1441 1441
     protected function localEntregaDANFE($x = 0, $y = 0)
@@ -1584,8 +1584,8 @@  discard block
 block discarded – undo
1584 1584
      * Monta o campo com os dados do local de entrega na DANFE. (retrato e paisagem)
1585 1585
      *
1586 1586
      * @name   localretiradaDANFE
1587
-     * @param  number $x Posição horizontal canto esquerdo
1588
-     * @param  number $y Posição vertical canto superior
1587
+     * @param  integer $x Posição horizontal canto esquerdo
1588
+     * @param  integer $y Posição vertical canto superior
1589 1589
      * @return number Posição vertical final
1590 1590
      */
1591 1591
     protected function localRetiradaDANFE($x = 0, $y = 0)
@@ -1734,7 +1734,7 @@  discard block
 block discarded – undo
1734 1734
      * Gera a String do Texto da Fatura
1735 1735
      *
1736 1736
      * @name   getTextoFatura
1737
-     * @return uma String com o texto ou "";
1737
+     * @return string String com o texto ou "";
1738 1738
      */
1739 1739
     protected function getTextoFatura()
1740 1740
     {
@@ -1788,8 +1788,8 @@  discard block
 block discarded – undo
1788 1788
      * Monta o campo de duplicatas da DANFE (retrato e paisagem)
1789 1789
      *
1790 1790
      * @name   fatura
1791
-     * @param  number $x Posição horizontal canto esquerdo
1792
-     * @param  number $y Posição vertical canto superior
1791
+     * @param  integer $x Posição horizontal canto esquerdo
1792
+     * @param  double $y Posição vertical canto superior
1793 1793
      * @return number Posição vertical final
1794 1794
      */
1795 1795
     protected function fatura($x, $y)
@@ -1911,8 +1911,8 @@  discard block
 block discarded – undo
1911 1911
      * Monta o campo de pagamentos da DANFE (retrato e paisagem) (foi baseada na fatura)
1912 1912
      *
1913 1913
      * @name   pagamento
1914
-     * @param  number $x Posição horizontal canto esquerdo
1915
-     * @param  number $y Posição vertical canto superior
1914
+     * @param  integer $x Posição horizontal canto esquerdo
1915
+     * @param  double $y Posição vertical canto superior
1916 1916
      * @return number Posição vertical final
1917 1917
      */
1918 1918
     protected function pagamento($x, $y)
@@ -2020,6 +2020,8 @@  discard block
 block discarded – undo
2020 2020
      * @param  float $h Altura do campo
2021 2021
      * @param  float $h Título do campo
2022 2022
      * @param  float $h Valor do imposto
2023
+     * @param string $titulo
2024
+     * @param string $campoImposto
2023 2025
      * @return float Sugestão do $x do próximo imposto
2024 2026
      */
2025 2027
     protected function impostoHelper($x, $y, $w, $h, $titulo, $campoImposto)
@@ -2046,9 +2048,9 @@  discard block
 block discarded – undo
2046 2048
      * imposto
2047 2049
      * Monta o campo de impostos e totais da DANFE (retrato e paisagem)
2048 2050
      *
2049
-     * @param  number $x Posição horizontal canto esquerdo
2050
-     * @param  number $y Posição vertical canto superior
2051
-     * @return number Posição vertical final
2051
+     * @param  integer $x Posição horizontal canto esquerdo
2052
+     * @param  double $y Posição vertical canto superior
2053
+     * @return double Posição vertical final
2052 2054
      */
2053 2055
     protected function imposto($x, $y)
2054 2056
     {
@@ -2441,6 +2443,10 @@  discard block
 block discarded – undo
2441 2443
 
2442 2444
 
2443 2445
 
2446
+    /**
2447
+     * @param string $campo
2448
+     * @param string $formato
2449
+     */
2444 2450
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2445 2451
     {
2446 2452
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
@@ -2545,7 +2551,6 @@  discard block
 block discarded – undo
2545 2551
      * @param  float $x       Posição horizontal canto esquerdo
2546 2552
      * @param  float $y       Posição vertical canto superior
2547 2553
      * @param  float $nInicio Número do item inicial
2548
-     * @param  float $max     Número do item final
2549 2554
      * @param  float $hmax    Altura máxima do campo de itens em mm
2550 2555
      * @return float Posição vertical final
2551 2556
      */
@@ -3292,8 +3297,8 @@  discard block
 block discarded – undo
3292 3297
      * Monta o canhoto da DANFE (retrato e paisagem)
3293 3298
      *
3294 3299
      * @name   canhotoDANFE
3295
-     * @param  number $x Posição horizontal canto esquerdo
3296
-     * @param  number $y Posição vertical canto superior
3300
+     * @param  integer $x Posição horizontal canto esquerdo
3301
+     * @param  integer $y Posição vertical canto superior
3297 3302
      * @return number Posição vertical final
3298 3303
      *
3299 3304
      * TODO 21/07/14 fmertins: quando orientação L-paisagem, o canhoto está sendo gerado incorretamente
@@ -3592,6 +3597,9 @@  discard block
 block discarded – undo
3592 3597
         return $saida;
3593 3598
     }
3594 3599
 
3600
+    /**
3601
+     * @param string $xml
3602
+     */
3595 3603
     private function loadDoc($xml)
3596 3604
     {
3597 3605
         $this->xml = $xml;
Please login to merge, or discard this patch.
Indentation   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -374,7 +374,6 @@  discard block
 block discarded – undo
374 374
      * A definição de margens e posições iniciais para a impressão são estabelecidas
375 375
      * pelo conteúdo da funçao e podem ser modificados.
376 376
      *
377
-
378 377
      * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML
379 378
      */
380 379
     protected function monta(
@@ -1948,11 +1947,11 @@  discard block
 block discarded – undo
1948 1947
             }
1949 1948
             $increm = 1;
1950 1949
             $formaPagamento = ['01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito',
1951
-                               '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação',
1952
-                               '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível',
1953
-                               '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'];
1950
+                                '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação',
1951
+                                '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível',
1952
+                                '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'];
1954 1953
             $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners',
1955
-                         '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
1954
+                            '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
1956 1955
             foreach ($this->detPag as $k => $d) {
1957 1956
                 $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
1958 1957
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
Please login to merge, or discard this patch.
Spacing   +339 added lines, -340 removed lines patch added patch discarded remove patch
@@ -288,14 +288,14 @@  discard block
 block discarded – undo
288 288
             'style' => ''
289 289
         ];
290 290
         $k = $this->pdf->k;
291
-        $this->textadicfontsize = $fontProduto['size']/$k;
291
+        $this->textadicfontsize = $fontProduto['size'] / $k;
292 292
         $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
293 293
         if (isset($this->infAdic)) {
294 294
             $i = 0;
295 295
             if ($this->textoAdic != '') {
296 296
                 $this->textoAdic .= ". \n";
297 297
             }
298
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl"))
298
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl"))
299 299
                 ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl"))
300 300
                 : '';
301 301
             $infPedido = $this->geraInformacoesDaTagCompra();
@@ -303,14 +303,14 @@  discard block
 block discarded – undo
303 303
                 $this->textoAdic .= $infPedido;
304 304
             }
305 305
             $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
306
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco"))
306
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco"))
307 307
                 ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco")
308 308
                 : '';
309 309
             $obsCont = $this->infAdic->getElementsByTagName("obsCont");
310 310
             if (isset($obsCont)) {
311 311
                 foreach ($obsCont as $obs) {
312
-                    $campo =  $obsCont->item($i)->getAttribute("xCampo");
313
-                    $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
312
+                    $campo = $obsCont->item($i)->getAttribute("xCampo");
313
+                    $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
314 314
                         ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue
315 315
                         : '';
316 316
                     $this->textoAdic .= "\n" . $campo . ':  ' . trim($xTexto);
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
         //fim da alteração NT 2013.003 Lei da Transparência
337 337
         $this->textoAdic = str_replace(";", "\n", $this->textoAdic);
338 338
         $alinhas = explode("\n", $this->textoAdic);
339
-        $numlinhasdados = $this->pdf->getNumLines($this->textoAdic, $this->wAdic, $fontProduto)+1.5;
339
+        $numlinhasdados = $this->pdf->getNumLines($this->textoAdic, $this->wAdic, $fontProduto) + 1.5;
340 340
         $this->textadicfontsize = $this->pdf->fontSize;
341 341
         $hdadosadic = ceil($numlinhasdados * ($this->textadicfontsize));
342 342
         if ($hdadosadic > 70) {
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
                     'size' => $f,
348 348
                     'style' => ''
349 349
                 ];
350
-                $numlinhasdados = $this->pdf->getNumLines($this->textoAdic, $this->wAdic, $fontProduto)+3;
350
+                $numlinhasdados = $this->pdf->getNumLines($this->textoAdic, $this->wAdic, $fontProduto) + 3;
351 351
                 $this->textadicfontsize = $this->pdf->fontSize;
352 352
                 $hdadosadic = ceil($numlinhasdados * $this->textadicfontsize);
353 353
                 echo $hdadosadic;
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
             if ($this->papel == 'A4') {
407 407
                 $this->maxW = 297;
408 408
                 $this->maxH = 210;
409
-                $xInic = $this->margesq+10;
409
+                $xInic = $this->margesq + 10;
410 410
                 //se paisagem multiplica a largura do canhoto pela quantidade de canhotos
411 411
                 //$this->wCanhoto *= $this->qCanhoto;
412 412
             }
@@ -414,10 +414,10 @@  discard block
 block discarded – undo
414 414
         //total inicial de paginas
415 415
         $totPag = 1;
416 416
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
417
-        $this->wPrint = $this->maxW-($this->margesq * 2);
417
+        $this->wPrint = $this->maxW - ($this->margesq * 2);
418 418
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
419 419
         //superior e inferior
420
-        $this->hPrint = $this->maxH-$this->margsup-$this->marginf;
420
+        $this->hPrint = $this->maxH - $this->margsup - $this->marginf;
421 421
         // estabelece contagem de paginas
422 422
         $this->pdf->aliasNbPages();
423 423
         // fixa as margens
@@ -461,18 +461,18 @@  discard block
 block discarded – undo
461 461
         }
462 462
         //calcular a altura necessária para os dados adicionais
463 463
         if ($this->orientacao == 'P') {
464
-            $this->wAdic = round($this->wPrint*0.66, 0);
464
+            $this->wAdic = round($this->wPrint * 0.66, 0);
465 465
         } else {
466
-            $this->wAdic = round(($this->wPrint-$this->wCanhoto)*0.5, 0);
466
+            $this->wAdic = round(($this->wPrint - $this->wCanhoto) * 0.5, 0);
467 467
         }
468 468
         $fontProduto = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
469 469
 
470 470
         $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais();
471 471
 
472 472
         //altura disponivel para os campos da DANFE
473
-        $hcabecalho = 47;//para cabeçalho
474
-        $hdestinatario = 25;//para destinatario
475
-        $hduplicatas = 12;//para cada grupo de 7 duplicatas
473
+        $hcabecalho = 47; //para cabeçalho
474
+        $hdestinatario = 25; //para destinatario
475
+        $hduplicatas = 12; //para cada grupo de 7 duplicatas
476 476
         if (isset($this->entrega)) {
477 477
             $hlocalentrega = 25;
478 478
         } else {
@@ -483,11 +483,11 @@  discard block
 block discarded – undo
483 483
         } else {
484 484
             $hlocalretirada = 0;
485 485
         }
486
-        $himposto = 18;// para imposto
487
-        $htransporte = 25;// para transporte
488
-        $hissqn = 11;// para issqn
489
-        $hfooter = 5;// para rodape
490
-        $hCabecItens = 4;//cabeçalho dos itens
486
+        $himposto = 18; // para imposto
487
+        $htransporte = 25; // para transporte
488
+        $hissqn = 11; // para issqn
489
+        $hfooter = 5; // para rodape
490
+        $hCabecItens = 4; //cabeçalho dos itens
491 491
         $hOCUPADA = $hcabecalho
492 492
             + $hdestinatario
493 493
             + $hlocalentrega
@@ -510,10 +510,10 @@  discard block
 block discarded – undo
510 510
         $this->sizeExtraTextoFatura());*/
511 511
 
512 512
         if ($this->orientacao == 'P') {
513
-            $hDispo1 -= 24 * $this->qCanhoto;//para canhoto
513
+            $hDispo1 -= 24 * $this->qCanhoto; //para canhoto
514 514
             $w = $this->wPrint;
515 515
         } else {
516
-            $hcanhoto = $this->hPrint;//para canhoto
516
+            $hcanhoto = $this->hPrint; //para canhoto
517 517
             $w = $this->wPrint - $this->wCanhoto;
518 518
         }
519 519
         //$hDispo1 += 14;
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
         $fontProduto = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
523 523
         $numlinhas = 0;
524 524
         $hUsado = $hCabecItens;
525
-        $w2 = round($w*0.28, 0);
525
+        $w2 = round($w * 0.28, 0);
526 526
         $hDispo = $hDispo1;
527 527
         $totPag = 1;
528 528
         $i = 0;
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
                 $hDispo = $hDispo2;
539 539
                 $hUsado = $hCabecItens;
540 540
                 // Remove canhoto para páginas secundárias em modo paisagem ('L')
541
-                $w2 = round($this->wPrint*0.28, 0);
541
+                $w2 = round($this->wPrint * 0.28, 0);
542 542
                 $i--; // decrementa para readicionar o item que não coube nessa pagina na outra.
543 543
             }
544 544
             $i++;
@@ -559,14 +559,14 @@  discard block
 block discarded – undo
559 559
         //coloca o cabeçalho
560 560
         $y = $this->header($x, $y, $pag, $totPag);
561 561
         //coloca os dados do destinatário
562
-        $y = $this->destinatarioDANFE($x, $y+1);
562
+        $y = $this->destinatarioDANFE($x, $y + 1);
563 563
         //coloca os dados do local de retirada
564 564
         if (isset($this->retirada)) {
565
-            $y = $this->localRetiradaDANFE($x, $y+1);
565
+            $y = $this->localRetiradaDANFE($x, $y + 1);
566 566
         }
567 567
         //coloca os dados do local de entrega
568 568
         if (isset($this->entrega)) {
569
-            $y = $this->localEntregaDANFE($x, $y+1);
569
+            $y = $this->localEntregaDANFE($x, $y + 1);
570 570
         }
571 571
 
572 572
         //Verifica as formas de pagamento da nota fiscal
@@ -581,29 +581,29 @@  discard block
 block discarded – undo
581 581
         }
582 582
         //caso tenha boleto imprimir fatura
583 583
         if ($this->dup->length > 0) {
584
-            $y = $this->fatura($x, $y+1);
584
+            $y = $this->fatura($x, $y + 1);
585 585
         } else {
586 586
             //Se somente tiver a forma de pagamento sem pagamento não imprimir nada
587
-            if (count($formaPag)=='1' && isset($formaPag[90])) {
587
+            if (count($formaPag) == '1' && isset($formaPag[90])) {
588 588
                 $y = $y;
589 589
             } else {
590 590
                 //caso tenha mais de uma forma de pagamento ou seja diferente de boleto exibe a
591 591
                 //forma de pagamento e o valor
592
-                $y = $this->pagamento($x, $y+1);
592
+                $y = $this->pagamento($x, $y + 1);
593 593
             }
594 594
         }
595 595
         //coloca os dados dos impostos e totais da NFe
596
-        $y = $this->imposto($x, $y+1);
596
+        $y = $this->imposto($x, $y + 1);
597 597
         //coloca os dados do trasnporte
598
-        $y = $this->transporte($x, $y+1);
598
+        $y = $this->transporte($x, $y + 1);
599 599
         //itens da DANFE
600 600
         $nInicial = 0;
601 601
 
602
-        $y = $this->itens($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens);
602
+        $y = $this->itens($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens);
603 603
 
604 604
         //coloca os dados do ISSQN
605 605
         if ($linhaISSQN == 1) {
606
-            $y = $this->issqn($x, $y+4);
606
+            $y = $this->issqn($x, $y + 4);
607 607
         } else {
608 608
             $y += 4;
609 609
         }
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
             //coloca o cabeçalho na página adicional
633 633
             $y = $this->header($x, $y, $n, $totPag);
634 634
             //coloca os itens na página adicional
635
-            $y = $this->itens($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens);
635
+            $y = $this->itens($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens);
636 636
             //coloca o rodapé da página
637 637
             if ($this->orientacao == 'P') {
638 638
                 $this->rodape($this->margesq);
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
         if ($startPos === false) {
670 670
             return $cdata;
671 671
         }
672
-        for ($x=$len; $x>0; $x--) {
672
+        for ($x = $len; $x > 0; $x--) {
673 673
             if (substr($cdata, $x, 1) == '>') {
674 674
                 $endPos = $x;
675 675
                 break;
@@ -680,15 +680,15 @@  discard block
 block discarded – undo
680 680
         } else {
681 681
             $parte1 = '';
682 682
         }
683
-        $parte2 = substr($cdata, $startPos, $endPos-$startPos+1);
683
+        $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1);
684 684
         if ($endPos < $len) {
685 685
             $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1);
686 686
         } else {
687 687
             $parte3 = '';
688 688
         }
689
-        $texto = trim($parte1).' '.trim($parte3);
689
+        $texto = trim($parte1) . ' ' . trim($parte3);
690 690
         if (strpos($parte2, '<CDATA>') === false) {
691
-            $cdata = '<CDATA>'.$parte2.'</CDATA>';
691
+            $cdata = '<CDATA>' . $parte2 . '</CDATA>';
692 692
         } else {
693 693
             $cdata = $parte2;
694 694
         }
@@ -762,15 +762,15 @@  discard block
 block discarded – undo
762 762
         //grupo CADATA infCpl
763 763
         $t = $dom->getElementsByTagName('transmissor')->item(0);
764 764
         $r = $dom->getElementsByTagName('receptor')->item(0);
765
-        $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
766
-            'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : '';
767
-        $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
768
-            'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : '';
769
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
770
-            'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : '';
771
-        $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
772
-            'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : '';
773
-        $texto .= "".$versao.$especieNF.$fabEntrega.$dca;
765
+        $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
766
+            'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
767
+        $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
768
+            'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
769
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
770
+            'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
771
+        $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
772
+            'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
773
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
774 774
         if (isset($t)) {
775 775
             if ($t->hasAttributes()) {
776 776
                 $texto .= " Transmissor ";
@@ -856,14 +856,14 @@  discard block
 block discarded – undo
856 856
         }
857 857
         //####################################################################################
858 858
         //coluna esquerda identificação do emitente
859
-        $w = round($maxW*0.41, 0);
859
+        $w = round($maxW * 0.41, 0);
860 860
         if ($this->orientacao == 'P') {
861 861
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
862 862
         } else {
863 863
             $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
864 864
         }
865 865
         $w1 = $w;
866
-        $h=32;
866
+        $h = 32;
867 867
         $oldY += $h;
868 868
         $this->pdf->textBox($x, $y, $w, $h);
869 869
         $texto = 'IDENTIFICAÇÃO DO EMITENTE';
@@ -879,39 +879,39 @@  discard block
 block discarded – undo
879 879
         if (!empty($this->logomarca)) {
880 880
             $logoInfo = getimagesize($this->logomarca);
881 881
             //largura da imagem em mm
882
-            $logoWmm = ($logoInfo[0]/72)*25.4;
882
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
883 883
             //altura da imagem em mm
884
-            $logoHmm = ($logoInfo[1]/72)*25.4;
885
-            if ($this->logoAlign=='L') {
886
-                $nImgW = round($w/3, 0);
887
-                $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
888
-                $xImg = $x+1;
889
-                $yImg = round(($h-$nImgH)/2, 0)+$y;
884
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
885
+            if ($this->logoAlign == 'L') {
886
+                $nImgW = round($w / 3, 0);
887
+                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
888
+                $xImg = $x + 1;
889
+                $yImg = round(($h - $nImgH) / 2, 0) + $y;
890 890
                 //estabelecer posições do texto
891
-                $x1 = round($xImg + $nImgW +1, 0);
892
-                $y1 = round($h/3+$y, 0);
893
-                $tw = round(2*$w/3, 0);
894
-            } elseif ($this->logoAlign=='C') {
895
-                $nImgH = round($h/3, 0);
896
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
897
-                $xImg = round(($w-$nImgW)/2+$x, 0);
898
-                $yImg = $y+3;
891
+                $x1 = round($xImg + $nImgW + 1, 0);
892
+                $y1 = round($h / 3 + $y, 0);
893
+                $tw = round(2 * $w / 3, 0);
894
+            } elseif ($this->logoAlign == 'C') {
895
+                $nImgH = round($h / 3, 0);
896
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
897
+                $xImg = round(($w - $nImgW) / 2 + $x, 0);
898
+                $yImg = $y + 3;
899 899
                 $x1 = $x;
900 900
                 $y1 = round($yImg + $nImgH + 1, 0);
901 901
                 $tw = $w;
902
-            } elseif ($this->logoAlign=='R') {
903
-                $nImgW = round($w/3, 0);
904
-                $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
905
-                $xImg = round($x+($w-(1+$nImgW)), 0);
906
-                $yImg = round(($h-$nImgH)/2, 0)+$y;
902
+            } elseif ($this->logoAlign == 'R') {
903
+                $nImgW = round($w / 3, 0);
904
+                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
905
+                $xImg = round($x + ($w - (1 + $nImgW)), 0);
906
+                $yImg = round(($h - $nImgH) / 2, 0) + $y;
907 907
                 $x1 = $x;
908
-                $y1 = round($h/3+$y, 0);
909
-                $tw = round(2*$w/3, 0);
910
-            } elseif ($this->logoAlign=='F') {
911
-                $nImgH = round($h-5, 0);
912
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
913
-                $xImg = round(($w-$nImgW)/2+$x, 0);
914
-                $yImg = $y+3;
908
+                $y1 = round($h / 3 + $y, 0);
909
+                $tw = round(2 * $w / 3, 0);
910
+            } elseif ($this->logoAlign == 'F') {
911
+                $nImgH = round($h - 5, 0);
912
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
913
+                $xImg = round(($w - $nImgW) / 2 + $x, 0);
914
+                $yImg = $y + 3;
915 915
                 $x1 = $x;
916 916
                 $y1 = round($yImg + $nImgH + 1, 0);
917 917
                 $tw = $w;
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
             $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg');
921 921
         } else {
922 922
             $x1 = $x;
923
-            $y1 = round($h/3+$y, 0);
923
+            $y1 = round($h / 3 + $y, 0);
924 924
             $tw = $w;
925 925
         }
926 926
         // monta as informações apenas se diferente de full logo
@@ -930,9 +930,9 @@  discard block
 block discarded – undo
930 930
             $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue;
931 931
             $this->pdf->textBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, '');
932 932
             //endereço
933
-            $y1 = $y1+5;
933
+            $y1 = $y1 + 5;
934 934
             $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
935
-            $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
935
+            $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
936 936
                 ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
937 937
                 : '';
938 938
             $lgr = $this->getTagValue($this->enderEmit, "xLgr");
@@ -952,33 +952,33 @@  discard block
 block discarded – undo
952 952
         //####################################################################################
953 953
         //coluna central Danfe
954 954
         $x += $w;
955
-        $w=round($maxW * 0.17, 0);//35;
955
+        $w = round($maxW * 0.17, 0); //35;
956 956
         $w2 = $w;
957 957
         $h = 32;
958 958
         $this->pdf->textBox($x, $y, $w, $h);
959 959
 
960 960
         $texto = "DANFE";
961 961
         $aFont = ['font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B'];
962
-        $this->pdf->textBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
962
+        $this->pdf->textBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
963 963
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
964 964
         $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica';
965 965
         $h = 20;
966
-        $this->pdf->textBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false);
966
+        $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false);
967 967
 
968 968
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
969 969
         $texto = '0 - ENTRADA';
970 970
         $y1 = $y + 14;
971 971
         $h = 8;
972
-        $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
972
+        $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
973 973
         $texto = '1 - SAÍDA';
974 974
         $y1 = $y + 17;
975
-        $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
975
+        $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
976 976
         //tipo de nF
977 977
         $aFont = ['font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B'];
978 978
         $y1 = $y + 13;
979 979
         $h = 7;
980 980
         $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
981
-        $this->pdf->textBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, '');
981
+        $this->pdf->textBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, '');
982 982
         //numero da NF
983 983
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
984 984
         $y1 = $y + 20;
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
         //####################################################################################
1011 1011
         //coluna codigo de barras
1012 1012
         $x += $w;
1013
-        $w = ($maxW-$w1-$w2);//85;
1013
+        $w = ($maxW - $w1 - $w2); //85;
1014 1014
         $w3 = $w;
1015 1015
         $h = 32;
1016 1016
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1019,22 +1019,22 @@  discard block
 block discarded – undo
1019 1019
         $bW = 75;
1020 1020
         $bH = 12;
1021 1021
         //codigo de barras
1022
-        $this->pdf->code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH);
1022
+        $this->pdf->code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH);
1023 1023
         //linhas divisorias
1024
-        $this->pdf->line($x, $y+4+$bH, $x+$w, $y+4+$bH);
1025
-        $this->pdf->line($x, $y+12+$bH, $x+$w, $y+12+$bH);
1024
+        $this->pdf->line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH);
1025
+        $this->pdf->line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH);
1026 1026
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1027
-        $y1 = $y+4+$bH;
1027
+        $y1 = $y + 4 + $bH;
1028 1028
         $h = 7;
1029 1029
         $texto = 'CHAVE DE ACESSO';
1030 1030
         $this->pdf->textBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1031 1031
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
1032
-        $y1 = $y+8+$bH;
1032
+        $y1 = $y + 8 + $bH;
1033 1033
         $texto = $this->formatField($chave_acesso, $this->formatoChave);
1034
-        $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, '');
1035
-        $y1 = $y+12+$bH;
1034
+        $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, '');
1035
+        $y1 = $y + 12 + $bH;
1036 1036
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1037
-        $chaveContingencia="";
1037
+        $chaveContingencia = "";
1038 1038
         if ($this->notaDpec()) {
1039 1039
             $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC';
1040 1040
         } else {
@@ -1045,16 +1045,16 @@  discard block
 block discarded – undo
1045 1045
             $chaveContingencia = $this->geraChaveAdicionalDeContingencia();
1046 1046
             $this->pdf->setFillColor(0, 0, 0);
1047 1047
             //codigo de barras
1048
-            $this->pdf->code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2);
1048
+            $this->pdf->code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2);
1049 1049
         } else {
1050 1050
             $texto = 'Consulta de autenticidade no portal nacional da NF-e';
1051
-            $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, '');
1052
-            $y1 = $y+16+$bH;
1051
+            $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, '');
1052
+            $y1 = $y + 16 + $bH;
1053 1053
             $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora';
1054 1054
             $this->pdf->textBox(
1055
-                $x+2,
1055
+                $x + 2,
1056 1056
                 $y1,
1057
-                $w-2,
1057
+                $w - 2,
1058 1058
                 $h,
1059 1059
                 $texto,
1060 1060
                 $aFont,
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
         //natureza da operação
1071 1071
         $texto = 'NATUREZA DA OPERAÇÃO';
1072 1072
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1073
-        $w = $w1+$w2;
1073
+        $w = $w1 + $w2;
1074 1074
         $y = $oldY;
1075 1075
         $oldY += $h;
1076 1076
         $x = $oldX;
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
                 $cStat = '';
1104 1104
             } else {
1105 1105
                 if (isset($this->nfeProc)) {
1106
-                    $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1106
+                    $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1107 1107
                         ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1108 1108
                         : '';
1109 1109
                     $tsHora = $this->toTimestamp(
@@ -1145,25 +1145,25 @@  discard block
 block discarded – undo
1145 1145
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1146 1146
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1147 1147
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1148
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1148
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1149 1149
             ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1150 1150
             : '';
1151 1151
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1152 1152
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1153 1153
         //CNPJ
1154 1154
         $x += $w;
1155
-        $w = ($maxW-(3 * $w));
1155
+        $w = ($maxW - (3 * $w));
1156 1156
         $texto = 'CNPJ';
1157 1157
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1158 1158
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1159 1159
         //Pegando valor do CPF/CNPJ
1160
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1160
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1161 1161
             $texto = $this->formatField(
1162 1162
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1163 1163
                 "###.###.###/####-##"
1164 1164
             );
1165 1165
         } else {
1166
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1166
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1167 1167
                 ? $this->formatField(
1168 1168
                     $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1169 1169
                     "###.###.###-##"
@@ -1180,22 +1180,22 @@  discard block
 block discarded – undo
1180 1180
         $resp = $this->statusNFe();
1181 1181
         if (!$resp['status']) {
1182 1182
             $x = 10;
1183
-            $y = $this->hPrint-130;
1183
+            $y = $this->hPrint - 130;
1184 1184
             $h = 25;
1185
-            $w = $maxW-(2*$x);
1185
+            $w = $maxW - (2 * $x);
1186 1186
             $this->pdf->settextcolor(90, 90, 90);
1187 1187
             $texto = $resp['message'];
1188 1188
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1189 1189
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1190 1190
             $y += $h;
1191 1191
             $h = 5;
1192
-            $w = $maxW-(2*$x);
1192
+            $w = $maxW - (2 * $x);
1193 1193
             if (isset($this->infProt) && $resp['status']) {
1194 1194
                 $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue;
1195 1195
             } else {
1196 1196
                 $xMotivo = '';
1197 1197
             }
1198
-            $texto = "SEM VALOR FISCAL\n".$xMotivo;
1198
+            $texto = "SEM VALOR FISCAL\n" . $xMotivo;
1199 1199
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1200 1200
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1201 1201
             $this->pdf->settextcolor(0, 0, 0);
@@ -1203,12 +1203,12 @@  discard block
 block discarded – undo
1203 1203
         if ($this->notaDpec() || $this->tpEmis == 4) {
1204 1204
             //DPEC
1205 1205
             $x = 10;
1206
-            $y = $this->hPrint-130;
1206
+            $y = $this->hPrint - 130;
1207 1207
             $h = 25;
1208
-            $w = $maxW-(2*$x);
1208
+            $w = $maxW - (2 * $x);
1209 1209
             $this->pdf->SetTextColor(200, 200, 200);
1210
-            $texto = "DANFE impresso em contingência -\n".
1211
-                "DPEC regularmente recebido pela Receita\n".
1210
+            $texto = "DANFE impresso em contingência -\n" .
1211
+                "DPEC regularmente recebido pela Receita\n" .
1212 1212
                 "Federal do Brasil";
1213 1213
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1214 1214
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1244 1244
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1245 1245
         //NOME / RAZÃO SOCIAL
1246
-        $w = round($maxW*0.61, 0);
1246
+        $w = round($maxW * 0.61, 0);
1247 1247
         $w1 = $w;
1248 1248
         $y += 3;
1249 1249
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1258,19 +1258,19 @@  discard block
 block discarded – undo
1258 1258
         }
1259 1259
         //CNPJ / CPF
1260 1260
         $x += $w;
1261
-        $w = round($maxW*0.23, 0);
1261
+        $w = round($maxW * 0.23, 0);
1262 1262
         $w2 = $w;
1263 1263
         $texto = 'CNPJ / CPF';
1264 1264
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1265 1265
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1266 1266
         //Pegando valor do CPF/CNPJ
1267
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1267
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1268 1268
             $texto = $this->formatField(
1269 1269
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1270 1270
                 "###.###.###/####-##"
1271 1271
             );
1272 1272
         } else {
1273
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1273
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1274 1274
                 ? $this->formatField(
1275 1275
                     $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1276 1276
                     "###.###.###-##"
@@ -1281,16 +1281,16 @@  discard block
 block discarded – undo
1281 1281
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1282 1282
         //DATA DA EMISSÃO
1283 1283
         $x += $w;
1284
-        $w = $maxW-($w1+$w2);
1284
+        $w = $maxW - ($w1 + $w2);
1285 1285
         $wx = $w;
1286 1286
         $texto = 'DATA DA EMISSÃO';
1287 1287
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1288 1288
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1289
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1289
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1290 1290
             ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1291 1291
             : '';
1292 1292
         if ($dEmi == '') {
1293
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1293
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1294 1294
                 ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1295 1295
                 : '';
1296 1296
             $aDemi = explode('T', $dEmi);
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1305 1305
         }
1306 1306
         //ENDEREÇO
1307
-        $w = round($maxW*0.47, 0);
1307
+        $w = round($maxW * 0.47, 0);
1308 1308
         $w1 = $w;
1309 1309
         $y += $h;
1310 1310
         $x = $oldX;
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1320 1320
         //BAIRRO / DISTRITO
1321 1321
         $x += $w;
1322
-        $w = round($maxW*0.21, 0);
1322
+        $w = round($maxW * 0.21, 0);
1323 1323
         $w2 = $w;
1324 1324
         $texto = 'BAIRRO / DISTRITO';
1325 1325
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
@@ -1329,12 +1329,12 @@  discard block
 block discarded – undo
1329 1329
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1330 1330
         //CEP
1331 1331
         $x += $w;
1332
-        $w = $maxW-$w1-$w2-$wx;
1332
+        $w = $maxW - $w1 - $w2 - $wx;
1333 1333
         $w2 = $w;
1334 1334
         $texto = 'CEP';
1335 1335
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1336 1336
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1337
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1337
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1338 1338
             ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1339 1339
             : '';
1340 1340
         $texto = $this->formatField($texto, "#####-###");
@@ -1346,11 +1346,11 @@  discard block
 block discarded – undo
1346 1346
         $texto = 'DATA DA SAÍDA/ENTRADA';
1347 1347
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1348 1348
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1349
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1349
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1350 1350
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1351 1351
             : '';
1352 1352
         if ($dSaiEnt == '') {
1353
-            $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1353
+            $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1354 1354
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1355 1355
                 : '';
1356 1356
             $aDsaient = explode('T', $dSaiEnt);
@@ -1370,7 +1370,7 @@  discard block
 block discarded – undo
1370 1370
         if (strtoupper(trim($texto)) == "EXTERIOR"
1371 1371
             && $this->dest->getElementsByTagName("xPais")->length > 0
1372 1372
         ) {
1373
-            $texto .= " - " .  $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue;
1373
+            $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue;
1374 1374
         }
1375 1375
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1376 1376
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1385,19 +1385,19 @@  discard block
 block discarded – undo
1385 1385
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1386 1386
         //FONE / FAX
1387 1387
         $x += $w;
1388
-        $w = round(($maxW -$w1-$wx-8)/2, 0);
1388
+        $w = round(($maxW - $w1 - $wx - 8) / 2, 0);
1389 1389
         $w3 = $w;
1390 1390
         $texto = 'FONE / FAX';
1391 1391
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1392 1392
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1393
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1393
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1394 1394
             ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1395 1395
             : '';
1396 1396
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1397 1397
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1398 1398
         //INSCRIÇÃO ESTADUAL
1399 1399
         $x += $w;
1400
-        $w = $maxW -$w1-$wx-8-$w3;
1400
+        $w = $maxW - $w1 - $wx - 8 - $w3;
1401 1401
         $texto = 'INSCRIÇÃO ESTADUAL';
1402 1402
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1403 1403
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1411,11 +1411,11 @@  discard block
 block discarded – undo
1411 1411
         $texto = 'HORA DA SAÍDA/ENTRADA';
1412 1412
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1413 1413
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1414
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1414
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1415 1415
             ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1416 1416
             : '';
1417 1417
         if ($hSaiEnt == '') {
1418
-            $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1418
+            $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1419 1419
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1420 1420
                 : '';
1421 1421
             $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt);
@@ -1454,7 +1454,7 @@  discard block
 block discarded – undo
1454 1454
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
1455 1455
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1456 1456
         //NOME / RAZÃO SOCIAL
1457
-        $w = round($maxW*0.61, 0);
1457
+        $w = round($maxW * 0.61, 0);
1458 1458
         $w1 = $w;
1459 1459
         $y += 3;
1460 1460
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1472,19 +1472,19 @@  discard block
 block discarded – undo
1472 1472
         }
1473 1473
         //CNPJ / CPF
1474 1474
         $x += $w;
1475
-        $w = round($maxW*0.23, 0);
1475
+        $w = round($maxW * 0.23, 0);
1476 1476
         $w2 = $w;
1477 1477
         $texto = 'CNPJ / CPF';
1478 1478
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1479 1479
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1480 1480
         //Pegando valor do CPF/CNPJ
1481
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1481
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1482 1482
             $texto = $this->formatField(
1483 1483
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1484 1484
                 "###.###.###/####-##"
1485 1485
             );
1486 1486
         } else {
1487
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1487
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1488 1488
                 $this->formatField(
1489 1489
                     $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1490 1490
                     "###.###.###-##"
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1495 1495
         //INSCRIÇÃO ESTADUAL
1496 1496
         $x += $w;
1497
-        $w = $maxW-($w1+$w2);
1497
+        $w = $maxW - ($w1 + $w2);
1498 1498
         $wx = $w;
1499 1499
         $texto = 'INSCRIÇÃO ESTADUAL';
1500 1500
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1510,7 +1510,7 @@  discard block
 block discarded – undo
1510 1510
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1511 1511
         }
1512 1512
         //ENDEREÇO
1513
-        $w = round($maxW*0.355, 0) + $wx;
1513
+        $w = round($maxW * 0.355, 0) + $wx;
1514 1514
         $w1 = $w;
1515 1515
         $y += $h;
1516 1516
         $x = $oldX;
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1525 1525
         //BAIRRO / DISTRITO
1526 1526
         $x += $w;
1527
-        $w = round($maxW*0.335, 0);
1527
+        $w = round($maxW * 0.335, 0);
1528 1528
         $w2 = $w;
1529 1529
         $texto = 'BAIRRO / DISTRITO';
1530 1530
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1534,17 +1534,17 @@  discard block
 block discarded – undo
1534 1534
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1535 1535
         //CEP
1536 1536
         $x += $w;
1537
-        $w = $maxW-($w1+$w2);
1537
+        $w = $maxW - ($w1 + $w2);
1538 1538
         $texto = 'CEP';
1539 1539
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1540 1540
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1541
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1541
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1542 1542
             $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1543 1543
         $texto = $this->formatField($texto, "#####-###");
1544 1544
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1545 1545
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1546 1546
         //MUNICÍPIO
1547
-        $w = round($maxW*0.805, 0);
1547
+        $w = round($maxW * 0.805, 0);
1548 1548
         $w1 = $w;
1549 1549
         $y += $h;
1550 1550
         $x = $oldX;
@@ -1553,7 +1553,7 @@  discard block
 block discarded – undo
1553 1553
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1554 1554
         $texto = $this->entrega->getElementsByTagName("xMun")->item(0)->nodeValue;
1555 1555
         if (strtoupper(trim($texto)) == "EXTERIOR" && $this->entrega->getElementsByTagName("xPais")->length > 0) {
1556
-            $texto .= " - " .  $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue;
1556
+            $texto .= " - " . $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue;
1557 1557
         }
1558 1558
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1559 1559
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1568,11 +1568,11 @@  discard block
 block discarded – undo
1568 1568
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1569 1569
         //FONE / FAX
1570 1570
         $x += $w;
1571
-        $w = $maxW-$w-$w1;
1571
+        $w = $maxW - $w - $w1;
1572 1572
         $texto = 'FONE / FAX';
1573 1573
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1574 1574
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1575
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1575
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1576 1576
             $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1577 1577
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1578 1578
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1604,7 +1604,7 @@  discard block
 block discarded – undo
1604 1604
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
1605 1605
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1606 1606
         //NOME / RAZÃO SOCIAL
1607
-        $w = round($maxW*0.61, 0);
1607
+        $w = round($maxW * 0.61, 0);
1608 1608
         $w1 = $w;
1609 1609
         $y += 3;
1610 1610
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1622,19 +1622,19 @@  discard block
 block discarded – undo
1622 1622
         }
1623 1623
         //CNPJ / CPF
1624 1624
         $x += $w;
1625
-        $w = round($maxW*0.23, 0);
1625
+        $w = round($maxW * 0.23, 0);
1626 1626
         $w2 = $w;
1627 1627
         $texto = 'CNPJ / CPF';
1628 1628
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1629 1629
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1630 1630
         //Pegando valor do CPF/CNPJ
1631
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1631
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1632 1632
             $texto = $this->formatField(
1633 1633
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1634 1634
                 "###.###.###/####-##"
1635 1635
             );
1636 1636
         } else {
1637
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1637
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1638 1638
                 $this->formatField(
1639 1639
                     $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1640 1640
                     "###.###.###-##"
@@ -1644,7 +1644,7 @@  discard block
 block discarded – undo
1644 1644
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1645 1645
         //INSCRIÇÃO ESTADUAL
1646 1646
         $x += $w;
1647
-        $w = $maxW-($w1+$w2);
1647
+        $w = $maxW - ($w1 + $w2);
1648 1648
         $wx = $w;
1649 1649
         $texto = 'INSCRIÇÃO ESTADUAL';
1650 1650
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1661 1661
         }
1662 1662
         //ENDEREÇO
1663
-        $w = round($maxW*0.355, 0) + $wx;
1663
+        $w = round($maxW * 0.355, 0) + $wx;
1664 1664
         $w1 = $w;
1665 1665
         $y += $h;
1666 1666
         $x = $oldX;
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1675 1675
         //BAIRRO / DISTRITO
1676 1676
         $x += $w;
1677
-        $w = round($maxW*0.335, 0);
1677
+        $w = round($maxW * 0.335, 0);
1678 1678
         $w2 = $w;
1679 1679
         $texto = 'BAIRRO / DISTRITO';
1680 1680
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1684,17 +1684,17 @@  discard block
 block discarded – undo
1684 1684
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1685 1685
         //CEP
1686 1686
         $x += $w;
1687
-        $w = $maxW-($w1+$w2);
1687
+        $w = $maxW - ($w1 + $w2);
1688 1688
         $texto = 'CEP';
1689 1689
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1690 1690
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1691
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1691
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1692 1692
             $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1693 1693
         $texto = $this->formatField($texto, "#####-###");
1694 1694
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1695 1695
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1696 1696
         //MUNICÍPIO
1697
-        $w = round($maxW*0.805, 0);
1697
+        $w = round($maxW * 0.805, 0);
1698 1698
         $w1 = $w;
1699 1699
         $y += $h;
1700 1700
         $x = $oldX;
@@ -1703,7 +1703,7 @@  discard block
 block discarded – undo
1703 1703
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1704 1704
         $texto = $this->retirada->getElementsByTagName("xMun")->item(0)->nodeValue;
1705 1705
         if (strtoupper(trim($texto)) == "EXTERIOR" && $this->retirada->getElementsByTagName("xPais")->length > 0) {
1706
-            $texto .= " - " .  $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue;
1706
+            $texto .= " - " . $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue;
1707 1707
         }
1708 1708
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1709 1709
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1718,11 +1718,11 @@  discard block
 block discarded – undo
1718 1718
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1719 1719
         //FONE / FAX
1720 1720
         $x += $w;
1721
-        $w = $maxW-$w-$w1;
1721
+        $w = $maxW - $w - $w1;
1722 1722
         $texto = 'FONE / FAX';
1723 1723
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1724 1724
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1725
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1725
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1726 1726
             $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1727 1727
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1728 1728
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
     protected function fatura($x, $y)
1796 1796
     {
1797 1797
         $linha = 1;
1798
-        $h = 8+3;
1798
+        $h = 8 + 3;
1799 1799
         $oldx = $x;
1800 1800
         $textoFatura = $this->getTextoFatura();
1801 1801
         //verificar se existem duplicatas
@@ -1828,29 +1828,29 @@  discard block
 block discarded – undo
1828 1828
                 return ($y + $h - 3);
1829 1829
             }
1830 1830
             if ($textoFatura !== "" && $this->exibirTextoFatura) {
1831
-                $myH=6;
1831
+                $myH = 6;
1832 1832
                 $myW = $this->wPrint;
1833 1833
                 if ($this->orientacao == 'L') {
1834 1834
                     $myW -= $this->wCanhoto;
1835 1835
                 }
1836 1836
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1837 1837
                 $this->pdf->textBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, '');
1838
-                $y+=$myH+1;
1838
+                $y += $myH + 1;
1839 1839
             }
1840 1840
             if ($this->orientacao == 'P') {
1841
-                $w = round($this->wPrint/7.018, 0)-1;
1841
+                $w = round($this->wPrint / 7.018, 0) - 1;
1842 1842
             } else {
1843 1843
                 $w = 28;
1844 1844
             }
1845 1845
             $increm = 1;
1846 1846
             foreach ($this->dup as $k => $d) {
1847
-                $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1847
+                $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1848 1848
                     ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1849 1849
                     : '';
1850
-                $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1850
+                $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1851 1851
                     ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1852 1852
                     : '';
1853
-                $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1853
+                $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1854 1854
                     ? 'R$ ' . number_format(
1855 1855
                         $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1856 1856
                         2,
@@ -1860,14 +1860,14 @@  discard block
 block discarded – undo
1860 1860
                     : '';
1861 1861
                 $h = 8;
1862 1862
                 $texto = '';
1863
-                if ($nDup!='0' && $nDup!='') {
1863
+                if ($nDup != '0' && $nDup != '') {
1864 1864
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1865 1865
                     $this->pdf->textBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, '');
1866 1866
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1867 1867
                     $this->pdf->textBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, '');
1868 1868
                 } else {
1869 1869
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1870
-                    $this->pdf->textBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, '');
1870
+                    $this->pdf->textBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, '');
1871 1871
                 }
1872 1872
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1873 1873
                 $this->pdf->textBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, '');
@@ -1877,7 +1877,7 @@  discard block
 block discarded – undo
1877 1877
                 $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, '');
1878 1878
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1879 1879
                 $this->pdf->textBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, '');
1880
-                $x += $w+$increm;
1880
+                $x += $w + $increm;
1881 1881
                 $dupcont += 1;
1882 1882
                 if ($this->orientacao == 'P') {
1883 1883
                     $maxDupCont = 6;
@@ -1899,10 +1899,10 @@  discard block
 block discarded – undo
1899 1899
                 $y -= 9;
1900 1900
                 $linha--;
1901 1901
             }
1902
-            return ($y+$h);
1902
+            return ($y + $h);
1903 1903
         } else {
1904 1904
             $linha = 0;
1905
-            return ($y-2);
1905
+            return ($y - 2);
1906 1906
         }
1907 1907
     }
1908 1908
 
@@ -1918,13 +1918,13 @@  discard block
 block discarded – undo
1918 1918
     protected function pagamento($x, $y)
1919 1919
     {
1920 1920
         $linha = 1;
1921
-        $h = 8+3;
1921
+        $h = 8 + 3;
1922 1922
         $oldx = $x;
1923 1923
         //verificar se existem cobranças definidas
1924 1924
         if (isset($this->detPag) && $this->detPag->length > 0) {
1925 1925
             //#####################################################################
1926 1926
             //Tipo de pagamento
1927
-            $texto =  "PAGAMENTO";
1927
+            $texto = "PAGAMENTO";
1928 1928
             if ($this->orientacao == 'P') {
1929 1929
                 $w = $this->wPrint;
1930 1930
             } else {
@@ -1937,7 +1937,7 @@  discard block
 block discarded – undo
1937 1937
             $dups = "";
1938 1938
             $dupcont = 0;
1939 1939
             if ($this->orientacao == 'P') {
1940
-                $w = round($this->wPrint/7.018, 0)-1;
1940
+                $w = round($this->wPrint / 7.018, 0) - 1;
1941 1941
             } else {
1942 1942
                 $w = 28;
1943 1943
             }
@@ -1947,17 +1947,17 @@  discard block
 block discarded – undo
1947 1947
                 $maxDupCont = 8;
1948 1948
             }
1949 1949
             $increm = 1;
1950
-            $formaPagamento = ['01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito',
1951
-                               '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação',
1952
-                               '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível',
1953
-                               '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'];
1954
-            $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners',
1955
-                         '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
1950
+            $formaPagamento = ['01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito',
1951
+                               '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação',
1952
+                               '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível',
1953
+                               '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros'];
1954
+            $bandeira = ['01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners',
1955
+                         '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros'];
1956 1956
             foreach ($this->detPag as $k => $d) {
1957 1957
                 $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
1958 1958
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
1959 1959
                     : '0';
1960
-                $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
1960
+                $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
1961 1961
                     ? 'R$ ' . number_format(
1962 1962
                         $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
1963 1963
                         2,
@@ -1969,7 +1969,7 @@  discard block
 block discarded – undo
1969 1969
                 $texto = '';
1970 1970
                 if (isset($formaPagamento[$fPag])) {
1971 1971
                     /*Exibir Item sem pagamento*/
1972
-                    if ($fPag=='90') {
1972
+                    if ($fPag == '90') {
1973 1973
                         continue;
1974 1974
                     }
1975 1975
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
@@ -1978,16 +1978,16 @@  discard block
 block discarded – undo
1978 1978
                     $this->pdf->textBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, '');
1979 1979
                 } else {
1980 1980
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
1981
-                    $this->pdf->textBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, '');
1981
+                    $this->pdf->textBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, '');
1982 1982
                 }
1983 1983
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1984 1984
                 $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, '');
1985 1985
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1986 1986
                 $this->pdf->textBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, '');
1987
-                $x += $w+$increm;
1987
+                $x += $w + $increm;
1988 1988
                 $dupcont += 1;
1989 1989
 
1990
-                if ($dupcont>$maxDupCont) {
1990
+                if ($dupcont > $maxDupCont) {
1991 1991
                     $y += 9;
1992 1992
                     $x = $oldx;
1993 1993
                     $dupcont = 0;
@@ -2002,10 +2002,10 @@  discard block
 block discarded – undo
2002 2002
                 $y -= 9;
2003 2003
                 $linha--;
2004 2004
             }
2005
-            return ($y+$h);
2005
+            return ($y + $h);
2006 2006
         } else {
2007 2007
             $linha = 0;
2008
-            return ($y-2);
2008
+            return ($y - 2);
2009 2009
         }
2010 2010
     } //fim da função pagamento
2011 2011
 
@@ -2114,7 +2114,7 @@  discard block
 block discarded – undo
2114 2114
         }
2115 2115
         $x = $this->impostoHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF");
2116 2116
 
2117
-        return ($y+$h);
2117
+        return ($y + $h);
2118 2118
     } //fim imposto
2119 2119
 
2120 2120
     /**
@@ -2142,13 +2142,13 @@  discard block
 block discarded – undo
2142 2142
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
2143 2143
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2144 2144
         //NOME / RAZÃO SOCIAL
2145
-        $w1 = $maxW*0.29;
2145
+        $w1 = $maxW * 0.29;
2146 2146
         $y += 3;
2147 2147
         $texto = 'NOME / RAZÃO SOCIAL';
2148 2148
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2149 2149
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2150 2150
         if (isset($this->transporta)) {
2151
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2151
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2152 2152
                 ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2153 2153
                 : '';
2154 2154
         } else {
@@ -2158,11 +2158,11 @@  discard block
 block discarded – undo
2158 2158
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2159 2159
         //FRETE POR CONTA
2160 2160
         $x += $w1;
2161
-        $w2 = $maxW*0.15;
2161
+        $w2 = $maxW * 0.15;
2162 2162
         $texto = 'FRETE';
2163 2163
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2164 2164
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2165
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2165
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2166 2166
             ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2167 2167
             : '0';
2168 2168
         switch ($tipoFrete) {
@@ -2193,7 +2193,7 @@  discard block
 block discarded – undo
2193 2193
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2194 2194
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2195 2195
         if (isset($this->veicTransp)) {
2196
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2196
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2197 2197
                 ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2198 2198
                 : '';
2199 2199
         } else {
@@ -2207,11 +2207,11 @@  discard block
 block discarded – undo
2207 2207
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2208 2208
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2209 2209
         if (isset($this->veicTransp)) {
2210
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2210
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2211 2211
                 ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2212 2212
                 : '';
2213 2213
         } elseif (isset($this->reboque)) {
2214
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2214
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2215 2215
                 ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2216 2216
                 : '';
2217 2217
         } else {
@@ -2221,16 +2221,16 @@  discard block
 block discarded – undo
2221 2221
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2222 2222
         //UF
2223 2223
         $x += $w2;
2224
-        $w3 = round($maxW*0.04, 0);
2224
+        $w3 = round($maxW * 0.04, 0);
2225 2225
         $texto = 'UF';
2226 2226
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2227 2227
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2228 2228
         if (isset($this->veicTransp)) {
2229
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2229
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2230 2230
                 ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2231 2231
                 : '';
2232 2232
         } elseif (isset($this->reboque)) {
2233
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2233
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2234 2234
                 ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2235 2235
                 : '';
2236 2236
         } else {
@@ -2240,19 +2240,19 @@  discard block
 block discarded – undo
2240 2240
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2241 2241
         //CNPJ / CPF
2242 2242
         $x += $w3;
2243
-        $w = $maxW-($w1+3*$w2+$w3);
2243
+        $w = $maxW - ($w1 + 3 * $w2 + $w3);
2244 2244
         $texto = 'CNPJ / CPF';
2245 2245
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2246 2246
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2247 2247
         if (isset($this->transporta)) {
2248
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2248
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2249 2249
                 ? $this->formatField(
2250 2250
                     $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2251 2251
                     "##.###.###/####-##"
2252 2252
                 )
2253 2253
                 : '';
2254 2254
             if ($texto == '') {
2255
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2255
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2256 2256
                     ? $this->formatField(
2257 2257
                         $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2258 2258
                         "###.###.###-##"
@@ -2269,12 +2269,12 @@  discard block
 block discarded – undo
2269 2269
         $y += $h;
2270 2270
         $x = $oldX;
2271 2271
         $h = 7;
2272
-        $w1 = $maxW*0.44;
2272
+        $w1 = $maxW * 0.44;
2273 2273
         $texto = 'ENDEREÇO';
2274 2274
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2275 2275
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2276 2276
         if (isset($this->transporta)) {
2277
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2277
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2278 2278
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2279 2279
                 : '';
2280 2280
         } else {
@@ -2284,12 +2284,12 @@  discard block
 block discarded – undo
2284 2284
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2285 2285
         //MUNICÍPIO
2286 2286
         $x += $w1;
2287
-        $w2 = round($maxW*0.30, 0);
2287
+        $w2 = round($maxW * 0.30, 0);
2288 2288
         $texto = 'MUNICÍPIO';
2289 2289
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2290 2290
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2291 2291
         if (isset($this->transporta)) {
2292
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2292
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2293 2293
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2294 2294
                 : '';
2295 2295
         } else {
@@ -2299,12 +2299,12 @@  discard block
 block discarded – undo
2299 2299
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2300 2300
         //UF
2301 2301
         $x += $w2;
2302
-        $w3 = round($maxW*0.04, 0);
2302
+        $w3 = round($maxW * 0.04, 0);
2303 2303
         $texto = 'UF';
2304 2304
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2305 2305
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2306 2306
         if (isset($this->transporta)) {
2307
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2307
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2308 2308
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2309 2309
                 : '';
2310 2310
         } else {
@@ -2314,13 +2314,13 @@  discard block
 block discarded – undo
2314 2314
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2315 2315
         //INSCRIÇÃO ESTADUAL
2316 2316
         $x += $w3;
2317
-        $w = $maxW-($w1+$w2+$w3);
2317
+        $w = $maxW - ($w1 + $w2 + $w3);
2318 2318
         $texto = 'INSCRIÇÃO ESTADUAL';
2319 2319
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2320 2320
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2321 2321
         $texto = '';
2322 2322
         if (isset($this->transporta)) {
2323
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2323
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2324 2324
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2325 2325
             }
2326 2326
         }
@@ -2333,16 +2333,16 @@  discard block
 block discarded – undo
2333 2333
         $marca = '';
2334 2334
         $numero = '';
2335 2335
         $texto = '';
2336
-        $pesoBruto=0;
2337
-        $pesoLiquido=0;
2336
+        $pesoBruto = 0;
2337
+        $pesoLiquido = 0;
2338 2338
         foreach ($volumes as $volume) {
2339
-            $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2339
+            $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2340 2340
                 $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2341
-            $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2341
+            $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2342 2342
                 $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2343
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2343
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2344 2344
                 $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2345
-            $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2345
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2346 2346
                 $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2347 2347
             if ($texto != $especie && $especie != '') {
2348 2348
                 //tem várias especies
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
             } else {
2351 2351
                 $especie = $texto;
2352 2352
             }
2353
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2353
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2354 2354
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2355 2355
                 : '';
2356 2356
             if ($texto != $marca && $marca != '') {
@@ -2359,7 +2359,7 @@  discard block
 block discarded – undo
2359 2359
             } else {
2360 2360
                 $marca = $texto;
2361 2361
             }
2362
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2362
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2363 2363
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2364 2364
                 : '';
2365 2365
             if ($texto != $numero && $numero != '') {
@@ -2375,7 +2375,7 @@  discard block
 block discarded – undo
2375 2375
         $y += $h;
2376 2376
         $x = $oldX;
2377 2377
         $h = 7;
2378
-        $w1 = round($maxW*0.10, 0);
2378
+        $w1 = round($maxW * 0.10, 0);
2379 2379
         $texto = 'QUANTIDADE';
2380 2380
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2381 2381
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2386,7 +2386,7 @@  discard block
 block discarded – undo
2386 2386
         }
2387 2387
         //ESPÉCIE
2388 2388
         $x += $w1;
2389
-        $w2 = round($maxW*0.17, 0);
2389
+        $w2 = round($maxW * 0.17, 0);
2390 2390
         $texto = 'ESPÉCIE';
2391 2391
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2392 2392
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2398,7 +2398,7 @@  discard block
 block discarded – undo
2398 2398
         $texto = 'MARCA';
2399 2399
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2400 2400
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2401
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2401
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2402 2402
             $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2403 2403
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
2404 2404
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -2412,7 +2412,7 @@  discard block
 block discarded – undo
2412 2412
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2413 2413
         //PESO BRUTO
2414 2414
         $x += $w2;
2415
-        $w3 = round($maxW*0.20, 0);
2415
+        $w3 = round($maxW * 0.20, 0);
2416 2416
         $texto = 'PESO BRUTO';
2417 2417
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2418 2418
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2425,7 +2425,7 @@  discard block
 block discarded – undo
2425 2425
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2426 2426
         //PESO LÍQUIDO
2427 2427
         $x += $w3;
2428
-        $w = $maxW -($w1+3*$w2+$w3);
2428
+        $w = $maxW - ($w1 + 3 * $w2 + $w3);
2429 2429
         $texto = 'PESO LÍQUIDO';
2430 2430
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2431 2431
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2436,7 +2436,7 @@  discard block
 block discarded – undo
2436 2436
         }
2437 2437
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
2438 2438
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
2439
-        return ($y+$h);
2439
+        return ($y + $h);
2440 2440
     } //fim transporte
2441 2441
 
2442 2442
 
@@ -2448,7 +2448,7 @@  discard block
 block discarded – undo
2448 2448
             return "";
2449 2449
         }
2450 2450
         $valor_original = $valor_original->nodeValue;
2451
-        $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2451
+        $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2452 2452
 
2453 2453
         if ($valor != "") {
2454 2454
             return sprintf($formato, $valor);
@@ -2495,18 +2495,18 @@  discard block
 block discarded – undo
2495 2495
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2496 2496
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2497 2497
         }
2498
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2498
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2499 2499
             ? substr(
2500 2500
                 $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2501 2501
                 0,
2502 2502
                 500
2503 2503
             )
2504 2504
             : '';
2505
-        if (! empty($infAdProd)) {
2505
+        if (!empty($infAdProd)) {
2506 2506
             $infAdProd = trim($infAdProd);
2507 2507
             $infAdProd .= ' ';
2508 2508
         }
2509
-        $loteTxt ='';
2509
+        $loteTxt = '';
2510 2510
         $rastro = $prod->getElementsByTagName("med");
2511 2511
         if (!empty($prod->getElementsByTagName("rastro"))) {
2512 2512
             $rastro = $prod->getElementsByTagName("rastro");
@@ -2520,15 +2520,15 @@  discard block
 block discarded – undo
2520 2520
                 $i++;
2521 2521
             }
2522 2522
             if ($loteTxt != '') {
2523
-                $loteTxt.= ' ';
2523
+                $loteTxt .= ' ';
2524 2524
             }
2525 2525
         }
2526 2526
         //NT2013.006 FCI
2527
-        $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2528
-            ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2529
-        $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2527
+        $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2528
+            ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2529
+        $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2530 2530
         $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
2531
-            . (strlen($tmp_ad)!=0?"\n    ".$tmp_ad:'');
2531
+            . (strlen($tmp_ad) != 0 ? "\n    " . $tmp_ad : '');
2532 2532
         //decodifica os caracteres html no xml
2533 2533
         $texto = html_entity_decode($texto);
2534 2534
         if ($this->descProdQuebraLinha) {
@@ -2579,111 +2579,111 @@  discard block
 block discarded – undo
2579 2579
         // cabecalho LOOP COM OS DADOS DOS PRODUTOS
2580 2580
         //CÓDIGO PRODUTO
2581 2581
         $texto = "CÓDIGO PRODUTO";
2582
-        $w1 = round($w*0.09, 0);
2582
+        $w1 = round($w * 0.09, 0);
2583 2583
         $h = 4;
2584 2584
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2585 2585
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2586
-        $this->pdf->line($x+$w1, $y, $x+$w1, $y+$hmax);
2586
+        $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2587 2587
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2588 2588
         $x += $w1;
2589
-        $w2 = round($w*0.25, 0);
2589
+        $w2 = round($w * 0.25, 0);
2590 2590
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2591 2591
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2592 2592
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2593
-        $this->pdf->line($x+$w2, $y, $x+$w2, $y+$hmax);
2593
+        $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2594 2594
         //NCM/SH
2595 2595
         $x += $w2;
2596
-        $w3 = round($w*0.06, 0);
2596
+        $w3 = round($w * 0.06, 0);
2597 2597
         $texto = 'NCM/SH';
2598 2598
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2599 2599
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2600
-        $this->pdf->line($x+$w3, $y, $x+$w3, $y+$hmax);
2600
+        $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2601 2601
         //O/CST ou O/CSOSN
2602 2602
         $x += $w3;
2603
-        $w4 = round($w*0.05, 0);
2604
-        $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2
2603
+        $w4 = round($w * 0.05, 0);
2604
+        $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2
2605 2605
         if ($this->getTagValue($this->emit, 'CRT') == '3') {
2606
-            $texto = 'O/CST';//Regime Normal
2606
+            $texto = 'O/CST'; //Regime Normal
2607 2607
         }
2608 2608
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2609 2609
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2610
-        $this->pdf->line($x+$w4, $y, $x+$w4, $y+$hmax);
2610
+        $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2611 2611
         //CFOP
2612 2612
         $x += $w4;
2613
-        $w5 = round($w*0.04, 0);
2613
+        $w5 = round($w * 0.04, 0);
2614 2614
         $texto = 'CFOP';
2615 2615
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2616 2616
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2617
-        $this->pdf->line($x+$w5, $y, $x+$w5, $y+$hmax);
2617
+        $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2618 2618
         //UN
2619 2619
         $x += $w5;
2620
-        $w6 = round($w*0.03, 0);
2620
+        $w6 = round($w * 0.03, 0);
2621 2621
         $texto = 'UN';
2622 2622
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2623 2623
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2624
-        $this->pdf->line($x+$w6, $y, $x+$w6, $y+$hmax);
2624
+        $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2625 2625
         //QUANT
2626 2626
         $x += $w6;
2627
-        $w7 = round($w*0.08, 0);
2627
+        $w7 = round($w * 0.08, 0);
2628 2628
         $texto = 'QUANT';
2629 2629
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2630 2630
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2631
-        $this->pdf->line($x+$w7, $y, $x+$w7, $y+$hmax);
2631
+        $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2632 2632
         //VALOR UNIT
2633 2633
         $x += $w7;
2634
-        $w8 = round($w*0.06, 0);
2634
+        $w8 = round($w * 0.06, 0);
2635 2635
         $texto = 'VALOR UNIT';
2636 2636
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2637 2637
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2638
-        $this->pdf->line($x+$w8, $y, $x+$w8, $y+$hmax);
2638
+        $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2639 2639
         //VALOR TOTAL
2640 2640
         $x += $w8;
2641
-        $w9 = round($w*0.06, 0);
2641
+        $w9 = round($w * 0.06, 0);
2642 2642
         $texto = 'VALOR TOTAL';
2643 2643
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2644 2644
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2645
-        $this->pdf->line($x+$w9, $y, $x+$w9, $y+$hmax);
2645
+        $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2646 2646
         //VALOR DESCONTO
2647 2647
         $x += $w9;
2648
-        $w10 = round($w*0.05, 0);
2648
+        $w10 = round($w * 0.05, 0);
2649 2649
         $texto = 'VALOR DESC';
2650 2650
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2651 2651
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2652
-        $this->pdf->line($x+$w10, $y, $x+$w10, $y+$hmax);
2652
+        $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2653 2653
         //B.CÁLC ICMS
2654 2654
         $x += $w10;
2655
-        $w11 = round($w*0.06, 0);
2655
+        $w11 = round($w * 0.06, 0);
2656 2656
         $texto = 'B.CÁLC ICMS';
2657 2657
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2658 2658
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2659
-        $this->pdf->line($x+$w11, $y, $x+$w11, $y+$hmax);
2659
+        $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2660 2660
         //VALOR ICMS
2661 2661
         $x += $w11;
2662
-        $w12 = round($w*0.06, 0);
2662
+        $w12 = round($w * 0.06, 0);
2663 2663
         $texto = 'VALOR ICMS';
2664 2664
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2665 2665
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2666
-        $this->pdf->line($x+$w12, $y, $x+$w12, $y+$hmax);
2666
+        $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2667 2667
         //VALOR IPI
2668 2668
         $x += $w12;
2669
-        $w13 = round($w*0.05, 0);
2669
+        $w13 = round($w * 0.05, 0);
2670 2670
         $texto = 'VALOR IPI';
2671 2671
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2672 2672
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2673
-        $this->pdf->line($x+$w13, $y, $x+$w13, $y+$hmax);
2673
+        $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2674 2674
         //ALÍQ. ICMS
2675 2675
         $x += $w13;
2676
-        $w14 = round($w*0.04, 0);
2676
+        $w14 = round($w * 0.04, 0);
2677 2677
         $texto = 'ALÍQ. ICMS';
2678 2678
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2679 2679
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2680
-        $this->pdf->line($x+$w14, $y, $x+$w14, $y+$hmax);
2680
+        $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2681 2681
         //ALÍQ. IPI
2682 2682
         $x += $w14;
2683
-        $w15 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13+$w14);
2683
+        $w15 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2684 2684
         $texto = 'ALÍQ. IPI';
2685 2685
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2686
-        $this->pdf->line($oldX, $y+$h+1, $oldX + $w, $y+$h+1);
2686
+        $this->pdf->line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1);
2687 2687
         $y += 5;
2688 2688
         //##################################################################################
2689 2689
         // LOOP COM OS DADOS DOS PRODUTOS
@@ -2696,7 +2696,7 @@  discard block
 block discarded – undo
2696 2696
         } else {
2697 2697
             $w = $this->wPrint - $this->wCanhoto;
2698 2698
         }
2699
-        $w2 = round($w*0.28, 0);
2699
+        $w2 = round($w * 0.28, 0);
2700 2700
 
2701 2701
         foreach ($this->det as $d) {
2702 2702
             if ($i >= $nInicio) {
@@ -2730,11 +2730,11 @@  discard block
 block discarded – undo
2730 2730
                         break;
2731 2731
                     }
2732 2732
                 }
2733
-                $y_linha=$y+$h;
2733
+                $y_linha = $y + $h;
2734 2734
                 // linha entre itens
2735 2735
                 $this->pdf->dashedHLine($oldX, $y_linha, $w, 0.1, 120);
2736 2736
                 //corrige o x
2737
-                $x=$oldX;
2737
+                $x = $oldX;
2738 2738
                 //codigo do produto
2739 2739
                 $guup = $i + 1;
2740 2740
                 $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue;
@@ -2748,16 +2748,16 @@  discard block
 block discarded – undo
2748 2748
                 }
2749 2749
                 $x += $w2;
2750 2750
                 //NCM
2751
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2751
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2752 2752
                     $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2753 2753
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2754 2754
                 $x += $w3;
2755 2755
                 //CST
2756 2756
                 if (isset($ICMS)) {
2757
-                    $origem =  $this->getTagValue($ICMS, "orig");
2758
-                    $cst =  $this->getTagValue($ICMS, "CST");
2759
-                    $csosn =  $this->getTagValue($ICMS, "CSOSN");
2760
-                    $texto = $origem.$cst.$csosn;
2757
+                    $origem = $this->getTagValue($ICMS, "orig");
2758
+                    $cst = $this->getTagValue($ICMS, "CST");
2759
+                    $csosn = $this->getTagValue($ICMS, "CSOSN");
2760
+                    $texto = $origem . $cst . $csosn;
2761 2761
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2762 2762
                 }
2763 2763
                 //CFOP
@@ -2824,7 +2824,7 @@  discard block
 block discarded – undo
2824 2824
                 //Valor da Base de calculo
2825 2825
                 $x += $w10;
2826 2826
                 if (isset($ICMS)) {
2827
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2827
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2828 2828
                         ? number_format(
2829 2829
                             $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
2830 2830
                             2,
@@ -2837,7 +2837,7 @@  discard block
 block discarded – undo
2837 2837
                 //Valor do ICMS
2838 2838
                 $x += $w11;
2839 2839
                 if (isset($ICMS)) {
2840
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2840
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2841 2841
                         ? number_format(
2842 2842
                             $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
2843 2843
                             2,
@@ -2850,7 +2850,7 @@  discard block
 block discarded – undo
2850 2850
                 //Valor do IPI
2851 2851
                 $x += $w12;
2852 2852
                 if (isset($IPI)) {
2853
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2853
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2854 2854
                         ? number_format(
2855 2855
                             $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
2856 2856
                             2,
@@ -2865,7 +2865,7 @@  discard block
 block discarded – undo
2865 2865
                 // %ICMS
2866 2866
                 $x += $w13;
2867 2867
                 if (isset($ICMS)) {
2868
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2868
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2869 2869
                         ? number_format(
2870 2870
                             $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
2871 2871
                             2,
@@ -2878,7 +2878,7 @@  discard block
 block discarded – undo
2878 2878
                 //%IPI
2879 2879
                 $x += $w14;
2880 2880
                 if (isset($IPI)) {
2881
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
2881
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
2882 2882
                         ? number_format(
2883 2883
                             $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
2884 2884
                             2,
@@ -2909,7 +2909,7 @@  discard block
 block discarded – undo
2909 2909
                 $i++;
2910 2910
             }
2911 2911
         }
2912
-        return $oldY+$hmax;
2912
+        return $oldY + $hmax;
2913 2913
     }
2914 2914
 
2915 2915
 
@@ -2943,7 +2943,7 @@  discard block
 block discarded – undo
2943 2943
 
2944 2944
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
2945 2945
 
2946
-        $w1 = round($w*0.09, 0);
2946
+        $w1 = round($w * 0.09, 0);
2947 2947
 
2948 2948
         // Tabela Renavam Combustivel
2949 2949
         $renavamCombustivel = [
@@ -3038,54 +3038,54 @@  discard block
 block discarded – undo
3038 3038
 
3039 3039
         $yVeic = $y + $h;
3040 3040
         $texto = 'Chassi: ............: ' . $veiculoChassi;
3041
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3041
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3042 3042
         $yVeic += $h;
3043 3043
         $texto = 'Cor...................: ' . $veiculoCor;
3044
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3044
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3045 3045
         $yVeic += $h;
3046 3046
         $texto = 'Cilindrada........: ' . $veiculoCilindrada;
3047
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3047
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3048 3048
         $yVeic += $h;
3049 3049
         $texto = 'Cmkg...............: ' . $veiculoCmkg;
3050
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3050
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3051 3051
         $yVeic += $h;
3052 3052
         $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo);
3053
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3053
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3054 3054
         $yVeic = $y + $h;
3055 3055
         $xVeic = $x + 65;
3056 3056
         $texto = 'Nº Motor: .........: ' . $veiculoMotor;
3057
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3057
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3058 3058
         $yVeic += $h;
3059 3059
         $texto = 'Renavam...........: ' . $veiculoRenavam;
3060
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3060
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3061 3061
         $yVeic += $h;
3062 3062
         $texto = 'HP.....................: ' . $veiculoHp;
3063
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3063
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3064 3064
         $yVeic += $h;
3065 3065
         $texto = 'Placa.................: ' . $veiculoPlaca;
3066
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3066
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3067 3067
         $yVeic += $h;
3068 3068
         $texto = 'Tipo Pintura......: ' . ($renavamEspecie[intval($veiculoTipoPintura)] ?? $veiculoTipoPintura);
3069
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3069
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3070 3070
         $yVeic = $y + $h;
3071 3071
         $xVeic = $xVeic + 55;
3072 3072
         $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo;
3073
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3073
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3074 3074
         $yVeic += $h;
3075 3075
         $texto = 'Especie..................: ' . ($renavamEspecie[intval($veiculoEspecie)] ?? $veiculoEspecie);
3076
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3076
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3077 3077
         $yVeic += $h;
3078 3078
         $texto = 'Combustivel..........: ' . ($renavamCombustivel[intval($veiculoCombustivel)] ?? $veiculoCombustivel);
3079
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3079
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3080 3080
         $yVeic += $h;
3081 3081
         $texto = 'Serial.....................: ' . $veiculoSerial;
3082
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3082
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3083 3083
         $yVeic += $h;
3084
-        $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo;
3085
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3084
+        $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo;
3085
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3086 3086
         $yVeic += $h;
3087
-        $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia;
3088
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3087
+        $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia;
3088
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3089 3089
     }
3090 3090
 
3091 3091
     /**
@@ -3109,12 +3109,12 @@  discard block
 block discarded – undo
3109 3109
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3110 3110
         //INSCRIÇÃO MUNICIPAL
3111 3111
         $y += 3;
3112
-        $w = round($this->wPrint*0.23, 0);
3112
+        $w = round($this->wPrint * 0.23, 0);
3113 3113
         $texto = 'INSCRIÇÃO MUNICIPAL';
3114 3114
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3115 3115
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3116 3116
         //inscrição municipal
3117
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3117
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3118 3118
             $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3119 3119
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
3120 3120
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -3124,7 +3124,7 @@  discard block
 block discarded – undo
3124 3124
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3125 3125
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3126 3126
         if (isset($this->ISSQNtot)) {
3127
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3127
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3128 3128
                 $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3129 3129
             $texto = number_format($texto, 2, ",", ".");
3130 3130
         } else {
@@ -3138,9 +3138,9 @@  discard block
 block discarded – undo
3138 3138
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3139 3139
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3140 3140
         if (isset($this->ISSQNtot)) {
3141
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3141
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3142 3142
                 $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3143
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3143
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3144 3144
         } else {
3145 3145
             $texto = '';
3146 3146
         }
@@ -3151,21 +3151,21 @@  discard block
 block discarded – undo
3151 3151
         if ($this->orientacao == 'P') {
3152 3152
             $w = $this->wPrint - (3 * $w);
3153 3153
         } else {
3154
-            $w = $this->wPrint - (3 * $w)-$this->wCanhoto;
3154
+            $w = $this->wPrint - (3 * $w) - $this->wCanhoto;
3155 3155
         }
3156 3156
         $texto = 'VALOR TOTAL DO ISSQN';
3157 3157
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3158 3158
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3159 3159
         if (isset($this->ISSQNtot)) {
3160
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3160
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3161 3161
                 $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3162
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3162
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3163 3163
         } else {
3164 3164
             $texto = '';
3165 3165
         }
3166 3166
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
3167 3167
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3168
-        return ($y+$h+1);
3168
+        return ($y + $h + 1);
3169 3169
     }
3170 3170
 
3171 3171
     /**
@@ -3188,7 +3188,7 @@  discard block
 block discarded – undo
3188 3188
         if ($this->orientacao == 'P') {
3189 3189
             $w = $this->wPrint;
3190 3190
         } else {
3191
-            $w = $this->wPrint-$this->wCanhoto;
3191
+            $w = $this->wPrint - $this->wCanhoto;
3192 3192
         }
3193 3193
         $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style'=> 'B'];
3194 3194
         $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, '');
@@ -3208,7 +3208,7 @@  discard block
 block discarded – undo
3208 3208
         $y += 1;
3209 3209
         $aFont = ['font'=>$this->fontePadrao, 'size'=> $this->textadicfontsize * $this->pdf->k, 'style'=>''];
3210 3210
         //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>''];
3211
-        $this->pdf->textBox($x, $y+2, $w-2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
3211
+        $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
3212 3212
         //RESERVADO AO FISCO
3213 3213
         $texto = "RESERVADO AO FISCO";
3214 3214
         if (isset($this->nfeProc) && $this->nfeProc->getElementsByTagName("xMsg")->length) {
@@ -3217,9 +3217,9 @@  discard block
 block discarded – undo
3217 3217
         $x += $w;
3218 3218
         $y -= 1;
3219 3219
         if ($this->orientacao == 'P') {
3220
-            $w = $this->wPrint-$w;
3220
+            $w = $this->wPrint - $w;
3221 3221
         } else {
3222
-            $w = $this->wPrint-$w-$this->wCanhoto;
3222
+            $w = $this->wPrint - $w - $this->wCanhoto;
3223 3223
         }
3224 3224
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B'];
3225 3225
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -3258,8 +3258,8 @@  discard block
 block discarded – undo
3258 3258
         }
3259 3259
         $y += 2;
3260 3260
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
3261
-        $this->pdf->textBox($x, $y, $w-2, $h, $texto, $aFont, 'T', 'L', 0, '', false);
3262
-        return $y+$h;
3261
+        $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false);
3262
+        return $y + $h;
3263 3263
     }
3264 3264
 
3265 3265
     /**
@@ -3277,11 +3277,11 @@  discard block
 block discarded – undo
3277 3277
         if ($this->orientacao == 'P') {
3278 3278
             $w = $this->wPrint;
3279 3279
         } else {
3280
-            $w = $this->wPrint-$this->wCanhoto;
3280
+            $w = $this->wPrint - $this->wCanhoto;
3281 3281
             $x = $this->wCanhoto;
3282 3282
         }
3283 3283
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
3284
-        $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s')
3284
+        $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s')
3285 3285
             . '  ' . $this->creditos;
3286 3286
         $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false);
3287 3287
         $texto = $this->powered ? "Powered by NFePHP®" : '';
@@ -3336,9 +3336,9 @@  discard block
 block discarded – undo
3336 3336
         } else {
3337 3337
             //linha separadora do canhoto - 238
3338 3338
             //posicao altura
3339
-            $y = $this->wPrint-85;
3339
+            $y = $this->wPrint - 85;
3340 3340
             //altura
3341
-            $w = $this->wPrint-85-24;
3341
+            $w = $this->wPrint - 85 - 24;
3342 3342
         }
3343 3343
         $h = 10;
3344 3344
         //desenha caixa
@@ -3361,21 +3361,21 @@  discard block
 block discarded – undo
3361 3361
             $texto .= "AO LADO";
3362 3362
         }
3363 3363
         $texto .= ". EMISSÃO: ";
3364
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3364
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3365 3365
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3366 3366
         if ($dEmi == '') {
3367
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3367
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3368 3368
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3369 3369
             $aDemi = explode('T', $dEmi);
3370 3370
             $dEmi = $aDemi[0];
3371 3371
         }
3372
-        $texto .= $this->ymdTodmy($dEmi) ." ";
3372
+        $texto .= $this->ymdTodmy($dEmi) . " ";
3373 3373
         $texto .= "VALOR TOTAL: R$ ";
3374 3374
         $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " ";
3375 3375
         $texto .= "DESTINATÁRIO: ";
3376 3376
         $texto .= $destinatario;
3377 3377
         if ($this->orientacao == 'P') {
3378
-            $this->pdf->textBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false);
3378
+            $this->pdf->textBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false);
3379 3379
             $x1 = $x + $w;
3380 3380
             $w1 = $this->wPrint - $w;
3381 3381
             $texto = "NF-e";
@@ -3388,12 +3388,12 @@  discard block
 block discarded – undo
3388 3388
             //DATA DE RECEBIMENTO
3389 3389
             $texto = "DATA DE RECEBIMENTO";
3390 3390
             $y += $h;
3391
-            $w2 = round($this->wPrint*0.17, 0); //35;
3391
+            $w2 = round($this->wPrint * 0.17, 0); //35;
3392 3392
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3393 3393
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3394 3394
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3395 3395
             $x += $w2;
3396
-            $w3 = $w-$w2;
3396
+            $w3 = $w - $w2;
3397 3397
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3398 3398
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
3399 3399
             $x = $oldX;
@@ -3403,7 +3403,7 @@  discard block
 block discarded – undo
3403 3403
             return $y;
3404 3404
         } else {
3405 3405
             $x--;
3406
-            $x = $this->pdf->textBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3406
+            $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3407 3407
             //NUMERO DA NOTA FISCAL LOGO NFE
3408 3408
             $w1 = 18;
3409 3409
             $x1 = $oldX;
@@ -3417,14 +3417,14 @@  discard block
 block discarded – undo
3417 3417
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3418 3418
             //DATA DO RECEBIMENTO
3419 3419
             $texto = "DATA DO RECEBIMENTO";
3420
-            $y = $this->wPrint-85;
3420
+            $y = $this->wPrint - 85;
3421 3421
             $x = 12;
3422
-            $w2 = round($this->wPrint*0.17, 0); //35;
3422
+            $w2 = round($this->wPrint * 0.17, 0); //35;
3423 3423
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3424 3424
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3425 3425
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3426 3426
             $y -= $w2;
3427
-            $w3 = $w-$w2;
3427
+            $w3 = $w - $w2;
3428 3428
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3429 3429
             $aFont = ['font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>''];
3430 3430
             $x = $this->pdf->textBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3448,13 +3448,13 @@  discard block
 block discarded – undo
3448 3448
         }
3449 3449
         $saida = "";
3450 3450
         if (isset($this->compra)) {
3451
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3451
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3452 3452
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3453 3453
             }
3454
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3454
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3455 3455
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3456 3456
             }
3457
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3457
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3458 3458
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3459 3459
             }
3460 3460
         }
@@ -3480,21 +3480,21 @@  discard block
 block discarded – undo
3480 3480
         if ($vICMS > 0) {
3481 3481
             $vICMS = 1;
3482 3482
         }
3483
-        $icmss  = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue;
3483
+        $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue;
3484 3484
         if ($icmss > 0) {
3485 3485
             $icmss = 1;
3486 3486
         }
3487
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3487
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3488 3488
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3489 3489
         if ($dEmi == '') {
3490
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3490
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3491 3491
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3492 3492
             $aDemi = explode('T', $dEmi);
3493 3493
             $dEmi = $aDemi[0];
3494 3494
         }
3495 3495
         $dd  = $dEmi;
3496 3496
         $rpos = strrpos($dd, '-');
3497
-        $dd  = substr($dd, $rpos +1);
3497
+        $dd  = substr($dd, $rpos + 1);
3498 3498
         $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd);
3499 3499
         $chave = $chave . $this->modulo11($chave);
3500 3500
         return $chave;
@@ -3518,7 +3518,7 @@  discard block
 block discarded – undo
3518 3518
         $formaNfRef = "\r\nNF  Ref.: série:%d numero:%d emit:%s em %s modelo: %d";
3519 3519
         $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d";
3520 3520
         $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s";
3521
-        $saida='';
3521
+        $saida = '';
3522 3522
         $nfRefs = $this->ide->getElementsByTagName('NFref');
3523 3523
         if (0 === $nfRefs->length) {
3524 3524
             return $saida;
@@ -3534,7 +3534,7 @@  discard block
 block discarded – undo
3534 3534
             foreach ($refNFe as $chave_acessoRef) {
3535 3535
                 $chave_acesso = $chave_acessoRef->nodeValue;
3536 3536
                 $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave);
3537
-                $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2);
3537
+                $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2);
3538 3538
                 $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3539 3539
                 $serie  = substr($chave_acesso, 22, 3);
3540 3540
                 $numero = substr($chave_acesso, 25, 9);
@@ -3555,7 +3555,7 @@  discard block
 block discarded – undo
3555 3555
             foreach ($refCTe as $chave_acessoRef) {
3556 3556
                 $chave_acesso = $chave_acessoRef->nodeValue;
3557 3557
                 $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave);
3558
-                $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2);
3558
+                $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2);
3559 3559
                 $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3560 3560
                 $serie  = substr($chave_acesso, 22, 3);
3561 3561
                 $numero = substr($chave_acesso, 25, 9);
@@ -3571,10 +3571,9 @@  discard block
 block discarded – undo
3571 3571
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3572 3572
             foreach ($refNFP as $umaRefNFe) {
3573 3573
                 $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3574
-                $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3575
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3576
-                    '';
3577
-                $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3574
+                $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3575
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3576
+                $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3578 3577
                     $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3579 3578
                 $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3580 3579
                 $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
Please login to merge, or discard this patch.