Completed
Push — master ( e42bfa...cb38d2 )
by Roberto
04:06 queued 12s
created
src/NFe/Danfe.php 2 patches
Doc Comments   +27 added lines, -19 removed lines patch added patch discarded remove patch
@@ -858,8 +858,8 @@  discard block
 block discarded – undo
858 858
      *header
859 859
      * Monta o cabelhalho da DANFE (retrato e paisagem)
860 860
      *
861
-     * @param  number $x      Posição horizontal inicial, canto esquerdo
862
-     * @param  number $y      Posição vertical inicial, canto superior
861
+     * @param  integer $x      Posição horizontal inicial, canto esquerdo
862
+     * @param  integer $y      Posição vertical inicial, canto superior
863 863
      * @param  number $pag    Número da Página
864 864
      * @param  number $totPag Total de páginas
865 865
      * @return number Posição vertical final
@@ -1344,8 +1344,8 @@  discard block
 block discarded – undo
1344 1344
      * Monta o campo com os dados do destinatário na DANFE. (retrato e paisagem)
1345 1345
      *
1346 1346
      * @name   destinatarioDANFE
1347
-     * @param  number $x Posição horizontal canto esquerdo
1348
-     * @param  number $y Posição vertical canto superior
1347
+     * @param  integer $x Posição horizontal canto esquerdo
1348
+     * @param  integer $y Posição vertical canto superior
1349 1349
      * @return number Posição vertical final
1350 1350
      */
1351 1351
     protected function destinatarioDANFE($x = 0, $y = 0)
@@ -1556,8 +1556,8 @@  discard block
 block discarded – undo
1556 1556
      * Monta o campo com os dados do local de entrega na DANFE. (retrato e paisagem)
1557 1557
      *
1558 1558
      * @name   localEntregaDANFE
1559
-     * @param  number $x Posição horizontal canto esquerdo
1560
-     * @param  number $y Posição vertical canto superior
1559
+     * @param  integer $x Posição horizontal canto esquerdo
1560
+     * @param  integer $y Posição vertical canto superior
1561 1561
      * @return number Posição vertical final
1562 1562
      */
1563 1563
     protected function localEntregaDANFE($x = 0, $y = 0)
@@ -1706,8 +1706,8 @@  discard block
 block discarded – undo
1706 1706
      * Monta o campo com os dados do local de entrega na DANFE. (retrato e paisagem)
1707 1707
      *
1708 1708
      * @name   localretiradaDANFE
1709
-     * @param  number $x Posição horizontal canto esquerdo
1710
-     * @param  number $y Posição vertical canto superior
1709
+     * @param  integer $x Posição horizontal canto esquerdo
1710
+     * @param  integer $y Posição vertical canto superior
1711 1711
      * @return number Posição vertical final
1712 1712
      */
1713 1713
     protected function localRetiradaDANFE($x = 0, $y = 0)
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
      * Gera a String do Texto da Fatura
1857 1857
       *
1858 1858
      * @name   getTextoFatura
1859
-     * @return uma String com o texto ou "";
1859
+     * @return string String com o texto ou "";
1860 1860
      */
1861 1861
     protected function getTextoFatura()
1862 1862
     {
@@ -1910,8 +1910,8 @@  discard block
 block discarded – undo
1910 1910
      * Monta o campo de duplicatas da DANFE (retrato e paisagem)
1911 1911
      *
1912 1912
      * @name   fatura
1913
-     * @param  number $x Posição horizontal canto esquerdo
1914
-     * @param  number $y Posição vertical canto superior
1913
+     * @param  integer $x Posição horizontal canto esquerdo
1914
+     * @param  double $y Posição vertical canto superior
1915 1915
      * @return number Posição vertical final
1916 1916
      */
1917 1917
     protected function fatura($x, $y)
@@ -2033,8 +2033,8 @@  discard block
 block discarded – undo
2033 2033
      * Monta o campo de pagamentos da DANFE (retrato e paisagem) (foi baseada na fatura)
2034 2034
      *
2035 2035
      * @name   pagamento
2036
-     * @param  number $x Posição horizontal canto esquerdo
2037
-     * @param  number $y Posição vertical canto superior
2036
+     * @param  integer $x Posição horizontal canto esquerdo
2037
+     * @param  double $y Posição vertical canto superior
2038 2038
      * @return number Posição vertical final
2039 2039
      */
2040 2040
     protected function pagamento($x, $y)
@@ -2142,6 +2142,8 @@  discard block
 block discarded – undo
2142 2142
      * @param  float $h Altura do campo
2143 2143
      * @param  float $h Título do campo
2144 2144
      * @param  float $h Valor do imposto
2145
+     * @param string $titulo
2146
+     * @param string $campoImposto
2145 2147
      * @return float Sugestão do $x do próximo imposto
2146 2148
      */
2147 2149
     protected function impostoHelper($x, $y, $w, $h, $titulo, $campoImposto)
@@ -2168,9 +2170,9 @@  discard block
 block discarded – undo
2168 2170
      * imposto
2169 2171
      * Monta o campo de impostos e totais da DANFE (retrato e paisagem)
2170 2172
      *
2171
-     * @param  number $x Posição horizontal canto esquerdo
2172
-     * @param  number $y Posição vertical canto superior
2173
-     * @return number Posição vertical final
2173
+     * @param  integer $x Posição horizontal canto esquerdo
2174
+     * @param  double $y Posição vertical canto superior
2175
+     * @return double Posição vertical final
2174 2176
      */
2175 2177
     protected function imposto($x, $y)
2176 2178
     {
@@ -2566,6 +2568,10 @@  discard block
 block discarded – undo
2566 2568
 
2567 2569
 
2568 2570
 
2571
+    /**
2572
+     * @param string $campo
2573
+     * @param string $formato
2574
+     */
2569 2575
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2570 2576
     {
2571 2577
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
@@ -2670,7 +2676,6 @@  discard block
 block discarded – undo
2670 2676
      * @param  float $x       Posição horizontal canto esquerdo
2671 2677
      * @param  float $y       Posição vertical canto superior
2672 2678
      * @param  float $nInicio Número do item inicial
2673
-     * @param  float $max     Número do item final
2674 2679
      * @param  float $hmax    Altura máxima do campo de itens em mm
2675 2680
      * @return float Posição vertical final
2676 2681
      */
@@ -3369,8 +3374,8 @@  discard block
 block discarded – undo
3369 3374
      * Monta o canhoto da DANFE (retrato e paisagem)
3370 3375
      *
3371 3376
      * @name   canhotoDANFE
3372
-     * @param  number $x Posição horizontal canto esquerdo
3373
-     * @param  number $y Posição vertical canto superior
3377
+     * @param  integer $x Posição horizontal canto esquerdo
3378
+     * @param  integer $y Posição vertical canto superior
3374 3379
      * @return number Posição vertical final
3375 3380
      *
3376 3381
      * TODO 21/07/14 fmertins: quando orientação L-paisagem, o canhoto está sendo gerado incorretamente
@@ -3663,6 +3668,9 @@  discard block
 block discarded – undo
3663 3668
         return $saida;
3664 3669
     }
3665 3670
     
3671
+    /**
3672
+     * @param string $xml
3673
+     */
3666 3674
     private function loadDoc($xml)
3667 3675
     {
3668 3676
         $this->xml = $xml;
Please login to merge, or discard this patch.
Spacing   +345 added lines, -346 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
             if ($papel == 'A4') {
271 271
                 $this->maxW = 297;
272 272
                 $this->maxH = 210;
273
-                $xInic = $this->margesq+10;
273
+                $xInic = $this->margesq + 10;
274 274
                 //se paisagem multiplica a largura do canhoto pela quantidade de canhotos
275 275
                 //$this->wCanhoto *= $this->qCanhoto;
276 276
             }
@@ -278,10 +278,10 @@  discard block
 block discarded – undo
278 278
         //total inicial de paginas
279 279
         $totPag = 1;
280 280
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
281
-        $this->wPrint = $this->maxW-($this->margesq * 2);
281
+        $this->wPrint = $this->maxW - ($this->margesq * 2);
282 282
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
283 283
         //superior e inferior
284
-        $this->hPrint = $this->maxH-$this->margsup-$this->marginf;
284
+        $this->hPrint = $this->maxH - $this->margsup - $this->marginf;
285 285
         // estabelece contagem de paginas
286 286
         $this->pdf->aliasNbPages();
287 287
         // fixa as margens
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
         }
326 326
         //calcular a altura necessária para os dados adicionais
327 327
         if ($this->orientacao == 'P') {
328
-            $this->wAdic = round($this->wPrint*0.66, 0);
328
+            $this->wAdic = round($this->wPrint * 0.66, 0);
329 329
         } else {
330
-            $this->wAdic = round(($this->wPrint-$this->wCanhoto)*0.5, 0);
330
+            $this->wAdic = round(($this->wPrint - $this->wCanhoto) * 0.5, 0);
331 331
         }
332 332
         $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
333 333
         $this->textoAdic = '';
@@ -339,8 +339,8 @@  discard block
 block discarded – undo
339 339
             $txRetxBairro = $this->getTagValue($this->retirada, "xBairro");
340 340
             $txRetxMun = $this->getTagValue($this->retirada, "xMun");
341 341
             $txRetUF = $this->getTagValue($this->retirada, "UF");
342
-            $this->textoAdic .= "LOCAL DE RETIRADA : ".
343
-                    $txRetCNPJ.
342
+            $this->textoAdic .= "LOCAL DE RETIRADA : " .
343
+                    $txRetCNPJ .
344 344
                     '-' .
345 345
                     $txRetxLgr .
346 346
                     ', ' .
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
             if ($this->textoAdic != '') {
368 368
                 $this->textoAdic .= ". \r\n";
369 369
             }
370
-            $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl.
371
-               ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n";
370
+            $this->textoAdic .= "LOCAL DE ENTREGA : " . $txRetCNPJ . '-' . $txRetxLgr . ', ' . $txRetnro . ' ' . $txRetxCpl .
371
+               ' - ' . $txRetxBairro . ' ' . $txRetxMun . ' - ' . $txRetUF . "\r\n";
372 372
         }
373 373
         //informações adicionais
374 374
         $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
             if ($this->textoAdic != '') {
378 378
                 $this->textoAdic .= ". \r\n";
379 379
             }
380
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl"))
380
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl"))
381 381
             ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl"))
382 382
             : '';
383 383
             $infPedido = $this->geraInformacoesDaTagCompra();
@@ -385,14 +385,14 @@  discard block
 block discarded – undo
385 385
                 $this->textoAdic .= $infPedido;
386 386
             }
387 387
             $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
388
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco"))
388
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco"))
389 389
             ? "\r\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco")
390 390
             : '';
391 391
             $obsCont = $this->infAdic->getElementsByTagName("obsCont");
392 392
             if (isset($obsCont)) {
393 393
                 foreach ($obsCont as $obs) {
394
-                    $campo =  $obsCont->item($i)->getAttribute("xCampo");
395
-                    $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
394
+                    $campo = $obsCont->item($i)->getAttribute("xCampo");
395
+                    $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
396 396
                     ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue
397 397
                     : '';
398 398
                     $this->textoAdic .= "\r\n" . $campo . ':  ' . trim($xTexto);
@@ -423,11 +423,11 @@  discard block
 block discarded – undo
423 423
             $numlinhasdados += $this->pdf->getNumLines($linha, $this->wAdic, $fontProduto);
424 424
         }
425 425
         $this->textadicfontsize = $this->pdf->fontSize;
426
-        $hdadosadic = round(($numlinhasdados+3) * $this->textadicfontsize, 0);
426
+        $hdadosadic = round(($numlinhasdados + 3) * $this->textadicfontsize, 0);
427 427
         if ($hdadosadic > 70) {
428
-            for ($per=1; $per>=0.01; $per=$per-0.01) {
429
-                $this->textadicfontsize = $this->pdf->fontSize*$per;
430
-                $hdadosadic = round(($numlinhasdados+3) * $this->textadicfontsize, 0);
428
+            for ($per = 1; $per >= 0.01; $per = $per - 0.01) {
429
+                $this->textadicfontsize = $this->pdf->fontSize * $per;
430
+                $hdadosadic = round(($numlinhasdados + 3) * $this->textadicfontsize, 0);
431 431
                 if ($hdadosadic <= 90) {
432 432
                     $hdadosadic = 70;
433 433
                     break;
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
             $hdadosadic = 10;
440 440
         }
441 441
         //altura disponivel para os campos da DANFE
442
-        $hcabecalho = 47;//para cabeçalho
443
-        $hdestinatario = 25;//para destinatario
444
-        $hduplicatas = 12;//para cada grupo de 7 duplicatas
442
+        $hcabecalho = 47; //para cabeçalho
443
+        $hdestinatario = 25; //para destinatario
444
+        $hduplicatas = 12; //para cada grupo de 7 duplicatas
445 445
         if (isset($this->entrega)) {
446 446
             $hlocalentrega = 25;
447 447
         } else {
@@ -452,11 +452,11 @@  discard block
 block discarded – undo
452 452
         } else {
453 453
             $hlocalretirada = 0;
454 454
         }
455
-        $himposto = 18;// para imposto
456
-        $htransporte = 25;// para transporte
457
-        $hissqn = 11;// para issqn
458
-        $hfooter = 5;// para rodape
459
-        $hCabecItens = 4;//cabeçalho dos itens
455
+        $himposto = 18; // para imposto
456
+        $htransporte = 25; // para transporte
457
+        $hissqn = 11; // para issqn
458
+        $hfooter = 5; // para rodape
459
+        $hCabecItens = 4; //cabeçalho dos itens
460 460
         //alturas disponiveis para os dados
461 461
         $hDispo1 = $this->hPrint - 10 - ($hcabecalho +
462 462
             //$hdestinatario + ($linhasDup * $hduplicatas) + $himposto + $htransporte +
@@ -465,18 +465,18 @@  discard block
 block discarded – undo
465 465
             ($linhaISSQN * $hissqn) + $hdadosadic + $hfooter + $hCabecItens +
466 466
             $this->sizeExtraTextoFatura());
467 467
         if ($this->orientacao == 'P') {
468
-            $hDispo1 -= 24 * $this->qCanhoto;//para canhoto
468
+            $hDispo1 -= 24 * $this->qCanhoto; //para canhoto
469 469
             $w = $this->wPrint;
470 470
         } else {
471
-            $hcanhoto = $this->hPrint;//para canhoto
471
+            $hcanhoto = $this->hPrint; //para canhoto
472 472
             $w = $this->wPrint - $this->wCanhoto;
473 473
         }
474
-        $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens)-4;
474
+        $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens) - 4;
475 475
         //Contagem da altura ocupada para impressão dos itens
476 476
         $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
477 477
         $numlinhas = 0;
478 478
         $hUsado = $hCabecItens;
479
-        $w2 = round($w*0.28, 0);
479
+        $w2 = round($w * 0.28, 0);
480 480
         $hDispo = $hDispo1;
481 481
         $totPag = 1;
482 482
         $i = 0;
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
                 $hDispo = $hDispo2;
490 490
                 $hUsado = $hCabecItens;
491 491
                 // Remove canhoto para páginas secundárias em modo paisagem ('L')
492
-                $w2 = round($this->wPrint*0.28, 0);
492
+                $w2 = round($this->wPrint * 0.28, 0);
493 493
                 $i--; // decrementa para readicionar o item que não coube nessa pagina na outra.
494 494
             }
495 495
             $i++;
@@ -513,15 +513,15 @@  discard block
 block discarded – undo
513 513
         //coloca o cabeçalho
514 514
         $y = $this->header($x, $y, $pag, $totPag);
515 515
         //coloca os dados do destinatário
516
-        $y = $this->destinatarioDANFE($x, $y+1);
516
+        $y = $this->destinatarioDANFE($x, $y + 1);
517 517
         
518 518
         //coloca os dados do local de retirada
519 519
         if (isset($this->retirada)) {
520
-            $y = $this->localRetiradaDANFE($x, $y+1);
520
+            $y = $this->localRetiradaDANFE($x, $y + 1);
521 521
         }
522 522
         //coloca os dados do local de entrega
523 523
         if (isset($this->entrega)) {
524
-            $y = $this->localEntregaDANFE($x, $y+1);
524
+            $y = $this->localEntregaDANFE($x, $y + 1);
525 525
         }
526 526
         
527 527
         //Verifica as formas de pagamento da nota fiscal
@@ -536,29 +536,29 @@  discard block
 block discarded – undo
536 536
         }
537 537
         //caso tenha boleto imprimir fatura
538 538
         if ($this->dup->length > 0) {
539
-            $y = $this->fatura($x, $y+1);
539
+            $y = $this->fatura($x, $y + 1);
540 540
         } else {
541 541
             //Se somente tiver a forma de pagamento sem pagamento ou outros não imprimir nada
542
-            if (count($formaPag)=='1' && (isset($formaPag[90]) || isset($formaPag[99]))) {
542
+            if (count($formaPag) == '1' && (isset($formaPag[90]) || isset($formaPag[99]))) {
543 543
                 $y = $y;
544 544
             } else {
545 545
                 //caso tenha mais de uma forma de pagamento ou seja diferente de boleto exibe a
546 546
                 //forma de pagamento e o valor
547
-                $y = $this->pagamento($x, $y+1);
547
+                $y = $this->pagamento($x, $y + 1);
548 548
             }
549 549
         }
550 550
         //coloca os dados dos impostos e totais da NFe
551
-        $y = $this->imposto($x, $y+1);
551
+        $y = $this->imposto($x, $y + 1);
552 552
         //coloca os dados do trasnporte
553
-        $y = $this->transporte($x, $y+1);
553
+        $y = $this->transporte($x, $y + 1);
554 554
         //itens da DANFE
555 555
         $nInicial = 0;
556 556
 
557
-        $y = $this->itens($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens);
557
+        $y = $this->itens($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens);
558 558
 
559 559
         //coloca os dados do ISSQN
560 560
         if ($linhaISSQN == 1) {
561
-            $y = $this->issqn($x, $y+4);
561
+            $y = $this->issqn($x, $y + 4);
562 562
         } else {
563 563
             $y += 4;
564 564
         }
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
             //coloca o cabeçalho na página adicional
588 588
             $y = $this->header($x, $y, $n, $totPag);
589 589
             //coloca os itens na página adicional
590
-            $y = $this->itens($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens);
590
+            $y = $this->itens($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens);
591 591
             //coloca o rodapé da página
592 592
             if ($this->orientacao == 'P') {
593 593
                 $this->rodape($margEsq);
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
         if ($startPos === false) {
625 625
             return $cdata;
626 626
         }
627
-        for ($x=$len; $x>0; $x--) {
627
+        for ($x = $len; $x > 0; $x--) {
628 628
             if (substr($cdata, $x, 1) == '>') {
629 629
                 $endPos = $x;
630 630
                 break;
@@ -635,15 +635,15 @@  discard block
 block discarded – undo
635 635
         } else {
636 636
             $parte1 = '';
637 637
         }
638
-        $parte2 = substr($cdata, $startPos, $endPos-$startPos+1);
638
+        $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1);
639 639
         if ($endPos < $len) {
640 640
             $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1);
641 641
         } else {
642 642
             $parte3 = '';
643 643
         }
644
-        $texto = trim($parte1).' '.trim($parte3);
644
+        $texto = trim($parte1) . ' ' . trim($parte3);
645 645
         if (strpos($parte2, '<CDATA>') === false) {
646
-            $cdata = '<CDATA>'.$parte2.'</CDATA>';
646
+            $cdata = '<CDATA>' . $parte2 . '</CDATA>';
647 647
         } else {
648 648
             $cdata = $parte2;
649 649
         }
@@ -717,15 +717,15 @@  discard block
 block discarded – undo
717 717
         //grupo CADATA infCpl
718 718
         $t = $dom->getElementsByTagName('transmissor')->item(0);
719 719
         $r = $dom->getElementsByTagName('receptor')->item(0);
720
-        $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
721
-            'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : '';
722
-        $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
723
-            'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : '';
724
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
725
-            'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : '';
726
-        $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
727
-            'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : '';
728
-        $texto .= "".$versao.$especieNF.$fabEntrega.$dca;
720
+        $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
721
+            'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
722
+        $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
723
+            'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
724
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
725
+            'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
726
+        $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
727
+            'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
728
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
729 729
         if (isset($t)) {
730 730
             if ($t->hasAttributes()) {
731 731
                 $texto .= " Transmissor ";
@@ -811,14 +811,14 @@  discard block
 block discarded – undo
811 811
         }
812 812
         //####################################################################################
813 813
         //coluna esquerda identificação do emitente
814
-        $w = round($maxW*0.41, 0);
814
+        $w = round($maxW * 0.41, 0);
815 815
         if ($this->orientacao == 'P') {
816 816
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
817 817
         } else {
818 818
             $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
819 819
         }
820 820
         $w1 = $w;
821
-        $h=32;
821
+        $h = 32;
822 822
         $oldY += $h;
823 823
         $this->pdf->textBox($x, $y, $w, $h);
824 824
         $texto = 'IDENTIFICAÇÃO DO EMITENTE';
@@ -834,39 +834,39 @@  discard block
 block discarded – undo
834 834
         if (!empty($this->logomarca)) {
835 835
             $logoInfo = getimagesize($this->logomarca);
836 836
             //largura da imagem em mm
837
-            $logoWmm = ($logoInfo[0]/72)*25.4;
837
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
838 838
             //altura da imagem em mm
839
-            $logoHmm = ($logoInfo[1]/72)*25.4;
840
-            if ($this->logoAlign=='L') {
841
-                $nImgW = round($w/3, 0);
842
-                $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
843
-                $xImg = $x+1;
844
-                $yImg = round(($h-$nImgH)/2, 0)+$y;
839
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
840
+            if ($this->logoAlign == 'L') {
841
+                $nImgW = round($w / 3, 0);
842
+                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
843
+                $xImg = $x + 1;
844
+                $yImg = round(($h - $nImgH) / 2, 0) + $y;
845 845
                 //estabelecer posições do texto
846
-                $x1 = round($xImg + $nImgW +1, 0);
847
-                $y1 = round($h/3+$y, 0);
848
-                $tw = round(2*$w/3, 0);
849
-            } elseif ($this->logoAlign=='C') {
850
-                $nImgH = round($h/3, 0);
851
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
852
-                $xImg = round(($w-$nImgW)/2+$x, 0);
853
-                $yImg = $y+3;
846
+                $x1 = round($xImg + $nImgW + 1, 0);
847
+                $y1 = round($h / 3 + $y, 0);
848
+                $tw = round(2 * $w / 3, 0);
849
+            } elseif ($this->logoAlign == 'C') {
850
+                $nImgH = round($h / 3, 0);
851
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
852
+                $xImg = round(($w - $nImgW) / 2 + $x, 0);
853
+                $yImg = $y + 3;
854 854
                 $x1 = $x;
855 855
                 $y1 = round($yImg + $nImgH + 1, 0);
856 856
                 $tw = $w;
857
-            } elseif ($this->logoAlign=='R') {
858
-                $nImgW = round($w/3, 0);
859
-                $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
860
-                $xImg = round($x+($w-(1+$nImgW)), 0);
861
-                $yImg = round(($h-$nImgH)/2, 0)+$y;
857
+            } elseif ($this->logoAlign == 'R') {
858
+                $nImgW = round($w / 3, 0);
859
+                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
860
+                $xImg = round($x + ($w - (1 + $nImgW)), 0);
861
+                $yImg = round(($h - $nImgH) / 2, 0) + $y;
862 862
                 $x1 = $x;
863
-                $y1 = round($h/3+$y, 0);
864
-                $tw = round(2*$w/3, 0);
865
-            } elseif ($this->logoAlign=='F') {
866
-                $nImgH = round($h-5, 0);
867
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
868
-                $xImg = round(($w-$nImgW)/2+$x, 0);
869
-                $yImg = $y+3;
863
+                $y1 = round($h / 3 + $y, 0);
864
+                $tw = round(2 * $w / 3, 0);
865
+            } elseif ($this->logoAlign == 'F') {
866
+                $nImgH = round($h - 5, 0);
867
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
868
+                $xImg = round(($w - $nImgW) / 2 + $x, 0);
869
+                $yImg = $y + 3;
870 870
                 $x1 = $x;
871 871
                 $y1 = round($yImg + $nImgH + 1, 0);
872 872
                 $tw = $w;
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
             $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg');
876 876
         } else {
877 877
             $x1 = $x;
878
-            $y1 = round($h/3+$y, 0);
878
+            $y1 = round($h / 3 + $y, 0);
879 879
             $tw = $w;
880 880
         }
881 881
         // monta as informações apenas se diferente de full logo
@@ -885,9 +885,9 @@  discard block
 block discarded – undo
885 885
             $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue;
886 886
             $this->pdf->textBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, '');
887 887
             //endereço
888
-            $y1 = $y1+5;
888
+            $y1 = $y1 + 5;
889 889
             $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
890
-            $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
890
+            $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
891 891
             ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
892 892
             : '';
893 893
             $lgr = $this->getTagValue($this->enderEmit, "xLgr");
@@ -907,33 +907,33 @@  discard block
 block discarded – undo
907 907
         //####################################################################################
908 908
         //coluna central Danfe
909 909
         $x += $w;
910
-        $w=round($maxW * 0.17, 0);//35;
910
+        $w = round($maxW * 0.17, 0); //35;
911 911
         $w2 = $w;
912 912
         $h = 32;
913 913
         $this->pdf->textBox($x, $y, $w, $h);
914 914
   
915 915
         $texto = "DANFE";
916 916
         $aFont = ['font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B'];
917
-        $this->pdf->textBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
917
+        $this->pdf->textBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
918 918
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
919 919
         $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica';
920 920
         $h = 20;
921
-        $this->pdf->textBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false);
921
+        $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false);
922 922
 
923 923
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
924 924
         $texto = '0 - ENTRADA';
925 925
         $y1 = $y + 14;
926 926
         $h = 8;
927
-        $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
927
+        $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
928 928
         $texto = '1 - SAÍDA';
929 929
         $y1 = $y + 17;
930
-        $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
930
+        $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
931 931
         //tipo de nF
932 932
         $aFont = ['font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B'];
933 933
         $y1 = $y + 13;
934 934
         $h = 7;
935 935
         $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
936
-        $this->pdf->textBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, '');
936
+        $this->pdf->textBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, '');
937 937
         //numero da NF
