@@ -288,14 +288,14 @@ discard block |
||
288 | 288 | 'style' => '' |
289 | 289 | ]; |
290 | 290 | $k = $this->pdf->k; |
291 | - $this->textadicfontsize = $fontProduto['size']/$k; |
|
291 | + $this->textadicfontsize = $fontProduto['size'] / $k; |
|
292 | 292 | $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
293 | 293 | if (isset($this->infAdic)) { |
294 | 294 | $i = 0; |
295 | 295 | if ($this->textoAdic != '') { |
296 | 296 | $this->textoAdic .= ". \n"; |
297 | 297 | } |
298 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl")) |
|
298 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl")) |
|
299 | 299 | ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl")) |
300 | 300 | : ''; |
301 | 301 | $infPedido = $this->geraInformacoesDaTagCompra(); |
@@ -303,14 +303,14 @@ discard block |
||
303 | 303 | $this->textoAdic .= $infPedido; |
304 | 304 | } |
305 | 305 | $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: '); |
306 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
306 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
307 | 307 | ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco") |
308 | 308 | : ''; |
309 | 309 | $obsCont = $this->infAdic->getElementsByTagName("obsCont"); |
310 | 310 | if (isset($obsCont)) { |
311 | 311 | foreach ($obsCont as $obs) { |
312 | - $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
313 | - $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
312 | + $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
313 | + $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
314 | 314 | ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue |
315 | 315 | : ''; |
316 | 316 | $this->textoAdic .= "\n" . $campo . ': ' . trim($xTexto); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | //fim da alteração NT 2013.003 Lei da Transparência |
337 | 337 | $this->textoAdic = str_replace(";", "\n", $this->textoAdic); |
338 | 338 | $alinhas = explode("\n", $this->textoAdic); |
339 | - $numlinhasdados = $this->pdf->getNumLines($this->textoAdic, $this->wAdic, $fontProduto)+1.5; |
|
339 | + $numlinhasdados = $this->pdf->getNumLines($this->textoAdic, $this->wAdic, $fontProduto) + 1.5; |
|
340 | 340 | $this->textadicfontsize = $this->pdf->fontSize; |
341 | 341 | $hdadosadic = ceil($numlinhasdados * ($this->textadicfontsize)); |
342 | 342 | if ($hdadosadic > 70) { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | 'size' => $f, |
348 | 348 | 'style' => '' |
349 | 349 | ]; |
350 | - $numlinhasdados = $this->pdf->getNumLines($this->textoAdic, $this->wAdic, $fontProduto)+3; |
|
350 | + $numlinhasdados = $this->pdf->getNumLines($this->textoAdic, $this->wAdic, $fontProduto) + 3; |
|
351 | 351 | $this->textadicfontsize = $this->pdf->fontSize; |
352 | 352 | $hdadosadic = ceil($numlinhasdados * $this->textadicfontsize); |
353 | 353 | echo $hdadosadic; |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | if ($this->papel == 'A4') { |
407 | 407 | $this->maxW = 297; |
408 | 408 | $this->maxH = 210; |
409 | - $xInic = $this->margesq+10; |
|
409 | + $xInic = $this->margesq + 10; |
|
410 | 410 | //se paisagem multiplica a largura do canhoto pela quantidade de canhotos |
411 | 411 | //$this->wCanhoto *= $this->qCanhoto; |
412 | 412 | } |
@@ -414,10 +414,10 @@ discard block |
||
414 | 414 | //total inicial de paginas |
415 | 415 | $totPag = 1; |
416 | 416 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
417 | - $this->wPrint = $this->maxW-($this->margesq * 2); |
|
417 | + $this->wPrint = $this->maxW - ($this->margesq * 2); |
|
418 | 418 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
419 | 419 | //superior e inferior |
420 | - $this->hPrint = $this->maxH-$this->margsup-$this->marginf; |
|
420 | + $this->hPrint = $this->maxH - $this->margsup - $this->marginf; |
|
421 | 421 | // estabelece contagem de paginas |
422 | 422 | $this->pdf->aliasNbPages(); |
423 | 423 | // fixa as margens |
@@ -461,18 +461,18 @@ discard block |
||
461 | 461 | } |
462 | 462 | //calcular a altura necessária para os dados adicionais |
463 | 463 | if ($this->orientacao == 'P') { |
464 | - $this->wAdic = round($this->wPrint*0.66, 0); |
|
464 | + $this->wAdic = round($this->wPrint * 0.66, 0); |
|
465 | 465 | } else { |
466 | - $this->wAdic = round(($this->wPrint-$this->wCanhoto)*0.5, 0); |
|
466 | + $this->wAdic = round(($this->wPrint - $this->wCanhoto) * 0.5, 0); |
|
467 | 467 | } |
468 | 468 | $fontProduto = ['font' => $this->fontePadrao, 'size' => 7, 'style' => '']; |
469 | 469 | |
470 | 470 | $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais(); |
471 | 471 | |
472 | 472 | //altura disponivel para os campos da DANFE |
473 | - $hcabecalho = 47;//para cabeçalho |
|
474 | - $hdestinatario = 25;//para destinatario |
|
475 | - $hduplicatas = 12;//para cada grupo de 7 duplicatas |
|
473 | + $hcabecalho = 47; //para cabeçalho |
|
474 | + $hdestinatario = 25; //para destinatario |
|
475 | + $hduplicatas = 12; //para cada grupo de 7 duplicatas |
|
476 | 476 | if (isset($this->entrega)) { |
477 | 477 | $hlocalentrega = 25; |
478 | 478 | } else { |
@@ -483,11 +483,11 @@ discard block |
||
483 | 483 | } else { |
484 | 484 | $hlocalretirada = 0; |
485 | 485 | } |
486 | - $himposto = 18;// para imposto |
|
487 | - $htransporte = 25;// para transporte |
|
488 | - $hissqn = 11;// para issqn |
|
489 | - $hfooter = 5;// para rodape |
|
490 | - $hCabecItens = 4;//cabeçalho dos itens |
|
486 | + $himposto = 18; // para imposto |
|
487 | + $htransporte = 25; // para transporte |
|
488 | + $hissqn = 11; // para issqn |
|
489 | + $hfooter = 5; // para rodape |
|
490 | + $hCabecItens = 4; //cabeçalho dos itens |
|
491 | 491 | $hOCUPADA = $hcabecalho |
492 | 492 | + $hdestinatario |
493 | 493 | + $hlocalentrega |
@@ -510,10 +510,10 @@ discard block |
||
510 | 510 | $this->sizeExtraTextoFatura());*/ |
511 | 511 | |
512 | 512 | if ($this->orientacao == 'P') { |
513 | - $hDispo1 -= 24 * $this->qCanhoto;//para canhoto |
|
513 | + $hDispo1 -= 24 * $this->qCanhoto; //para canhoto |
|
514 | 514 | $w = $this->wPrint; |
515 | 515 | } else { |
516 | - $hcanhoto = $this->hPrint;//para canhoto |
|
516 | + $hcanhoto = $this->hPrint; //para canhoto |
|
517 | 517 | $w = $this->wPrint - $this->wCanhoto; |
518 | 518 | } |
519 | 519 | //$hDispo1 += 14; |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | $fontProduto = ['font' => $this->fontePadrao, 'size' => 7, 'style' => '']; |
523 | 523 | $numlinhas = 0; |
524 | 524 | $hUsado = $hCabecItens; |
525 | - $w2 = round($w*0.28, 0); |
|
525 | + $w2 = round($w * 0.28, 0); |
|
526 | 526 | $hDispo = $hDispo1; |
527 | 527 | $totPag = 1; |
528 | 528 | $i = 0; |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | $hDispo = $hDispo2; |
539 | 539 | $hUsado = $hCabecItens; |
540 | 540 | // Remove canhoto para páginas secundárias em modo paisagem ('L') |
541 | - $w2 = round($this->wPrint*0.28, 0); |
|
541 | + $w2 = round($this->wPrint * 0.28, 0); |
|
542 | 542 | $i--; // decrementa para readicionar o item que não coube nessa pagina na outra. |
543 | 543 | } |
544 | 544 | $i++; |
@@ -559,14 +559,14 @@ discard block |
||
559 | 559 | //coloca o cabeçalho |
560 | 560 | $y = $this->header($x, $y, $pag, $totPag); |
561 | 561 | //coloca os dados do destinatário |
562 | - $y = $this->destinatarioDANFE($x, $y+1); |
|
562 | + $y = $this->destinatarioDANFE($x, $y + 1); |
|
563 | 563 | //coloca os dados do local de retirada |
564 | 564 | if (isset($this->retirada)) { |
565 | - $y = $this->localRetiradaDANFE($x, $y+1); |
|
565 | + $y = $this->localRetiradaDANFE($x, $y + 1); |
|
566 | 566 | } |
567 | 567 | //coloca os dados do local de entrega |
568 | 568 | if (isset($this->entrega)) { |
569 | - $y = $this->localEntregaDANFE($x, $y+1); |
|
569 | + $y = $this->localEntregaDANFE($x, $y + 1); |
|
570 | 570 | } |
571 | 571 | |
572 | 572 | //Verifica as formas de pagamento da nota fiscal |
@@ -581,29 +581,29 @@ discard block |
||
581 | 581 | } |
582 | 582 | //caso tenha boleto imprimir fatura |
583 | 583 | if ($this->dup->length > 0) { |
584 | - $y = $this->fatura($x, $y+1); |
|
584 | + $y = $this->fatura($x, $y + 1); |
|
585 | 585 | } else { |
586 | 586 | //Se somente tiver a forma de pagamento sem pagamento não imprimir nada |
587 | - if (count($formaPag)=='1' && isset($formaPag[90])) { |
|
587 | + if (count($formaPag) == '1' && isset($formaPag[90])) { |
|
588 | 588 | $y = $y; |
589 | 589 | } else { |
590 | 590 | //caso tenha mais de uma forma de pagamento ou seja diferente de boleto exibe a |
591 | 591 | //forma de pagamento e o valor |
592 | - $y = $this->pagamento($x, $y+1); |
|
592 | + $y = $this->pagamento($x, $y + 1); |
|
593 | 593 | } |
594 | 594 | } |
595 | 595 | //coloca os dados dos impostos e totais da NFe |
596 | - $y = $this->imposto($x, $y+1); |
|
596 | + $y = $this->imposto($x, $y + 1); |
|
597 | 597 | //coloca os dados do trasnporte |
598 | - $y = $this->transporte($x, $y+1); |
|
598 | + $y = $this->transporte($x, $y + 1); |
|
599 | 599 | //itens da DANFE |
600 | 600 | $nInicial = 0; |
601 | 601 | |
602 | - $y = $this->itens($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
602 | + $y = $this->itens($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
603 | 603 | |
604 | 604 | //coloca os dados do ISSQN |
605 | 605 | if ($linhaISSQN == 1) { |
606 | - $y = $this->issqn($x, $y+4); |
|
606 | + $y = $this->issqn($x, $y + 4); |
|
607 | 607 | } else { |
608 | 608 | $y += 4; |
609 | 609 | } |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | //coloca o cabeçalho na página adicional |
633 | 633 | $y = $this->header($x, $y, $n, $totPag); |
634 | 634 | //coloca os itens na página adicional |
635 | - $y = $this->itens($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
635 | + $y = $this->itens($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
636 | 636 | //coloca o rodapé da página |
637 | 637 | if ($this->orientacao == 'P') { |
638 | 638 | $this->rodape($this->margesq); |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | if ($startPos === false) { |
670 | 670 | return $cdata; |
671 | 671 | } |
672 | - for ($x=$len; $x>0; $x--) { |
|
672 | + for ($x = $len; $x > 0; $x--) { |
|
673 | 673 | if (substr($cdata, $x, 1) == '>') { |
674 | 674 | $endPos = $x; |
675 | 675 | break; |
@@ -680,15 +680,15 @@ discard block |
||
680 | 680 | } else { |
681 | 681 | $parte1 = ''; |
682 | 682 | } |
683 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
683 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
684 | 684 | if ($endPos < $len) { |
685 | 685 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
686 | 686 | } else { |
687 | 687 | $parte3 = ''; |
688 | 688 | } |
689 | - $texto = trim($parte1).' '.trim($parte3); |
|
689 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
690 | 690 | if (strpos($parte2, '<CDATA>') === false) { |
691 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
691 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
692 | 692 | } else { |
693 | 693 | $cdata = $parte2; |
694 | 694 | } |
@@ -762,15 +762,15 @@ discard block |
||
762 | 762 | //grupo CADATA infCpl |
763 | 763 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
764 | 764 | $r = $dom->getElementsByTagName('receptor')->item(0); |
765 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
766 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
767 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
768 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
769 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
770 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
771 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
772 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
773 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
765 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
766 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
767 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
768 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
769 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
770 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
771 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
772 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
773 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
774 | 774 | if (isset($t)) { |
775 | 775 | if ($t->hasAttributes()) { |
776 | 776 | $texto .= " Transmissor "; |
@@ -856,14 +856,14 @@ discard block |
||
856 | 856 | } |
857 | 857 | //#################################################################################### |
858 | 858 | //coluna esquerda identificação do emitente |
859 | - $w = round($maxW*0.41, 0); |
|
859 | + $w = round($maxW * 0.41, 0); |
|
860 | 860 | if ($this->orientacao == 'P') { |
861 | 861 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
862 | 862 | } else { |
863 | 863 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
864 | 864 | } |
865 | 865 | $w1 = $w; |
866 | - $h=32; |
|
866 | + $h = 32; |
|
867 | 867 | $oldY += $h; |
868 | 868 | $this->pdf->textBox($x, $y, $w, $h); |
869 | 869 | $texto = 'IDENTIFICAÇÃO DO EMITENTE'; |
@@ -879,39 +879,39 @@ discard block |
||
879 | 879 | if (!empty($this->logomarca)) { |
880 | 880 | $logoInfo = getimagesize($this->logomarca); |
881 | 881 | //largura da imagem em mm |
882 | - $logoWmm = ($logoInfo[0]/72)*25.4; |
|
882 | + $logoWmm = ($logoInfo[0] / 72) * 25.4; |
|
883 | 883 | //altura da imagem em mm |
884 | - $logoHmm = ($logoInfo[1]/72)*25.4; |
|
885 | - if ($this->logoAlign=='L') { |
|
886 | - $nImgW = round($w/3, 0); |
|
887 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
888 | - $xImg = $x+1; |
|
889 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
884 | + $logoHmm = ($logoInfo[1] / 72) * 25.4; |
|
885 | + if ($this->logoAlign == 'L') { |
|
886 | + $nImgW = round($w / 3, 0); |
|
887 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
888 | + $xImg = $x + 1; |
|
889 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
890 | 890 | //estabelecer posições do texto |
891 | - $x1 = round($xImg + $nImgW +1, 0); |
|
892 | - $y1 = round($h/3+$y, 0); |
|
893 | - $tw = round(2*$w/3, 0); |
|
894 | - } elseif ($this->logoAlign=='C') { |
|
895 | - $nImgH = round($h/3, 0); |
|
896 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
897 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
898 | - $yImg = $y+3; |
|
891 | + $x1 = round($xImg + $nImgW + 1, 0); |
|
892 | + $y1 = round($h / 3 + $y, 0); |
|
893 | + $tw = round(2 * $w / 3, 0); |
|
894 | + } elseif ($this->logoAlign == 'C') { |
|
895 | + $nImgH = round($h / 3, 0); |
|
896 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
897 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
898 | + $yImg = $y + 3; |
|
899 | 899 | $x1 = $x; |
900 | 900 | $y1 = round($yImg + $nImgH + 1, 0); |
901 | 901 | $tw = $w; |
902 | - } elseif ($this->logoAlign=='R') { |
|
903 | - $nImgW = round($w/3, 0); |
|
904 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
905 | - $xImg = round($x+($w-(1+$nImgW)), 0); |
|
906 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
902 | + } elseif ($this->logoAlign == 'R') { |
|
903 | + $nImgW = round($w / 3, 0); |
|
904 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
905 | + $xImg = round($x + ($w - (1 + $nImgW)), 0); |
|
906 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
907 | 907 | $x1 = $x; |
908 | - $y1 = round($h/3+$y, 0); |
|
909 | - $tw = round(2*$w/3, 0); |
|
910 | - } elseif ($this->logoAlign=='F') { |
|
911 | - $nImgH = round($h-5, 0); |
|
912 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
913 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
914 | - $yImg = $y+3; |
|
908 | + $y1 = round($h / 3 + $y, 0); |
|
909 | + $tw = round(2 * $w / 3, 0); |
|
910 | + } elseif ($this->logoAlign == 'F') { |
|
911 | + $nImgH = round($h - 5, 0); |
|
912 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
913 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
914 | + $yImg = $y + 3; |
|
915 | 915 | $x1 = $x; |
916 | 916 | $y1 = round($yImg + $nImgH + 1, 0); |
917 | 917 | $tw = $w; |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg'); |
921 | 921 | } else { |
922 | 922 | $x1 = $x; |
923 | - $y1 = round($h/3+$y, 0); |
|
923 | + $y1 = round($h / 3 + $y, 0); |
|
924 | 924 | $tw = $w; |
925 | 925 | } |
926 | 926 | // monta as informações apenas se diferente de full logo |
@@ -930,9 +930,9 @@ discard block |
||
930 | 930 | $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue; |
931 | 931 | $this->pdf->textBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, ''); |
932 | 932 | //endereço |
933 | - $y1 = $y1+5; |
|
933 | + $y1 = $y1 + 5; |
|
934 | 934 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
935 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
935 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
936 | 936 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
937 | 937 | : ''; |
938 | 938 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -952,33 +952,33 @@ discard block |
||
952 | 952 | //#################################################################################### |
953 | 953 | //coluna central Danfe |
954 | 954 | $x += $w; |
955 | - $w=round($maxW * 0.17, 0);//35; |
|
955 | + $w = round($maxW * 0.17, 0); //35; |
|
956 | 956 | $w2 = $w; |
957 | 957 | $h = 32; |
958 | 958 | $this->pdf->textBox($x, $y, $w, $h); |
959 | 959 | |
960 | 960 | $texto = "DANFE"; |
961 | 961 | $aFont = ['font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B']; |
962 | - $this->pdf->textBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
962 | + $this->pdf->textBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
963 | 963 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
964 | 964 | $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica'; |
965 | 965 | $h = 20; |
966 | - $this->pdf->textBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
966 | + $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
967 | 967 | |
968 | 968 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
969 | 969 | $texto = '0 - ENTRADA'; |
970 | 970 | $y1 = $y + 14; |
971 | 971 | $h = 8; |
972 | - $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
972 | + $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
973 | 973 | $texto = '1 - SAÍDA'; |
974 | 974 | $y1 = $y + 17; |
975 | - $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
975 | + $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
976 | 976 | //tipo de nF |
977 | 977 | $aFont = ['font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B']; |
978 | 978 | $y1 = $y + 13; |
979 | 979 | $h = 7; |
980 | 980 | $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
981 | - $this->pdf->textBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
981 | + $this->pdf->textBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
982 | 982 | //numero da NF |
983 | 983 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
984 | 984 | $y1 = $y + 20; |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | //#################################################################################### |
1011 | 1011 | //coluna codigo de barras |
1012 | 1012 | $x += $w; |
1013 | - $w = ($maxW-$w1-$w2);//85; |
|
1013 | + $w = ($maxW - $w1 - $w2); //85; |
|
1014 | 1014 | $w3 = $w; |
1015 | 1015 | $h = 32; |
1016 | 1016 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1019,22 +1019,22 @@ discard block |
||
1019 | 1019 | $bW = 75; |
1020 | 1020 | $bH = 12; |
1021 | 1021 | //codigo de barras |
1022 | - $this->pdf->code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH); |
|
1022 | + $this->pdf->code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH); |
|
1023 | 1023 | //linhas divisorias |
1024 | - $this->pdf->line($x, $y+4+$bH, $x+$w, $y+4+$bH); |
|
1025 | - $this->pdf->line($x, $y+12+$bH, $x+$w, $y+12+$bH); |
|
1024 | + $this->pdf->line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH); |
|
1025 | + $this->pdf->line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH); |
|
1026 | 1026 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1027 | - $y1 = $y+4+$bH; |
|
1027 | + $y1 = $y + 4 + $bH; |
|
1028 | 1028 | $h = 7; |
1029 | 1029 | $texto = 'CHAVE DE ACESSO'; |
1030 | 1030 | $this->pdf->textBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1031 | 1031 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
1032 | - $y1 = $y+8+$bH; |
|
1032 | + $y1 = $y + 8 + $bH; |
|
1033 | 1033 | $texto = $this->formatField($chave_acesso, $this->formatoChave); |
1034 | - $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1035 | - $y1 = $y+12+$bH; |
|
1034 | + $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1035 | + $y1 = $y + 12 + $bH; |
|
1036 | 1036 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
1037 | - $chaveContingencia=""; |
|
1037 | + $chaveContingencia = ""; |
|
1038 | 1038 | if ($this->notaDpec()) { |
1039 | 1039 | $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC'; |
1040 | 1040 | } else { |
@@ -1045,16 +1045,16 @@ discard block |
||
1045 | 1045 | $chaveContingencia = $this->geraChaveAdicionalDeContingencia(); |
1046 | 1046 | $this->pdf->setFillColor(0, 0, 0); |
1047 | 1047 | //codigo de barras |
1048 | - $this->pdf->code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2); |
|
1048 | + $this->pdf->code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2); |
|
1049 | 1049 | } else { |
1050 | 1050 | $texto = 'Consulta de autenticidade no portal nacional da NF-e'; |
1051 | - $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1052 | - $y1 = $y+16+$bH; |
|
1051 | + $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1052 | + $y1 = $y + 16 + $bH; |
|
1053 | 1053 | $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora'; |
1054 | 1054 | $this->pdf->textBox( |
1055 | - $x+2, |
|
1055 | + $x + 2, |
|
1056 | 1056 | $y1, |
1057 | - $w-2, |
|
1057 | + $w - 2, |
|
1058 | 1058 | $h, |
1059 | 1059 | $texto, |
1060 | 1060 | $aFont, |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | //natureza da operação |
1071 | 1071 | $texto = 'NATUREZA DA OPERAÇÃO'; |
1072 | 1072 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1073 | - $w = $w1+$w2; |
|
1073 | + $w = $w1 + $w2; |
|
1074 | 1074 | $y = $oldY; |
1075 | 1075 | $oldY += $h; |
1076 | 1076 | $x = $oldX; |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | $cStat = ''; |
1104 | 1104 | } else { |
1105 | 1105 | if (isset($this->nfeProc)) { |
1106 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
1106 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
1107 | 1107 | ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue |
1108 | 1108 | : ''; |
1109 | 1109 | $tsHora = $this->toTimestamp( |
@@ -1145,25 +1145,25 @@ discard block |
||
1145 | 1145 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
1146 | 1146 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1147 | 1147 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1148 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
1148 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
1149 | 1149 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
1150 | 1150 | : ''; |
1151 | 1151 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
1152 | 1152 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1153 | 1153 | //CNPJ |
1154 | 1154 | $x += $w; |
1155 | - $w = ($maxW-(3 * $w)); |
|
1155 | + $w = ($maxW - (3 * $w)); |
|
1156 | 1156 | $texto = 'CNPJ'; |
1157 | 1157 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1158 | 1158 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1159 | 1159 | //Pegando valor do CPF/CNPJ |
1160 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1160 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1161 | 1161 | $texto = $this->formatField( |
1162 | 1162 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1163 | 1163 | "###.###.###/####-##" |
1164 | 1164 | ); |
1165 | 1165 | } else { |
1166 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1166 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1167 | 1167 | ? $this->formatField( |
1168 | 1168 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
1169 | 1169 | "###.###.###-##" |
@@ -1180,22 +1180,22 @@ discard block |
||
1180 | 1180 | $resp = $this->statusNFe(); |
1181 | 1181 | if (!$resp['status']) { |
1182 | 1182 | $x = 10; |
1183 | - $y = $this->hPrint-130; |
|
1183 | + $y = $this->hPrint - 130; |
|
1184 | 1184 | $h = 25; |
1185 | - $w = $maxW-(2*$x); |
|
1185 | + $w = $maxW - (2 * $x); |
|
1186 | 1186 | $this->pdf->settextcolor(90, 90, 90); |
1187 | 1187 | $texto = $resp['message']; |
1188 | 1188 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
1189 | 1189 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1190 | 1190 | $y += $h; |
1191 | 1191 | $h = 5; |
1192 | - $w = $maxW-(2*$x); |
|
1192 | + $w = $maxW - (2 * $x); |
|
1193 | 1193 | if (isset($this->infProt) && $resp['status']) { |
1194 | 1194 | $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue; |
1195 | 1195 | } else { |
1196 | 1196 | $xMotivo = ''; |
1197 | 1197 | } |
1198 | - $texto = "SEM VALOR FISCAL\n".$xMotivo; |
|
1198 | + $texto = "SEM VALOR FISCAL\n" . $xMotivo; |
|
1199 | 1199 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
1200 | 1200 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1201 | 1201 | $this->pdf->settextcolor(0, 0, 0); |
@@ -1203,12 +1203,12 @@ discard block |
||
1203 | 1203 | if ($this->notaDpec() || $this->tpEmis == 4) { |
1204 | 1204 | //DPEC |
1205 | 1205 | $x = 10; |
1206 | - $y = $this->hPrint-130; |
|
1206 | + $y = $this->hPrint - 130; |
|
1207 | 1207 | $h = 25; |
1208 | - $w = $maxW-(2*$x); |
|
1208 | + $w = $maxW - (2 * $x); |
|
1209 | 1209 | $this->pdf->SetTextColor(200, 200, 200); |
1210 | - $texto = "DANFE impresso em contingência -\n". |
|
1211 | - "DPEC regularmente recebido pela Receita\n". |
|
1210 | + $texto = "DANFE impresso em contingência -\n" . |
|
1211 | + "DPEC regularmente recebido pela Receita\n" . |
|
1212 | 1212 | "Federal do Brasil"; |
1213 | 1213 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
1214 | 1214 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
1244 | 1244 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1245 | 1245 | //NOME / RAZÃO SOCIAL |
1246 | - $w = round($maxW*0.61, 0); |
|
1246 | + $w = round($maxW * 0.61, 0); |
|
1247 | 1247 | $w1 = $w; |
1248 | 1248 | $y += 3; |
1249 | 1249 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1258,19 +1258,19 @@ discard block |
||
1258 | 1258 | } |
1259 | 1259 | //CNPJ / CPF |
1260 | 1260 | $x += $w; |
1261 | - $w = round($maxW*0.23, 0); |
|
1261 | + $w = round($maxW * 0.23, 0); |
|
1262 | 1262 | $w2 = $w; |
1263 | 1263 | $texto = 'CNPJ / CPF'; |
1264 | 1264 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1265 | 1265 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1266 | 1266 | //Pegando valor do CPF/CNPJ |
1267 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1267 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1268 | 1268 | $texto = $this->formatField( |
1269 | 1269 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1270 | 1270 | "###.###.###/####-##" |
1271 | 1271 | ); |
1272 | 1272 | } else { |
1273 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1273 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1274 | 1274 | ? $this->formatField( |
1275 | 1275 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
1276 | 1276 | "###.###.###-##" |
@@ -1281,16 +1281,16 @@ discard block |
||
1281 | 1281 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1282 | 1282 | //DATA DA EMISSÃO |
1283 | 1283 | $x += $w; |
1284 | - $w = $maxW-($w1+$w2); |
|
1284 | + $w = $maxW - ($w1 + $w2); |
|
1285 | 1285 | $wx = $w; |
1286 | 1286 | $texto = 'DATA DA EMISSÃO'; |
1287 | 1287 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1288 | 1288 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1289 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
1289 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
1290 | 1290 | ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue |
1291 | 1291 | : ''; |
1292 | 1292 | if ($dEmi == '') { |
1293 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
1293 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
1294 | 1294 | ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue |
1295 | 1295 | : ''; |
1296 | 1296 | $aDemi = explode('T', $dEmi); |
@@ -1304,7 +1304,7 @@ discard block |
||
1304 | 1304 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
1305 | 1305 | } |
1306 | 1306 | //ENDEREÇO |
1307 | - $w = round($maxW*0.47, 0); |
|
1307 | + $w = round($maxW * 0.47, 0); |
|
1308 | 1308 | $w1 = $w; |
1309 | 1309 | $y += $h; |
1310 | 1310 | $x = $oldX; |
@@ -1319,7 +1319,7 @@ discard block |
||
1319 | 1319 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1320 | 1320 | //BAIRRO / DISTRITO |
1321 | 1321 | $x += $w; |
1322 | - $w = round($maxW*0.21, 0); |
|
1322 | + $w = round($maxW * 0.21, 0); |
|
1323 | 1323 | $w2 = $w; |
1324 | 1324 | $texto = 'BAIRRO / DISTRITO'; |
1325 | 1325 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
@@ -1329,12 +1329,12 @@ discard block |
||
1329 | 1329 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1330 | 1330 | //CEP |
1331 | 1331 | $x += $w; |
1332 | - $w = $maxW-$w1-$w2-$wx; |
|
1332 | + $w = $maxW - $w1 - $w2 - $wx; |
|
1333 | 1333 | $w2 = $w; |
1334 | 1334 | $texto = 'CEP'; |
1335 | 1335 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1336 | 1336 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1337 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
1337 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
1338 | 1338 | ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue |
1339 | 1339 | : ''; |
1340 | 1340 | $texto = $this->formatField($texto, "#####-###"); |
@@ -1346,11 +1346,11 @@ discard block |
||
1346 | 1346 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
1347 | 1347 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1348 | 1348 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1349 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
1349 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
1350 | 1350 | ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue |
1351 | 1351 | : ''; |
1352 | 1352 | if ($dSaiEnt == '') { |
1353 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1353 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1354 | 1354 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
1355 | 1355 | : ''; |
1356 | 1356 | $aDsaient = explode('T', $dSaiEnt); |
@@ -1370,7 +1370,7 @@ discard block |
||
1370 | 1370 | if (strtoupper(trim($texto)) == "EXTERIOR" |
1371 | 1371 | && $this->dest->getElementsByTagName("xPais")->length > 0 |
1372 | 1372 | ) { |
1373 | - $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
1373 | + $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
1374 | 1374 | } |
1375 | 1375 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
1376 | 1376 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1385,19 +1385,19 @@ discard block |
||
1385 | 1385 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1386 | 1386 | //FONE / FAX |
1387 | 1387 | $x += $w; |
1388 | - $w = round(($maxW -$w1-$wx-8)/2, 0); |
|
1388 | + $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
|
1389 | 1389 | $w3 = $w; |
1390 | 1390 | $texto = 'FONE / FAX'; |
1391 | 1391 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1392 | 1392 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1393 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
1393 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
1394 | 1394 | ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue |
1395 | 1395 | : ''; |
1396 | 1396 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
1397 | 1397 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1398 | 1398 | //INSCRIÇÃO ESTADUAL |
1399 | 1399 | $x += $w; |
1400 | - $w = $maxW -$w1-$wx-8-$w3; |
|
1400 | + $w = $maxW - $w1 - $wx - 8 - $w3; |
|
1401 | 1401 | $texto = 'INSCRIÇÃO ESTADUAL'; |
1402 | 1402 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1403 | 1403 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1411,11 +1411,11 @@ discard block |
||
1411 | 1411 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
1412 | 1412 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1413 | 1413 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1414 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
1414 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
1415 | 1415 | ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue |
1416 | 1416 | : ''; |
1417 | 1417 | if ($hSaiEnt == '') { |
1418 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1418 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1419 | 1419 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
1420 | 1420 | : ''; |
1421 | 1421 | $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt); |
@@ -1454,7 +1454,7 @@ discard block |
||
1454 | 1454 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
1455 | 1455 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1456 | 1456 | //NOME / RAZÃO SOCIAL |
1457 | - $w = round($maxW*0.61, 0); |
|
1457 | + $w = round($maxW * 0.61, 0); |
|
1458 | 1458 | $w1 = $w; |
1459 | 1459 | $y += 3; |
1460 | 1460 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1472,19 +1472,19 @@ discard block |
||
1472 | 1472 | } |
1473 | 1473 | //CNPJ / CPF |
1474 | 1474 | $x += $w; |
1475 | - $w = round($maxW*0.23, 0); |
|
1475 | + $w = round($maxW * 0.23, 0); |
|
1476 | 1476 | $w2 = $w; |
1477 | 1477 | $texto = 'CNPJ / CPF'; |
1478 | 1478 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1479 | 1479 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1480 | 1480 | //Pegando valor do CPF/CNPJ |
1481 | - if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1481 | + if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1482 | 1482 | $texto = $this->formatField( |
1483 | 1483 | $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1484 | 1484 | "###.###.###/####-##" |
1485 | 1485 | ); |
1486 | 1486 | } else { |
1487 | - $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1487 | + $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1488 | 1488 | $this->formatField( |
1489 | 1489 | $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue, |
1490 | 1490 | "###.###.###-##" |
@@ -1494,7 +1494,7 @@ discard block |
||
1494 | 1494 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1495 | 1495 | //INSCRIÇÃO ESTADUAL |
1496 | 1496 | $x += $w; |
1497 | - $w = $maxW-($w1+$w2); |
|
1497 | + $w = $maxW - ($w1 + $w2); |
|
1498 | 1498 | $wx = $w; |
1499 | 1499 | $texto = 'INSCRIÇÃO ESTADUAL'; |
1500 | 1500 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1510,7 +1510,7 @@ discard block |
||
1510 | 1510 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
1511 | 1511 | } |
1512 | 1512 | //ENDEREÇO |
1513 | - $w = round($maxW*0.355, 0) + $wx; |
|
1513 | + $w = round($maxW * 0.355, 0) + $wx; |
|
1514 | 1514 | $w1 = $w; |
1515 | 1515 | $y += $h; |
1516 | 1516 | $x = $oldX; |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1525 | 1525 | //BAIRRO / DISTRITO |
1526 | 1526 | $x += $w; |
1527 | - $w = round($maxW*0.335, 0); |
|
1527 | + $w = round($maxW * 0.335, 0); |
|
1528 | 1528 | $w2 = $w; |
1529 | 1529 | $texto = 'BAIRRO / DISTRITO'; |
1530 | 1530 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1534,17 +1534,17 @@ discard block |
||
1534 | 1534 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1535 | 1535 | //CEP |
1536 | 1536 | $x += $w; |
1537 | - $w = $maxW-($w1+$w2); |
|
1537 | + $w = $maxW - ($w1 + $w2); |
|
1538 | 1538 | $texto = 'CEP'; |
1539 | 1539 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1540 | 1540 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1541 | - $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1541 | + $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1542 | 1542 | $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
1543 | 1543 | $texto = $this->formatField($texto, "#####-###"); |
1544 | 1544 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1545 | 1545 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1546 | 1546 | //MUNICÍPIO |
1547 | - $w = round($maxW*0.805, 0); |
|
1547 | + $w = round($maxW * 0.805, 0); |
|
1548 | 1548 | $w1 = $w; |
1549 | 1549 | $y += $h; |
1550 | 1550 | $x = $oldX; |
@@ -1553,7 +1553,7 @@ discard block |
||
1553 | 1553 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1554 | 1554 | $texto = $this->entrega->getElementsByTagName("xMun")->item(0)->nodeValue; |
1555 | 1555 | if (strtoupper(trim($texto)) == "EXTERIOR" && $this->entrega->getElementsByTagName("xPais")->length > 0) { |
1556 | - $texto .= " - " . $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
1556 | + $texto .= " - " . $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
1557 | 1557 | } |
1558 | 1558 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1559 | 1559 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1568,11 +1568,11 @@ discard block |
||
1568 | 1568 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1569 | 1569 | //FONE / FAX |
1570 | 1570 | $x += $w; |
1571 | - $w = $maxW-$w-$w1; |
|
1571 | + $w = $maxW - $w - $w1; |
|
1572 | 1572 | $texto = 'FONE / FAX'; |
1573 | 1573 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1574 | 1574 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1575 | - $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1575 | + $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1576 | 1576 | $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
1577 | 1577 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1578 | 1578 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1604,7 +1604,7 @@ discard block |
||
1604 | 1604 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
1605 | 1605 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1606 | 1606 | //NOME / RAZÃO SOCIAL |
1607 | - $w = round($maxW*0.61, 0); |
|
1607 | + $w = round($maxW * 0.61, 0); |
|
1608 | 1608 | $w1 = $w; |
1609 | 1609 | $y += 3; |
1610 | 1610 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1622,19 +1622,19 @@ discard block |
||
1622 | 1622 | } |
1623 | 1623 | //CNPJ / CPF |
1624 | 1624 | $x += $w; |
1625 | - $w = round($maxW*0.23, 0); |
|
1625 | + $w = round($maxW * 0.23, 0); |
|
1626 | 1626 | $w2 = $w; |
1627 | 1627 | $texto = 'CNPJ / CPF'; |
1628 | 1628 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1629 | 1629 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1630 | 1630 | //Pegando valor do CPF/CNPJ |
1631 | - if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1631 | + if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1632 | 1632 | $texto = $this->formatField( |
1633 | 1633 | $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1634 | 1634 | "###.###.###/####-##" |
1635 | 1635 | ); |
1636 | 1636 | } else { |
1637 | - $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1637 | + $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1638 | 1638 | $this->formatField( |
1639 | 1639 | $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue, |
1640 | 1640 | "###.###.###-##" |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1645 | 1645 | //INSCRIÇÃO ESTADUAL |
1646 | 1646 | $x += $w; |
1647 | - $w = $maxW-($w1+$w2); |
|
1647 | + $w = $maxW - ($w1 + $w2); |
|
1648 | 1648 | $wx = $w; |
1649 | 1649 | $texto = 'INSCRIÇÃO ESTADUAL'; |
1650 | 1650 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1660,7 +1660,7 @@ discard block |
||
1660 | 1660 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
1661 | 1661 | } |
1662 | 1662 | //ENDEREÇO |
1663 | - $w = round($maxW*0.355, 0) + $wx; |
|
1663 | + $w = round($maxW * 0.355, 0) + $wx; |
|
1664 | 1664 | $w1 = $w; |
1665 | 1665 | $y += $h; |
1666 | 1666 | $x = $oldX; |
@@ -1674,7 +1674,7 @@ discard block |
||
1674 | 1674 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1675 | 1675 | //BAIRRO / DISTRITO |
1676 | 1676 | $x += $w; |
1677 | - $w = round($maxW*0.335, 0); |
|
1677 | + $w = round($maxW * 0.335, 0); |
|
1678 | 1678 | $w2 = $w; |
1679 | 1679 | $texto = 'BAIRRO / DISTRITO'; |
1680 | 1680 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1684,17 +1684,17 @@ discard block |
||
1684 | 1684 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1685 | 1685 | //CEP |
1686 | 1686 | $x += $w; |
1687 | - $w = $maxW-($w1+$w2); |
|
1687 | + $w = $maxW - ($w1 + $w2); |
|
1688 | 1688 | $texto = 'CEP'; |
1689 | 1689 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1690 | 1690 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1691 | - $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1691 | + $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1692 | 1692 | $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
1693 | 1693 | $texto = $this->formatField($texto, "#####-###"); |
1694 | 1694 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1695 | 1695 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1696 | 1696 | //MUNICÍPIO |
1697 | - $w = round($maxW*0.805, 0); |
|
1697 | + $w = round($maxW * 0.805, 0); |
|
1698 | 1698 | $w1 = $w; |
1699 | 1699 | $y += $h; |
1700 | 1700 | $x = $oldX; |
@@ -1703,7 +1703,7 @@ discard block |
||
1703 | 1703 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1704 | 1704 | $texto = $this->retirada->getElementsByTagName("xMun")->item(0)->nodeValue; |
1705 | 1705 | if (strtoupper(trim($texto)) == "EXTERIOR" && $this->retirada->getElementsByTagName("xPais")->length > 0) { |
1706 | - $texto .= " - " . $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
1706 | + $texto .= " - " . $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
1707 | 1707 | } |
1708 | 1708 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1709 | 1709 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1718,11 +1718,11 @@ discard block |
||
1718 | 1718 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1719 | 1719 | //FONE / FAX |
1720 | 1720 | $x += $w; |
1721 | - $w = $maxW-$w-$w1; |
|
1721 | + $w = $maxW - $w - $w1; |
|
1722 | 1722 | $texto = 'FONE / FAX'; |
1723 | 1723 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1724 | 1724 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1725 | - $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1725 | + $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1726 | 1726 | $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
1727 | 1727 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1728 | 1728 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1795,7 +1795,7 @@ discard block |
||
1795 | 1795 | protected function fatura($x, $y) |
1796 | 1796 | { |
1797 | 1797 | $linha = 1; |
1798 | - $h = 8+3; |
|
1798 | + $h = 8 + 3; |
|
1799 | 1799 | $oldx = $x; |
1800 | 1800 | $textoFatura = $this->getTextoFatura(); |
1801 | 1801 | //verificar se existem duplicatas |
@@ -1828,29 +1828,29 @@ discard block |
||
1828 | 1828 | return ($y + $h - 3); |
1829 | 1829 | } |
1830 | 1830 | if ($textoFatura !== "" && $this->exibirTextoFatura) { |
1831 | - $myH=6; |
|
1831 | + $myH = 6; |
|
1832 | 1832 | $myW = $this->wPrint; |
1833 | 1833 | if ($this->orientacao == 'L') { |
1834 | 1834 | $myW -= $this->wCanhoto; |
1835 | 1835 | } |
1836 | 1836 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
1837 | 1837 | $this->pdf->textBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, ''); |
1838 | - $y+=$myH+1; |
|
1838 | + $y += $myH + 1; |
|
1839 | 1839 | } |
1840 | 1840 | if ($this->orientacao == 'P') { |
1841 | - $w = round($this->wPrint/7.018, 0)-1; |
|
1841 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
1842 | 1842 | } else { |
1843 | 1843 | $w = 28; |
1844 | 1844 | } |
1845 | 1845 | $increm = 1; |
1846 | 1846 | foreach ($this->dup as $k => $d) { |
1847 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
1847 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
1848 | 1848 | ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue |
1849 | 1849 | : ''; |
1850 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
1850 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
1851 | 1851 | ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
1852 | 1852 | : ''; |
1853 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
1853 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
1854 | 1854 | ? 'R$ ' . number_format( |
1855 | 1855 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
1856 | 1856 | 2, |
@@ -1860,14 +1860,14 @@ discard block |
||
1860 | 1860 | : ''; |
1861 | 1861 | $h = 8; |
1862 | 1862 | $texto = ''; |
1863 | - if ($nDup!='0' && $nDup!='') { |
|
1863 | + if ($nDup != '0' && $nDup != '') { |
|
1864 | 1864 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1865 | 1865 | $this->pdf->textBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, ''); |
1866 | 1866 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
1867 | 1867 | $this->pdf->textBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, ''); |
1868 | 1868 | } else { |
1869 | 1869 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1870 | - $this->pdf->textBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, ''); |
|
1870 | + $this->pdf->textBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, ''); |
|
1871 | 1871 | } |
1872 | 1872 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1873 | 1873 | $this->pdf->textBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, ''); |
@@ -1877,7 +1877,7 @@ discard block |
||
1877 | 1877 | $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
1878 | 1878 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
1879 | 1879 | $this->pdf->textBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, ''); |
1880 | - $x += $w+$increm; |
|
1880 | + $x += $w + $increm; |
|
1881 | 1881 | $dupcont += 1; |
1882 | 1882 | if ($this->orientacao == 'P') { |
1883 | 1883 | $maxDupCont = 6; |
@@ -1899,10 +1899,10 @@ discard block |
||
1899 | 1899 | $y -= 9; |
1900 | 1900 | $linha--; |
1901 | 1901 | } |
1902 | - return ($y+$h); |
|
1902 | + return ($y + $h); |
|
1903 | 1903 | } else { |
1904 | 1904 | $linha = 0; |
1905 | - return ($y-2); |
|
1905 | + return ($y - 2); |
|
1906 | 1906 | } |
1907 | 1907 | } |
1908 | 1908 | |
@@ -1918,13 +1918,13 @@ discard block |
||
1918 | 1918 | protected function pagamento($x, $y) |
1919 | 1919 | { |
1920 | 1920 | $linha = 1; |
1921 | - $h = 8+3; |
|
1921 | + $h = 8 + 3; |
|
1922 | 1922 | $oldx = $x; |
1923 | 1923 | //verificar se existem cobranças definidas |
1924 | 1924 | if (isset($this->detPag) && $this->detPag->length > 0) { |
1925 | 1925 | //##################################################################### |
1926 | 1926 | //Tipo de pagamento |
1927 | - $texto = "PAGAMENTO"; |
|
1927 | + $texto = "PAGAMENTO"; |
|
1928 | 1928 | if ($this->orientacao == 'P') { |
1929 | 1929 | $w = $this->wPrint; |
1930 | 1930 | } else { |
@@ -1937,7 +1937,7 @@ discard block |
||
1937 | 1937 | $dups = ""; |
1938 | 1938 | $dupcont = 0; |
1939 | 1939 | if ($this->orientacao == 'P') { |
1940 | - $w = round($this->wPrint/7.018, 0)-1; |
|
1940 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
1941 | 1941 | } else { |
1942 | 1942 | $w = 28; |
1943 | 1943 | } |
@@ -1947,17 +1947,17 @@ discard block |
||
1947 | 1947 | $maxDupCont = 8; |
1948 | 1948 | } |
1949 | 1949 | $increm = 1; |
1950 | - $formaPagamento = ['01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito', |
|
1951 | - '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação', |
|
1952 | - '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
|
1953 | - '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros']; |
|
1954 | - $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
|
1955 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros']; |
|
1950 | + $formaPagamento = ['01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito', |
|
1951 | + '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação', |
|
1952 | + '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível', |
|
1953 | + '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros']; |
|
1954 | + $bandeira = ['01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners', |
|
1955 | + '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros']; |
|
1956 | 1956 | foreach ($this->detPag as $k => $d) { |
1957 | 1957 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
1958 | 1958 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue |
1959 | 1959 | : '0'; |
1960 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
1960 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
1961 | 1961 | ? 'R$ ' . number_format( |
1962 | 1962 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
1963 | 1963 | 2, |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | $texto = ''; |
1970 | 1970 | if (isset($formaPagamento[$fPag])) { |
1971 | 1971 | /*Exibir Item sem pagamento*/ |
1972 | - if ($fPag=='90') { |
|
1972 | + if ($fPag == '90') { |
|
1973 | 1973 | continue; |
1974 | 1974 | } |
1975 | 1975 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
@@ -1978,16 +1978,16 @@ discard block |
||
1978 | 1978 | $this->pdf->textBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, ''); |
1979 | 1979 | } else { |
1980 | 1980 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
1981 | - $this->pdf->textBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, ''); |
|
1981 | + $this->pdf->textBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, ''); |
|
1982 | 1982 | } |
1983 | 1983 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
1984 | 1984 | $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
1985 | 1985 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
1986 | 1986 | $this->pdf->textBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, ''); |
1987 | - $x += $w+$increm; |
|
1987 | + $x += $w + $increm; |
|
1988 | 1988 | $dupcont += 1; |
1989 | 1989 | |
1990 | - if ($dupcont>$maxDupCont) { |
|
1990 | + if ($dupcont > $maxDupCont) { |
|
1991 | 1991 | $y += 9; |
1992 | 1992 | $x = $oldx; |
1993 | 1993 | $dupcont = 0; |
@@ -2002,10 +2002,10 @@ discard block |
||
2002 | 2002 | $y -= 9; |
2003 | 2003 | $linha--; |
2004 | 2004 | } |
2005 | - return ($y+$h); |
|
2005 | + return ($y + $h); |
|
2006 | 2006 | } else { |
2007 | 2007 | $linha = 0; |
2008 | - return ($y-2); |
|
2008 | + return ($y - 2); |
|
2009 | 2009 | } |
2010 | 2010 | } //fim da função pagamento |
2011 | 2011 | |
@@ -2114,7 +2114,7 @@ discard block |
||
2114 | 2114 | } |
2115 | 2115 | $x = $this->impostoHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF"); |
2116 | 2116 | |
2117 | - return ($y+$h); |
|
2117 | + return ($y + $h); |
|
2118 | 2118 | } //fim imposto |
2119 | 2119 | |
2120 | 2120 | /** |
@@ -2142,13 +2142,13 @@ discard block |
||
2142 | 2142 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
2143 | 2143 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2144 | 2144 | //NOME / RAZÃO SOCIAL |
2145 | - $w1 = $maxW*0.29; |
|
2145 | + $w1 = $maxW * 0.29; |
|
2146 | 2146 | $y += 3; |
2147 | 2147 | $texto = 'NOME / RAZÃO SOCIAL'; |
2148 | 2148 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2149 | 2149 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2150 | 2150 | if (isset($this->transporta)) { |
2151 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
2151 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
2152 | 2152 | ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue |
2153 | 2153 | : ''; |
2154 | 2154 | } else { |
@@ -2158,11 +2158,11 @@ discard block |
||
2158 | 2158 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
2159 | 2159 | //FRETE POR CONTA |
2160 | 2160 | $x += $w1; |
2161 | - $w2 = $maxW*0.15; |
|
2161 | + $w2 = $maxW * 0.15; |
|
2162 | 2162 | $texto = 'FRETE'; |
2163 | 2163 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2164 | 2164 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2165 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
2165 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
2166 | 2166 | ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue |
2167 | 2167 | : '0'; |
2168 | 2168 | switch ($tipoFrete) { |
@@ -2193,7 +2193,7 @@ discard block |
||
2193 | 2193 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2194 | 2194 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2195 | 2195 | if (isset($this->veicTransp)) { |
2196 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
2196 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
2197 | 2197 | ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue |
2198 | 2198 | : ''; |
2199 | 2199 | } else { |
@@ -2207,11 +2207,11 @@ discard block |
||
2207 | 2207 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2208 | 2208 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2209 | 2209 | if (isset($this->veicTransp)) { |
2210 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2210 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2211 | 2211 | ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue |
2212 | 2212 | : ''; |
2213 | 2213 | } elseif (isset($this->reboque)) { |
2214 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2214 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2215 | 2215 | ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue |
2216 | 2216 | : ''; |
2217 | 2217 | } else { |
@@ -2221,16 +2221,16 @@ discard block |
||
2221 | 2221 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2222 | 2222 | //UF |
2223 | 2223 | $x += $w2; |
2224 | - $w3 = round($maxW*0.04, 0); |
|
2224 | + $w3 = round($maxW * 0.04, 0); |
|
2225 | 2225 | $texto = 'UF'; |
2226 | 2226 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2227 | 2227 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2228 | 2228 | if (isset($this->veicTransp)) { |
2229 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2229 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2230 | 2230 | ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue |
2231 | 2231 | : ''; |
2232 | 2232 | } elseif (isset($this->reboque)) { |
2233 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2233 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2234 | 2234 | ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue |
2235 | 2235 | : ''; |
2236 | 2236 | } else { |
@@ -2240,19 +2240,19 @@ discard block |
||
2240 | 2240 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2241 | 2241 | //CNPJ / CPF |
2242 | 2242 | $x += $w3; |
2243 | - $w = $maxW-($w1+3*$w2+$w3); |
|
2243 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
2244 | 2244 | $texto = 'CNPJ / CPF'; |
2245 | 2245 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2246 | 2246 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2247 | 2247 | if (isset($this->transporta)) { |
2248 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
2248 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
2249 | 2249 | ? $this->formatField( |
2250 | 2250 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
2251 | 2251 | "##.###.###/####-##" |
2252 | 2252 | ) |
2253 | 2253 | : ''; |
2254 | 2254 | if ($texto == '') { |
2255 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
2255 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
2256 | 2256 | ? $this->formatField( |
2257 | 2257 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
2258 | 2258 | "###.###.###-##" |
@@ -2269,12 +2269,12 @@ discard block |
||
2269 | 2269 | $y += $h; |
2270 | 2270 | $x = $oldX; |
2271 | 2271 | $h = 7; |
2272 | - $w1 = $maxW*0.44; |
|
2272 | + $w1 = $maxW * 0.44; |
|
2273 | 2273 | $texto = 'ENDEREÇO'; |
2274 | 2274 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2275 | 2275 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2276 | 2276 | if (isset($this->transporta)) { |
2277 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
2277 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
2278 | 2278 | ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue |
2279 | 2279 | : ''; |
2280 | 2280 | } else { |
@@ -2284,12 +2284,12 @@ discard block |
||
2284 | 2284 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
2285 | 2285 | //MUNICÍPIO |
2286 | 2286 | $x += $w1; |
2287 | - $w2 = round($maxW*0.30, 0); |
|
2287 | + $w2 = round($maxW * 0.30, 0); |
|
2288 | 2288 | $texto = 'MUNICÍPIO'; |
2289 | 2289 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2290 | 2290 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2291 | 2291 | if (isset($this->transporta)) { |
2292 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
2292 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
2293 | 2293 | ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue |
2294 | 2294 | : ''; |
2295 | 2295 | } else { |
@@ -2299,12 +2299,12 @@ discard block |
||
2299 | 2299 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2300 | 2300 | //UF |
2301 | 2301 | $x += $w2; |
2302 | - $w3 = round($maxW*0.04, 0); |
|
2302 | + $w3 = round($maxW * 0.04, 0); |
|
2303 | 2303 | $texto = 'UF'; |
2304 | 2304 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2305 | 2305 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2306 | 2306 | if (isset($this->transporta)) { |
2307 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2307 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2308 | 2308 | ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue |
2309 | 2309 | : ''; |
2310 | 2310 | } else { |
@@ -2314,13 +2314,13 @@ discard block |
||
2314 | 2314 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2315 | 2315 | //INSCRIÇÃO ESTADUAL |
2316 | 2316 | $x += $w3; |
2317 | - $w = $maxW-($w1+$w2+$w3); |
|
2317 | + $w = $maxW - ($w1 + $w2 + $w3); |
|
2318 | 2318 | $texto = 'INSCRIÇÃO ESTADUAL'; |
2319 | 2319 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2320 | 2320 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2321 | 2321 | $texto = ''; |
2322 | 2322 | if (isset($this->transporta)) { |
2323 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
2323 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
2324 | 2324 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
2325 | 2325 | } |
2326 | 2326 | } |
@@ -2333,16 +2333,16 @@ discard block |
||
2333 | 2333 | $marca = ''; |
2334 | 2334 | $numero = ''; |
2335 | 2335 | $texto = ''; |
2336 | - $pesoBruto=0; |
|
2337 | - $pesoLiquido=0; |
|
2336 | + $pesoBruto = 0; |
|
2337 | + $pesoLiquido = 0; |
|
2338 | 2338 | foreach ($volumes as $volume) { |
2339 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
2339 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
2340 | 2340 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
2341 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
2341 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
2342 | 2342 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
2343 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
2343 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
2344 | 2344 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
2345 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
2345 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
2346 | 2346 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
2347 | 2347 | if ($texto != $especie && $especie != '') { |
2348 | 2348 | //tem várias especies |
@@ -2350,7 +2350,7 @@ discard block |
||
2350 | 2350 | } else { |
2351 | 2351 | $especie = $texto; |
2352 | 2352 | } |
2353 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
2353 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
2354 | 2354 | ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue |
2355 | 2355 | : ''; |
2356 | 2356 | if ($texto != $marca && $marca != '') { |
@@ -2359,7 +2359,7 @@ discard block |
||
2359 | 2359 | } else { |
2360 | 2360 | $marca = $texto; |
2361 | 2361 | } |
2362 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
2362 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
2363 | 2363 | ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue |
2364 | 2364 | : ''; |
2365 | 2365 | if ($texto != $numero && $numero != '') { |
@@ -2375,7 +2375,7 @@ discard block |
||
2375 | 2375 | $y += $h; |
2376 | 2376 | $x = $oldX; |
2377 | 2377 | $h = 7; |
2378 | - $w1 = round($maxW*0.10, 0); |
|
2378 | + $w1 = round($maxW * 0.10, 0); |
|
2379 | 2379 | $texto = 'QUANTIDADE'; |
2380 | 2380 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2381 | 2381 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2386,7 +2386,7 @@ discard block |
||
2386 | 2386 | } |
2387 | 2387 | //ESPÉCIE |
2388 | 2388 | $x += $w1; |
2389 | - $w2 = round($maxW*0.17, 0); |
|
2389 | + $w2 = round($maxW * 0.17, 0); |
|
2390 | 2390 | $texto = 'ESPÉCIE'; |
2391 | 2391 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2392 | 2392 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2398,7 +2398,7 @@ discard block |
||
2398 | 2398 | $texto = 'MARCA'; |
2399 | 2399 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2400 | 2400 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2401 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2401 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2402 | 2402 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
2403 | 2403 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
2404 | 2404 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -2412,7 +2412,7 @@ discard block |
||
2412 | 2412 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2413 | 2413 | //PESO BRUTO |
2414 | 2414 | $x += $w2; |
2415 | - $w3 = round($maxW*0.20, 0); |
|
2415 | + $w3 = round($maxW * 0.20, 0); |
|
2416 | 2416 | $texto = 'PESO BRUTO'; |
2417 | 2417 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2418 | 2418 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2425,7 +2425,7 @@ discard block |
||
2425 | 2425 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
2426 | 2426 | //PESO LÍQUIDO |
2427 | 2427 | $x += $w3; |
2428 | - $w = $maxW -($w1+3*$w2+$w3); |
|
2428 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
2429 | 2429 | $texto = 'PESO LÍQUIDO'; |
2430 | 2430 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2431 | 2431 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2436,7 +2436,7 @@ discard block |
||
2436 | 2436 | } |
2437 | 2437 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
2438 | 2438 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
2439 | - return ($y+$h); |
|
2439 | + return ($y + $h); |
|
2440 | 2440 | } //fim transporte |
2441 | 2441 | |
2442 | 2442 | |
@@ -2448,7 +2448,7 @@ discard block |
||
2448 | 2448 | return ""; |
2449 | 2449 | } |
2450 | 2450 | $valor_original = $valor_original->nodeValue; |
2451 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
2451 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
2452 | 2452 | |
2453 | 2453 | if ($valor != "") { |
2454 | 2454 | return sprintf($formato, $valor); |
@@ -2495,18 +2495,18 @@ discard block |
||
2495 | 2495 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
2496 | 2496 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
2497 | 2497 | } |
2498 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
2498 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
2499 | 2499 | ? substr( |
2500 | 2500 | $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), |
2501 | 2501 | 0, |
2502 | 2502 | 500 |
2503 | 2503 | ) |
2504 | 2504 | : ''; |
2505 | - if (! empty($infAdProd)) { |
|
2505 | + if (!empty($infAdProd)) { |
|
2506 | 2506 | $infAdProd = trim($infAdProd); |
2507 | 2507 | $infAdProd .= ' '; |
2508 | 2508 | } |
2509 | - $loteTxt =''; |
|
2509 | + $loteTxt = ''; |
|
2510 | 2510 | $rastro = $prod->getElementsByTagName("med"); |
2511 | 2511 | if (!empty($prod->getElementsByTagName("rastro"))) { |
2512 | 2512 | $rastro = $prod->getElementsByTagName("rastro"); |
@@ -2520,15 +2520,15 @@ discard block |
||
2520 | 2520 | $i++; |
2521 | 2521 | } |
2522 | 2522 | if ($loteTxt != '') { |
2523 | - $loteTxt.= ' '; |
|
2523 | + $loteTxt .= ' '; |
|
2524 | 2524 | } |
2525 | 2525 | } |
2526 | 2526 | //NT2013.006 FCI |
2527 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
2528 | - ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
2529 | - $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
2527 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
2528 | + ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
2529 | + $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
2530 | 2530 | $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue |
2531 | - . (strlen($tmp_ad)!=0?"\n ".$tmp_ad:''); |
|
2531 | + . (strlen($tmp_ad) != 0 ? "\n " . $tmp_ad : ''); |
|
2532 | 2532 | //decodifica os caracteres html no xml |
2533 | 2533 | $texto = html_entity_decode($texto); |
2534 | 2534 | if ($this->descProdQuebraLinha) { |
@@ -2579,111 +2579,111 @@ discard block |
||
2579 | 2579 | // cabecalho LOOP COM OS DADOS DOS PRODUTOS |
2580 | 2580 | //CÓDIGO PRODUTO |
2581 | 2581 | $texto = "CÓDIGO PRODUTO"; |
2582 | - $w1 = round($w*0.09, 0); |
|
2582 | + $w1 = round($w * 0.09, 0); |
|
2583 | 2583 | $h = 4; |
2584 | 2584 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2585 | 2585 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2586 | - $this->pdf->line($x+$w1, $y, $x+$w1, $y+$hmax); |
|
2586 | + $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax); |
|
2587 | 2587 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
2588 | 2588 | $x += $w1; |
2589 | - $w2 = round($w*0.25, 0); |
|
2589 | + $w2 = round($w * 0.25, 0); |
|
2590 | 2590 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
2591 | 2591 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2592 | 2592 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2593 | - $this->pdf->line($x+$w2, $y, $x+$w2, $y+$hmax); |
|
2593 | + $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax); |
|
2594 | 2594 | //NCM/SH |
2595 | 2595 | $x += $w2; |
2596 | - $w3 = round($w*0.06, 0); |
|
2596 | + $w3 = round($w * 0.06, 0); |
|
2597 | 2597 | $texto = 'NCM/SH'; |
2598 | 2598 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2599 | 2599 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2600 | - $this->pdf->line($x+$w3, $y, $x+$w3, $y+$hmax); |
|
2600 | + $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax); |
|
2601 | 2601 | //O/CST ou O/CSOSN |
2602 | 2602 | $x += $w3; |
2603 | - $w4 = round($w*0.05, 0); |
|
2604 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
|
2603 | + $w4 = round($w * 0.05, 0); |
|
2604 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2 |
|
2605 | 2605 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
2606 | - $texto = 'O/CST';//Regime Normal |
|
2606 | + $texto = 'O/CST'; //Regime Normal |
|
2607 | 2607 | } |
2608 | 2608 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2609 | 2609 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2610 | - $this->pdf->line($x+$w4, $y, $x+$w4, $y+$hmax); |
|
2610 | + $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax); |
|
2611 | 2611 | //CFOP |
2612 | 2612 | $x += $w4; |
2613 | - $w5 = round($w*0.04, 0); |
|
2613 | + $w5 = round($w * 0.04, 0); |
|
2614 | 2614 | $texto = 'CFOP'; |
2615 | 2615 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2616 | 2616 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2617 | - $this->pdf->line($x+$w5, $y, $x+$w5, $y+$hmax); |
|
2617 | + $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax); |
|
2618 | 2618 | //UN |
2619 | 2619 | $x += $w5; |
2620 | - $w6 = round($w*0.03, 0); |
|
2620 | + $w6 = round($w * 0.03, 0); |
|
2621 | 2621 | $texto = 'UN'; |
2622 | 2622 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2623 | 2623 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2624 | - $this->pdf->line($x+$w6, $y, $x+$w6, $y+$hmax); |
|
2624 | + $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax); |
|
2625 | 2625 | //QUANT |
2626 | 2626 | $x += $w6; |
2627 | - $w7 = round($w*0.08, 0); |
|
2627 | + $w7 = round($w * 0.08, 0); |
|
2628 | 2628 | $texto = 'QUANT'; |
2629 | 2629 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2630 | 2630 | $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2631 | - $this->pdf->line($x+$w7, $y, $x+$w7, $y+$hmax); |
|
2631 | + $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax); |
|
2632 | 2632 | //VALOR UNIT |
2633 | 2633 | $x += $w7; |
2634 | - $w8 = round($w*0.06, 0); |
|
2634 | + $w8 = round($w * 0.06, 0); |
|
2635 | 2635 | $texto = 'VALOR UNIT'; |
2636 | 2636 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2637 | 2637 | $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2638 | - $this->pdf->line($x+$w8, $y, $x+$w8, $y+$hmax); |
|
2638 | + $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax); |
|
2639 | 2639 | //VALOR TOTAL |
2640 | 2640 | $x += $w8; |
2641 | - $w9 = round($w*0.06, 0); |
|
2641 | + $w9 = round($w * 0.06, 0); |
|
2642 | 2642 | $texto = 'VALOR TOTAL'; |
2643 | 2643 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2644 | 2644 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2645 | - $this->pdf->line($x+$w9, $y, $x+$w9, $y+$hmax); |
|
2645 | + $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax); |
|
2646 | 2646 | //VALOR DESCONTO |
2647 | 2647 | $x += $w9; |
2648 | - $w10 = round($w*0.05, 0); |
|
2648 | + $w10 = round($w * 0.05, 0); |
|
2649 | 2649 | $texto = 'VALOR DESC'; |
2650 | 2650 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2651 | 2651 | $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2652 | - $this->pdf->line($x+$w10, $y, $x+$w10, $y+$hmax); |
|
2652 | + $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax); |
|
2653 | 2653 | //B.CÁLC ICMS |
2654 | 2654 | $x += $w10; |
2655 | - $w11 = round($w*0.06, 0); |
|
2655 | + $w11 = round($w * 0.06, 0); |
|
2656 | 2656 | $texto = 'B.CÁLC ICMS'; |
2657 | 2657 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2658 | 2658 | $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2659 | - $this->pdf->line($x+$w11, $y, $x+$w11, $y+$hmax); |
|
2659 | + $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax); |
|
2660 | 2660 | //VALOR ICMS |
2661 | 2661 | $x += $w11; |
2662 | - $w12 = round($w*0.06, 0); |
|
2662 | + $w12 = round($w * 0.06, 0); |
|
2663 | 2663 | $texto = 'VALOR ICMS'; |
2664 | 2664 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2665 | 2665 | $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2666 | - $this->pdf->line($x+$w12, $y, $x+$w12, $y+$hmax); |
|
2666 | + $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax); |
|
2667 | 2667 | //VALOR IPI |
2668 | 2668 | $x += $w12; |
2669 | - $w13 = round($w*0.05, 0); |
|
2669 | + $w13 = round($w * 0.05, 0); |
|
2670 | 2670 | $texto = 'VALOR IPI'; |
2671 | 2671 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2672 | 2672 | $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2673 | - $this->pdf->line($x+$w13, $y, $x+$w13, $y+$hmax); |
|
2673 | + $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax); |
|
2674 | 2674 | //ALÍQ. ICMS |
2675 | 2675 | $x += $w13; |
2676 | - $w14 = round($w*0.04, 0); |
|
2676 | + $w14 = round($w * 0.04, 0); |
|
2677 | 2677 | $texto = 'ALÍQ. ICMS'; |
2678 | 2678 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
2679 | 2679 | $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2680 | - $this->pdf->line($x+$w14, $y, $x+$w14, $y+$hmax); |
|
2680 | + $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax); |
|
2681 | 2681 | //ALÍQ. IPI |
2682 | 2682 | $x += $w14; |
2683 | - $w15 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13+$w14); |
|
2683 | + $w15 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14); |
|
2684 | 2684 | $texto = 'ALÍQ. IPI'; |
2685 | 2685 | $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2686 | - $this->pdf->line($oldX, $y+$h+1, $oldX + $w, $y+$h+1); |
|
2686 | + $this->pdf->line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1); |
|
2687 | 2687 | $y += 5; |
2688 | 2688 | //################################################################################## |
2689 | 2689 | // LOOP COM OS DADOS DOS PRODUTOS |
@@ -2722,11 +2722,11 @@ discard block |
||
2722 | 2722 | break; |
2723 | 2723 | } |
2724 | 2724 | } |
2725 | - $y_linha=$y+$h; |
|
2725 | + $y_linha = $y + $h; |
|
2726 | 2726 | // linha entre itens |
2727 | 2727 | $this->pdf->dashedHLine($oldX, $y_linha, $w, 0.1, 120); |
2728 | 2728 | //corrige o x |
2729 | - $x=$oldX; |
|
2729 | + $x = $oldX; |
|
2730 | 2730 | //codigo do produto |
2731 | 2731 | $guup = $i + 1; |
2732 | 2732 | $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue; |
@@ -2740,16 +2740,16 @@ discard block |
||
2740 | 2740 | } |
2741 | 2741 | $x += $w2; |
2742 | 2742 | //NCM |
2743 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
2743 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
2744 | 2744 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
2745 | 2745 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2746 | 2746 | $x += $w3; |
2747 | 2747 | //CST |
2748 | 2748 | if (isset($ICMS)) { |
2749 | - $origem = $this->getTagValue($ICMS, "orig"); |
|
2750 | - $cst = $this->getTagValue($ICMS, "CST"); |
|
2751 | - $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
2752 | - $texto = $origem.$cst.$csosn; |
|
2749 | + $origem = $this->getTagValue($ICMS, "orig"); |
|
2750 | + $cst = $this->getTagValue($ICMS, "CST"); |
|
2751 | + $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
2752 | + $texto = $origem . $cst . $csosn; |
|
2753 | 2753 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2754 | 2754 | } |
2755 | 2755 | //CFOP |
@@ -2816,7 +2816,7 @@ discard block |
||
2816 | 2816 | //Valor da Base de calculo |
2817 | 2817 | $x += $w10; |
2818 | 2818 | if (isset($ICMS)) { |
2819 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
2819 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
2820 | 2820 | ? number_format( |
2821 | 2821 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
2822 | 2822 | 2, |
@@ -2829,7 +2829,7 @@ discard block |
||
2829 | 2829 | //Valor do ICMS |
2830 | 2830 | $x += $w11; |
2831 | 2831 | if (isset($ICMS)) { |
2832 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
2832 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
2833 | 2833 | ? number_format( |
2834 | 2834 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
2835 | 2835 | 2, |
@@ -2842,7 +2842,7 @@ discard block |
||
2842 | 2842 | //Valor do IPI |
2843 | 2843 | $x += $w12; |
2844 | 2844 | if (isset($IPI)) { |
2845 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
2845 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
2846 | 2846 | ? number_format( |
2847 | 2847 | $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, |
2848 | 2848 | 2, |
@@ -2857,7 +2857,7 @@ discard block |
||
2857 | 2857 | // %ICMS |
2858 | 2858 | $x += $w13; |
2859 | 2859 | if (isset($ICMS)) { |
2860 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
2860 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
2861 | 2861 | ? number_format( |
2862 | 2862 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
2863 | 2863 | 2, |
@@ -2870,7 +2870,7 @@ discard block |
||
2870 | 2870 | //%IPI |
2871 | 2871 | $x += $w14; |
2872 | 2872 | if (isset($IPI)) { |
2873 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
2873 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
2874 | 2874 | ? number_format( |
2875 | 2875 | $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, |
2876 | 2876 | 2, |
@@ -2901,7 +2901,7 @@ discard block |
||
2901 | 2901 | $i++; |
2902 | 2902 | } |
2903 | 2903 | } |
2904 | - return $oldY+$hmax; |
|
2904 | + return $oldY + $hmax; |
|
2905 | 2905 | } |
2906 | 2906 | |
2907 | 2907 | |
@@ -2935,7 +2935,7 @@ discard block |
||
2935 | 2935 | |
2936 | 2936 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
2937 | 2937 | |
2938 | - $w1 = round($w*0.09, 0); |
|
2938 | + $w1 = round($w * 0.09, 0); |
|
2939 | 2939 | |
2940 | 2940 | // Tabela Renavam Combustivel |
2941 | 2941 | $renavamCombustivel = [ |
@@ -3030,54 +3030,54 @@ discard block |
||
3030 | 3030 | |
3031 | 3031 | $yVeic = $y + $h; |
3032 | 3032 | $texto = 'Chassi: ............: ' . $veiculoChassi; |
3033 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3033 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3034 | 3034 | $yVeic += $h; |
3035 | 3035 | $texto = 'Cor...................: ' . $veiculoCor; |
3036 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3036 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3037 | 3037 | $yVeic += $h; |
3038 | 3038 | $texto = 'Cilindrada........: ' . $veiculoCilindrada; |
3039 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3039 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3040 | 3040 | $yVeic += $h; |
3041 | 3041 | $texto = 'Cmkg...............: ' . $veiculoCmkg; |
3042 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3042 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3043 | 3043 | $yVeic += $h; |
3044 | 3044 | $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo); |
3045 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3045 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3046 | 3046 | $yVeic = $y + $h; |
3047 | 3047 | $xVeic = $x + 65; |
3048 | 3048 | $texto = 'Nº Motor: .........: ' . $veiculoMotor; |
3049 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3049 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3050 | 3050 | $yVeic += $h; |
3051 | 3051 | $texto = 'Renavam...........: ' . $veiculoRenavam; |
3052 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3052 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3053 | 3053 | $yVeic += $h; |
3054 | 3054 | $texto = 'HP.....................: ' . $veiculoHp; |
3055 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3055 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3056 | 3056 | $yVeic += $h; |
3057 | 3057 | $texto = 'Placa.................: ' . $veiculoPlaca; |
3058 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3058 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3059 | 3059 | $yVeic += $h; |
3060 | 3060 | $texto = 'Tipo Pintura......: ' . ($renavamEspecie[intval($veiculoTipoPintura)] ?? $veiculoTipoPintura); |
3061 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3061 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3062 | 3062 | $yVeic = $y + $h; |
3063 | 3063 | $xVeic = $xVeic + 55; |
3064 | 3064 | $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo; |
3065 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3065 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3066 | 3066 | $yVeic += $h; |
3067 | 3067 | $texto = 'Especie..................: ' . ($renavamEspecie[intval($veiculoEspecie)] ?? $veiculoEspecie); |
3068 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3068 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3069 | 3069 | $yVeic += $h; |
3070 | 3070 | $texto = 'Combustivel..........: ' . ($renavamCombustivel[intval($veiculoCombustivel)] ?? $veiculoCombustivel); |
3071 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3071 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3072 | 3072 | $yVeic += $h; |
3073 | 3073 | $texto = 'Serial.....................: ' . $veiculoSerial; |
3074 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3074 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3075 | 3075 | $yVeic += $h; |
3076 | - $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo; |
|
3077 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3076 | + $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo; |
|
3077 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3078 | 3078 | $yVeic += $h; |
3079 | - $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia; |
|
3080 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3079 | + $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia; |
|
3080 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3081 | 3081 | } |
3082 | 3082 | |
3083 | 3083 | /** |
@@ -3101,12 +3101,12 @@ discard block |
||
3101 | 3101 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
3102 | 3102 | //INSCRIÇÃO MUNICIPAL |
3103 | 3103 | $y += 3; |
3104 | - $w = round($this->wPrint*0.23, 0); |
|
3104 | + $w = round($this->wPrint * 0.23, 0); |
|
3105 | 3105 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
3106 | 3106 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
3107 | 3107 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3108 | 3108 | //inscrição municipal |
3109 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
3109 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
3110 | 3110 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
3111 | 3111 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
3112 | 3112 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -3116,7 +3116,7 @@ discard block |
||
3116 | 3116 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
3117 | 3117 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3118 | 3118 | if (isset($this->ISSQNtot)) { |
3119 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
3119 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
3120 | 3120 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
3121 | 3121 | $texto = number_format($texto, 2, ",", "."); |
3122 | 3122 | } else { |
@@ -3130,9 +3130,9 @@ discard block |
||
3130 | 3130 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
3131 | 3131 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3132 | 3132 | if (isset($this->ISSQNtot)) { |
3133 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
3133 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
3134 | 3134 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
3135 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3135 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3136 | 3136 | } else { |
3137 | 3137 | $texto = ''; |
3138 | 3138 | } |
@@ -3143,21 +3143,21 @@ discard block |
||
3143 | 3143 | if ($this->orientacao == 'P') { |
3144 | 3144 | $w = $this->wPrint - (3 * $w); |
3145 | 3145 | } else { |
3146 | - $w = $this->wPrint - (3 * $w)-$this->wCanhoto; |
|
3146 | + $w = $this->wPrint - (3 * $w) - $this->wCanhoto; |
|
3147 | 3147 | } |
3148 | 3148 | $texto = 'VALOR TOTAL DO ISSQN'; |
3149 | 3149 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
3150 | 3150 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3151 | 3151 | if (isset($this->ISSQNtot)) { |
3152 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
3152 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
3153 | 3153 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
3154 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3154 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3155 | 3155 | } else { |
3156 | 3156 | $texto = ''; |
3157 | 3157 | } |
3158 | 3158 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
3159 | 3159 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
3160 | - return ($y+$h+1); |
|
3160 | + return ($y + $h + 1); |
|
3161 | 3161 | } |
3162 | 3162 | |
3163 | 3163 | /** |
@@ -3180,7 +3180,7 @@ discard block |
||
3180 | 3180 | if ($this->orientacao == 'P') { |
3181 | 3181 | $w = $this->wPrint; |
3182 | 3182 | } else { |
3183 | - $w = $this->wPrint-$this->wCanhoto; |
|
3183 | + $w = $this->wPrint - $this->wCanhoto; |
|
3184 | 3184 | } |
3185 | 3185 | $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style'=> 'B']; |
3186 | 3186 | $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -3200,7 +3200,7 @@ discard block |
||
3200 | 3200 | $y += 1; |
3201 | 3201 | $aFont = ['font'=>$this->fontePadrao, 'size'=> $this->textadicfontsize * $this->pdf->k, 'style'=>'']; |
3202 | 3202 | //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>'']; |
3203 | - $this->pdf->textBox($x, $y+2, $w-2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
3203 | + $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
3204 | 3204 | //RESERVADO AO FISCO |
3205 | 3205 | $texto = "RESERVADO AO FISCO"; |
3206 | 3206 | if (isset($this->nfeProc) && $this->nfeProc->getElementsByTagName("xMsg")->length) { |
@@ -3209,9 +3209,9 @@ discard block |
||
3209 | 3209 | $x += $w; |
3210 | 3210 | $y -= 1; |
3211 | 3211 | if ($this->orientacao == 'P') { |
3212 | - $w = $this->wPrint-$w; |
|
3212 | + $w = $this->wPrint - $w; |
|
3213 | 3213 | } else { |
3214 | - $w = $this->wPrint-$w-$this->wCanhoto; |
|
3214 | + $w = $this->wPrint - $w - $this->wCanhoto; |
|
3215 | 3215 | } |
3216 | 3216 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B']; |
3217 | 3217 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3250,8 +3250,8 @@ discard block |
||
3250 | 3250 | } |
3251 | 3251 | $y += 2; |
3252 | 3252 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => '']; |
3253 | - $this->pdf->textBox($x, $y, $w-2, $h, $texto, $aFont, 'T', 'L', 0, '', false); |
|
3254 | - return $y+$h; |
|
3253 | + $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false); |
|
3254 | + return $y + $h; |
|
3255 | 3255 | } |
3256 | 3256 | |
3257 | 3257 | /** |
@@ -3269,11 +3269,11 @@ discard block |
||
3269 | 3269 | if ($this->orientacao == 'P') { |
3270 | 3270 | $w = $this->wPrint; |
3271 | 3271 | } else { |
3272 | - $w = $this->wPrint-$this->wCanhoto; |
|
3272 | + $w = $this->wPrint - $this->wCanhoto; |
|
3273 | 3273 | $x = $this->wCanhoto; |
3274 | 3274 | } |
3275 | 3275 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
3276 | - $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s') |
|
3276 | + $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s') |
|
3277 | 3277 | . ' ' . $this->creditos; |
3278 | 3278 | $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false); |
3279 | 3279 | $texto = $this->powered ? "Powered by NFePHP®" : ''; |
@@ -3328,9 +3328,9 @@ discard block |
||
3328 | 3328 | } else { |
3329 | 3329 | //linha separadora do canhoto - 238 |
3330 | 3330 | //posicao altura |
3331 | - $y = $this->wPrint-85; |
|
3331 | + $y = $this->wPrint - 85; |
|
3332 | 3332 | //altura |
3333 | - $w = $this->wPrint-85-24; |
|
3333 | + $w = $this->wPrint - 85 - 24; |
|
3334 | 3334 | } |
3335 | 3335 | $h = 10; |
3336 | 3336 | //desenha caixa |
@@ -3353,21 +3353,21 @@ discard block |
||
3353 | 3353 | $texto .= "AO LADO"; |
3354 | 3354 | } |
3355 | 3355 | $texto .= ". EMISSÃO: "; |
3356 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3356 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3357 | 3357 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
3358 | 3358 | if ($dEmi == '') { |
3359 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3359 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3360 | 3360 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
3361 | 3361 | $aDemi = explode('T', $dEmi); |
3362 | 3362 | $dEmi = $aDemi[0]; |
3363 | 3363 | } |
3364 | - $texto .= $this->ymdTodmy($dEmi) ." "; |
|
3364 | + $texto .= $this->ymdTodmy($dEmi) . " "; |
|
3365 | 3365 | $texto .= "VALOR TOTAL: R$ "; |
3366 | 3366 | $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " "; |
3367 | 3367 | $texto .= "DESTINATÁRIO: "; |
3368 | 3368 | $texto .= $destinatario; |
3369 | 3369 | if ($this->orientacao == 'P') { |
3370 | - $this->pdf->textBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
3370 | + $this->pdf->textBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
3371 | 3371 | $x1 = $x + $w; |
3372 | 3372 | $w1 = $this->wPrint - $w; |
3373 | 3373 | $texto = "NF-e"; |
@@ -3380,12 +3380,12 @@ discard block |
||
3380 | 3380 | //DATA DE RECEBIMENTO |
3381 | 3381 | $texto = "DATA DE RECEBIMENTO"; |
3382 | 3382 | $y += $h; |
3383 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
3383 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
3384 | 3384 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
3385 | 3385 | $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3386 | 3386 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
3387 | 3387 | $x += $w2; |
3388 | - $w3 = $w-$w2; |
|
3388 | + $w3 = $w - $w2; |
|
3389 | 3389 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
3390 | 3390 | $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3391 | 3391 | $x = $oldX; |
@@ -3395,7 +3395,7 @@ discard block |
||
3395 | 3395 | return $y; |
3396 | 3396 | } else { |
3397 | 3397 | $x--; |
3398 | - $x = $this->pdf->textBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
3398 | + $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
3399 | 3399 | //NUMERO DA NOTA FISCAL LOGO NFE |
3400 | 3400 | $w1 = 18; |
3401 | 3401 | $x1 = $oldX; |
@@ -3409,14 +3409,14 @@ discard block |
||
3409 | 3409 | $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
3410 | 3410 | //DATA DO RECEBIMENTO |
3411 | 3411 | $texto = "DATA DO RECEBIMENTO"; |
3412 | - $y = $this->wPrint-85; |
|
3412 | + $y = $this->wPrint - 85; |
|
3413 | 3413 | $x = 12; |
3414 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
3414 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
3415 | 3415 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
3416 | 3416 | $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3417 | 3417 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
3418 | 3418 | $y -= $w2; |
3419 | - $w3 = $w-$w2; |
|
3419 | + $w3 = $w - $w2; |
|
3420 | 3420 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
3421 | 3421 | $aFont = ['font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>'']; |
3422 | 3422 | $x = $this->pdf->textBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3440,13 +3440,13 @@ discard block |
||
3440 | 3440 | } |
3441 | 3441 | $saida = ""; |
3442 | 3442 | if (isset($this->compra)) { |
3443 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
3443 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
3444 | 3444 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
3445 | 3445 | } |
3446 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
3446 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
3447 | 3447 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
3448 | 3448 | } |
3449 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
3449 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
3450 | 3450 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
3451 | 3451 | } |
3452 | 3452 | } |
@@ -3472,21 +3472,21 @@ discard block |
||
3472 | 3472 | if ($vICMS > 0) { |
3473 | 3473 | $vICMS = 1; |
3474 | 3474 | } |
3475 | - $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
3475 | + $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
3476 | 3476 | if ($icmss > 0) { |
3477 | 3477 | $icmss = 1; |
3478 | 3478 | } |
3479 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3479 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3480 | 3480 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
3481 | 3481 | if ($dEmi == '') { |
3482 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3482 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3483 | 3483 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
3484 | 3484 | $aDemi = explode('T', $dEmi); |
3485 | 3485 | $dEmi = $aDemi[0]; |
3486 | 3486 | } |
3487 | 3487 | $dd = $dEmi; |
3488 | 3488 | $rpos = strrpos($dd, '-'); |
3489 | - $dd = substr($dd, $rpos +1); |
|
3489 | + $dd = substr($dd, $rpos + 1); |
|
3490 | 3490 | $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd); |
3491 | 3491 | $chave = $chave . $this->modulo11($chave); |
3492 | 3492 | return $chave; |
@@ -3510,7 +3510,7 @@ discard block |
||
3510 | 3510 | $formaNfRef = "\r\nNF Ref.: série:%d numero:%d emit:%s em %s modelo: %d"; |
3511 | 3511 | $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d"; |
3512 | 3512 | $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s"; |
3513 | - $saida=''; |
|
3513 | + $saida = ''; |
|
3514 | 3514 | $nfRefs = $this->ide->getElementsByTagName('NFref'); |
3515 | 3515 | if (0 === $nfRefs->length) { |
3516 | 3516 | return $saida; |
@@ -3526,7 +3526,7 @@ discard block |
||
3526 | 3526 | foreach ($refNFe as $chave_acessoRef) { |
3527 | 3527 | $chave_acesso = $chave_acessoRef->nodeValue; |
3528 | 3528 | $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave); |
3529 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
3529 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
3530 | 3530 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
3531 | 3531 | $serie = substr($chave_acesso, 22, 3); |
3532 | 3532 | $numero = substr($chave_acesso, 25, 9); |
@@ -3547,7 +3547,7 @@ discard block |
||
3547 | 3547 | foreach ($refCTe as $chave_acessoRef) { |
3548 | 3548 | $chave_acesso = $chave_acessoRef->nodeValue; |
3549 | 3549 | $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave); |
3550 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
3550 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
3551 | 3551 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
3552 | 3552 | $serie = substr($chave_acesso, 22, 3); |
3553 | 3553 | $numero = substr($chave_acesso, 25, 9); |
@@ -3563,10 +3563,9 @@ discard block |
||
3563 | 3563 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
3564 | 3564 | foreach ($refNFP as $umaRefNFe) { |
3565 | 3565 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
3566 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
3567 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
3568 | - ''; |
|
3569 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
3566 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
3567 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
3568 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
3570 | 3569 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
3571 | 3570 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
3572 | 3571 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |