Passed
Push — master ( 29f1f0...ff0b46 )
by Roberto
01:04 queued 11s
created
src/NFe/Danfce.php 1 patch
Spacing   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 {
26 26
     protected $papel;
27 27
     protected $xml; // string XML NFe
28
-    protected $logomarca=''; // path para logomarca em jpg
29
-    protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####";
30
-    protected $debugMode=0; //ativa ou desativa o modo de debug
28
+    protected $logomarca = ''; // path para logomarca em jpg
29
+    protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
30
+    protected $debugMode = 0; //ativa ou desativa o modo de debug
31 31
     protected $tpImp; //ambiente
32
-    protected $fontePadrao='Times';
32
+    protected $fontePadrao = 'Times';
33 33
     protected $nfeProc;
34 34
     protected $nfe;
35 35
     protected $infNFe;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         $this->textoAdic = '';
259 259
         if (isset($this->infAdic)) {
260 260
             $this->textoAdic .= !empty($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue) ?
261
-            'Inf. Contribuinte: '.
261
+            'Inf. Contribuinte: ' .
262 262
             trim($this->pAnfavea($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue)) : '';
263 263
             if (!empty($this->textoAdic)) {
264 264
                 $this->textoAdic = str_replace(";", "\n", $this->textoAdic);
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
             $orientacao = 'P';
284 284
         }
285 285
         $this->orientacao = $orientacao;
286
-        $this->papel = array(80,$tamPapelVert);
286
+        $this->papel = array(80, $tamPapelVert);
287 287
         $this->logoAlign = $logoAlign;
288 288
         //$this->situacao_externa = $situacaoExterna;
289 289
         $this->numero_registro_dpec = $depecNumReg;
@@ -307,10 +307,10 @@  discard block
 block discarded – undo
307 307
         //total inicial de paginas
308 308
         $totPag = 1;
309 309
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
310
-        $this->wPrint = $maxW-($margEsq*2);
310
+        $this->wPrint = $maxW - ($margEsq * 2);
311 311
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
312 312
         //superior e inferior
313
-        $this->hPrint = $maxH-$margSup-$margInf;
313
+        $this->hPrint = $maxH - $margSup - $margInf;
314 314
         // estabelece contagem de paginas
315 315
         $this->pdf->aliasNbPages();
316 316
         $this->pdf->setMargins($margEsq, $margSup); // fixa as margens
@@ -321,25 +321,25 @@  discard block
 block discarded – undo
321 321
         $this->pdf->setLineWidth(0.1); // define a largura da linha
322 322
         $this->pdf->setTextColor(0, 0, 0);
323 323
         $this->pTextBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA?
324
-        $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca)  (FIXO)
325
-        $hcabecalhoSecundario = 10;//para cabeçalho secundário (cabeçalho sefaz) (FIXO)
326
-        $hprodutos = $hLinha + ($qtdItens*$hMaxLinha) ;//box poduto
324
+        $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca)  (FIXO)
325
+        $hcabecalhoSecundario = 10; //para cabeçalho secundário (cabeçalho sefaz) (FIXO)
326
+        $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto
327 327
         $hTotal = 12; //box total (FIXO)
328
-        $hpagamentos = $hLinha + ($qtdPgto*$hLinha);//para pagamentos
328
+        $hpagamentos = $hLinha + ($qtdPgto * $hLinha); //para pagamentos
329 329
         if (!empty($this->vTroco)) {
330 330
             $hpagamentos += $hLinha;
331 331
         }
332
-        $hmsgfiscal = 21;// para imposto (FIXO)
332
+        $hmsgfiscal = 21; // para imposto (FIXO)
333 333
         if (!isset($this->dest)) {
334
-            $hcliente = 6;// para cliente (FIXO)
334
+            $hcliente = 6; // para cliente (FIXO)
335 335
         } else {
336 336
             $hcliente = 12;
337 337
         }// para cliente (FIXO)};
338
-        $hQRCode = 50;// para qrcode (FIXO)
339
-        $hCabecItens = 4;//cabeçalho dos itens
338
+        $hQRCode = 50; // para qrcode (FIXO)
339
+        $hCabecItens = 4; //cabeçalho dos itens
340 340
         
341 341
         $hUsado = $hCabecItens;
342
-        $w2 = round($this->wPrint*0.31, 0);
342
+        $w2 = round($this->wPrint * 0.31, 0);
343 343
         $totPag = 1;
344 344
         $pag = 1;
345 345
         $x = $xInic;
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
         $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal;
360 360
         $y = $this->pPagamentosDANFE($x, $y, $hpagamentos);
361 361
         //COLOCA MENSAGEM FISCAL
362
-        $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos;
362
+        $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos;
363 363
         $y = $this->pFiscalDANFE($x, $y, $hmsgfiscal);
364 364
         //COLOCA CONSUMIDOR
365 365
         $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal;
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
         }
379 379
         
380 380
         //retorna o ID na NFe
381
-        if ($classPdf!==false) {
381
+        if ($classPdf !== false) {
382 382
             $aR = [
383 383
              'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")),
384 384
              'classe_PDF'=>$this->pdf
@@ -398,14 +398,14 @@  discard block
 block discarded – undo
398 398
         $emitIM     = $this->pSimpleGetValue($this->emit, "IM");
399 399
         $emitFone = $this->pSimpleGetValue($this->enderEmit, "fone");
400 400
         $foneLen = strlen($emitFone);
401
-        if ($foneLen>0) {
401
+        if ($foneLen > 0) {
402 402
             $ddd = substr($emitFone, 0, 2);
403 403
             $fone1 = substr($emitFone, -8);
404 404
             $digito9 = ' ';
405 405
             if ($foneLen == 11) {
406 406
                 $digito9 = substr($emitFone, 2, 1);
407 407
             }
408
-            $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4);
408
+            $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4);
409 409
         } else {
410 410
             $emitFone = '';
411 411
         }
@@ -419,18 +419,18 @@  discard block
 block discarded – undo
419 419
         // CONFIGURAÇÃO DE POSIÇÃO
420 420
         $margemInterna = $this->margemInterna;
421 421
         $maxW = $this->wPrint;
422
-        $h = $h-($margemInterna);
422
+        $h = $h - ($margemInterna);
423 423
         //COLOCA LOGOMARCA
424 424
         if (is_file($this->logomarca)) {
425 425
             $xImg = $margemInterna;
426 426
             $yImg = $margemInterna + 1;
427 427
             $this->pdf->Image($this->logomarca, $xImg, $yImg, 30, 22.5);
428
-            $xRs = ($maxW*0.4) + $margemInterna;
429
-            $wRs = ($maxW*0.6);
428
+            $xRs = ($maxW * 0.4) + $margemInterna;
429
+            $wRs = ($maxW * 0.6);
430 430
             $alignEmit = 'L';
431 431
         } else {
432 432
             $xRs = $margemInterna;
433
-            $wRs = ($maxW*1);
433
+            $wRs = ($maxW * 1);
434 434
             $alignEmit = 'L';
435 435
         }
436 436
         //COLOCA RAZÃO SOCIAL
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
     {
451 451
         $margemInterna = $this->margemInterna;
452 452
         $maxW = $this->wPrint;
453
-        $w = ($maxW*1);
453
+        $w = ($maxW * 1);
454 454
         $hBox1 = 7;
455 455
         $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica";
456 456
         $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
@@ -467,13 +467,13 @@  discard block
 block discarded – undo
467 467
         $margemInterna = $this->margemInterna;
468 468
         $maxW = $this->wPrint;
469 469
         $qtdItens = $this->det->length;
470
-        $w = ($maxW*1);
470
+        $w = ($maxW * 1);
471 471
         $hLinha = $this->hLinha;
472 472
         $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
473
-        $wBoxCod = $w*0.17;
473
+        $wBoxCod = $w * 0.17;
474 474
         $texto = "CÓDIGO";
475 475
         $this->pTextBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
476
-        $wBoxDescricao = $w*0.43;
476
+        $wBoxDescricao = $w * 0.43;
477 477
         $xBoxDescricao = $wBoxCod + $x;
478 478
         $texto = "DESCRICÃO";
479 479
         $this->pTextBox(
@@ -489,19 +489,19 @@  discard block
 block discarded – undo
489 489
             '',
490 490
             false
491 491
         );
492
-        $wBoxQt = $w*0.08;
492
+        $wBoxQt = $w * 0.08;
493 493
         $xBoxQt = $wBoxDescricao + $xBoxDescricao;
494 494
         $texto = "QT";
495 495
         $this->pTextBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
496
-        $wBoxUn = $w*0.06;
496
+        $wBoxUn = $w * 0.06;
497 497
         $xBoxUn = $wBoxQt + $xBoxQt;
498 498
         $texto = "UN";
499 499
         $this->pTextBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
500
-        $wBoxVl = $w*0.13;
500
+        $wBoxVl = $w * 0.13;
501 501
         $xBoxVl = $wBoxUn + $xBoxUn;
502 502
         $texto = "VALOR";
503 503
         $this->pTextBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
504
-        $wBoxTotal = $w*0.13;
504
+        $wBoxTotal = $w * 0.13;
505 505
         $xBoxTotal = $wBoxVl + $xBoxVl;
506 506
         $texto = "TOTAL";
507 507
         $this->pTextBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
@@ -521,13 +521,13 @@  discard block
 block discarded – undo
521 521
                 $vUnCom     = number_format($this->pSimpleGetValue($prod, "vUnCom"), 2, ",", ".");
522 522
                 $vProd      = number_format($this->pSimpleGetValue($prod, "vProd"), 2, ",", ".");
523 523
                 //COLOCA PRODUTO
524
-                $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha);
524
+                $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha);
525 525
                 //COLOCA PRODUTO CÓDIGO
526
-                $wBoxCod = $w*0.17;
526
+                $wBoxCod = $w * 0.17;
527 527
                 $texto = $cProd;
528 528
                 $this->pTextBox($x, $yBoxProd, $wBoxCod, $hMaxLinha, $texto, $aFontProdutos, 'C', 'C', 0, '', false);
529 529
                 //COLOCA PRODUTO DESCRIÇÃO
530
-                $wBoxDescricao = $w*0.43;
530
+                $wBoxDescricao = $w * 0.43;
531 531
                 $xBoxDescricao = $wBoxCod + $x;
532 532
                 $texto = $xProd;
533 533
                 $this->pTextBox(
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
                     false
545 545
                 );
546 546
                 //COLOCA PRODUTO QUANTIDADE
547
-                $wBoxQt = $w*0.08;
547
+                $wBoxQt = $w * 0.08;
548 548
                 $xBoxQt = $wBoxDescricao + $xBoxDescricao;
549 549
                 $texto = $qCom;
550 550
                 $this->pTextBox(
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
                     false
562 562
                 );
563 563
                 //COLOCA PRODUTO UNIDADE
564
-                $wBoxUn = $w*0.06;
564
+                $wBoxUn = $w * 0.06;
565 565
                 $xBoxUn = $wBoxQt + $xBoxQt;
566 566
                 $texto = $uCom;
567 567
                 $this->pTextBox(
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
                     false
579 579
                 );
580 580
                 //COLOCA PRODUTO VL UNITÁRIO
581
-                $wBoxVl = $w*0.13;
581
+                $wBoxVl = $w * 0.13;
582 582
                 $xBoxVl = $wBoxUn + $xBoxUn;
583 583
                 $texto = $vUnCom;
584 584
                 $this->pTextBox(
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
                     false
596 596
                 );
597 597
                 //COLOCA PRODUTO VL TOTAL
598
-                $wBoxTotal = $w*0.13;
598
+                $wBoxTotal = $w * 0.13;
599 599
                 $xBoxTotal = $wBoxVl + $xBoxVl;
600 600
                 $texto = $vProd;
601 601
                 $this->pTextBox(
@@ -622,8 +622,8 @@  discard block
 block discarded – undo
622 622
         $margemInterna = $this->margemInterna;
623 623
         $maxW = $this->wPrint;
624 624
         $hLinha = 3;
625
-        $wColEsq = ($maxW*0.7);
626
-        $wColDir = ($maxW*0.3);
625
+        $wColEsq = ($maxW * 0.7);
626
+        $wColDir = ($maxW * 0.3);
627 627
         $xValor = $x + $wColEsq;
628 628
         $qtdItens = $this->det->length;
629 629
         $vProd = $this->pSimpleGetValue($this->ICMSTot, "vProd");
@@ -644,28 +644,28 @@  discard block
 block discarded – undo
644 644
         $texto = "R$ " . number_format($vProd, 2, ",", ".");
645 645
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
646 646
         $this->pTextBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
647
-        $yDesconto = $y + ($hLinha*2);
647
+        $yDesconto = $y + ($hLinha * 2);
648 648
         $texto = "Descontos";
649 649
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
650 650
         $this->pTextBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
651 651
         $texto = "R$ " . $vDesc;
652 652
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
653 653
         $this->pTextBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
654
-        $yFrete= $y + ($hLinha*3);
654
+        $yFrete = $y + ($hLinha * 3);
655 655
         $texto = "Frete";
656 656
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
657 657
         $this->pTextBox($x, $yFrete, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
658 658
         $texto = "R$ " . $vFrete;
659 659
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
660 660
         $this->pTextBox($xValor, $yFrete, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
661
-        $yTotalFinal = $y + ($hLinha*4);
661
+        $yTotalFinal = $y + ($hLinha * 4);
662 662
         $texto = "Total";
663 663
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
664 664
         $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
665 665
         $texto = "R$ " . $vNF;
666 666
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
667 667
         $this->pTextBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
668
-        $yTotalFinal = $y + ($hLinha*5);
668
+        $yTotalFinal = $y + ($hLinha * 5);
669 669
         $texto = "Informação dos Tributos Totais Incidentes";
670 670
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'');
671 671
         $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
@@ -680,16 +680,16 @@  discard block
 block discarded – undo
680 680
         $margemInterna = $this->margemInterna;
681 681
         $maxW = $this->wPrint;
682 682
         $qtdPgto = $this->pag->length;
683
-        $w = ($maxW*1);
683
+        $w = ($maxW * 1);
684 684
         $hLinha = $this->hLinha;
685
-        $wColEsq = ($maxW*0.7);
686
-        $wColDir = ($maxW*0.3);
685
+        $wColEsq = ($maxW * 0.7);
686
+        $wColDir = ($maxW * 0.3);
687 687
         $xValor = $x + $wColEsq;
688 688
         $aFontPgto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
689
-        $wBoxEsq = $w*0.7;
689
+        $wBoxEsq = $w * 0.7;
690 690
         $texto = "FORMA DE PAGAMENTO";
691 691
         $this->pTextBox($x, $y, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
692
-        $wBoxDir = $w*0.3;
692
+        $wBoxDir = $w * 0.3;
693 693
         $xBoxDescricao = $x + $wBoxEsq;
694 694
         $texto = "VALOR PAGO";
695 695
         $this->pTextBox($xBoxDescricao, $y, $wBoxDir, $hLinha, $texto, $aFontPgto, 'T', 'R', 0, '', false);
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
                     $tBandNome = self::getCardName($tBand);
712 712
                 }
713 713
                 //COLOCA PRODUTO
714
-                $yBoxProd = $y + $hLinha + ($cont*$hLinha);
714
+                $yBoxProd = $y + $hLinha + ($cont * $hLinha);
715 715
                 //COLOCA PRODUTO CÓDIGO
716 716
                 $texto = $tPagNome;
717 717
                 $this->pTextBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
             }
736 736
             
737 737
             if (!empty($this->vTroco)) {
738
-                $yBoxProd = $y + $hLinha + ($cont*$hLinha);
738
+                $yBoxProd = $y + $hLinha + ($cont * $hLinha);
739 739
                 //COLOCA PRODUTO CÓDIGO
740 740
                 $texto = 'Troco';
741 741
                 $this->pTextBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
         $y += 6;
765 765
         $margemInterna = $this->margemInterna;
766 766
         $maxW = $this->wPrint;
767
-        $w = ($maxW*1);
767
+        $w = ($maxW * 1);
768 768
         $hLinha = $this->hLinha;
769 769
         $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
770 770
         $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'');
@@ -797,18 +797,18 @@  discard block
 block discarded – undo
797 797
         $urlChave = $this->urlConsulta[$tpAmb][$this->UFSigla[$cUF]];
798 798
         $texto = "ÁREA DE MENSAGEM FISCAL";
799 799
         $this->pTextBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
800
-        $yTex1 = $y + ($hLinha*1);
801
-        $hTex1 = $hLinha*2;
802
-        $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmiLocalFormat . " - Via Consumidor";
800
+        $yTex1 = $y + ($hLinha * 1);
801
+        $hTex1 = $hLinha * 2;
802
+        $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmiLocalFormat . " - Via Consumidor";
803 803
         $this->pTextBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false);
804
-        $yTex2 = $y + ($hLinha*3);
805
-        $hTex2 = $hLinha*2;
804
+        $yTex2 = $y + ($hLinha * 3);
805
+        $hTex2 = $hLinha * 2;
806 806
         $texto = "Consulte pela Chave de Acesso em " . $urlChave;
807 807
         $this->pTextBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false);
808 808
         $texto = "CHAVE DE ACESSO";
809
-        $yTit2 = $y + ($hLinha*5);
809
+        $yTit2 = $y + ($hLinha * 5);
810 810
         $this->pTextBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
811
-        $yTex3 = $y + ($hLinha*6);
811
+        $yTex3 = $y + ($hLinha * 6);
812 812
         $texto = $chNFe;
813 813
         $this->pTextBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false);
814 814
     }
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
         $y += 6;
819 819
         $margemInterna = $this->margemInterna;
820 820
         $maxW = $this->wPrint;
821
-        $w = ($maxW*1);
821
+        $w = ($maxW * 1);
822 822
         $hLinha = $this->hLinha;
823 823
         $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
824 824
         $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'');
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
             $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)
835 835
                     ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue
836 836
                     : '';
837
-            $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor
837
+            $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor
838 838
             $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0);
839 839
             $consNome = $this->pSimpleGetValue($this->dest, "xNome");
840 840
             $consLgr = $this->pSimpleGetValue($enderDest, "xLgr");
@@ -874,8 +874,8 @@  discard block
 block discarded – undo
874 874
             $yTex1 = $y + $hLinha;
875 875
             $texto = $consNome;
876 876
             if (!empty($consDoc)) {
877
-                $texto .= " - ". $consDoc . "\n" . $consEnd;
878
-                $this->pTextBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false);
877
+                $texto .= " - " . $consDoc . "\n" . $consEnd;
878
+                $this->pTextBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false);
879 879
             }
880 880
         } else {
881 881
             $yTex1 = $y + $hLinha;
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
         $y += 6;
890 890
         $margemInterna = $this->margemInterna;
891 891
         $maxW = $this->wPrint;
892
-        $w = ($maxW*1)+4;
892
+        $w = ($maxW * 1) + 4;
893 893
         $hLinha = $this->hLinha;
894 894
         $hBoxLinha = $this->hBoxLinha;
895 895
         $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
         $nProt = '';
899 899
         if (isset($this->nfeProc)) {
900 900
             $nProt = $this->pSimpleGetValue($this->nfeProc, "nProt");
901
-            $dhRecbto  = $this->pSimpleGetValue($this->nfeProc, "dhRecbto");
901
+            $dhRecbto = $this->pSimpleGetValue($this->nfeProc, "dhRecbto");
902 902
         }
903 903
         $barcode = new Barcode();
904 904
         $bobj = $barcode->getBarcodeObj(
@@ -912,15 +912,15 @@  discard block
 block discarded – undo
912 912
         $qrcode = $bobj->getPngData();
913 913
         $wQr = 50;
914 914
         $hQr = 50;
915
-        $yQr = ($y+$margemInterna);
916
-        $xQr = ($w/2) - ($wQr/2);
915
+        $yQr = ($y + $margemInterna);
916
+        $xQr = ($w / 2) - ($wQr / 2);
917 917
         // prepare a base64 encoded "data url"
918 918
         $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
919 919
         $info = getimagesize($pic);
920 920
         $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG');
921 921
         $dt = new DateTime($dhRecbto);
922
-        $yQr = ($yQr+$hQr+$margemInterna);
923
-        $this->pTextBox($x, $yQr, $w-4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n"
922
+        $yQr = ($yQr + $hQr + $margemInterna);
923
+        $this->pTextBox($x, $yQr, $w - 4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n"
924 924
             . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false);
925 925
     }
926 926
    
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
         $heigthText = $this->pTextBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
939 939
                 
940 940
         // seta o textbox do texto adicional
941
-        $this->pTextBox($x, $y+3, $w-2, $hLinha-3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false);
941
+        $this->pTextBox($x, $y + 3, $w - 2, $hLinha - 3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false);
942 942
     }
943 943
     
944 944
     /**
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
         if ($startPos === false) {
999 999
             return $cdata;
1000 1000
         }
1001
-        for ($x=$len; $x>0; $x--) {
1001
+        for ($x = $len; $x > 0; $x--) {
1002 1002
             if (substr($cdata, $x, 1) == '>') {
1003 1003
                 $endPos = $x;
1004 1004
                 break;
@@ -1009,15 +1009,15 @@  discard block
 block discarded – undo
1009 1009
         } else {
1010 1010
             $parte1 = '';
1011 1011
         }
1012
-        $parte2 = substr($cdata, $startPos, $endPos-$startPos+1);
1012
+        $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1);
1013 1013
         if ($endPos < $len) {
1014 1014
             $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1);
1015 1015
         } else {
1016 1016
             $parte3 = '';
1017 1017
         }
1018
-        $texto = trim($parte1).' '.trim($parte3);
1018
+        $texto = trim($parte1) . ' ' . trim($parte3);
1019 1019
         if (strpos($parte2, '<CDATA>') === false) {
1020
-            $cdata = '<CDATA>'.$parte2.'</CDATA>';
1020
+            $cdata = '<CDATA>' . $parte2 . '</CDATA>';
1021 1021
         } else {
1022 1022
             $cdata = $parte2;
1023 1023
         }
@@ -1089,15 +1089,15 @@  discard block
 block discarded – undo
1089 1089
         //grupo CADATA infCpl
1090 1090
         $t = $dom->getElementsByTagName('transmissor')->item(0);
1091 1091
         $r = $dom->getElementsByTagName('receptor')->item(0);
1092
-        $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
1093
-        'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : '';
1094
-        $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
1095
-        'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : '';
1096
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
1097
-        'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : '';
1098
-        $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
1099
-        'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : '';
1100
-        $texto .= "".$versao.$especieNF.$fabEntrega.$dca;
1092
+        $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
1093
+        'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
1094
+        $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
1095
+        'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
1096
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
1097
+        'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
1098
+        $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
1099
+        'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
1100
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
1101 1101
         if (isset($t)) {
1102 1102
             if ($t->hasAttributes()) {
1103 1103
                 $texto .= " Transmissor ";
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
         $bin = "";
1182 1182
         $iCount = 0;
1183 1183
         do {
1184
-            $bin .= chr(hexdec($str{$iCount}.$str{($iCount + 1)}));
1184
+            $bin .= chr(hexdec($str{$iCount} . $str{($iCount + 1)}));
1185 1185
             $iCount += 2;
1186 1186
         } while ($iCount < strlen($str));
1187 1187
         return $bin;
@@ -1215,12 +1215,12 @@  discard block
 block discarded – undo
1215 1215
         $seq .= '&digVal=' . strtolower($digHex);
1216 1216
         $seq .= '&cIdToken=' . $idToken;
1217 1217
         //o hash code é calculado com o Token incluso
1218
-        $hash = sha1($seq.$token);
1219
-        $seq .= '&cHashQRCode='. strtoupper($hash);
1218
+        $hash = sha1($seq . $token);
1219
+        $seq .= '&cHashQRCode=' . strtoupper($hash);
1220 1220
         if (strpos($url, '?') === false) {
1221
-            $seq = $url.'?'.$seq;
1221
+            $seq = $url . '?' . $seq;
1222 1222
         } else {
1223
-            $seq = $url.''.$seq;
1223
+            $seq = $url . '' . $seq;
1224 1224
         }
1225 1225
         return $seq;
1226 1226
     }
Please login to merge, or discard this patch.