938 938
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
939 939
         $y1 = $y + 20;
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
         //####################################################################################
966 966
         //coluna codigo de barras
967 967
         $x += $w;
968
-        $w = ($maxW-$w1-$w2);//85;
968
+        $w = ($maxW - $w1 - $w2); //85;
969 969
         $w3 = $w;
970 970
         $h = 32;
971 971
         $this->pdf->textBox($x, $y, $w, $h);
@@ -974,22 +974,22 @@  discard block
 block discarded – undo
974 974
         $bW = 75;
975 975
         $bH = 12;
976 976
         //codigo de barras
977
-        $this->pdf->code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH);
977
+        $this->pdf->code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH);
978 978
         //linhas divisorias
979
-        $this->pdf->line($x, $y+4+$bH, $x+$w, $y+4+$bH);
980
-        $this->pdf->line($x, $y+12+$bH, $x+$w, $y+12+$bH);
979
+        $this->pdf->line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH);
980
+        $this->pdf->line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH);
981 981
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
982
-        $y1 = $y+4+$bH;
982
+        $y1 = $y + 4 + $bH;
983 983
         $h = 7;
984 984
         $texto = 'CHAVE DE ACESSO';
985 985
         $this->pdf->textBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
986 986
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
987
-        $y1 = $y+8+$bH;
987
+        $y1 = $y + 8 + $bH;
988 988
         $texto = $this->formatField($chave_acesso, $this->formatoChave);
989
-        $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, '');
990
-        $y1 = $y+12+$bH;
989
+        $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, '');
990
+        $y1 = $y + 12 + $bH;
991 991
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
992
-        $chaveContingencia="";
992
+        $chaveContingencia = "";
993 993
         if ($this->notaDpec()) {
994 994
             $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC';
995 995
         } else {
@@ -1000,16 +1000,16 @@  discard block
 block discarded – undo
1000 1000
             $chaveContingencia = $this->geraChaveAdicionalDeContingencia();
1001 1001
             $this->pdf->setFillColor(0, 0, 0);
1002 1002
             //codigo de barras
1003
-            $this->pdf->code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2);
1003
+            $this->pdf->code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2);
1004 1004
         } else {
1005 1005
             $texto = 'Consulta de autenticidade no portal nacional da NF-e';
1006
-            $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, '');
1007
-            $y1 = $y+16+$bH;
1006
+            $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, '');
1007
+            $y1 = $y + 16 + $bH;
1008 1008
             $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora';
