Passed
Push — master ( 46e7ad...37ff31 )
by Roberto
53s
created
src/NFe/Danfce.php 1 patch
Spacing   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 {
25 25
     protected $papel;
26 26
     protected $xml; // string XML NFe
27
-    protected $logomarca=''; // path para logomarca em jpg
28
-    protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####";
29
-    protected $debugMode=0; //ativa ou desativa o modo de debug
27
+    protected $logomarca = ''; // path para logomarca em jpg
28
+    protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
29
+    protected $debugMode = 0; //ativa ou desativa o modo de debug
30 30
     protected $tpImp; //ambiente
31
-    protected $fontePadrao='Times';
31
+    protected $fontePadrao = 'Times';
32 32
     protected $nfeProc;
33 33
     protected $nfe;
34 34
     protected $infNFe;
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         $this->textoAdic = '';
254 254
         if (isset($this->infAdic)) {
255 255
             $this->textoAdic .= !empty($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue) ?
256
-            'Inf. Contribuinte: '.
256
+            'Inf. Contribuinte: ' .
257 257
             trim($this->pAnfavea($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue)) : '';
258 258
             if (!empty($this->textoAdic)) {
259 259
                 $this->textoAdic = str_replace(";", "\n", $this->textoAdic);
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
             $orientacao = 'P';
279 279
         }
280 280
         $this->orientacao = $orientacao;
281
-        $this->papel = array(80,$tamPapelVert);
281
+        $this->papel = array(80, $tamPapelVert);
282 282
         $this->logoAlign = $logoAlign;
283 283
         //$this->situacao_externa = $situacaoExterna;
284 284
         $this->numero_registro_dpec = $depecNumReg;
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
         //total inicial de paginas
303 303
         $totPag = 1;
304 304
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
305
-        $this->wPrint = $maxW-($margEsq*2);
305
+        $this->wPrint = $maxW - ($margEsq * 2);
306 306
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
307 307
         //superior e inferior
308
-        $this->hPrint = $maxH-$margSup-$margInf;
308
+        $this->hPrint = $maxH - $margSup - $margInf;
309 309
         // estabelece contagem de paginas
310 310
         $this->pdf->aliasNbPages();
311 311
         $this->pdf->setMargins($margEsq, $margSup); // fixa as margens
@@ -316,22 +316,22 @@  discard block
 block discarded – undo
316 316
         $this->pdf->setLineWidth(0.1); // define a largura da linha
317 317
         $this->pdf->setTextColor(0, 0, 0);
318 318
         $this->pTextBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA?
319
-        $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca)  (FIXO)
320
-        $hcabecalhoSecundario = 10;//para cabeçalho secundário (cabeçalho sefaz) (FIXO)
321
-        $hprodutos = $hLinha + ($qtdItens*$hMaxLinha) ;//box poduto
319
+        $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca)  (FIXO)
320
+        $hcabecalhoSecundario = 10; //para cabeçalho secundário (cabeçalho sefaz) (FIXO)
321
+        $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto
322 322
         $hTotal = 12; //box total (FIXO)
323
-        $hpagamentos = $hLinha + ($qtdPgto*$hLinha);//para pagamentos
324
-        $hmsgfiscal = 21;// para imposto (FIXO)
323
+        $hpagamentos = $hLinha + ($qtdPgto * $hLinha); //para pagamentos
324
+        $hmsgfiscal = 21; // para imposto (FIXO)
325 325
         if (!isset($this->dest)) {
326
-            $hcliente = 6;// para cliente (FIXO)
326
+            $hcliente = 6; // para cliente (FIXO)
327 327
         } else {
328 328
             $hcliente = 12;
329 329
         }// para cliente (FIXO)};
330
-        $hQRCode = 50;// para qrcode (FIXO)
331
-        $hCabecItens = 4;//cabeçalho dos itens
330
+        $hQRCode = 50; // para qrcode (FIXO)
331
+        $hCabecItens = 4; //cabeçalho dos itens
332 332
         
333 333
         $hUsado = $hCabecItens;
334
-        $w2 = round($this->wPrint*0.31, 0);
334
+        $w2 = round($this->wPrint * 0.31, 0);
335 335
         $totPag = 1;
336 336
         $pag = 1;
337 337
         $x = $xInic;
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal;
352 352
         $y = $this->pPagamentosDANFE($x, $y, $hpagamentos);
353 353
         //COLOCA MENSAGEM FISCAL
354
-        $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos;
354
+        $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos;
355 355
         $y = $this->pFiscalDANFE($x, $y, $hmsgfiscal);
356 356
         //COLOCA CONSUMIDOR
357 357
         $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal;
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         }
371 371
         
372 372
         //retorna o ID na NFe
373
-        if ($classPdf!==false) {
373
+        if ($classPdf !== false) {
374 374
             $aR = [
375 375
              'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")),
376 376
              'classe_PDF'=>$this->pdf
@@ -390,14 +390,14 @@  discard block
 block discarded – undo
390 390
         $emitIM     = $this->pSimpleGetValue($this->emit, "IM");
391 391
         $emitFone = $this->pSimpleGetValue($this->enderEmit, "fone");
392 392
         $foneLen = strlen($emitFone);
393
-        if ($foneLen>0) {
393
+        if ($foneLen > 0) {
394 394
             $ddd = substr($emitFone, 0, 2);
395 395
             $fone1 = substr($emitFone, -8);
396 396
             $digito9 = ' ';
397 397
             if ($foneLen == 11) {
398 398
                 $digito9 = substr($emitFone, 2, 1);
399 399
             }
400
-            $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4);
400
+            $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4);
401 401
         } else {
402 402
             $emitFone = '';
403 403
         }
@@ -411,18 +411,18 @@  discard block
 block discarded – undo
411 411
         // CONFIGURAÇÃO DE POSIÇÃO
412 412
         $margemInterna = $this->margemInterna;
413 413
         $maxW = $this->wPrint;
414
-        $h = $h-($margemInterna);
414
+        $h = $h - ($margemInterna);
415 415
         //COLOCA LOGOMARCA
416 416
         if (is_file($this->logomarca)) {
417 417
             $xImg = $margemInterna;
418 418
             $yImg = $margemInterna + 1;
419 419
             $this->pdf->Image($this->logomarca, $xImg, $yImg, 30, 22.5);
420
-            $xRs = ($maxW*0.4) + $margemInterna;
421
-            $wRs = ($maxW*0.6);
420
+            $xRs = ($maxW * 0.4) + $margemInterna;
421
+            $wRs = ($maxW * 0.6);
422 422
             $alignEmit = 'L';
423 423
         } else {
424 424
             $xRs = $margemInterna;
425
-            $wRs = ($maxW*1);
425
+            $wRs = ($maxW * 1);
426 426
             $alignEmit = 'L';
427 427
         }
428 428
         //COLOCA RAZÃO SOCIAL
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     {
443 443
         $margemInterna = $this->margemInterna;
444 444
         $maxW = $this->wPrint;
445
-        $w = ($maxW*1);
445
+        $w = ($maxW * 1);
446 446
         $hBox1 = 7;
447 447
         $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica";
448 448
         $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
@@ -459,13 +459,13 @@  discard block
 block discarded – undo
459 459
         $margemInterna = $this->margemInterna;
460 460
         $maxW = $this->wPrint;
461 461
         $qtdItens = $this->det->length;
462
-        $w = ($maxW*1);
462
+        $w = ($maxW * 1);
463 463
         $hLinha = $this->hLinha;
464 464
         $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
465
-        $wBoxCod = $w*0.17;
465
+        $wBoxCod = $w * 0.17;
466 466
         $texto = "CÓDIGO";
467 467
         $this->pTextBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
468
-        $wBoxDescricao = $w*0.43;
468
+        $wBoxDescricao = $w * 0.43;
469 469
         $xBoxDescricao = $wBoxCod + $x;
470 470
         $texto = "DESCRICÃO";
471 471
         $this->pTextBox(
@@ -481,19 +481,19 @@  discard block
 block discarded – undo
481 481
             '',
482 482
             false
483 483
         );
484
-        $wBoxQt = $w*0.08;
484
+        $wBoxQt = $w * 0.08;
485 485
         $xBoxQt = $wBoxDescricao + $xBoxDescricao;
486 486
         $texto = "QT";
487 487
         $this->pTextBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
488
-        $wBoxUn = $w*0.06;
488
+        $wBoxUn = $w * 0.06;
489 489
         $xBoxUn = $wBoxQt + $xBoxQt;
490 490
         $texto = "UN";
491 491
         $this->pTextBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
492
-        $wBoxVl = $w*0.13;
492
+        $wBoxVl = $w * 0.13;
493 493
         $xBoxVl = $wBoxUn + $xBoxUn;
494 494
         $texto = "VALOR";
495 495
         $this->pTextBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
496
-        $wBoxTotal = $w*0.13;
496
+        $wBoxTotal = $w * 0.13;
497 497
         $xBoxTotal = $wBoxVl + $xBoxVl;
498 498
         $texto = "TOTAL";
499 499
         $this->pTextBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
@@ -513,13 +513,13 @@  discard block
 block discarded – undo
513 513
                 $vUnCom     = number_format($this->pSimpleGetValue($prod, "vUnCom"), 2, ",", ".");
514 514
                 $vProd      = number_format($this->pSimpleGetValue($prod, "vProd"), 2, ",", ".");
515 515
                 //COLOCA PRODUTO
516
-                $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha);
516
+                $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha);
517 517
                 //COLOCA PRODUTO CÓDIGO
518
-                $wBoxCod = $w*0.17;
518
+                $wBoxCod = $w * 0.17;
519 519
                 $texto = $cProd;
520 520
                 $this->pTextBox($x, $yBoxProd, $wBoxCod, $hMaxLinha, $texto, $aFontProdutos, 'C', 'C', 0, '', false);
521 521
                 //COLOCA PRODUTO DESCRIÇÃO
522
-                $wBoxDescricao = $w*0.43;
522
+                $wBoxDescricao = $w * 0.43;
523 523
                 $xBoxDescricao = $wBoxCod + $x;
524 524
                 $texto = $xProd;
525 525
                 $this->pTextBox(
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
                     false
537 537
                 );
538 538
                 //COLOCA PRODUTO QUANTIDADE
539
-                $wBoxQt = $w*0.08;
539
+                $wBoxQt = $w * 0.08;
540 540
                 $xBoxQt = $wBoxDescricao + $xBoxDescricao;
541 541
                 $texto = $qCom;
542 542
                 $this->pTextBox(
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
                     false
554 554
                 );
555 555
                 //COLOCA PRODUTO UNIDADE
556
-                $wBoxUn = $w*0.06;
556
+                $wBoxUn = $w * 0.06;
557 557
                 $xBoxUn = $wBoxQt + $xBoxQt;
558 558
                 $texto = $uCom;
559 559
                 $this->pTextBox(
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
                     false
571 571
                 );
572 572
                 //COLOCA PRODUTO VL UNITÁRIO
573
-                $wBoxVl = $w*0.13;
573
+                $wBoxVl = $w * 0.13;
574 574
                 $xBoxVl = $wBoxUn + $xBoxUn;
575 575
                 $texto = $vUnCom;
576 576
                 $this->pTextBox(
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
                     false
588 588
                 );
589 589
                 //COLOCA PRODUTO VL TOTAL
590
-                $wBoxTotal = $w*0.13;
590
+                $wBoxTotal = $w * 0.13;
591 591
                 $xBoxTotal = $wBoxVl + $xBoxVl;
592 592
                 $texto = $vProd;
593 593
                 $this->pTextBox(
@@ -614,8 +614,8 @@  discard block
 block discarded – undo
614 614
         $margemInterna = $this->margemInterna;
615 615
         $maxW = $this->wPrint;
616 616
         $hLinha = 3;
617
-        $wColEsq = ($maxW*0.7);
618
-        $wColDir = ($maxW*0.3);
617
+        $wColEsq = ($maxW * 0.7);
618
+        $wColDir = ($maxW * 0.3);
619 619
         $xValor = $x + $wColEsq;
620 620
         $qtdItens = $this->det->length;
621 621
         $vProd = $this->pSimpleGetValue($this->ICMSTot, "vProd");
@@ -636,28 +636,28 @@  discard block
 block discarded – undo
636 636
         $texto = "R$ " . number_format($vProd, 2, ",", ".");
637 637
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
638 638
         $this->pTextBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
639
-        $yDesconto = $y + ($hLinha*2);
639
+        $yDesconto = $y + ($hLinha * 2);
640 640
         $texto = "Descontos";
641 641
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
642 642
         $this->pTextBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
643 643
         $texto = "R$ " . $vDesc;
644 644
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
645 645
         $this->pTextBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
646
-        $yFrete= $y + ($hLinha*3);
646
+        $yFrete = $y + ($hLinha * 3);
647 647
         $texto = "Frete";
648 648
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
649 649
         $this->pTextBox($x, $yFrete, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
650 650
         $texto = "R$ " . $vFrete;
651 651
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
652 652
         $this->pTextBox($xValor, $yFrete, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
653
-        $yTotalFinal = $y + ($hLinha*4);
653
+        $yTotalFinal = $y + ($hLinha * 4);
654 654
         $texto = "Total";
655 655
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
656 656
         $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
657 657
         $texto = "R$ " . $vNF;
658 658
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
659 659
         $this->pTextBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
660
-        $yTotalFinal = $y + ($hLinha*5);
660
+        $yTotalFinal = $y + ($hLinha * 5);
661 661
         $texto = "Informação dos Tributos Totais Incidentes";
662 662
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'');
663 663
         $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
@@ -672,16 +672,16 @@  discard block
 block discarded – undo
672 672
         $margemInterna = $this->margemInterna;
673 673
         $maxW = $this->wPrint;
674 674
         $qtdPgto = $this->pag->length;
675
-        $w = ($maxW*1);
675
+        $w = ($maxW * 1);
676 676
         $hLinha = $this->hLinha;
677
-        $wColEsq = ($maxW*0.7);
678
-        $wColDir = ($maxW*0.3);
677
+        $wColEsq = ($maxW * 0.7);
678
+        $wColDir = ($maxW * 0.3);
679 679
         $xValor = $x + $wColEsq;
680 680
         $aFontPgto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
681
-        $wBoxEsq = $w*0.7;
681
+        $wBoxEsq = $w * 0.7;
682 682
         $texto = "FORMA DE PAGAMENTO";
683 683
         $this->pTextBox($x, $y, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
684
-        $wBoxDir = $w*0.3;
684
+        $wBoxDir = $w * 0.3;
685 685
         $xBoxDescricao = $x + $wBoxEsq;
686 686
         $texto = "VALOR PAGO";
687 687
         $this->pTextBox($xBoxDescricao, $y, $wBoxDir, $hLinha, $texto, $aFontPgto, 'T', 'R', 0, '', false);
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
                     $tBandNome = self::getCardName($tBand);
704 704
                 }
705 705
                 //COLOCA PRODUTO
706
-                $yBoxProd = $y + $hLinha + ($cont*$hLinha);
706
+                $yBoxProd = $y + $hLinha + ($cont * $hLinha);
707 707
                 //COLOCA PRODUTO CÓDIGO
708 708
                 $texto = $tPagNome;
709 709
                 $this->pTextBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
         $y += 6;
734 734
         $margemInterna = $this->margemInterna;
735 735
         $maxW = $this->wPrint;
736
-        $w = ($maxW*1);
736
+        $w = ($maxW * 1);
737 737
         $hLinha = $this->hLinha;
738 738
         $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
739 739
         $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'');
@@ -764,18 +764,18 @@  discard block
 block discarded – undo
764 764
         $urlChave = $this->urlConsulta[$tpAmb][$this->UFSigla[$cUF]];
765 765
         $texto = "ÁREA DE MENSAGEM FISCAL";
766 766
         $this->pTextBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
767
-        $yTex1 = $y + ($hLinha*1);
768
-        $hTex1 = $hLinha*2;
769
-        $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmi . " - Via Consumidor";
767
+        $yTex1 = $y + ($hLinha * 1);
768
+        $hTex1 = $hLinha * 2;
769
+        $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmi . " - Via Consumidor";
770 770
         $this->pTextBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false);
771
-        $yTex2 = $y + ($hLinha*3);
772
-        $hTex2 = $hLinha*2;
771
+        $yTex2 = $y + ($hLinha * 3);
772
+        $hTex2 = $hLinha * 2;
773 773
         $texto = "Consulte pela Chave de Acesso em " . $urlChave;
774 774
         $this->pTextBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false);
775 775
         $texto = "CHAVE DE ACESSO";
776
-        $yTit2 = $y + ($hLinha*5);
776
+        $yTit2 = $y + ($hLinha * 5);
777 777
         $this->pTextBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
778
-        $yTex3 = $y + ($hLinha*6);
778
+        $yTex3 = $y + ($hLinha * 6);
779 779
         $texto = $chNFe;
780 780
         $this->pTextBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false);
781 781
     }
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
         $y += 6;
786 786
         $margemInterna = $this->margemInterna;
787 787
         $maxW = $this->wPrint;
788
-        $w = ($maxW*1);
788
+        $w = ($maxW * 1);
789 789
         $hLinha = $this->hLinha;
790 790
         $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
791 791
         $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'');
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
             $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)
802 802
                     ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue
803 803
                     : '';
804
-            $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor
804
+            $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor
805 805
             $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0);
806 806
             $consNome = $this->pSimpleGetValue($this->dest, "xNome");
807 807
             $consLgr = $this->pSimpleGetValue($enderDest, "xLgr");
@@ -841,8 +841,8 @@  discard block
 block discarded – undo
841 841
             $yTex1 = $y + $hLinha;
842 842
             $texto = $consNome;
843 843
             if (!empty($consDoc)) {
844
-                $texto .= " - ". $consDoc . "\n" . $consEnd;
845
-                $this->pTextBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false);
844
+                $texto .= " - " . $consDoc . "\n" . $consEnd;
845
+                $this->pTextBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false);
846 846
             }
847 847
         } else {
848 848
             $yTex1 = $y + $hLinha;
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
         $y += 6;
857 857
         $margemInterna = $this->margemInterna;
858 858
         $maxW = $this->wPrint;
859
-        $w = ($maxW*1);
859
+        $w = ($maxW * 1);
860 860
         $hLinha = $this->hLinha;
861 861
         $hBoxLinha = $this->hBoxLinha;
862 862
         $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
         $nProt = '';
866 866
         if (isset($this->nfeProc)) {
867 867
             $nProt = $this->pSimpleGetValue($this->nfeProc, "nProt");
868
-            $dhRecbto  = $this->pSimpleGetValue($this->nfeProc, "dhRecbto");
868
+            $dhRecbto = $this->pSimpleGetValue($this->nfeProc, "dhRecbto");
869 869
         }
870 870
         $barcode = new Barcode();
871 871
         $bobj = $barcode->getBarcodeObj(
@@ -879,14 +879,14 @@  discard block
 block discarded – undo
879 879
         $qrcode = $bobj->getPngData();
880 880
         $wQr = 50;
881 881
         $hQr = 50;
882
-        $yQr = ($y+$margemInterna);
883
-        $xQr = ($w/2) - ($wQr/2);
882
+        $yQr = ($y + $margemInterna);
883
+        $xQr = ($w / 2) - ($wQr / 2);
884 884
         // prepare a base64 encoded "data url"
885 885
         $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
886 886
         $info = getimagesize($pic);
887 887
         $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG');
888 888
         $dt = new DateTime($dhRecbto);
889
-        $yQr = ($yQr+$hQr+$margemInterna);
889
+        $yQr = ($yQr + $hQr + $margemInterna);
890 890
         $this->pTextBox($x, $yQr, $w, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n"
891 891
             . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false);
892 892
     }
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
         $heigthText = $this->pTextBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
906 906
                 
907 907
         // seta o textbox do texto adicional
908
-        $this->pTextBox($x, $y+3, $w-2, $hLinha-3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false);
908
+        $this->pTextBox($x, $y + 3, $w - 2, $hLinha - 3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false);
909 909
     }
910 910
     
911 911
     /**
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
         if ($startPos === false) {
966 966
             return $cdata;
967 967
         }
968
-        for ($x=$len; $x>0; $x--) {
968
+        for ($x = $len; $x > 0; $x--) {
969 969
             if (substr($cdata, $x, 1) == '>') {
970 970
                 $endPos = $x;
971 971
                 break;
@@ -976,15 +976,15 @@  discard block
 block discarded – undo
976 976
         } else {
977 977
             $parte1 = '';
978 978
         }
979
-        $parte2 = substr($cdata, $startPos, $endPos-$startPos+1);
979
+        $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1);
980 980
         if ($endPos < $len) {
981 981
             $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1);
982 982
         } else {
983 983
             $parte3 = '';
984 984
         }
985
-        $texto = trim($parte1).' '.trim($parte3);
985
+        $texto = trim($parte1) . ' ' . trim($parte3);
986 986
         if (strpos($parte2, '<CDATA>') === false) {
987
-            $cdata = '<CDATA>'.$parte2.'</CDATA>';
987
+            $cdata = '<CDATA>' . $parte2 . '</CDATA>';
988 988
         } else {
989 989
             $cdata = $parte2;
990 990
         }
@@ -1056,15 +1056,15 @@  discard block
 block discarded – undo
1056 1056
         //grupo CADATA infCpl
1057 1057
         $t = $dom->getElementsByTagName('transmissor')->item(0);
1058 1058
         $r = $dom->getElementsByTagName('receptor')->item(0);
1059
-        $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
1060
-        'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : '';
1061
-        $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
1062
-        'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : '';
1063
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
1064
-        'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : '';
1065
-        $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
1066
-        'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : '';
1067
-        $texto .= "".$versao.$especieNF.$fabEntrega.$dca;
1059
+        $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
1060
+        'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
1061
+        $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
1062
+        'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
1063
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
1064
+        'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
1065
+        $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
1066
+        'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
1067
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
1068 1068
         if (isset($t)) {
1069 1069
             if ($t->hasAttributes()) {
1070 1070
                 $texto .= " Transmissor ";
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
         $bin = "";
1146 1146
         $iCount = 0;
1147 1147
         do {
1148
-            $bin .= chr(hexdec($str{$iCount}.$str{($iCount + 1)}));
1148
+            $bin .= chr(hexdec($str{$iCount} . $str{($iCount + 1)}));
1149 1149
             $iCount += 2;
1150 1150
         } while ($iCount < strlen($str));
1151 1151
         return $bin;
@@ -1179,12 +1179,12 @@  discard block
 block discarded – undo
1179 1179
         $seq .= '&digVal=' . strtolower($digHex);
1180 1180
         $seq .= '&cIdToken=' . $idToken;
1181 1181
         //o hash code é calculado com o Token incluso
1182
-        $hash = sha1($seq.$token);
1183
-        $seq .= '&cHashQRCode='. strtoupper($hash);
1182
+        $hash = sha1($seq . $token);
1183
+        $seq .= '&cHashQRCode=' . strtoupper($hash);
1184 1184
         if (strpos($url, '?') === false) {
1185
-            $seq = $url.'?'.$seq;
1185
+            $seq = $url . '?' . $seq;
1186 1186
         } else {
1187
-            $seq = $url.''.$seq;
1187
+            $seq = $url . '' . $seq;
1188 1188
         }
1189 1189
         return $seq;
1190 1190
     }
Please login to merge, or discard this patch.