1009 1009
             $this->pdf->textBox(
1010
-                $x+2,
1010
+                $x + 2,
1011 1011
                 $y1,
1012
-                $w-2,
1012
+                $w - 2,
1013 1013
                 $h,
1014 1014
                 $texto,
1015 1015
                 $aFont,
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
         //natureza da operação
1026 1026
         $texto = 'NATUREZA DA OPERAÇÃO';
1027 1027
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1028
-        $w = $w1+$w2;
1028
+        $w = $w1 + $w2;
1029 1029
         $y = $oldY;
1030 1030
         $oldY += $h;
1031 1031
         $x = $oldX;
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
                 $cStat = '';
1059 1059
             } else {
1060 1060
                 if (isset($this->nfeProc)) {
1061
-                    $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1061
+                    $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1062 1062
                     ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1063 1063
                     : '';
1064 1064
                     $tsHora = $this->toTimestamp(
@@ -1100,25 +1100,25 @@  discard block
 block discarded – undo
1100 1100
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1101 1101
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1102 1102
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1103
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1103
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1104 1104
         ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1105 1105
         : '';
1106 1106
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1107 1107
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1108 1108
         //CNPJ
1109 1109
         $x += $w;
1110
-        $w = ($maxW-(3 * $w));
1110
+        $w = ($maxW - (3 * $w));
1111 1111
         $texto = 'CNPJ';
1112 1112
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1113 1113
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1114 1114
         //Pegando valor do CPF/CNPJ
1115
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1115
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1116 1116
             $texto = $this->formatField(
1117 1117
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1118 1118
                 "###.###.###/####-##"
1119 1119
             );
1120 1120
         } else {
1121
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1121
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1122 1122
             ? $this->formatField(
1123 1123
                 $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1124 1124
                 "###.###.###-##"
@@ -1135,22 +1135,22 @@  discard block
 block discarded – undo
1135 1135
         $resp = $this->statusNFe();
1136 1136
         if (!$resp['status']) {
1137 1137
             $x = 10;
1138
-            $y = $this->hPrint-130;
1138
+            $y = $this->hPrint - 130;
1139 1139
             $h = 25;
1140
-            $w = $maxW-(2*$x);
1140
+            $w = $maxW - (2 * $x);
1141 1141
             $this->pdf->settextcolor(90, 90, 90);
1142 1142
             $texto = $resp['message'];
1143 1143
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1144 1144
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1145 1145
             $y += $h;
1146 1146
             $h = 5;
1147
-            $w = $maxW-(2*$x);
1147
+            $w = $maxW - (2 * $x);
1148 1148
             if (isset($this->infProt) && $resp['status']) {
1149 1149
                 $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue;
1150 1150
             } else {
1151 1151
                 $xMotivo = '';
1152 1152
             }
1153
-            $texto = "SEM VALOR FISCAL\n".$xMotivo;
1153
+            $texto = "SEM VALOR FISCAL\n" . $xMotivo;
1154 1154
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1155 1155
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1156 1156
             $this->pdf->settextcolor(0, 0, 0);
@@ -1173,12 +1173,12 @@  discard block
 block discarded – undo
1173 1173
         if ($this->notaDpec() || $this->tpEmis == 4) {
1174 1174
             //DPEC
1175 1175
             $x = 10;
1176
-            $y = $this->hPrint-130;
1176
+            $y = $this->hPrint - 130;
1177 1177
             $h = 25;
1178
-            $w = $maxW-(2*$x);
1178
+            $w = $maxW - (2 * $x);
1179 1179
             $this->pdf->SetTextColor(200, 200, 200);
1180
-            $texto = "DANFE impresso em contingência -\n".
1181
-                     "DPEC regularmente recebido pela Receita\n".
1180
+            $texto = "DANFE impresso em contingência -\n" .
1181
+                     "DPEC regularmente recebido pela Receita\n" .
1182 1182
                      "Federal do Brasil";
1183 1183
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1184 1184
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1298 1298
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1299 1299
         //NOME / RAZÃO SOCIAL
1300
-        $w = round($maxW*0.61, 0);
1300
+        $w = round($maxW * 0.61, 0);
1301 1301
         $w1 = $w;
1302 1302
         $y += 3;
1303 1303
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1312,19 +1312,19 @@  discard block
 block discarded – undo
1312 1312
         }
1313 1313
         //CNPJ / CPF
1314 1314
         $x += $w;
1315
-        $w = round($maxW*0.23, 0);
1315
+        $w = round($maxW * 0.23, 0);
1316 1316
         $w2 = $w;
1317 1317
         $texto = 'CNPJ / CPF';
1318 1318
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1319 1319
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1320 1320
         //Pegando valor do CPF/CNPJ
1321
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1321
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1322 1322
             $texto = $this->formatField(
1323 1323
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1324 1324
                 "###.###.###/####-##"
1325 1325
             );
1326 1326
         } else {
1327
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1327
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1328 1328
             ? $this->formatField(
1329 1329
                 $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1330 1330
                 "###.###.###-##"
@@ -1335,16 +1335,16 @@  discard block
 block discarded – undo
1335 1335
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1336 1336
         //DATA DA EMISSÃO
1337 1337
         $x += $w;
1338
-        $w = $maxW-($w1+$w2);
1338
+        $w = $maxW - ($w1 + $w2);
1339 1339
         $wx = $w;
1340 1340
         $texto = 'DATA DA EMISSÃO';
1341 1341
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1342 1342
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1343
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1343
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1344 1344
         ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1345 1345
         : '';
1346 1346
         if ($dEmi == '') {
1347
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1347
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1348 1348
             ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1349 1349
             : '';
1350 1350
             $aDemi = explode('T', $dEmi);
@@ -1358,7 +1358,7 @@  discard block
 block discarded – undo
1358 1358
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1359 1359
         }
1360 1360
         //ENDEREÇO
1361
-        $w = round($maxW*0.47, 0);
1361
+        $w = round($maxW * 0.47, 0);
1362 1362
         $w1 = $w;
1363 1363
         $y += $h;
1364 1364
         $x = $oldX;
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1374 1374
         //BAIRRO / DISTRITO
1375 1375
         $x += $w;
1376
-        $w = round($maxW*0.21, 0);
1376
+        $w = round($maxW * 0.21, 0);
1377 1377
         $w2 = $w;
1378 1378
         $texto = 'BAIRRO / DISTRITO';
1379 1379
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
@@ -1383,12 +1383,12 @@  discard block
 block discarded – undo
1383 1383
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1384 1384
         //CEP
1385 1385
         $x += $w;
1386
-        $w = $maxW-$w1-$w2-$wx;
1386
+        $w = $maxW - $w1 - $w2 - $wx;
1387 1387
         $w2 = $w;
1388 1388
         $texto = 'CEP';
1389 1389
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1390 1390
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1391
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1391
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1392 1392
         ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1393 1393
         : '';
1394 1394
         $texto = $this->formatField($texto, "#####-###");
@@ -1400,11 +1400,11 @@  discard block
 block discarded – undo
1400 1400
         $texto = 'DATA DA SAÍDA/ENTRADA';
1401 1401
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1402 1402
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1403
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1403
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1404 1404
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1405 1405
             : '';
1406 1406
         if ($dSaiEnt == '') {
1407
-            $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1407
+            $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1408 1408
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1409 1409
                 : '';
1410 1410
             $aDsaient = explode('T', $dSaiEnt);
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
         if (strtoupper(trim($texto)) == "EXTERIOR"
1425 1425
             && $this->dest->getElementsByTagName("xPais")->length > 0
1426 1426
         ) {
1427
-            $texto .= " - " .  $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue;
1427
+            $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue;
1428 1428
         }
1429 1429
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1430 1430
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1439,19 +1439,19 @@  discard block
 block discarded – undo
1439 1439
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1440 1440
         //FONE / FAX
1441 1441
         $x += $w;
1442
-        $w = round(($maxW -$w1-$wx-8)/2, 0);
1442
+        $w = round(($maxW - $w1 - $wx - 8) / 2, 0);
1443 1443
         $w3 = $w;
1444 1444
         $texto = 'FONE / FAX';
1445 1445
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1446 1446
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1447
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1447
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1448 1448
         ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1449 1449
         : '';
1450 1450
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1451 1451
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1452 1452
         //INSCRIÇÃO ESTADUAL
1453 1453
         $x += $w;
1454
-        $w = $maxW -$w1-$wx-8-$w3;
1454
+        $w = $maxW - $w1 - $wx - 8 - $w3;
1455 1455
         $texto = 'INSCRIÇÃO ESTADUAL';
1456 1456
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1457 1457
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1465,11 +1465,11 @@  discard block
 block discarded – undo
1465 1465
         $texto = 'HORA DA SAÍDA/ENTRADA';
1466 1466
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1467 1467
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1468
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1468
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1469 1469
         ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1470 1470
         : '';
1471 1471
         if ($hSaiEnt == '') {
1472
-            $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1472
+            $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1473 1473
             ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1474 1474
             : '';
1475 1475
             $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt);
@@ -1508,7 +1508,7 @@  discard block
 block discarded – undo
1508 1508
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
1509 1509
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1510 1510
         //NOME / RAZÃO SOCIAL
1511
-        $w = round($maxW*0.61, 0);
1511
+        $w = round($maxW * 0.61, 0);
1512 1512
         $w1 = $w;
1513 1513
         $y += 3;
1514 1514
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1526,19 +1526,19 @@  discard block
 block discarded – undo
1526 1526
         }
1527 1527
         //CNPJ / CPF
1528 1528
         $x += $w;
1529
-        $w = round($maxW*0.23, 0);
1529
+        $w = round($maxW * 0.23, 0);
1530 1530
         $w2 = $w;
1531 1531
         $texto = 'CNPJ / CPF';
1532 1532
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1533 1533
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1534 1534
         //Pegando valor do CPF/CNPJ
1535
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1535
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1536 1536
             $texto = $this->formatField(
1537 1537
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1538 1538
                 "###.###.###/####-##"
1539 1539
             );
1540 1540
         } else {
1541
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1541
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1542 1542
                     $this->formatField(
1543 1543
                         $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1544 1544
                         "###.###.###-##"
@@ -1548,7 +1548,7 @@  discard block
 block discarded – undo
1548 1548
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1549 1549
         //INSCRIÇÃO ESTADUAL
1550 1550
         $x += $w;
1551
-        $w = $maxW-($w1+$w2);
1551
+        $w = $maxW - ($w1 + $w2);
1552 1552
         $wx = $w;
1553 1553
         $texto = 'INSCRIÇÃO ESTADUAL';
1554 1554
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1565 1565
         }
1566 1566
         //ENDEREÇO
1567
-        $w = round($maxW*0.355, 0) + $wx;
1567
+        $w = round($maxW * 0.355, 0) + $wx;
1568 1568
         $w1 = $w;
1569 1569
         $y += $h;
1570 1570
         $x = $oldX;
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1579 1579
         //BAIRRO / DISTRITO
1580 1580
         $x += $w;
1581
-        $w = round($maxW*0.335, 0);
1581
+        $w = round($maxW * 0.335, 0);
1582 1582
         $w2 = $w;
1583 1583
         $texto = 'BAIRRO / DISTRITO';
1584 1584
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1588,17 +1588,17 @@  discard block
 block discarded – undo
1588 1588
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1589 1589
         //CEP
1590 1590
         $x += $w;
1591
-        $w = $maxW-($w1+$w2);
1591
+        $w = $maxW - ($w1 + $w2);
1592 1592
         $texto = 'CEP';
1593 1593
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1594 1594
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1595
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1595
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1596 1596
                 $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1597 1597
         $texto = $this->formatField($texto, "#####-###");
1598 1598
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1599 1599
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1600 1600
         //MUNICÍPIO
1601
-        $w = round($maxW*0.805, 0);
1601
+        $w = round($maxW * 0.805, 0);
1602 1602
         $w1 = $w;
1603 1603
         $y += $h;
1604 1604
         $x = $oldX;
@@ -1607,7 +1607,7 @@  discard block
 block discarded – undo
1607 1607
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1608 1608
         $texto = $this->entrega->getElementsByTagName("xMun")->item(0)->nodeValue;
1609 1609
         if (strtoupper(trim($texto)) == "EXTERIOR" && $this->entrega->getElementsByTagName("xPais")->length > 0) {
1610
-            $texto .= " - " .  $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue;
1610
+            $texto .= " - " . $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue;
1611 1611
         }
1612 1612
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1613 1613
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1622,11 +1622,11 @@  discard block
 block discarded – undo
1622 1622
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1623 1623
         //FONE / FAX
1624 1624
         $x += $w;
1625
-        $w = $maxW-$w-$w1;
1625
+        $w = $maxW - $w - $w1;
1626 1626
         $texto = 'FONE / FAX';
1627 1627
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1628 1628
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1629
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1629
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1630 1630
                 $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1631 1631
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1632 1632
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1658,7 +1658,7 @@  discard block
 block discarded – undo
1658 1658
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
1659 1659
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1660 1660
         //NOME / RAZÃO SOCIAL
1661
-        $w = round($maxW*0.61, 0);
1661
+        $w = round($maxW * 0.61, 0);
1662 1662
         $w1 = $w;
1663 1663
         $y += 3;
1664 1664
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1676,19 +1676,19 @@  discard block
 block discarded – undo
1676 1676
         }
1677 1677
         //CNPJ / CPF
1678 1678
         $x += $w;
1679
-        $w = round($maxW*0.23, 0);
1679
+        $w = round($maxW * 0.23, 0);
1680 1680
         $w2 = $w;
1681 1681
         $texto = 'CNPJ / CPF';
1682 1682
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1683 1683
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1684 1684
         //Pegando valor do CPF/CNPJ
1685
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1685
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1686 1686
             $texto = $this->formatField(
1687 1687
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1688 1688
                 "###.###.###/####-##"
1689 1689
             );
1690 1690
         } else {
1691
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1691
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1692 1692
                     $this->formatField(
1693 1693
                         $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1694 1694
                         "###.###.###-##"
@@ -1698,7 +1698,7 @@  discard block
 block discarded – undo
1698 1698
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1699 1699
         //INSCRIÇÃO ESTADUAL
1700 1700
         $x += $w;
1701
-        $w = $maxW-($w1+$w2);
1701
+        $w = $maxW - ($w1 + $w2);
1702 1702
         $wx = $w;
1703 1703
         $texto = 'INSCRIÇÃO ESTADUAL';
1704 1704
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1714,7 +1714,7 @@  discard block
 block discarded – undo
1714 1714
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1715 1715
         }
1716 1716
         //ENDEREÇO
1717
-        $w = round($maxW*0.355, 0) + $wx;
1717
+        $w = round($maxW * 0.355, 0) + $wx;
1718 1718
         $w1 = $w;
1719 1719
         $y += $h;
1720 1720
         $x = $oldX;
@@ -1728,7 +1728,7 @@  discard block
 block discarded – undo
1728 1728
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1729 1729
         //BAIRRO / DISTRITO
1730 1730
         $x += $w;
1731
-        $w = round($maxW*0.335, 0);
1731
+        $w = round($maxW * 0.335, 0);
1732 1732
         $w2 = $w;
1733 1733
         $texto = 'BAIRRO / DISTRITO';
1734 1734
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1738,17 +1738,17 @@  discard block
 block discarded – undo
1738 1738
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1739 1739
         //CEP
1740 1740
         $x += $w;
1741
-        $w = $maxW-($w1+$w2);
1741
+        $w = $maxW - ($w1 + $w2);
1742 1742
         $texto = 'CEP';
1743 1743
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1744 1744
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1745
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1745
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1746 1746
                 $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1747 1747
         $texto = $this->formatField($texto, "#####-###");
1748 1748
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1749 1749
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1750 1750
         //MUNICÍPIO
1751
-        $w = round($maxW*0.805, 0);
1751
+        $w = round($maxW * 0.805, 0);
1752 1752
         $w1 = $w;
1753 1753
         $y += $h;
1754 1754
         $x = $oldX;
@@ -1757,7 +1757,7 @@  discard block
 block discarded – undo
1757 1757
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1758 1758
         $texto = $this->retirada->getElementsByTagName("xMun")->item(0)->nodeValue;
1759 1759
         if (strtoupper(trim($texto)) == "EXTERIOR" && $this->retirada->getElementsByTagName("xPais")->length > 0) {
1760
-            $texto .= " - " .  $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue;
1760
+            $texto .= " - " . $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue;
1761 1761
         }
1762 1762
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1763 1763
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1772,11 +1772,11 @@  discard block
 block discarded – undo
1772 1772
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1773 1773
         //FONE / FAX
1774 1774
         $x += $w;
1775
-        $w = $maxW-$w-$w1;
1775
+        $w = $maxW - $w - $w1;
1776 1776
         $texto = 'FONE / FAX';
1777 1777
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1778 1778
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1779
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1779
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1780 1780
                 $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1781 1781
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1782 1782
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1849,7 +1849,7 @@  discard block
 block discarded – undo
1849 1849
     protected function fatura($x, $y)
1850 1850
     {
1851 1851
         $linha = 1;
1852
-        $h = 8+3;
1852
+        $h = 8 + 3;
1853 1853
         $oldx = $x;
1854 1854
         $textoFatura = $this->getTextoFatura();
1855 1855
         //verificar se existem duplicatas
@@ -1882,29 +1882,29 @@  discard block
 block discarded – undo
1882 1882
                 return ($y + $h - 3);
1883 1883
             }
1884 1884
             if ($textoFatura !== "" && $this->exibirTextoFatura) {
1885
-                $myH=6;
1885
+                $myH = 6;
1886 1886
                 $myW = $this->wPrint;
1887 1887
                 if ($this->orientacao == 'L') {
1888 1888
                     $myW -= $this->wCanhoto;
1889 1889
                 }
1890 1890
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1891 1891
                 $this->pdf->textBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, '');
1892
-                $y+=$myH+1;
1892
+                $y += $myH + 1;
1893 1893
             }
1894 1894
             if ($this->orientacao == 'P') {
1895
-                $w = round($this->wPrint/7.018, 0)-1;
1895
+                $w = round($this->wPrint / 7.018, 0) - 1;
1896 1896
             } else {
1897 1897
                 $w = 28;
1898 1898
             }
1899 1899
             $increm = 1;
1900 1900
             foreach ($this->dup as $k => $d) {
1901
-                $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1901
+                $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1902 1902
                 ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1903 1903
                 : '';
1904
-                $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1904
+                $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1905 1905
                 ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1906 1906
                 : '';
1907
-                $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1907
+                $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1908 1908
                 ? 'R$ ' . number_format(
1909 1909
                     $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1910 1910
                     2,
@@ -1914,14 +1914,14 @@  discard block
 block discarded – undo
1914 1914
                 : '';
1915 1915
                 $h = 8;
1916 1916
                 $texto = '';
1917
-                if ($nDup!='0' && $nDup!='') {
1917
+                if ($nDup != '0' && $nDup != '') {
1918 1918
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1919 1919
                     $this->pdf->textBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, '');
1920 1920
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1921 1921
                     $this->pdf->textBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, '');
1922 1922
                 } else {
1923 1923
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1924
-                    $this->pdf->textBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, '');
1924
+                    $this->pdf->textBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, '');
1925 1925
                 }
1926 1926
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1927 1927
                 $this->pdf->textBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, '');
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
                 $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, '');
1932 1932
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1933 1933
                 $this->pdf->textBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, '');
1934
-                $x += $w+$increm;
1934
+                $x += $w + $increm;
1935 1935
                 $dupcont += 1;
1936 1936
                 if ($this->orientacao == 'P') {
1937 1937
                     $maxDupCont = 6;
@@ -1953,10 +1953,10 @@  discard block
 block discarded – undo
1953 1953
                 $y -= 9;
1954 1954
                 $linha--;
1955 1955
             }
1956
-            return ($y+$h);
1956
+            return ($y + $h);
1957 1957
         } else {
1958 1958
             $linha = 0;
1959
-            return ($y-2);
1959
+            return ($y - 2);
1960 1960
         }
1961 1961
     }
1962 1962
 
@@ -1972,7 +1972,7 @@  discard block
 block discarded – undo
1972 1972
     protected function pagamento($x, $y)
1973 1973
     {
1974 1974
         $linha = 1;
1975
-        $h = 8+3;
1975
+        $h = 8 + 3;
1976 1976
         $oldx = $x;
1977 1977
         //verificar se existem cobranças definidas
1978 1978
         if (isset($this->detPag) && $this->detPag->length > 0) {
@@ -1991,7 +1991,7 @@  discard block
 block discarded – undo
1991 1991
             $dups = "";
1992 1992
             $dupcont = 0;
1993 1993
             if ($this->orientacao == 'P') {
1994
-                $w = round($this->wPrint/7.018, 0)-1;
1994
+                $w = round($this->wPrint / 7.018, 0) - 1;
1995 1995
             } else {
1996 1996
                 $w = 28;
1997 1997
             }
@@ -2001,17 +2001,17 @@  discard block
 block discarded – undo
2001 2001
                 $maxDupCont = 8;
2002 2002
             }
2003 2003
             $increm = 1;
2004
-            $formaPagamento = ['01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito',
2005
-                                    '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação',
2006
-                                    '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível',
2007
-                                    '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'];
2008
-            $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners',
2009
-                              '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
2004
+            $formaPagamento = ['01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito',
2005
+                                    '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação',
2006
+                                    '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível',
2007
+                                    '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros'];
2008
+            $bandeira = ['01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners',
2009
+                              '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros'];
2010 2010
             foreach ($this->detPag as $k => $d) {
2011 2011
                 $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2012 2012
                 ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
2013 2013
                 : '0';
2014
-                $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2014
+                $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2015 2015
                 ? 'R$ ' . number_format(
2016 2016
                     $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
2017 2017
                     2,
@@ -2023,7 +2023,7 @@  discard block
 block discarded – undo
2023 2023
                 $texto = '';
2024 2024
                 if (isset($formaPagamento[$fPag])) {
2025 2025
                     /*Exibir Item sem pagamento ou outros?*/
2026
-                    if ($fPag=='90' || $fPag=='99') {
2026
+                    if ($fPag == '90' || $fPag == '99') {
2027 2027
                         continue;
2028 2028
                     }
2029 2029
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
@@ -2032,16 +2032,16 @@  discard block
 block discarded – undo
2032 2032
                     $this->pdf->textBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, '');
2033 2033
                 } else {
2034 2034
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
2035
-                    $this->pdf->textBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, '');
2035
+                    $this->pdf->textBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, '');
2036 2036
                 }
2037 2037
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2038 2038
                 $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, '');
2039 2039
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
2040 2040
                 $this->pdf->textBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, '');
2041
-                $x += $w+$increm;
2041
+                $x += $w + $increm;
2042 2042
                 $dupcont += 1;
2043 2043
 
2044
-                if ($dupcont>$maxDupCont) {
2044
+                if ($dupcont > $maxDupCont) {
2045 2045
                     $y += 9;
2046 2046
                     $x = $oldx;
2047 2047
                     $dupcont = 0;
@@ -2056,10 +2056,10 @@  discard block
 block discarded – undo
2056 2056
                 $y -= 9;
2057 2057
                 $linha--;
2058 2058
             }
2059
-            return ($y+$h);
2059
+            return ($y + $h);
2060 2060
         } else {
2061 2061
             $linha = 0;
2062
-            return ($y-2);
2062
+            return ($y - 2);
2063 2063
         }
2064 2064
     } //fim da função pagamento
2065 2065
     
@@ -2171,7 +2171,7 @@  discard block
 block discarded – undo
2171 2171
         }
2172 2172
         $x = $this->impostoHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF");
2173 2173
 
2174
-        return ($y+$h);
2174
+        return ($y + $h);
2175 2175
     } //fim imposto
2176 2176
 
2177 2177
     /**
@@ -2199,13 +2199,13 @@  discard block
 block discarded – undo
2199 2199
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
2200 2200
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2201 2201
         //NOME / RAZÃO SOCIAL
2202
-        $w1 = $maxW*0.29;
2202
+        $w1 = $maxW * 0.29;
2203 2203
         $y += 3;
2204 2204
         $texto = 'NOME / RAZÃO SOCIAL';
2205 2205
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2206 2206
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2207 2207
         if (isset($this->transporta)) {
2208
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2208
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2209 2209
             ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2210 2210
             : '';
2211 2211
         } else {
@@ -2215,11 +2215,11 @@  discard block
 block discarded – undo
2215 2215
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2216 2216
         //FRETE POR CONTA
2217 2217
         $x += $w1;
2218
-        $w2 = $maxW*0.15;
2218
+        $w2 = $maxW * 0.15;
2219 2219
         $texto = 'FRETE';
2220 2220
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2221 2221
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2222
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2222
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2223 2223
         ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2224 2224
         : '0';
2225 2225
         switch ($tipoFrete) {
@@ -2250,7 +2250,7 @@  discard block
 block discarded – undo
2250 2250
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2251 2251
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2252 2252
         if (isset($this->veicTransp)) {
2253
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2253
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2254 2254
             ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2255 2255
             : '';
2256 2256
         } else {
@@ -2264,11 +2264,11 @@  discard block
 block discarded – undo
2264 2264
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2265 2265
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2266 2266
         if (isset($this->veicTransp)) {
2267
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2267
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2268 2268
             ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2269 2269
             : '';
2270 2270
         } elseif (isset($this->reboque)) {
2271
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2271
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2272 2272
             ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2273 2273
             : '';
2274 2274
         } else {
@@ -2278,16 +2278,16 @@  discard block
 block discarded – undo
2278 2278
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2279 2279
         //UF
2280 2280
         $x += $w2;
2281
-        $w3 = round($maxW*0.04, 0);
2281
+        $w3 = round($maxW * 0.04, 0);
2282 2282
         $texto = 'UF';
2283 2283
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2284 2284
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2285 2285
         if (isset($this->veicTransp)) {
2286
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2286
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2287 2287
             ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2288 2288
             : '';
2289 2289
         } elseif (isset($this->reboque)) {
2290
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2290
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2291 2291
             ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2292 2292
             : '';
2293 2293
         } else {
@@ -2297,19 +2297,19 @@  discard block
 block discarded – undo
2297 2297
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2298 2298
         //CNPJ / CPF
2299 2299
         $x += $w3;
2300
-        $w = $maxW-($w1+3*$w2+$w3);
2300
+        $w = $maxW - ($w1 + 3 * $w2 + $w3);
2301 2301
         $texto = 'CNPJ / CPF';
2302 2302
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2303 2303
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2304 2304
         if (isset($this->transporta)) {
2305
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2305
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2306 2306
             ? $this->formatField(
2307 2307
                 $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2308 2308
                 "##.###.###/####-##"
2309 2309
             )
2310 2310
             : '';
2311 2311
             if ($texto == '') {
2312
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2312
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2313 2313
                 ? $this->formatField(
2314 2314
                     $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2315 2315
                     "###.###.###-##"
@@ -2326,12 +2326,12 @@  discard block
 block discarded – undo
2326 2326
         $y += $h;
2327 2327
         $x = $oldX;
2328 2328
         $h = 7;
2329
-        $w1 = $maxW*0.44;
2329
+        $w1 = $maxW * 0.44;
2330 2330
         $texto = 'ENDEREÇO';
2331 2331
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2332 2332
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2333 2333
         if (isset($this->transporta)) {
2334
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2334
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2335 2335
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2336 2336
                 : '';
2337 2337
         } else {
@@ -2341,12 +2341,12 @@  discard block
 block discarded – undo
2341 2341
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2342 2342
         //MUNICÍPIO
2343 2343
         $x += $w1;
2344
-        $w2 = round($maxW*0.30, 0);
2344
+        $w2 = round($maxW * 0.30, 0);
2345 2345
         $texto = 'MUNICÍPIO';
2346 2346
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2347 2347
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2348 2348
         if (isset($this->transporta)) {
2349
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2349
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2350 2350
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2351 2351
                 : '';
2352 2352
         } else {
@@ -2356,12 +2356,12 @@  discard block
 block discarded – undo
2356 2356
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2357 2357
         //UF
2358 2358
         $x += $w2;
2359
-        $w3 = round($maxW*0.04, 0);
2359
+        $w3 = round($maxW * 0.04, 0);
2360 2360
         $texto = 'UF';
2361 2361
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2362 2362
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2363 2363
         if (isset($this->transporta)) {
2364
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2364
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2365 2365
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2366 2366
                 : '';
2367 2367
         } else {
@@ -2371,13 +2371,13 @@  discard block
 block discarded – undo
2371 2371
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2372 2372
         //INSCRIÇÃO ESTADUAL
2373 2373
         $x += $w3;
2374
-        $w = $maxW-($w1+$w2+$w3);
2374
+        $w = $maxW - ($w1 + $w2 + $w3);
2375 2375
         $texto = 'INSCRIÇÃO ESTADUAL';
2376 2376
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2377 2377
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2378 2378
         $texto = '';
2379 2379
         if (isset($this->transporta)) {
2380
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2380
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2381 2381
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2382 2382
             }
2383 2383
         }
@@ -2390,16 +2390,16 @@  discard block
 block discarded – undo
2390 2390
         $marca = '';
2391 2391
         $numero = '';
2392 2392
         $texto = '';
2393
-        $pesoBruto=0;
2394
-        $pesoLiquido=0;
2393
+        $pesoBruto = 0;
2394
+        $pesoLiquido = 0;
2395 2395
         foreach ($volumes as $volume) {
2396
-            $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2396
+            $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2397 2397
                     $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2398
-            $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2398
+            $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2399 2399
                     $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2400
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2400
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2401 2401
                     $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2402
-            $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2402
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2403 2403
                     $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2404 2404
             if ($texto != $especie && $especie != '') {
2405 2405
                 //tem várias especies
@@ -2407,7 +2407,7 @@  discard block
 block discarded – undo
2407 2407
             } else {
2408 2408
                 $especie = $texto;
2409 2409
             }
2410
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2410
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2411 2411
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2412 2412
                 : '';
2413 2413
             if ($texto != $marca && $marca != '') {
@@ -2416,7 +2416,7 @@  discard block
 block discarded – undo
2416 2416
             } else {
2417 2417
                 $marca = $texto;
2418 2418
             }
2419
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2419
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2420 2420
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2421 2421
                 : '';
2422 2422
             if ($texto != $numero && $numero != '') {
@@ -2432,7 +2432,7 @@  discard block
 block discarded – undo
2432 2432
         $y += $h;
2433 2433
         $x = $oldX;
2434 2434
         $h = 7;
2435
-        $w1 = round($maxW*0.10, 0);
2435
+        $w1 = round($maxW * 0.10, 0);
2436 2436
         $texto = 'QUANTIDADE';
2437 2437
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2438 2438
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2443,7 +2443,7 @@  discard block
 block discarded – undo
2443 2443
         }
2444 2444
         //ESPÉCIE
2445 2445
         $x += $w1;
2446
-        $w2 = round($maxW*0.17, 0);
2446
+        $w2 = round($maxW * 0.17, 0);
2447 2447
         $texto = 'ESPÉCIE';
2448 2448
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2449 2449
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2455,7 +2455,7 @@  discard block
 block discarded – undo
2455 2455
         $texto = 'MARCA';
2456 2456
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2457 2457
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2458
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2458
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2459 2459
                 $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2460 2460
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
2461 2461
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -2469,7 +2469,7 @@  discard block
 block discarded – undo
2469 2469
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2470 2470
         //PESO BRUTO
2471 2471
         $x += $w2;
2472
-        $w3 = round($maxW*0.20, 0);
2472
+        $w3 = round($maxW * 0.20, 0);
2473 2473
         $texto = 'PESO BRUTO';
2474 2474
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2475 2475
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2482,7 +2482,7 @@  discard block
 block discarded – undo
2482 2482
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2483 2483
         //PESO LÍQUIDO
2484 2484
         $x += $w3;
2485
-        $w = $maxW -($w1+3*$w2+$w3);
2485
+        $w = $maxW - ($w1 + 3 * $w2 + $w3);
2486 2486
         $texto = 'PESO LÍQUIDO';
2487 2487
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2488 2488
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2493,7 +2493,7 @@  discard block
 block discarded – undo
2493 2493
         }
2494 2494
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
2495 2495
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
2496
-        return ($y+$h);
2496
+        return ($y + $h);
2497 2497
     } //fim transporte
2498 2498
 
2499 2499
 
@@ -2505,7 +2505,7 @@  discard block
 block discarded – undo
2505 2505
             return "";
2506 2506
         }
2507 2507
         $valor_original = $valor_original->nodeValue;
2508
-        $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2508
+        $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2509 2509
 
2510 2510
         if ($valor != "") {
2511 2511
             return sprintf($formato, $valor);
@@ -2552,18 +2552,18 @@  discard block
 block discarded – undo
2552 2552
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2553 2553
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2554 2554
         }
2555
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2555
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2556 2556
         ? substr(
2557 2557
             $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2558 2558
             0,
2559 2559
             500
2560 2560
         )
2561 2561
         : '';
2562
-        if (! empty($infAdProd)) {
2562
+        if (!empty($infAdProd)) {
2563 2563
             $infAdProd = trim($infAdProd);
2564 2564
             $infAdProd .= ' ';
2565 2565
         }
2566
-        $loteTxt ='';
2566
+        $loteTxt = '';
2567 2567
         $rastro = $prod->getElementsByTagName("med");
2568 2568
         if (!empty($prod->getElementsByTagName("rastro"))) {
2569 2569
             $rastro = $prod->getElementsByTagName("rastro");
@@ -2577,15 +2577,15 @@  discard block
 block discarded – undo
2577 2577
                 $i++;
2578 2578
             }
2579 2579
             if ($loteTxt != '') {
2580
-                $loteTxt.= ' ';
2580
+                $loteTxt .= ' ';
2581 2581
             }
2582 2582
         }
2583 2583
         //NT2013.006 FCI
2584
-        $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2585
-                ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2586
-        $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2584
+        $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2585
+                ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2586
+        $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2587 2587
         $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
2588
-            . (strlen($tmp_ad)!=0?"\n    ".$tmp_ad:'');
2588
+            . (strlen($tmp_ad) != 0 ? "\n    " . $tmp_ad : '');
2589 2589
         //decodifica os caracteres html no xml
2590 2590
         $texto = html_entity_decode($texto);
2591 2591
         if ($this->descProdQuebraLinha) {
@@ -2635,111 +2635,111 @@  discard block
 block discarded – undo
2635 2635
         // cabecalho LOOP COM OS DADOS DOS PRODUTOS
2636 2636
         //CÓDIGO PRODUTO
2637 2637
         $texto = "CÓDIGO PRODUTO";
2638
-        $w1 = round($w*0.09, 0);
2638
+        $w1 = round($w * 0.09, 0);
2639 2639
         $h = 4;
2640 2640
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2641 2641
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2642
-        $this->pdf->line($x+$w1, $y, $x+$w1, $y+$hmax);
2642
+        $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2643 2643
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2644 2644
         $x += $w1;
2645
-        $w2 = round($w*0.25, 0);
2645
+        $w2 = round($w * 0.25, 0);
2646 2646
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2647 2647
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2648 2648
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2649
-        $this->pdf->line($x+$w2, $y, $x+$w2, $y+$hmax);
2649
+        $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2650 2650
         //NCM/SH
2651 2651
         $x += $w2;
2652
-        $w3 = round($w*0.06, 0);
2652
+        $w3 = round($w * 0.06, 0);
2653 2653
         $texto = 'NCM/SH';
2654 2654
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2655 2655
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2656
-        $this->pdf->line($x+$w3, $y, $x+$w3, $y+$hmax);
2656
+        $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2657 2657
         //O/CST ou O/CSOSN
2658 2658
         $x += $w3;
2659
-        $w4 = round($w*0.05, 0);
2660
-        $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2
2659
+        $w4 = round($w * 0.05, 0);
2660
+        $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2
2661 2661
         if ($this->getTagValue($this->emit, 'CRT') == '3') {
2662
-             $texto = 'O/CST';//Regime Normal
2662
+             $texto = 'O/CST'; //Regime Normal
2663 2663
         }
2664 2664
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2665 2665
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2666
-        $this->pdf->line($x+$w4, $y, $x+$w4, $y+$hmax);
2666
+        $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2667 2667
         //CFOP
2668 2668
         $x += $w4;
2669
-        $w5 = round($w*0.04, 0);
2669
+        $w5 = round($w * 0.04, 0);
2670 2670
         $texto = 'CFOP';
2671 2671
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2672 2672
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2673
-        $this->pdf->line($x+$w5, $y, $x+$w5, $y+$hmax);
2673
+        $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2674 2674
         //UN
2675 2675
         $x += $w5;
2676
-        $w6 = round($w*0.03, 0);
2676
+        $w6 = round($w * 0.03, 0);
2677 2677
         $texto = 'UN';
2678 2678
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2679 2679
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2680
-        $this->pdf->line($x+$w6, $y, $x+$w6, $y+$hmax);
2680
+        $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2681 2681
         //QUANT
2682 2682
         $x += $w6;
2683
-        $w7 = round($w*0.08, 0);
2683
+        $w7 = round($w * 0.08, 0);
2684 2684
         $texto = 'QUANT';
2685 2685
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2686 2686
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2687
-        $this->pdf->line($x+$w7, $y, $x+$w7, $y+$hmax);
2687
+        $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2688 2688
         //VALOR UNIT
2689 2689
         $x += $w7;
2690
-        $w8 = round($w*0.06, 0);
2690
+        $w8 = round($w * 0.06, 0);
2691 2691
         $texto = 'VALOR UNIT';
2692 2692
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2693 2693
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2694
-        $this->pdf->line($x+$w8, $y, $x+$w8, $y+$hmax);
2694
+        $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2695 2695
         //VALOR TOTAL
2696 2696
         $x += $w8;
2697
-        $w9 = round($w*0.06, 0);
2697
+        $w9 = round($w * 0.06, 0);
2698 2698
         $texto = 'VALOR TOTAL';
2699 2699
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2700 2700
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2701
-        $this->pdf->line($x+$w9, $y, $x+$w9, $y+$hmax);
2701
+        $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2702 2702
         //VALOR DESCONTO
2703 2703
         $x += $w9;
2704
-        $w10 = round($w*0.05, 0);
2704
+        $w10 = round($w * 0.05, 0);
2705 2705
         $texto = 'VALOR DESC';
2706 2706
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2707 2707
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2708
-        $this->pdf->line($x+$w10, $y, $x+$w10, $y+$hmax);
2708
+        $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2709 2709
         //B.CÁLC ICMS
2710 2710
         $x += $w10;
2711
-        $w11 = round($w*0.06, 0);
2711
+        $w11 = round($w * 0.06, 0);
2712 2712
         $texto = 'B.CÁLC ICMS';
2713 2713
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2714 2714
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2715
-        $this->pdf->line($x+$w11, $y, $x+$w11, $y+$hmax);
2715
+        $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2716 2716
         //VALOR ICMS
2717 2717
         $x += $w11;
2718
-        $w12 = round($w*0.06, 0);
2718
+        $w12 = round($w * 0.06, 0);
2719 2719
         $texto = 'VALOR ICMS';
2720 2720
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2721 2721
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2722
-        $this->pdf->line($x+$w12, $y, $x+$w12, $y+$hmax);
2722
+        $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2723 2723
         //VALOR IPI
2724 2724
         $x += $w12;
2725
-        $w13 = round($w*0.05, 0);
2725
+        $w13 = round($w * 0.05, 0);
2726 2726
         $texto = 'VALOR IPI';
2727 2727
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2728 2728
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2729
-        $this->pdf->line($x+$w13, $y, $x+$w13, $y+$hmax);
2729
+        $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2730 2730
         //ALÍQ. ICMS
2731 2731
         $x += $w13;
2732
-        $w14 = round($w*0.04, 0);
2732
+        $w14 = round($w * 0.04, 0);
2733 2733
         $texto = 'ALÍQ. ICMS';
2734 2734
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2735 2735
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2736
-        $this->pdf->line($x+$w14, $y, $x+$w14, $y+$hmax);
2736
+        $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2737 2737
         //ALÍQ. IPI
2738 2738
         $x += $w14;
2739
-        $w15 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13+$w14);
2739
+        $w15 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2740 2740
         $texto = 'ALÍQ. IPI';
2741 2741
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2742
-        $this->pdf->line($oldX, $y+$h+1, $oldX + $w, $y+$h+1);
2742
+        $this->pdf->line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1);
2743 2743
         $y += 5;
2744 2744
         //##################################################################################
2745 2745
         // LOOP COM OS DADOS DOS PRODUTOS
@@ -2757,7 +2757,7 @@  discard block
 block discarded – undo
2757 2757
                 $textoProduto = trim($this->descricaoProduto($thisItem));
2758 2758
 
2759 2759
                 $linhaDescr = $this->pdf->getNumLines($textoProduto, $w2, $aFont);
2760
-                $h = round(($linhaDescr * $this->pdf->fontSize)+ ($linhaDescr * 0.5), 2);
2760
+                $h = round(($linhaDescr * $this->pdf->fontSize) + ($linhaDescr * 0.5), 2);
2761 2761
                 $hUsado += $h;
2762 2762
 
2763 2763
                 $diffH = $hmax - $hUsado;
@@ -2770,11 +2770,11 @@  discard block
 block discarded – undo
2770 2770
                         break;
2771 2771
                     }
2772 2772
                 }
2773
-                $y_linha=$y+$h;
2773
+                $y_linha = $y + $h;
2774 2774
                 // linha entre itens
2775 2775
                 $this->pdf->dashedHLine($oldX, $y_linha, $w, 0.1, 120);
2776 2776
                 //corrige o x
2777
-                $x=$oldX;
2777
+                $x = $oldX;
2778 2778
                 //codigo do produto
2779 2779
                 $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue;
2780 2780
                 $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'C', 0, '');
@@ -2787,16 +2787,16 @@  discard block
 block discarded – undo
2787 2787
                 }
2788 2788
                 $x += $w2;
2789 2789
                 //NCM
2790
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2790
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2791 2791
                         $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2792 2792
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2793 2793
                 $x += $w3;
2794 2794
                 //CST
2795 2795
                 if (isset($ICMS)) {
2796
-                    $origem =  $this->getTagValue($ICMS, "orig");
2797
-                    $cst =  $this->getTagValue($ICMS, "CST");
2798
-                    $csosn =  $this->getTagValue($ICMS, "CSOSN");
2799
-                    $texto = $origem.$cst.$csosn;
2796
+                    $origem = $this->getTagValue($ICMS, "orig");
2797
+                    $cst = $this->getTagValue($ICMS, "CST");
2798
+                    $csosn = $this->getTagValue($ICMS, "CSOSN");
2799
+                    $texto = $origem . $cst . $csosn;
2800 2800
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2801 2801
                 }
2802 2802
                 //CFOP
@@ -2837,7 +2837,7 @@  discard block
 block discarded – undo
2837 2837
                 //Valor da Base de calculo
2838 2838
                 $x += $w10;
2839 2839
                 if (isset($ICMS)) {
2840
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2840
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2841 2841
                     ? number_format(
2842 2842
                         $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
2843 2843
                         2,
@@ -2850,7 +2850,7 @@  discard block
 block discarded – undo
2850 2850
                 //Valor do ICMS
2851 2851
                 $x += $w11;
2852 2852
                 if (isset($ICMS)) {
2853
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2853
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2854 2854
                     ? number_format(
2855 2855
                         $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
2856 2856
                         2,
@@ -2863,7 +2863,7 @@  discard block
 block discarded – undo
2863 2863
                 //Valor do IPI
2864 2864
                 $x += $w12;
2865 2865
                 if (isset($IPI)) {
2866
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2866
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2867 2867
                     ? number_format(
2868 2868
                         $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
2869 2869
                         2,
@@ -2878,7 +2878,7 @@  discard block
 block discarded – undo
2878 2878
                 // %ICMS
2879 2879
                 $x += $w13;
2880 2880
                 if (isset($ICMS)) {
2881
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2881
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2882 2882
                     ? number_format(
2883 2883
                         $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
2884 2884
                         2,
@@ -2891,7 +2891,7 @@  discard block
 block discarded – undo
2891 2891
                 //%IPI
2892 2892
                 $x += $w14;
2893 2893
                 if (isset($IPI)) {
2894
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
2894
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
2895 2895
                     ? number_format(
2896 2896
                         $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
2897 2897
                         2,
@@ -2922,7 +2922,7 @@  discard block
 block discarded – undo
2922 2922
                 $i++;
2923 2923
             }
2924 2924
         }
2925
-        return $oldY+$hmax;
2925
+        return $oldY + $hmax;
2926 2926
     }
2927 2927
 
2928 2928
 
@@ -2956,7 +2956,7 @@  discard block
 block discarded – undo
2956 2956
 
2957 2957
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
2958 2958
 
2959
-        $w1 = round($w*0.09, 0);
2959
+        $w1 = round($w * 0.09, 0);
2960 2960
 
2961 2961
         // Tabela Renavam Combustivel
2962 2962
         $renavamCombustivel = [
@@ -3051,54 +3051,54 @@  discard block
 block discarded – undo
3051 3051
 
3052 3052
         $yVeic = $y + $h;
3053 3053
         $texto = 'Chassi: ............: ' . $veiculoChassi;
3054
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3054
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3055 3055
         $yVeic += $h;
3056 3056
         $texto = 'Cor...................: ' . $veiculoCor;
3057
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3057
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3058 3058
         $yVeic += $h;
3059 3059
         $texto = 'Cilindrada........: ' . $veiculoCilindrada;
3060
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3060
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3061 3061
         $yVeic += $h;
3062 3062
         $texto = 'Cmkg...............: ' . $veiculoCmkg;
3063
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3063
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3064 3064
         $yVeic += $h;
3065 3065
         $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo);
3066
-         $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3066
+         $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3067 3067
         $yVeic = $y + $h;
3068 3068
         $xVeic = $x + 65;
3069 3069
         $texto = 'Nº Motor: .........: ' . $veiculoMotor;
3070
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3070
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3071 3071
         $yVeic += $h;
3072 3072
         $texto = 'Renavam...........: ' . $veiculoRenavam;
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 = 'HP.....................: ' . $veiculoHp;
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 = 'Placa.................: ' . $veiculoPlaca;
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 = 'Tipo Pintura......: ' . ($renavamEspecie[intval($veiculoTipoPintura)] ?? $veiculoTipoPintura);
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 = $y + $h;
3084 3084
         $xVeic = $xVeic + 55;
3085 3085
         $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo;
3086
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3086
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3087 3087
         $yVeic += $h;
3088 3088
         $texto = 'Especie..................: ' . ($renavamEspecie[intval($veiculoEspecie)] ?? $veiculoEspecie);
3089
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3089
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3090 3090
         $yVeic += $h;
3091 3091
         $texto = 'Combustivel..........: ' . ($renavamCombustivel[intval($veiculoCombustivel)] ?? $veiculoCombustivel);
3092
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3092
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3093 3093
         $yVeic += $h;
3094 3094
         $texto = 'Serial.....................: ' . $veiculoSerial;
3095
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3095
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3096 3096
         $yVeic += $h;
3097
-        $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo;
3098
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3097
+        $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo;
3098
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3099 3099
         $yVeic += $h;
3100
-        $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia;
3101
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3100
+        $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia;
3101
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3102 3102
     }
3103 3103
 
3104 3104
     /**
@@ -3122,12 +3122,12 @@  discard block
 block discarded – undo
3122 3122
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3123 3123
         //INSCRIÇÃO MUNICIPAL
3124 3124
         $y += 3;
3125
-        $w = round($this->wPrint*0.23, 0);
3125
+        $w = round($this->wPrint * 0.23, 0);
3126 3126
         $texto = 'INSCRIÇÃO MUNICIPAL';
3127 3127
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3128 3128
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3129 3129
         //inscrição municipal
3130
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3130
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3131 3131
                 $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3132 3132
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
3133 3133
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -3137,7 +3137,7 @@  discard block
 block discarded – undo
3137 3137
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3138 3138
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3139 3139
         if (isset($this->ISSQNtot)) {
3140
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3140
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3141 3141
                     $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3142 3142
             $texto = number_format($texto, 2, ",", ".");
3143 3143
         } else {
@@ -3151,9 +3151,9 @@  discard block
 block discarded – undo
3151 3151
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3152 3152
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3153 3153
         if (isset($this->ISSQNtot)) {
3154
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3154
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3155 3155
                     $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3156
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3156
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3157 3157
         } else {
3158 3158
             $texto = '';
3159 3159
         }
@@ -3164,21 +3164,21 @@  discard block
 block discarded – undo
3164 3164
         if ($this->orientacao == 'P') {
3165 3165
             $w = $this->wPrint - (3 * $w);
3166 3166
         } else {
3167
-            $w = $this->wPrint - (3 * $w)-$this->wCanhoto;
3167
+            $w = $this->wPrint - (3 * $w) - $this->wCanhoto;
3168 3168
         }
3169 3169
         $texto = 'VALOR TOTAL DO ISSQN';
3170 3170
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3171 3171
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3172 3172
         if (isset($this->ISSQNtot)) {
3173
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3173
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3174 3174
                     $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3175
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3175
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3176 3176
         } else {
3177 3177
             $texto = '';
3178 3178
         }
3179 3179
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
3180 3180
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3181
-        return ($y+$h+1);
3181
+        return ($y + $h + 1);
3182 3182
     }
3183 3183
 
3184 3184
     /**
@@ -3199,7 +3199,7 @@  discard block
 block discarded – undo
3199 3199
         if ($this->orientacao == 'P') {
3200 3200
               $w = $this->wPrint;
3201 3201
         } else {
3202
-              $w = $this->wPrint-$this->wCanhoto;
3202
+              $w = $this->wPrint - $this->wCanhoto;
3203 3203
         }
3204 3204
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
3205 3205
         $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, '');
@@ -3214,8 +3214,8 @@  discard block
 block discarded – undo
3214 3214
         //$this->wAdic com a largura do campo
3215 3215
         //$this->textoAdic com o texto completo do campo
3216 3216
         $y += 1;
3217
-        $aFont = ['font'=>$this->fontePadrao, 'size'=>$this->textadicfontsize*$this->pdf->k, 'style'=>''];
3218
-        $this->pdf->textBox($x, $y+2, $w-2, $h-3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
3217
+        $aFont = ['font'=>$this->fontePadrao, 'size'=>$this->textadicfontsize * $this->pdf->k, 'style'=>''];
3218
+        $this->pdf->textBox($x, $y + 2, $w - 2, $h - 3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
3219 3219
         //RESERVADO AO FISCO
3220 3220
         $texto = "RESERVADO AO FISCO";
3221 3221
         if (isset($this->nfeProc) && $this->nfeProc->getElementsByTagName("xMsg")->length) {
@@ -3224,9 +3224,9 @@  discard block
 block discarded – undo
3224 3224
         $x += $w;
3225 3225
         $y -= 1;
3226 3226
         if ($this->orientacao == 'P') {
3227
-            $w = $this->wPrint-$w;
3227
+            $w = $this->wPrint - $w;
3228 3228
         } else {
3229
-            $w = $this->wPrint-$w-$this->wCanhoto;
3229
+            $w = $this->wPrint - $w - $this->wCanhoto;
3230 3230
         }
3231 3231
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B'];
3232 3232
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -3265,8 +3265,8 @@  discard block
 block discarded – undo
3265 3265
         }
3266 3266
         $y += 2;
3267 3267
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
3268
-        $this->pdf->textBox($x, $y, $w-2, $h-3, $texto, $aFont, 'T', 'L', 0, '', false);
3269
-        return $y+$h;
3268
+        $this->pdf->textBox($x, $y, $w - 2, $h - 3, $texto, $aFont, 'T', 'L', 0, '', false);
3269
+        return $y + $h;
3270 3270
     }
3271 3271
 
3272 3272
     /**
@@ -3285,11 +3285,11 @@  discard block
 block discarded – undo
3285 3285
         if ($this->orientacao == 'P') {
3286 3286
               $w = $this->wPrint;
3287 3287
         } else {
3288
-              $w = $this->wPrint-$this->wCanhoto;
3288
+              $w = $this->wPrint - $this->wCanhoto;
3289 3289
               $x = $this->wCanhoto;
3290 3290
         }
3291 3291
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
3292
-        $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s')
3292
+        $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s')
3293 3293
             . '  ' . $this->creditos;
3294 3294
         $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false);
3295 3295
         $texto = "Powered by NFePHP®";
@@ -3345,9 +3345,9 @@  discard block
 block discarded – undo
3345 3345
         } else {
3346 3346
             //linha separadora do canhoto - 238
3347 3347
             //posicao altura
3348
-            $y = $this->wPrint-85;
3348
+            $y = $this->wPrint - 85;
3349 3349
             //altura
3350
-            $w = $this->wPrint-85-24;
3350
+            $w = $this->wPrint - 85 - 24;
3351 3351
         }
3352 3352
         $h = 10;
3353 3353
         //desenha caixa
@@ -3370,21 +3370,21 @@  discard block
 block discarded – undo
3370 3370
             $texto .= "AO LADO";
3371 3371
         }
3372 3372
         $texto .= ". EMISSÃO: ";
3373
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3373
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3374 3374
                 $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3375 3375
         if ($dEmi == '') {
3376
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3376
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3377 3377
                     $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3378 3378
             $aDemi = explode('T', $dEmi);
3379 3379
             $dEmi = $aDemi[0];
3380 3380
         }
3381
-        $texto .= $this->ymdTodmy($dEmi) ." ";
3381
+        $texto .= $this->ymdTodmy($dEmi) . " ";
3382 3382
         $texto .= "VALOR TOTAL: R$ ";
3383 3383
         $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " ";
3384 3384
         $texto .= "DESTINATÁRIO: ";
3385 3385
         $texto .= $destinatario;
3386 3386
         if ($this->orientacao == 'P') {
3387
-            $this->pdf->textBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false);
3387
+            $this->pdf->textBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false);
3388 3388
             $x1 = $x + $w;
3389 3389
             $w1 = $this->wPrint - $w;
3390 3390
             $texto = "NF-e";
@@ -3397,12 +3397,12 @@  discard block
 block discarded – undo
3397 3397
             //DATA DE RECEBIMENTO
3398 3398
             $texto = "DATA DE RECEBIMENTO";
3399 3399
             $y += $h;
3400
-            $w2 = round($this->wPrint*0.17, 0); //35;
3400
+            $w2 = round($this->wPrint * 0.17, 0); //35;
3401 3401
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3402 3402
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3403 3403
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3404 3404
             $x += $w2;
3405
-            $w3 = $w-$w2;
3405
+            $w3 = $w - $w2;
3406 3406
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3407 3407
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
3408 3408
             $x = $oldX;
@@ -3412,7 +3412,7 @@  discard block
 block discarded – undo
3412 3412
             return $y;
3413 3413
         } else {
3414 3414
             $x--;
3415
-            $x = $this->pdf->textBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3415
+            $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3416 3416
             //NUMERO DA NOTA FISCAL LOGO NFE
3417 3417
             $w1 = 18;
3418 3418
             $x1 = $oldX;
@@ -3426,14 +3426,14 @@  discard block
 block discarded – undo
3426 3426
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3427 3427
             //DATA DO RECEBIMENTO
3428 3428
             $texto = "DATA DO RECEBIMENTO";
3429
-            $y = $this->wPrint-85;
3429
+            $y = $this->wPrint - 85;
3430 3430
             $x = 12;
3431
-            $w2 = round($this->wPrint*0.17, 0); //35;
3431
+            $w2 = round($this->wPrint * 0.17, 0); //35;
3432 3432
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3433 3433
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3434 3434
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3435 3435
             $y -= $w2;
3436
-            $w3 = $w-$w2;
3436
+            $w3 = $w - $w2;
3437 3437
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3438 3438
             $aFont = ['font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>''];
3439 3439
             $x = $this->pdf->textBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3454,13 +3454,13 @@  discard block
 block discarded – undo
3454 3454
     {
3455 3455
         $saida = "";
3456 3456
         if (isset($this->compra)) {
3457
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3457
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3458 3458
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3459 3459
             }
3460
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3460
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3461 3461
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3462 3462
             }
3463
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3463
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3464 3464
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3465 3465
             }
3466 3466
         }
@@ -3486,21 +3486,21 @@  discard block
 block discarded – undo
3486 3486
         if ($vICMS > 0) {
3487 3487
             $vICMS = 1;
3488 3488
         }
3489
-        $icmss  = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue;
3489
+        $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue;
3490 3490
         if ($icmss > 0) {
3491 3491
             $icmss = 1;
3492 3492
         }
3493
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3493
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3494 3494
                 $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3495 3495
         if ($dEmi == '') {
3496
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3496
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3497 3497
                     $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3498 3498
             $aDemi = explode('T', $dEmi);
3499 3499
             $dEmi = $aDemi[0];
3500 3500
         }
3501 3501
         $dd  = $dEmi;
3502 3502
         $rpos = strrpos($dd, '-');
3503
-        $dd  = substr($dd, $rpos +1);
3503
+        $dd  = substr($dd, $rpos + 1);
3504 3504
         $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd);
3505 3505
         $chave = $chave . $this->modulo11($chave);
3506 3506
         return $chave;
@@ -3521,7 +3521,7 @@  discard block
 block discarded – undo
3521 3521
         $formaNfRef = "\r\nNF  Ref.: série:%d numero:%d emit:%s em %s modelo: %d";
3522 3522
         $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d";
3523 3523
         $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s";
3524
-        $saida='';
3524
+        $saida = '';
3525 3525
         $nfRefs = $this->ide->getElementsByTagName('NFref');
3526 3526
         if (0 === $nfRefs->length) {
3527 3527
             return $saida;
@@ -3537,7 +3537,7 @@  discard block
 block discarded – undo
3537 3537
             foreach ($refNFe as $chave_acessoRef) {
3538 3538
                 $chave_acesso = $chave_acessoRef->nodeValue;
3539 3539
                 $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave);
3540
-                $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2);
3540
+                $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2);
3541 3541
                 $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3542 3542
                 $serie  = substr($chave_acesso, 22, 3);
3543 3543
                 $numero = substr($chave_acesso, 25, 9);
@@ -3558,7 +3558,7 @@  discard block
 block discarded – undo
3558 3558
             foreach ($refCTe as $chave_acessoRef) {
3559 3559
                 $chave_acesso = $chave_acessoRef->nodeValue;
3560 3560
                 $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave);
3561
-                $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2);
3561
+                $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2);
3562 3562
                 $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3563 3563
                 $serie  = substr($chave_acesso, 22, 3);
3564 3564
                 $numero = substr($chave_acesso, 25, 9);
@@ -3574,10 +3574,9 @@  discard block
 block discarded – undo
3574 3574
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3575 3575
             foreach ($refNFP as $umaRefNFe) {
3576 3576
                 $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3577
-                $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3578
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3579
-                    '';
3580
-                $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3577
+                $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3578
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3579
+                $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3581 3580
                         $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3582 3581
                 $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3583 3582
                 $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
Please login to merge, or discard this patch.